From c5a14fde5bf96506d459c86a28000cfee79403b6 Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Wed, 21 Aug 2019 16:25:59 +0200 Subject: [PATCH 1/8] Generate Elasticmapreduce support. Contains a manual fix for recursive modules Configuration / ConfigurationList. --- Makefile | 1 + aws_elasticmapreduce.opam | 22 + input/emr/latest | 1 + .../elasticmapreduce/lib/addInstanceGroups.ml | 58 + .../lib/addInstanceGroups.mli | 7 + .../elasticmapreduce/lib/addJobFlowSteps.ml | 57 + .../elasticmapreduce/lib/addJobFlowSteps.mli | 7 + libraries/elasticmapreduce/lib/addTags.ml | 28 + libraries/elasticmapreduce/lib/addTags.mli | 7 + .../elasticmapreduce/lib/describeCluster.ml | 57 + .../elasticmapreduce/lib/describeCluster.mli | 7 + .../elasticmapreduce/lib/describeJobFlows.ml | 57 + .../elasticmapreduce/lib/describeJobFlows.mli | 7 + .../elasticmapreduce/lib/describeStep.ml | 57 + .../elasticmapreduce/lib/describeStep.mli | 7 + libraries/elasticmapreduce/lib/dune | 6 + .../elasticmapreduce/lib/errors_internal.ml | 151 + .../lib/listBootstrapActions.ml | 58 + .../lib/listBootstrapActions.mli | 7 + .../elasticmapreduce/lib/listClusters.ml | 57 + .../elasticmapreduce/lib/listClusters.mli | 7 + .../lib/listInstanceGroups.ml | 58 + .../lib/listInstanceGroups.mli | 7 + .../elasticmapreduce/lib/listInstances.ml | 57 + .../elasticmapreduce/lib/listInstances.mli | 7 + libraries/elasticmapreduce/lib/listSteps.ml | 54 + libraries/elasticmapreduce/lib/listSteps.mli | 7 + .../lib/modifyInstanceGroups.ml | 30 + .../lib/modifyInstanceGroups.mli | 7 + libraries/elasticmapreduce/lib/removeTags.ml | 29 + libraries/elasticmapreduce/lib/removeTags.mli | 7 + libraries/elasticmapreduce/lib/runJobFlow.ml | 54 + libraries/elasticmapreduce/lib/runJobFlow.mli | 7 + .../lib/setTerminationProtection.ml | 31 + .../lib/setTerminationProtection.mli | 7 + .../lib/setVisibleToAllUsers.ml | 30 + .../lib/setVisibleToAllUsers.mli | 7 + .../elasticmapreduce/lib/terminateJobFlows.ml | 30 + .../lib/terminateJobFlows.mli | 7 + libraries/elasticmapreduce/lib/types.ml | 5165 +++++++++++++++++ .../lib_test/aws_elasticmapreduce_test.ml | 43 + libraries/elasticmapreduce/lib_test/dune | 20 + .../elasticmapreduce/lib_test/test_async.ml | 11 + .../elasticmapreduce/lib_test/test_lwt.ml | 11 + 44 files changed, 6352 insertions(+) create mode 100644 aws_elasticmapreduce.opam create mode 120000 input/emr/latest create mode 100644 libraries/elasticmapreduce/lib/addInstanceGroups.ml create mode 100644 libraries/elasticmapreduce/lib/addInstanceGroups.mli create mode 100644 libraries/elasticmapreduce/lib/addJobFlowSteps.ml create mode 100644 libraries/elasticmapreduce/lib/addJobFlowSteps.mli create mode 100644 libraries/elasticmapreduce/lib/addTags.ml create mode 100644 libraries/elasticmapreduce/lib/addTags.mli create mode 100644 libraries/elasticmapreduce/lib/describeCluster.ml create mode 100644 libraries/elasticmapreduce/lib/describeCluster.mli create mode 100644 libraries/elasticmapreduce/lib/describeJobFlows.ml create mode 100644 libraries/elasticmapreduce/lib/describeJobFlows.mli create mode 100644 libraries/elasticmapreduce/lib/describeStep.ml create mode 100644 libraries/elasticmapreduce/lib/describeStep.mli create mode 100644 libraries/elasticmapreduce/lib/dune create mode 100644 libraries/elasticmapreduce/lib/errors_internal.ml create mode 100644 libraries/elasticmapreduce/lib/listBootstrapActions.ml create mode 100644 libraries/elasticmapreduce/lib/listBootstrapActions.mli create mode 100644 libraries/elasticmapreduce/lib/listClusters.ml create mode 100644 libraries/elasticmapreduce/lib/listClusters.mli create mode 100644 libraries/elasticmapreduce/lib/listInstanceGroups.ml create mode 100644 libraries/elasticmapreduce/lib/listInstanceGroups.mli create mode 100644 libraries/elasticmapreduce/lib/listInstances.ml create mode 100644 libraries/elasticmapreduce/lib/listInstances.mli create mode 100644 libraries/elasticmapreduce/lib/listSteps.ml create mode 100644 libraries/elasticmapreduce/lib/listSteps.mli create mode 100644 libraries/elasticmapreduce/lib/modifyInstanceGroups.ml create mode 100644 libraries/elasticmapreduce/lib/modifyInstanceGroups.mli create mode 100644 libraries/elasticmapreduce/lib/removeTags.ml create mode 100644 libraries/elasticmapreduce/lib/removeTags.mli create mode 100644 libraries/elasticmapreduce/lib/runJobFlow.ml create mode 100644 libraries/elasticmapreduce/lib/runJobFlow.mli create mode 100644 libraries/elasticmapreduce/lib/setTerminationProtection.ml create mode 100644 libraries/elasticmapreduce/lib/setTerminationProtection.mli create mode 100644 libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml create mode 100644 libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli create mode 100644 libraries/elasticmapreduce/lib/terminateJobFlows.ml create mode 100644 libraries/elasticmapreduce/lib/terminateJobFlows.mli create mode 100644 libraries/elasticmapreduce/lib/types.ml create mode 100644 libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml create mode 100644 libraries/elasticmapreduce/lib_test/dune create mode 100644 libraries/elasticmapreduce/lib_test/test_async.ml create mode 100644 libraries/elasticmapreduce/lib_test/test_lwt.ml diff --git a/Makefile b/Makefile index fdf4ce461..e438b198f 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ LIBRARIES := \ aws-cloudwatch \ aws-elasticache \ aws-elasticloadbalancing \ + aws-emr \ aws-rds \ aws-sdb \ aws-ssm \ diff --git a/aws_elasticmapreduce.opam b/aws_elasticmapreduce.opam new file mode 100644 index 000000000..439c0d563 --- /dev/null +++ b/aws_elasticmapreduce.opam @@ -0,0 +1,22 @@ +opam-version: "2.0" +maintainer: "Tim McGilchrist " +authors: [ "Spiros Eliopoulos " + "Daniel Patterson " + "Tim McGilchrist " + ] +synopsis: "Amazon Web Services SDK bindings to Amazon Elastic MapReduce" +description: "Amazon Web Services SDK bindings to Amazon Elastic MapReduce" +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} +] diff --git a/input/emr/latest b/input/emr/latest new file mode 120000 index 000000000..ae411e764 --- /dev/null +++ b/input/emr/latest @@ -0,0 +1 @@ +2009-03-31 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.ml b/libraries/elasticmapreduce/lib/addInstanceGroups.ml new file mode 100644 index 000000000..b86673eab --- /dev/null +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.ml @@ -0,0 +1,58 @@ +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))) + (List.append + [("Version", ["2009-03-31"]); ("Action", ["AddInstanceGroups"])] + (Util.drop_empty + (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) + (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 -> + `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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.mli b/libraries/elasticmapreduce/lib/addInstanceGroups.mli new file mode 100644 index 000000000..f8b16b12a --- /dev/null +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.mli @@ -0,0 +1,7 @@ +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) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml new file mode 100644 index 000000000..17618aabf --- /dev/null +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml @@ -0,0 +1,57 @@ +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))) + (List.append + [("Version", ["2009-03-31"]); ("Action", ["AddJobFlowSteps"])] + (Util.drop_empty + (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) + (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 -> + `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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.mli b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli new file mode 100644 index 000000000..0ee5d2483 --- /dev/null +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli @@ -0,0 +1,7 @@ +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) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addTags.ml b/libraries/elasticmapreduce/lib/addTags.ml new file mode 100644 index 000000000..731ec5bc6 --- /dev/null +++ b/libraries/elasticmapreduce/lib/addTags.ml @@ -0,0 +1,28 @@ +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"])] + (Util.drop_empty + (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)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addTags.mli b/libraries/elasticmapreduce/lib/addTags.mli new file mode 100644 index 000000000..c14e3958b --- /dev/null +++ b/libraries/elasticmapreduce/lib/addTags.mli @@ -0,0 +1,7 @@ +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) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeCluster.ml b/libraries/elasticmapreduce/lib/describeCluster.ml new file mode 100644 index 000000000..3740b91f1 --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeCluster.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = DescribeClusterInput.t +type output = DescribeClusterOutput.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", ["DescribeCluster"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DescribeClusterInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "DescribeClusterResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp DescribeClusterOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeClusterOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeClusterOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeCluster.mli b/libraries/elasticmapreduce/lib/describeCluster.mli new file mode 100644 index 000000000..1783e849c --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeCluster.mli @@ -0,0 +1,7 @@ +open Types +type input = DescribeClusterInput.t +type output = DescribeClusterOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.ml b/libraries/elasticmapreduce/lib/describeJobFlows.ml new file mode 100644 index 000000000..d23e59710 --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeJobFlows.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = DescribeJobFlowsInput.t +type output = DescribeJobFlowsOutput.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", ["DescribeJobFlows"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DescribeJobFlowsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "DescribeJobFlowsResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp DescribeJobFlowsOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeJobFlowsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeJobFlowsOutput - 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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.mli b/libraries/elasticmapreduce/lib/describeJobFlows.mli new file mode 100644 index 000000000..41738ac9a --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeJobFlows.mli @@ -0,0 +1,7 @@ +open Types +type input = DescribeJobFlowsInput.t +type output = DescribeJobFlowsOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeStep.ml b/libraries/elasticmapreduce/lib/describeStep.ml new file mode 100644 index 000000000..953a0cffa --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeStep.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = DescribeStepInput.t +type output = DescribeStepOutput.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", ["DescribeStep"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DescribeStepInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "DescribeStepResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp DescribeStepOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeStepOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStepOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeStep.mli b/libraries/elasticmapreduce/lib/describeStep.mli new file mode 100644 index 000000000..8871af090 --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeStep.mli @@ -0,0 +1,7 @@ +open Types +type input = DescribeStepInput.t +type output = DescribeStepOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/dune b/libraries/elasticmapreduce/lib/dune new file mode 100644 index 000000000..0a8d7b51b --- /dev/null +++ b/libraries/elasticmapreduce/lib/dune @@ -0,0 +1,6 @@ +(library + (name aws_elasticmapreduce) + (public_name aws_elasticmapreduce) + (synopsis "aws-Amazon Elastic MapReduce") + (flags (:standard -w -27)) + (libraries aws)) diff --git a/libraries/elasticmapreduce/lib/errors_internal.ml b/libraries/elasticmapreduce/lib/errors_internal.ml new file mode 100644 index 000000000..08cd36c3f --- /dev/null +++ b/libraries/elasticmapreduce/lib/errors_internal.ml @@ -0,0 +1,151 @@ +type t = + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InternalServerException + | InvalidAction + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidRequestException + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited +let common = + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] +let to_http_code e = + match e with + | AuthFailure -> None + | Blocked -> None + | DryRunOperation -> None + | IdempotentParameterMismatch -> None + | IncompleteSignature -> Some 400 + | InternalFailure -> Some 500 + | InternalServerException -> None + | InvalidAction -> Some 400 + | InvalidClientTokenId -> Some 403 + | InvalidParameter -> None + | InvalidParameterCombination -> Some 400 + | InvalidParameterValue -> Some 400 + | InvalidQueryParameter -> Some 400 + | InvalidRequestException -> None + | MalformedQueryString -> Some 404 + | MissingAction -> Some 400 + | MissingAuthenticationToken -> Some 403 + | MissingParameter -> Some 400 + | OptInRequired -> Some 403 + | PendingVerification -> None + | RequestExpired -> Some 400 + | RequestLimitExceeded -> None + | ServiceUnavailable -> Some 503 + | Throttling -> Some 400 + | UnauthorizedOperation -> None + | UnknownParameter -> None + | UnsupportedProtocol -> None + | ValidationError -> Some 400 + | Uninhabited -> None +let to_string e = + match e with + | AuthFailure -> "AuthFailure" + | Blocked -> "Blocked" + | DryRunOperation -> "DryRunOperation" + | IdempotentParameterMismatch -> "IdempotentParameterMismatch" + | IncompleteSignature -> "IncompleteSignature" + | InternalFailure -> "InternalFailure" + | InternalServerException -> "InternalServerException" + | InvalidAction -> "InvalidAction" + | InvalidClientTokenId -> "InvalidClientTokenId" + | InvalidParameter -> "InvalidParameter" + | InvalidParameterCombination -> "InvalidParameterCombination" + | InvalidParameterValue -> "InvalidParameterValue" + | InvalidQueryParameter -> "InvalidQueryParameter" + | InvalidRequestException -> "InvalidRequestException" + | MalformedQueryString -> "MalformedQueryString" + | MissingAction -> "MissingAction" + | MissingAuthenticationToken -> "MissingAuthenticationToken" + | MissingParameter -> "MissingParameter" + | OptInRequired -> "OptInRequired" + | PendingVerification -> "PendingVerification" + | RequestExpired -> "RequestExpired" + | RequestLimitExceeded -> "RequestLimitExceeded" + | ServiceUnavailable -> "ServiceUnavailable" + | Throttling -> "Throttling" + | UnauthorizedOperation -> "UnauthorizedOperation" + | UnknownParameter -> "UnknownParameter" + | UnsupportedProtocol -> "UnsupportedProtocol" + | ValidationError -> "ValidationError" + | Uninhabited -> "Uninhabited" +let of_string e = + match e with + | "AuthFailure" -> Some AuthFailure + | "Blocked" -> Some Blocked + | "DryRunOperation" -> Some DryRunOperation + | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch + | "IncompleteSignature" -> Some IncompleteSignature + | "InternalFailure" -> Some InternalFailure + | "InternalServerException" -> Some InternalServerException + | "InvalidAction" -> Some InvalidAction + | "InvalidClientTokenId" -> Some InvalidClientTokenId + | "InvalidParameter" -> Some InvalidParameter + | "InvalidParameterCombination" -> Some InvalidParameterCombination + | "InvalidParameterValue" -> Some InvalidParameterValue + | "InvalidQueryParameter" -> Some InvalidQueryParameter + | "InvalidRequestException" -> Some InvalidRequestException + | "MalformedQueryString" -> Some MalformedQueryString + | "MissingAction" -> Some MissingAction + | "MissingAuthenticationToken" -> Some MissingAuthenticationToken + | "MissingParameter" -> Some MissingParameter + | "OptInRequired" -> Some OptInRequired + | "PendingVerification" -> Some PendingVerification + | "RequestExpired" -> Some RequestExpired + | "RequestLimitExceeded" -> Some RequestLimitExceeded + | "ServiceUnavailable" -> Some ServiceUnavailable + | "Throttling" -> Some Throttling + | "UnauthorizedOperation" -> Some UnauthorizedOperation + | "UnknownParameter" -> Some UnknownParameter + | "UnsupportedProtocol" -> Some UnsupportedProtocol + | "ValidationError" -> Some ValidationError + | "Uninhabited" -> Some Uninhabited + | _ -> None \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.ml b/libraries/elasticmapreduce/lib/listBootstrapActions.ml new file mode 100644 index 000000000..34cfaf1b8 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.ml @@ -0,0 +1,58 @@ +open Types +open Aws +type input = ListBootstrapActionsInput.t +type output = ListBootstrapActionsOutput.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", ["ListBootstrapActions"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListBootstrapActionsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListBootstrapActionsResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ListBootstrapActionsOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListBootstrapActionsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListBootstrapActionsOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.mli b/libraries/elasticmapreduce/lib/listBootstrapActions.mli new file mode 100644 index 000000000..6952f38bc --- /dev/null +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.mli @@ -0,0 +1,7 @@ +open Types +type input = ListBootstrapActionsInput.t +type output = ListBootstrapActionsOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listClusters.ml b/libraries/elasticmapreduce/lib/listClusters.ml new file mode 100644 index 000000000..46baea1b7 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listClusters.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = ListClustersInput.t +type output = ListClustersOutput.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", ["ListClusters"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListClustersInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListClustersResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ListClustersOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed ListClustersOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListClustersOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listClusters.mli b/libraries/elasticmapreduce/lib/listClusters.mli new file mode 100644 index 000000000..17a20059e --- /dev/null +++ b/libraries/elasticmapreduce/lib/listClusters.mli @@ -0,0 +1,7 @@ +open Types +type input = ListClustersInput.t +type output = ListClustersOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.ml b/libraries/elasticmapreduce/lib/listInstanceGroups.ml new file mode 100644 index 000000000..995681844 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.ml @@ -0,0 +1,58 @@ +open Types +open Aws +type input = ListInstanceGroupsInput.t +type output = ListInstanceGroupsOutput.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", ["ListInstanceGroups"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListInstanceGroupsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListInstanceGroupsResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ListInstanceGroupsOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListInstanceGroupsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListInstanceGroupsOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.mli b/libraries/elasticmapreduce/lib/listInstanceGroups.mli new file mode 100644 index 000000000..d12808bdd --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.mli @@ -0,0 +1,7 @@ +open Types +type input = ListInstanceGroupsInput.t +type output = ListInstanceGroupsOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstances.ml b/libraries/elasticmapreduce/lib/listInstances.ml new file mode 100644 index 000000000..2bfdd7820 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstances.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = ListInstancesInput.t +type output = ListInstancesOutput.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", ["ListInstances"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListInstancesInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListInstancesResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ListInstancesOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed ListInstancesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListInstancesOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstances.mli b/libraries/elasticmapreduce/lib/listInstances.mli new file mode 100644 index 000000000..8774b3f7f --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstances.mli @@ -0,0 +1,7 @@ +open Types +type input = ListInstancesInput.t +type output = ListInstancesOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSteps.ml b/libraries/elasticmapreduce/lib/listSteps.ml new file mode 100644 index 000000000..462852bf9 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listSteps.ml @@ -0,0 +1,54 @@ +open Types +open Aws +type input = ListStepsInput.t +type output = ListStepsOutput.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", ["ListSteps"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListStepsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListStepsResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ListStepsOutput.parse) + (let open Error in + BadResponse + { body; message = "Could not find well formed ListStepsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListStepsOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSteps.mli b/libraries/elasticmapreduce/lib/listSteps.mli new file mode 100644 index 000000000..d76719a19 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listSteps.mli @@ -0,0 +1,7 @@ +open Types +type input = ListStepsInput.t +type output = ListStepsOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml new file mode 100644 index 000000000..944f0f421 --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = ModifyInstanceGroupsInput.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", ["ModifyInstanceGroups"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ModifyInstanceGroupsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [Errors_internal.InternalFailure] @ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli new file mode 100644 index 000000000..d50398fb5 --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli @@ -0,0 +1,7 @@ +open Types +type input = ModifyInstanceGroupsInput.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeTags.ml b/libraries/elasticmapreduce/lib/removeTags.ml new file mode 100644 index 000000000..1b64b0008 --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeTags.ml @@ -0,0 +1,29 @@ +open Types +open Aws +type input = RemoveTagsInput.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", ["RemoveTags"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (RemoveTagsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeTags.mli b/libraries/elasticmapreduce/lib/removeTags.mli new file mode 100644 index 000000000..e9948fe9a --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeTags.mli @@ -0,0 +1,7 @@ +open Types +type input = RemoveTagsInput.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/runJobFlow.ml b/libraries/elasticmapreduce/lib/runJobFlow.ml new file mode 100644 index 000000000..fca21a44d --- /dev/null +++ b/libraries/elasticmapreduce/lib/runJobFlow.ml @@ -0,0 +1,54 @@ +open Types +open Aws +type input = RunJobFlowInput.t +type output = RunJobFlowOutput.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", ["RunJobFlow"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (RunJobFlowInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "RunJobFlowResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp RunJobFlowOutput.parse) + (let open Error in + BadResponse + { body; message = "Could not find well formed RunJobFlowOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RunJobFlowOutput - 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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/runJobFlow.mli b/libraries/elasticmapreduce/lib/runJobFlow.mli new file mode 100644 index 000000000..7f98c47d5 --- /dev/null +++ b/libraries/elasticmapreduce/lib/runJobFlow.mli @@ -0,0 +1,7 @@ +open Types +type input = RunJobFlowInput.t +type output = RunJobFlowOutput.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.ml b/libraries/elasticmapreduce/lib/setTerminationProtection.ml new file mode 100644 index 000000000..81266be59 --- /dev/null +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.ml @@ -0,0 +1,31 @@ +open Types +open Aws +type input = SetTerminationProtectionInput.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", ["SetTerminationProtection"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (SetTerminationProtectionInput.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [Errors_internal.InternalFailure] @ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.mli b/libraries/elasticmapreduce/lib/setTerminationProtection.mli new file mode 100644 index 000000000..4a60af7b9 --- /dev/null +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.mli @@ -0,0 +1,7 @@ +open Types +type input = SetTerminationProtectionInput.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml new file mode 100644 index 000000000..8aa76f4d8 --- /dev/null +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = SetVisibleToAllUsersInput.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", ["SetVisibleToAllUsers"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (SetVisibleToAllUsersInput.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [Errors_internal.InternalFailure] @ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli new file mode 100644 index 000000000..33cf90e7b --- /dev/null +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli @@ -0,0 +1,7 @@ +open Types +type input = SetVisibleToAllUsersInput.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.ml b/libraries/elasticmapreduce/lib/terminateJobFlows.ml new file mode 100644 index 000000000..e9cddc3cb --- /dev/null +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = TerminateJobFlowsInput.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", ["TerminateJobFlows"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (TerminateJobFlowsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [Errors_internal.InternalFailure] @ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.mli b/libraries/elasticmapreduce/lib/terminateJobFlows.mli new file mode 100644 index 000000000..9ededcdb0 --- /dev/null +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.mli @@ -0,0 +1,7 @@ +open Types +type input = TerminateJobFlowsInput.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/types.ml b/libraries/elasticmapreduce/lib/types.ml new file mode 100644 index 000000000..69b8879c5 --- /dev/null +++ b/libraries/elasticmapreduce/lib/types.ml @@ -0,0 +1,5165 @@ +open Aws +open Aws.BaseTypes +open CalendarLib +type calendar = Calendar.t +module KeyValue = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module XmlStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module KeyValueList = + struct + type t = KeyValue.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map KeyValue.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list KeyValue.to_query v + let to_json v = `List (List.map KeyValue.to_json v) + let of_json j = Json.to_list KeyValue.of_json j + end +module ScriptBootstrapActionConfig = + struct + type t = { + path: String.t ; + args: XmlStringList.t } + let make ~path ?(args= []) () = { path; args } + let parse xml = + Some + { + path = + (Xml.required "Path" + (Util.option_bind (Xml.member "Path" xml) String.parse)); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); + Some (Query.Pair ("Path", (String.to_query v.path)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("args", (XmlStringList.to_json v.args)); + Some ("path", (String.to_json v.path))]) + let of_json j = + { + path = (String.of_json (Util.of_option_exn (Json.lookup j "path"))); + args = + (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + } + end +module InstanceGroupState = + struct + type t = + | PROVISIONING + | BOOTSTRAPPING + | RUNNING + | RESIZING + | SUSPENDED + | TERMINATING + | TERMINATED + | ARRESTED + | SHUTTING_DOWN + | ENDED + let str_to_t = + [("ENDED", ENDED); + ("SHUTTING_DOWN", SHUTTING_DOWN); + ("ARRESTED", ARRESTED); + ("TERMINATED", TERMINATED); + ("TERMINATING", TERMINATING); + ("SUSPENDED", SUSPENDED); + ("RESIZING", RESIZING); + ("RUNNING", RUNNING); + ("BOOTSTRAPPING", BOOTSTRAPPING); + ("PROVISIONING", PROVISIONING)] + let t_to_str = + [(ENDED, "ENDED"); + (SHUTTING_DOWN, "SHUTTING_DOWN"); + (ARRESTED, "ARRESTED"); + (TERMINATED, "TERMINATED"); + (TERMINATING, "TERMINATING"); + (SUSPENDED, "SUSPENDED"); + (RESIZING, "RESIZING"); + (RUNNING, "RUNNING"); + (BOOTSTRAPPING, "BOOTSTRAPPING"); + (PROVISIONING, "PROVISIONING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceRoleType = + struct + type t = + | MASTER + | CORE + | TASK + let str_to_t = [("TASK", TASK); ("CORE", CORE); ("MASTER", MASTER)] + let t_to_str = [(TASK, "TASK"); (CORE, "CORE"); (MASTER, "MASTER")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MarketType = + struct + type t = + | ON_DEMAND + | SPOT + let str_to_t = [("SPOT", SPOT); ("ON_DEMAND", ON_DEMAND)] + let t_to_str = [(SPOT, "SPOT"); (ON_DEMAND, "ON_DEMAND")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ActionOnFailure = + struct + type t = + | TERMINATE_JOB_FLOW + | TERMINATE_CLUSTER + | CANCEL_AND_WAIT + | CONTINUE + let str_to_t = + [("CONTINUE", CONTINUE); + ("CANCEL_AND_WAIT", CANCEL_AND_WAIT); + ("TERMINATE_CLUSTER", TERMINATE_CLUSTER); + ("TERMINATE_JOB_FLOW", TERMINATE_JOB_FLOW)] + let t_to_str = + [(CONTINUE, "CONTINUE"); + (CANCEL_AND_WAIT, "CANCEL_AND_WAIT"); + (TERMINATE_CLUSTER, "TERMINATE_CLUSTER"); + (TERMINATE_JOB_FLOW, "TERMINATE_JOB_FLOW")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module HadoopJarStepConfig = + struct + type t = + { + properties: KeyValueList.t ; + jar: String.t ; + main_class: String.t option ; + args: XmlStringList.t } + let make ?(properties= []) ~jar ?main_class ?(args= []) () = + { properties; jar; main_class; args } + let parse xml = + Some + { + properties = + (Util.of_option [] + (Util.option_bind (Xml.member "Properties" xml) + KeyValueList.parse)); + jar = + (Xml.required "Jar" + (Util.option_bind (Xml.member "Jar" xml) String.parse)); + main_class = + (Util.option_bind (Xml.member "MainClass" xml) String.parse); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); + Util.option_map v.main_class + (fun f -> Query.Pair ("MainClass", (String.to_query f))); + Some (Query.Pair ("Jar", (String.to_query v.jar))); + Some + (Query.Pair + ("Properties.member", (KeyValueList.to_query v.properties)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("args", (XmlStringList.to_json v.args)); + Util.option_map v.main_class + (fun f -> ("main_class", (String.to_json f))); + Some ("jar", (String.to_json v.jar)); + Some ("properties", (KeyValueList.to_json v.properties))]) + let of_json j = + { + properties = + (KeyValueList.of_json + (Util.of_option_exn (Json.lookup j "properties"))); + jar = (String.of_json (Util.of_option_exn (Json.lookup j "jar"))); + main_class = + (Util.option_map (Json.lookup j "main_class") String.of_json); + args = + (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + } + end +module StepExecutionState = + struct + type t = + | PENDING + | RUNNING + | CONTINUE + | COMPLETED + | CANCELLED + | FAILED + | INTERRUPTED + let str_to_t = + [("INTERRUPTED", INTERRUPTED); + ("FAILED", FAILED); + ("CANCELLED", CANCELLED); + ("COMPLETED", COMPLETED); + ("CONTINUE", CONTINUE); + ("RUNNING", RUNNING); + ("PENDING", PENDING)] + let t_to_str = + [(INTERRUPTED, "INTERRUPTED"); + (FAILED, "FAILED"); + (CANCELLED, "CANCELLED"); + (COMPLETED, "COMPLETED"); + (CONTINUE, "CONTINUE"); + (RUNNING, "RUNNING"); + (PENDING, "PENDING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StringMap = + struct + type t = (String.t, String.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl String.to_string String.to_query v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> ((String.to_string k), (String.to_json v)) :: acc) + v []) + let of_json j = Json.to_hashtbl String.of_string String.of_json j + end +module StepStateChangeReasonCode = + struct + type t = + | NONE + let str_to_t = [("NONE", NONE)] + let t_to_str = [(NONE, "NONE")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceGroupStateChangeReasonCode = + struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | CLUSTER_TERMINATED + let str_to_t = + [("CLUSTER_TERMINATED", CLUSTER_TERMINATED); + ("INSTANCE_FAILURE", INSTANCE_FAILURE); + ("VALIDATION_ERROR", VALIDATION_ERROR); + ("INTERNAL_ERROR", INTERNAL_ERROR)] + let t_to_str = + [(CLUSTER_TERMINATED, "CLUSTER_TERMINATED"); + (INSTANCE_FAILURE, "INSTANCE_FAILURE"); + (VALIDATION_ERROR, "VALIDATION_ERROR"); + (INTERNAL_ERROR, "INTERNAL_ERROR")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceStateChangeReasonCode = + struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | BOOTSTRAP_FAILURE + | CLUSTER_TERMINATED + let str_to_t = + [("CLUSTER_TERMINATED", CLUSTER_TERMINATED); + ("BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE); + ("INSTANCE_FAILURE", INSTANCE_FAILURE); + ("VALIDATION_ERROR", VALIDATION_ERROR); + ("INTERNAL_ERROR", INTERNAL_ERROR)] + let t_to_str = + [(CLUSTER_TERMINATED, "CLUSTER_TERMINATED"); + (BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE"); + (INSTANCE_FAILURE, "INSTANCE_FAILURE"); + (VALIDATION_ERROR, "VALIDATION_ERROR"); + (INTERNAL_ERROR, "INTERNAL_ERROR")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ClusterStateChangeReasonCode = + struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | BOOTSTRAP_FAILURE + | USER_REQUEST + | STEP_FAILURE + | ALL_STEPS_COMPLETED + let str_to_t = + [("ALL_STEPS_COMPLETED", ALL_STEPS_COMPLETED); + ("STEP_FAILURE", STEP_FAILURE); + ("USER_REQUEST", USER_REQUEST); + ("BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE); + ("INSTANCE_FAILURE", INSTANCE_FAILURE); + ("VALIDATION_ERROR", VALIDATION_ERROR); + ("INTERNAL_ERROR", INTERNAL_ERROR)] + let t_to_str = + [(ALL_STEPS_COMPLETED, "ALL_STEPS_COMPLETED"); + (STEP_FAILURE, "STEP_FAILURE"); + (USER_REQUEST, "USER_REQUEST"); + (BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE"); + (INSTANCE_FAILURE, "INSTANCE_FAILURE"); + (VALIDATION_ERROR, "VALIDATION_ERROR"); + (INTERNAL_ERROR, "INTERNAL_ERROR")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BootstrapActionConfig = + struct + type t = + { + name: String.t ; + script_bootstrap_action: ScriptBootstrapActionConfig.t } + let make ~name ~script_bootstrap_action () = + { name; script_bootstrap_action } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + script_bootstrap_action = + (Xml.required "ScriptBootstrapAction" + (Util.option_bind (Xml.member "ScriptBootstrapAction" xml) + ScriptBootstrapActionConfig.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ScriptBootstrapAction", + (ScriptBootstrapActionConfig.to_query + v.script_bootstrap_action))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("script_bootstrap_action", + (ScriptBootstrapActionConfig.to_json + v.script_bootstrap_action)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + script_bootstrap_action = + (ScriptBootstrapActionConfig.of_json + (Util.of_option_exn (Json.lookup j "script_bootstrap_action"))) + } + end +module InstanceGroupDetail = + struct + type t = + { + instance_group_id: String.t option ; + name: String.t option ; + market: MarketType.t ; + instance_role: InstanceRoleType.t ; + bid_price: String.t option ; + instance_type: String.t ; + instance_request_count: Integer.t ; + instance_running_count: Integer.t ; + state: InstanceGroupState.t ; + last_state_change_reason: String.t option ; + creation_date_time: DateTime.t ; + start_date_time: DateTime.t option ; + ready_date_time: DateTime.t option ; + end_date_time: DateTime.t option } + let make ?instance_group_id ?name ~market ~instance_role ?bid_price + ~instance_type ~instance_request_count ~instance_running_count + ~state ?last_state_change_reason ~creation_date_time + ?start_date_time ?ready_date_time ?end_date_time () = + { + instance_group_id; + name; + market; + instance_role; + bid_price; + instance_type; + instance_request_count; + instance_running_count; + state; + last_state_change_reason; + creation_date_time; + start_date_time; + ready_date_time; + end_date_time + } + let parse xml = + Some + { + instance_group_id = + (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + market = + (Xml.required "Market" + (Util.option_bind (Xml.member "Market" xml) MarketType.parse)); + instance_role = + (Xml.required "InstanceRole" + (Util.option_bind (Xml.member "InstanceRole" xml) + InstanceRoleType.parse)); + bid_price = + (Util.option_bind (Xml.member "BidPrice" xml) String.parse); + instance_type = + (Xml.required "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse)); + instance_request_count = + (Xml.required "InstanceRequestCount" + (Util.option_bind (Xml.member "InstanceRequestCount" xml) + Integer.parse)); + instance_running_count = + (Xml.required "InstanceRunningCount" + (Util.option_bind (Xml.member "InstanceRunningCount" xml) + Integer.parse)); + state = + (Xml.required "State" + (Util.option_bind (Xml.member "State" xml) + InstanceGroupState.parse)); + last_state_change_reason = + (Util.option_bind (Xml.member "LastStateChangeReason" xml) + String.parse); + creation_date_time = + (Xml.required "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse)); + start_date_time = + (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); + ready_date_time = + (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.ready_date_time + (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); + Util.option_map v.start_date_time + (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); + Some + (Query.Pair + ("CreationDateTime", + (DateTime.to_query v.creation_date_time))); + Util.option_map v.last_state_change_reason + (fun f -> + Query.Pair ("LastStateChangeReason", (String.to_query f))); + Some (Query.Pair ("State", (InstanceGroupState.to_query v.state))); + Some + (Query.Pair + ("InstanceRunningCount", + (Integer.to_query v.instance_running_count))); + Some + (Query.Pair + ("InstanceRequestCount", + (Integer.to_query v.instance_request_count))); + Some + (Query.Pair ("InstanceType", (String.to_query v.instance_type))); + Util.option_map v.bid_price + (fun f -> Query.Pair ("BidPrice", (String.to_query f))); + Some + (Query.Pair + ("InstanceRole", (InstanceRoleType.to_query v.instance_role))); + Some (Query.Pair ("Market", (MarketType.to_query v.market))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.instance_group_id + (fun f -> Query.Pair ("InstanceGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.ready_date_time + (fun f -> ("ready_date_time", (DateTime.to_json f))); + Util.option_map v.start_date_time + (fun f -> ("start_date_time", (DateTime.to_json f))); + Some + ("creation_date_time", (DateTime.to_json v.creation_date_time)); + Util.option_map v.last_state_change_reason + (fun f -> ("last_state_change_reason", (String.to_json f))); + Some ("state", (InstanceGroupState.to_json v.state)); + Some + ("instance_running_count", + (Integer.to_json v.instance_running_count)); + Some + ("instance_request_count", + (Integer.to_json v.instance_request_count)); + Some ("instance_type", (String.to_json v.instance_type)); + Util.option_map v.bid_price + (fun f -> ("bid_price", (String.to_json f))); + Some ("instance_role", (InstanceRoleType.to_json v.instance_role)); + Some ("market", (MarketType.to_json v.market)); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.instance_group_id + (fun f -> ("instance_group_id", (String.to_json f)))]) + let of_json j = + { + instance_group_id = + (Util.option_map (Json.lookup j "instance_group_id") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + market = + (MarketType.of_json (Util.of_option_exn (Json.lookup j "market"))); + instance_role = + (InstanceRoleType.of_json + (Util.of_option_exn (Json.lookup j "instance_role"))); + bid_price = + (Util.option_map (Json.lookup j "bid_price") String.of_json); + instance_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "instance_type"))); + instance_request_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_request_count"))); + instance_running_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_running_count"))); + state = + (InstanceGroupState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + last_state_change_reason = + (Util.option_map (Json.lookup j "last_state_change_reason") + String.of_json); + creation_date_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_date_time"))); + start_date_time = + (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); + ready_date_time = + (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + } + end +module StepConfig = + struct + type t = + { + name: String.t ; + action_on_failure: ActionOnFailure.t option ; + hadoop_jar_step: HadoopJarStepConfig.t } + let make ~name ?action_on_failure ~hadoop_jar_step () = + { name; action_on_failure; hadoop_jar_step } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + action_on_failure = + (Util.option_bind (Xml.member "ActionOnFailure" xml) + ActionOnFailure.parse); + hadoop_jar_step = + (Xml.required "HadoopJarStep" + (Util.option_bind (Xml.member "HadoopJarStep" xml) + HadoopJarStepConfig.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HadoopJarStep", + (HadoopJarStepConfig.to_query v.hadoop_jar_step))); + Util.option_map v.action_on_failure + (fun f -> + Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("hadoop_jar_step", + (HadoopJarStepConfig.to_json v.hadoop_jar_step)); + Util.option_map v.action_on_failure + (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + action_on_failure = + (Util.option_map (Json.lookup j "action_on_failure") + ActionOnFailure.of_json); + hadoop_jar_step = + (HadoopJarStepConfig.of_json + (Util.of_option_exn (Json.lookup j "hadoop_jar_step"))) + } + end +module StepExecutionStatusDetail = + struct + type t = + { + state: StepExecutionState.t ; + creation_date_time: DateTime.t ; + start_date_time: DateTime.t option ; + end_date_time: DateTime.t option ; + last_state_change_reason: String.t option } + let make ~state ~creation_date_time ?start_date_time ?end_date_time + ?last_state_change_reason () = + { + state; + creation_date_time; + start_date_time; + end_date_time; + last_state_change_reason + } + let parse xml = + Some + { + state = + (Xml.required "State" + (Util.option_bind (Xml.member "State" xml) + StepExecutionState.parse)); + creation_date_time = + (Xml.required "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse)); + start_date_time = + (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse); + last_state_change_reason = + (Util.option_bind (Xml.member "LastStateChangeReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.last_state_change_reason + (fun f -> + Query.Pair ("LastStateChangeReason", (String.to_query f))); + Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.start_date_time + (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); + Some + (Query.Pair + ("CreationDateTime", + (DateTime.to_query v.creation_date_time))); + Some (Query.Pair ("State", (StepExecutionState.to_query v.state)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.last_state_change_reason + (fun f -> ("last_state_change_reason", (String.to_json f))); + Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.start_date_time + (fun f -> ("start_date_time", (DateTime.to_json f))); + Some + ("creation_date_time", (DateTime.to_json v.creation_date_time)); + Some ("state", (StepExecutionState.to_json v.state))]) + let of_json j = + { + state = + (StepExecutionState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + creation_date_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_date_time"))); + start_date_time = + (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json); + last_state_change_reason = + (Util.option_map (Json.lookup j "last_state_change_reason") + String.of_json) + } + end +module StringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module rec ConfigurationList : sig + type t = Configuration.t list + val parse : Ezxmlm.nodes -> Configuration.t list option + val to_query : t -> Query.t + val to_json : t -> Json.t + val of_json : Json.t -> t + val make : t -> unit -> t +end = + struct + type t = Configuration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Configuration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Configuration.to_query v + let to_json v = `List (List.map Configuration.to_json v) + let of_json j = Json.to_list Configuration.of_json j + end + and Configuration : sig + type t = + { + classification: String.t option ; + configurations: ConfigurationList.t ; + properties: StringMap.t option } + val parse : Ezxmlm.nodes -> t option + val to_query : t -> Query.t + val to_json : t -> Json.t + val of_json : Json.t -> t + val make : ?classification:string -> ?configurations:ConfigurationList.t -> ?properties:StringMap.t -> unit -> t + end = + struct + type t = + { + classification: String.t option ; + configurations: ConfigurationList.t ; + properties: StringMap.t option } + let make ?classification ?(configurations= []) ?properties () = + { classification; configurations; properties } + let parse xml = + Some + { + classification = + (Util.option_bind (Xml.member "Classification" xml) String.parse); + configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "Configurations" xml) + ConfigurationList.parse)); + properties = + (Util.option_bind (Xml.member "Properties" xml) StringMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.properties + (fun f -> Query.Pair ("Properties", (StringMap.to_query f))); + Some + (Query.Pair + ("Configurations.member", + (ConfigurationList.to_query v.configurations))); + Util.option_map v.classification + (fun f -> Query.Pair ("Classification", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.properties + (fun f -> ("properties", (StringMap.to_json f))); + Some + ("configurations", (ConfigurationList.to_json v.configurations)); + Util.option_map v.classification + (fun f -> ("classification", (String.to_json f)))]) + let of_json j = + { + classification = + (Util.option_map (Json.lookup j "classification") String.of_json); + configurations = + (ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "configurations"))); + properties = + (Util.option_map (Json.lookup j "properties") StringMap.of_json) + } + end +module StepState = + struct + type t = + | PENDING + | RUNNING + | COMPLETED + | CANCELLED + | FAILED + | INTERRUPTED + let str_to_t = + [("INTERRUPTED", INTERRUPTED); + ("FAILED", FAILED); + ("CANCELLED", CANCELLED); + ("COMPLETED", COMPLETED); + ("RUNNING", RUNNING); + ("PENDING", PENDING)] + let t_to_str = + [(INTERRUPTED, "INTERRUPTED"); + (FAILED, "FAILED"); + (CANCELLED, "CANCELLED"); + (COMPLETED, "COMPLETED"); + (RUNNING, "RUNNING"); + (PENDING, "PENDING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StepStateChangeReason = + struct + type t = + { + code: StepStateChangeReasonCode.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = + (Util.option_bind (Xml.member "Code" xml) + StepStateChangeReasonCode.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> + Query.Pair ("Code", (StepStateChangeReasonCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code + (fun f -> ("code", (StepStateChangeReasonCode.to_json f)))]) + let of_json j = + { + code = + (Util.option_map (Json.lookup j "code") + StepStateChangeReasonCode.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module StepTimeline = + struct + type t = + { + creation_date_time: DateTime.t option ; + start_date_time: DateTime.t option ; + end_date_time: DateTime.t option } + let make ?creation_date_time ?start_date_time ?end_date_time () = + { creation_date_time; start_date_time; end_date_time } + let parse xml = + Some + { + creation_date_time = + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse); + start_date_time = + (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.start_date_time + (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); + Util.option_map v.creation_date_time + (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.start_date_time + (fun f -> ("start_date_time", (DateTime.to_json f))); + Util.option_map v.creation_date_time + (fun f -> ("creation_date_time", (DateTime.to_json f)))]) + let of_json j = + { + creation_date_time = + (Util.option_map (Json.lookup j "creation_date_time") + DateTime.of_json); + start_date_time = + (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + } + end +module InstanceGroupStateChangeReason = + struct + type t = + { + code: InstanceGroupStateChangeReasonCode.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = + (Util.option_bind (Xml.member "Code" xml) + InstanceGroupStateChangeReasonCode.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> + Query.Pair + ("Code", (InstanceGroupStateChangeReasonCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code + (fun f -> + ("code", (InstanceGroupStateChangeReasonCode.to_json f)))]) + let of_json j = + { + code = + (Util.option_map (Json.lookup j "code") + InstanceGroupStateChangeReasonCode.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module InstanceGroupTimeline = + struct + type t = + { + creation_date_time: DateTime.t option ; + ready_date_time: DateTime.t option ; + end_date_time: DateTime.t option } + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + let parse xml = + Some + { + creation_date_time = + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse); + ready_date_time = + (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.ready_date_time + (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); + Util.option_map v.creation_date_time + (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.ready_date_time + (fun f -> ("ready_date_time", (DateTime.to_json f))); + Util.option_map v.creation_date_time + (fun f -> ("creation_date_time", (DateTime.to_json f)))]) + let of_json j = + { + creation_date_time = + (Util.option_map (Json.lookup j "creation_date_time") + DateTime.of_json); + ready_date_time = + (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + } + end +module InstanceState = + struct + type t = + | AWAITING_FULFILLMENT + | PROVISIONING + | BOOTSTRAPPING + | RUNNING + | TERMINATED + let str_to_t = + [("TERMINATED", TERMINATED); + ("RUNNING", RUNNING); + ("BOOTSTRAPPING", BOOTSTRAPPING); + ("PROVISIONING", PROVISIONING); + ("AWAITING_FULFILLMENT", AWAITING_FULFILLMENT)] + let t_to_str = + [(TERMINATED, "TERMINATED"); + (RUNNING, "RUNNING"); + (BOOTSTRAPPING, "BOOTSTRAPPING"); + (PROVISIONING, "PROVISIONING"); + (AWAITING_FULFILLMENT, "AWAITING_FULFILLMENT")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceStateChangeReason = + struct + type t = + { + code: InstanceStateChangeReasonCode.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = + (Util.option_bind (Xml.member "Code" xml) + InstanceStateChangeReasonCode.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> + Query.Pair + ("Code", (InstanceStateChangeReasonCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code + (fun f -> ("code", (InstanceStateChangeReasonCode.to_json f)))]) + let of_json j = + { + code = + (Util.option_map (Json.lookup j "code") + InstanceStateChangeReasonCode.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module InstanceTimeline = + struct + type t = + { + creation_date_time: DateTime.t option ; + ready_date_time: DateTime.t option ; + end_date_time: DateTime.t option } + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + let parse xml = + Some + { + creation_date_time = + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse); + ready_date_time = + (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.ready_date_time + (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); + Util.option_map v.creation_date_time + (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.ready_date_time + (fun f -> ("ready_date_time", (DateTime.to_json f))); + Util.option_map v.creation_date_time + (fun f -> ("creation_date_time", (DateTime.to_json f)))]) + let of_json j = + { + creation_date_time = + (Util.option_map (Json.lookup j "creation_date_time") + DateTime.of_json); + ready_date_time = + (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + } + end +module ClusterState = + struct + type t = + | STARTING + | BOOTSTRAPPING + | RUNNING + | WAITING + | TERMINATING + | TERMINATED + | TERMINATED_WITH_ERRORS + let str_to_t = + [("TERMINATED_WITH_ERRORS", TERMINATED_WITH_ERRORS); + ("TERMINATED", TERMINATED); + ("TERMINATING", TERMINATING); + ("WAITING", WAITING); + ("RUNNING", RUNNING); + ("BOOTSTRAPPING", BOOTSTRAPPING); + ("STARTING", STARTING)] + let t_to_str = + [(TERMINATED_WITH_ERRORS, "TERMINATED_WITH_ERRORS"); + (TERMINATED, "TERMINATED"); + (TERMINATING, "TERMINATING"); + (WAITING, "WAITING"); + (RUNNING, "RUNNING"); + (BOOTSTRAPPING, "BOOTSTRAPPING"); + (STARTING, "STARTING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ClusterStateChangeReason = + struct + type t = + { + code: ClusterStateChangeReasonCode.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = + (Util.option_bind (Xml.member "Code" xml) + ClusterStateChangeReasonCode.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> + Query.Pair + ("Code", (ClusterStateChangeReasonCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code + (fun f -> ("code", (ClusterStateChangeReasonCode.to_json f)))]) + let of_json j = + { + code = + (Util.option_map (Json.lookup j "code") + ClusterStateChangeReasonCode.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ClusterTimeline = + struct + type t = + { + creation_date_time: DateTime.t option ; + ready_date_time: DateTime.t option ; + end_date_time: DateTime.t option } + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + let parse xml = + Some + { + creation_date_time = + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse); + ready_date_time = + (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.ready_date_time + (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); + Util.option_map v.creation_date_time + (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.ready_date_time + (fun f -> ("ready_date_time", (DateTime.to_json f))); + Util.option_map v.creation_date_time + (fun f -> ("creation_date_time", (DateTime.to_json f)))]) + let of_json j = + { + creation_date_time = + (Util.option_map (Json.lookup j "creation_date_time") + DateTime.of_json); + ready_date_time = + (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + } + end +module BootstrapActionDetail = + struct + type t = { + bootstrap_action_config: BootstrapActionConfig.t option } + let make ?bootstrap_action_config () = { bootstrap_action_config } + let parse xml = + Some + { + bootstrap_action_config = + (Util.option_bind (Xml.member "BootstrapActionConfig" xml) + BootstrapActionConfig.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.bootstrap_action_config + (fun f -> + Query.Pair + ("BootstrapActionConfig", + (BootstrapActionConfig.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.bootstrap_action_config + (fun f -> + ("bootstrap_action_config", + (BootstrapActionConfig.to_json f)))]) + let of_json j = + { + bootstrap_action_config = + (Util.option_map (Json.lookup j "bootstrap_action_config") + BootstrapActionConfig.of_json) + } + end +module JobFlowExecutionState = + struct + type t = + | STARTING + | BOOTSTRAPPING + | RUNNING + | WAITING + | SHUTTING_DOWN + | TERMINATED + | COMPLETED + | FAILED + let str_to_t = + [("FAILED", FAILED); + ("COMPLETED", COMPLETED); + ("TERMINATED", TERMINATED); + ("SHUTTING_DOWN", SHUTTING_DOWN); + ("WAITING", WAITING); + ("RUNNING", RUNNING); + ("BOOTSTRAPPING", BOOTSTRAPPING); + ("STARTING", STARTING)] + let t_to_str = + [(FAILED, "FAILED"); + (COMPLETED, "COMPLETED"); + (TERMINATED, "TERMINATED"); + (SHUTTING_DOWN, "SHUTTING_DOWN"); + (WAITING, "WAITING"); + (RUNNING, "RUNNING"); + (BOOTSTRAPPING, "BOOTSTRAPPING"); + (STARTING, "STARTING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceGroupDetailList = + struct + type t = InstanceGroupDetail.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceGroupDetail.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceGroupDetail.to_query v + let to_json v = `List (List.map InstanceGroupDetail.to_json v) + let of_json j = Json.to_list InstanceGroupDetail.of_json j + end +module PlacementType = + struct + type t = { + availability_zone: String.t } + let make ~availability_zone () = { availability_zone } + let parse xml = + Some + { + availability_zone = + (Xml.required "AvailabilityZone" + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZone", (String.to_query v.availability_zone)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("availability_zone", (String.to_json v.availability_zone))]) + let of_json j = + { + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))) + } + end +module StepDetail = + struct + type t = + { + step_config: StepConfig.t ; + execution_status_detail: StepExecutionStatusDetail.t } + let make ~step_config ~execution_status_detail () = + { step_config; execution_status_detail } + let parse xml = + Some + { + step_config = + (Xml.required "StepConfig" + (Util.option_bind (Xml.member "StepConfig" xml) + StepConfig.parse)); + execution_status_detail = + (Xml.required "ExecutionStatusDetail" + (Util.option_bind (Xml.member "ExecutionStatusDetail" xml) + StepExecutionStatusDetail.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ExecutionStatusDetail", + (StepExecutionStatusDetail.to_query + v.execution_status_detail))); + Some + (Query.Pair ("StepConfig", (StepConfig.to_query v.step_config)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("execution_status_detail", + (StepExecutionStatusDetail.to_json v.execution_status_detail)); + Some ("step_config", (StepConfig.to_json v.step_config))]) + let of_json j = + { + step_config = + (StepConfig.of_json + (Util.of_option_exn (Json.lookup j "step_config"))); + execution_status_detail = + (StepExecutionStatusDetail.of_json + (Util.of_option_exn (Json.lookup j "execution_status_detail"))) + } + end +module Application = + struct + type t = + { + name: String.t option ; + version: String.t option ; + args: StringList.t ; + additional_info: StringMap.t option } + let make ?name ?version ?(args= []) ?additional_info () = + { name; version; args; additional_info } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + version = + (Util.option_bind (Xml.member "Version" xml) String.parse); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) StringList.parse)); + additional_info = + (Util.option_bind (Xml.member "AdditionalInfo" xml) + StringMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (StringMap.to_query f))); + Some (Query.Pair ("Args.member", (StringList.to_query v.args))); + Util.option_map v.version + (fun f -> Query.Pair ("Version", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.additional_info + (fun f -> ("additional_info", (StringMap.to_json f))); + Some ("args", (StringList.to_json v.args)); + Util.option_map v.version + (fun f -> ("version", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + version = (Util.option_map (Json.lookup j "version") String.of_json); + args = + (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))); + additional_info = + (Util.option_map (Json.lookup j "additional_info") + StringMap.of_json) + } + end +module Tag = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module InstanceGroupConfig = + struct + type t = + { + name: String.t option ; + market: MarketType.t option ; + instance_role: InstanceRoleType.t ; + bid_price: String.t option ; + instance_type: String.t ; + instance_count: Integer.t ; + configurations: ConfigurationList.t } + let make ?name ?market ~instance_role ?bid_price ~instance_type + ~instance_count ?(configurations= []) () = + { + name; + market; + instance_role; + bid_price; + instance_type; + instance_count; + configurations + } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + market = + (Util.option_bind (Xml.member "Market" xml) MarketType.parse); + instance_role = + (Xml.required "InstanceRole" + (Util.option_bind (Xml.member "InstanceRole" xml) + InstanceRoleType.parse)); + bid_price = + (Util.option_bind (Xml.member "BidPrice" xml) String.parse); + instance_type = + (Xml.required "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse)); + instance_count = + (Xml.required "InstanceCount" + (Util.option_bind (Xml.member "InstanceCount" xml) + Integer.parse)); + configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "Configurations" xml) + ConfigurationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Configurations.member", + (ConfigurationList.to_query v.configurations))); + Some + (Query.Pair + ("InstanceCount", (Integer.to_query v.instance_count))); + Some + (Query.Pair ("InstanceType", (String.to_query v.instance_type))); + Util.option_map v.bid_price + (fun f -> Query.Pair ("BidPrice", (String.to_query f))); + Some + (Query.Pair + ("InstanceRole", (InstanceRoleType.to_query v.instance_role))); + Util.option_map v.market + (fun f -> Query.Pair ("Market", (MarketType.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("configurations", + (ConfigurationList.to_json v.configurations)); + Some ("instance_count", (Integer.to_json v.instance_count)); + Some ("instance_type", (String.to_json v.instance_type)); + Util.option_map v.bid_price + (fun f -> ("bid_price", (String.to_json f))); + Some ("instance_role", (InstanceRoleType.to_json v.instance_role)); + Util.option_map v.market + (fun f -> ("market", (MarketType.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + market = + (Util.option_map (Json.lookup j "market") MarketType.of_json); + instance_role = + (InstanceRoleType.of_json + (Util.of_option_exn (Json.lookup j "instance_role"))); + bid_price = + (Util.option_map (Json.lookup j "bid_price") String.of_json); + instance_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "instance_type"))); + instance_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_count"))); + configurations = + (ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "configurations"))) + } + end +module HadoopStepConfig = + struct + type t = + { + jar: String.t option ; + properties: StringMap.t option ; + main_class: String.t option ; + args: StringList.t } + let make ?jar ?properties ?main_class ?(args= []) () = + { jar; properties; main_class; args } + let parse xml = + Some + { + jar = (Util.option_bind (Xml.member "Jar" xml) String.parse); + properties = + (Util.option_bind (Xml.member "Properties" xml) StringMap.parse); + main_class = + (Util.option_bind (Xml.member "MainClass" xml) String.parse); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) StringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Args.member", (StringList.to_query v.args))); + Util.option_map v.main_class + (fun f -> Query.Pair ("MainClass", (String.to_query f))); + Util.option_map v.properties + (fun f -> Query.Pair ("Properties", (StringMap.to_query f))); + Util.option_map v.jar + (fun f -> Query.Pair ("Jar", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("args", (StringList.to_json v.args)); + Util.option_map v.main_class + (fun f -> ("main_class", (String.to_json f))); + Util.option_map v.properties + (fun f -> ("properties", (StringMap.to_json f))); + Util.option_map v.jar (fun f -> ("jar", (String.to_json f)))]) + let of_json j = + { + jar = (Util.option_map (Json.lookup j "jar") String.of_json); + properties = + (Util.option_map (Json.lookup j "properties") StringMap.of_json); + main_class = + (Util.option_map (Json.lookup j "main_class") String.of_json); + args = + (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + } + end +module StepStatus = + struct + type t = + { + state: StepState.t option ; + state_change_reason: StepStateChangeReason.t option ; + timeline: StepTimeline.t option } + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + let parse xml = + Some + { + state = (Util.option_bind (Xml.member "State" xml) StepState.parse); + state_change_reason = + (Util.option_bind (Xml.member "StateChangeReason" xml) + StepStateChangeReason.parse); + timeline = + (Util.option_bind (Xml.member "Timeline" xml) StepTimeline.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> Query.Pair ("Timeline", (StepTimeline.to_query f))); + Util.option_map v.state_change_reason + (fun f -> + Query.Pair + ("StateChangeReason", (StepStateChangeReason.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (StepState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> ("timeline", (StepTimeline.to_json f))); + Util.option_map v.state_change_reason + (fun f -> + ("state_change_reason", (StepStateChangeReason.to_json f))); + Util.option_map v.state + (fun f -> ("state", (StepState.to_json f)))]) + let of_json j = + { + state = (Util.option_map (Json.lookup j "state") StepState.of_json); + state_change_reason = + (Util.option_map (Json.lookup j "state_change_reason") + StepStateChangeReason.of_json); + timeline = + (Util.option_map (Json.lookup j "timeline") StepTimeline.of_json) + } + end +module EC2InstanceIdsToTerminateList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceGroupStatus = + struct + type t = + { + state: InstanceGroupState.t option ; + state_change_reason: InstanceGroupStateChangeReason.t option ; + timeline: InstanceGroupTimeline.t option } + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + let parse xml = + Some + { + state = + (Util.option_bind (Xml.member "State" xml) + InstanceGroupState.parse); + state_change_reason = + (Util.option_bind (Xml.member "StateChangeReason" xml) + InstanceGroupStateChangeReason.parse); + timeline = + (Util.option_bind (Xml.member "Timeline" xml) + InstanceGroupTimeline.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> + Query.Pair ("Timeline", (InstanceGroupTimeline.to_query f))); + Util.option_map v.state_change_reason + (fun f -> + Query.Pair + ("StateChangeReason", + (InstanceGroupStateChangeReason.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (InstanceGroupState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> ("timeline", (InstanceGroupTimeline.to_json f))); + Util.option_map v.state_change_reason + (fun f -> + ("state_change_reason", + (InstanceGroupStateChangeReason.to_json f))); + Util.option_map v.state + (fun f -> ("state", (InstanceGroupState.to_json f)))]) + let of_json j = + { + state = + (Util.option_map (Json.lookup j "state") InstanceGroupState.of_json); + state_change_reason = + (Util.option_map (Json.lookup j "state_change_reason") + InstanceGroupStateChangeReason.of_json); + timeline = + (Util.option_map (Json.lookup j "timeline") + InstanceGroupTimeline.of_json) + } + end +module InstanceGroupType = + struct + type t = + | MASTER + | CORE + | TASK + let str_to_t = [("TASK", TASK); ("CORE", CORE); ("MASTER", MASTER)] + let t_to_str = [(TASK, "TASK"); (CORE, "CORE"); (MASTER, "MASTER")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceStatus = + struct + type t = + { + state: InstanceState.t option ; + state_change_reason: InstanceStateChangeReason.t option ; + timeline: InstanceTimeline.t option } + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + let parse xml = + Some + { + state = + (Util.option_bind (Xml.member "State" xml) InstanceState.parse); + state_change_reason = + (Util.option_bind (Xml.member "StateChangeReason" xml) + InstanceStateChangeReason.parse); + timeline = + (Util.option_bind (Xml.member "Timeline" xml) + InstanceTimeline.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> + Query.Pair ("Timeline", (InstanceTimeline.to_query f))); + Util.option_map v.state_change_reason + (fun f -> + Query.Pair + ("StateChangeReason", + (InstanceStateChangeReason.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (InstanceState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> ("timeline", (InstanceTimeline.to_json f))); + Util.option_map v.state_change_reason + (fun f -> + ("state_change_reason", + (InstanceStateChangeReason.to_json f))); + Util.option_map v.state + (fun f -> ("state", (InstanceState.to_json f)))]) + let of_json j = + { + state = + (Util.option_map (Json.lookup j "state") InstanceState.of_json); + state_change_reason = + (Util.option_map (Json.lookup j "state_change_reason") + InstanceStateChangeReason.of_json); + timeline = + (Util.option_map (Json.lookup j "timeline") + InstanceTimeline.of_json) + } + end +module ClusterStatus = + struct + type t = + { + state: ClusterState.t option ; + state_change_reason: ClusterStateChangeReason.t option ; + timeline: ClusterTimeline.t option } + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + let parse xml = + Some + { + state = + (Util.option_bind (Xml.member "State" xml) ClusterState.parse); + state_change_reason = + (Util.option_bind (Xml.member "StateChangeReason" xml) + ClusterStateChangeReason.parse); + timeline = + (Util.option_bind (Xml.member "Timeline" xml) + ClusterTimeline.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> Query.Pair ("Timeline", (ClusterTimeline.to_query f))); + Util.option_map v.state_change_reason + (fun f -> + Query.Pair + ("StateChangeReason", + (ClusterStateChangeReason.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (ClusterState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timeline + (fun f -> ("timeline", (ClusterTimeline.to_json f))); + Util.option_map v.state_change_reason + (fun f -> + ("state_change_reason", (ClusterStateChangeReason.to_json f))); + Util.option_map v.state + (fun f -> ("state", (ClusterState.to_json f)))]) + let of_json j = + { + state = + (Util.option_map (Json.lookup j "state") ClusterState.of_json); + state_change_reason = + (Util.option_map (Json.lookup j "state_change_reason") + ClusterStateChangeReason.of_json); + timeline = + (Util.option_map (Json.lookup j "timeline") ClusterTimeline.of_json) + } + end +module BootstrapActionDetailList = + struct + type t = BootstrapActionDetail.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BootstrapActionDetail.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list BootstrapActionDetail.to_query v + let to_json v = `List (List.map BootstrapActionDetail.to_json v) + let of_json j = Json.to_list BootstrapActionDetail.of_json j + end +module JobFlowExecutionStatusDetail = + struct + type t = + { + state: JobFlowExecutionState.t ; + creation_date_time: DateTime.t ; + start_date_time: DateTime.t option ; + ready_date_time: DateTime.t option ; + end_date_time: DateTime.t option ; + last_state_change_reason: String.t option } + let make ~state ~creation_date_time ?start_date_time ?ready_date_time + ?end_date_time ?last_state_change_reason () = + { + state; + creation_date_time; + start_date_time; + ready_date_time; + end_date_time; + last_state_change_reason + } + let parse xml = + Some + { + state = + (Xml.required "State" + (Util.option_bind (Xml.member "State" xml) + JobFlowExecutionState.parse)); + creation_date_time = + (Xml.required "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) + DateTime.parse)); + start_date_time = + (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); + ready_date_time = + (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); + end_date_time = + (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse); + last_state_change_reason = + (Util.option_bind (Xml.member "LastStateChangeReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.last_state_change_reason + (fun f -> + Query.Pair ("LastStateChangeReason", (String.to_query f))); + Util.option_map v.end_date_time + (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); + Util.option_map v.ready_date_time + (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); + Util.option_map v.start_date_time + (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); + Some + (Query.Pair + ("CreationDateTime", + (DateTime.to_query v.creation_date_time))); + Some + (Query.Pair ("State", (JobFlowExecutionState.to_query v.state)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.last_state_change_reason + (fun f -> ("last_state_change_reason", (String.to_json f))); + Util.option_map v.end_date_time + (fun f -> ("end_date_time", (DateTime.to_json f))); + Util.option_map v.ready_date_time + (fun f -> ("ready_date_time", (DateTime.to_json f))); + Util.option_map v.start_date_time + (fun f -> ("start_date_time", (DateTime.to_json f))); + Some + ("creation_date_time", (DateTime.to_json v.creation_date_time)); + Some ("state", (JobFlowExecutionState.to_json v.state))]) + let of_json j = + { + state = + (JobFlowExecutionState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + creation_date_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_date_time"))); + start_date_time = + (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); + ready_date_time = + (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); + end_date_time = + (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json); + last_state_change_reason = + (Util.option_map (Json.lookup j "last_state_change_reason") + String.of_json) + } + end +module JobFlowInstancesDetail = + struct + type t = + { + master_instance_type: String.t ; + master_public_dns_name: String.t option ; + master_instance_id: String.t option ; + slave_instance_type: String.t ; + instance_count: Integer.t ; + instance_groups: InstanceGroupDetailList.t ; + normalized_instance_hours: Integer.t option ; + ec2_key_name: String.t option ; + ec2_subnet_id: String.t option ; + placement: PlacementType.t option ; + keep_job_flow_alive_when_no_steps: Boolean.t option ; + termination_protected: Boolean.t option ; + hadoop_version: String.t option } + let make ~master_instance_type ?master_public_dns_name + ?master_instance_id ~slave_instance_type ~instance_count + ?(instance_groups= []) ?normalized_instance_hours ?ec2_key_name + ?ec2_subnet_id ?placement ?keep_job_flow_alive_when_no_steps + ?termination_protected ?hadoop_version () = + { + master_instance_type; + master_public_dns_name; + master_instance_id; + slave_instance_type; + instance_count; + instance_groups; + normalized_instance_hours; + ec2_key_name; + ec2_subnet_id; + placement; + keep_job_flow_alive_when_no_steps; + termination_protected; + hadoop_version + } + let parse xml = + Some + { + master_instance_type = + (Xml.required "MasterInstanceType" + (Util.option_bind (Xml.member "MasterInstanceType" xml) + String.parse)); + master_public_dns_name = + (Util.option_bind (Xml.member "MasterPublicDnsName" xml) + String.parse); + master_instance_id = + (Util.option_bind (Xml.member "MasterInstanceId" xml) + String.parse); + slave_instance_type = + (Xml.required "SlaveInstanceType" + (Util.option_bind (Xml.member "SlaveInstanceType" xml) + String.parse)); + instance_count = + (Xml.required "InstanceCount" + (Util.option_bind (Xml.member "InstanceCount" xml) + Integer.parse)); + instance_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroups" xml) + InstanceGroupDetailList.parse)); + normalized_instance_hours = + (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) + Integer.parse); + ec2_key_name = + (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); + ec2_subnet_id = + (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); + placement = + (Util.option_bind (Xml.member "Placement" xml) + PlacementType.parse); + keep_job_flow_alive_when_no_steps = + (Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) + Boolean.parse); + termination_protected = + (Util.option_bind (Xml.member "TerminationProtected" xml) + Boolean.parse); + hadoop_version = + (Util.option_bind (Xml.member "HadoopVersion" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.hadoop_version + (fun f -> Query.Pair ("HadoopVersion", (String.to_query f))); + Util.option_map v.termination_protected + (fun f -> + Query.Pair ("TerminationProtected", (Boolean.to_query f))); + Util.option_map v.keep_job_flow_alive_when_no_steps + (fun f -> + Query.Pair + ("KeepJobFlowAliveWhenNoSteps", (Boolean.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (PlacementType.to_query f))); + Util.option_map v.ec2_subnet_id + (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); + Util.option_map v.ec2_key_name + (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f))); + Util.option_map v.normalized_instance_hours + (fun f -> + Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); + Some + (Query.Pair + ("InstanceGroups.member", + (InstanceGroupDetailList.to_query v.instance_groups))); + Some + (Query.Pair + ("InstanceCount", (Integer.to_query v.instance_count))); + Some + (Query.Pair + ("SlaveInstanceType", + (String.to_query v.slave_instance_type))); + Util.option_map v.master_instance_id + (fun f -> Query.Pair ("MasterInstanceId", (String.to_query f))); + Util.option_map v.master_public_dns_name + (fun f -> + Query.Pair ("MasterPublicDnsName", (String.to_query f))); + Some + (Query.Pair + ("MasterInstanceType", + (String.to_query v.master_instance_type)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.hadoop_version + (fun f -> ("hadoop_version", (String.to_json f))); + Util.option_map v.termination_protected + (fun f -> ("termination_protected", (Boolean.to_json f))); + Util.option_map v.keep_job_flow_alive_when_no_steps + (fun f -> + ("keep_job_flow_alive_when_no_steps", (Boolean.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (PlacementType.to_json f))); + Util.option_map v.ec2_subnet_id + (fun f -> ("ec2_subnet_id", (String.to_json f))); + Util.option_map v.ec2_key_name + (fun f -> ("ec2_key_name", (String.to_json f))); + Util.option_map v.normalized_instance_hours + (fun f -> ("normalized_instance_hours", (Integer.to_json f))); + Some + ("instance_groups", + (InstanceGroupDetailList.to_json v.instance_groups)); + Some ("instance_count", (Integer.to_json v.instance_count)); + Some + ("slave_instance_type", (String.to_json v.slave_instance_type)); + Util.option_map v.master_instance_id + (fun f -> ("master_instance_id", (String.to_json f))); + Util.option_map v.master_public_dns_name + (fun f -> ("master_public_dns_name", (String.to_json f))); + Some + ("master_instance_type", + (String.to_json v.master_instance_type))]) + let of_json j = + { + master_instance_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "master_instance_type"))); + master_public_dns_name = + (Util.option_map (Json.lookup j "master_public_dns_name") + String.of_json); + master_instance_id = + (Util.option_map (Json.lookup j "master_instance_id") + String.of_json); + slave_instance_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "slave_instance_type"))); + instance_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_count"))); + instance_groups = + (InstanceGroupDetailList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups"))); + normalized_instance_hours = + (Util.option_map (Json.lookup j "normalized_instance_hours") + Integer.of_json); + ec2_key_name = + (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); + ec2_subnet_id = + (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); + placement = + (Util.option_map (Json.lookup j "placement") PlacementType.of_json); + keep_job_flow_alive_when_no_steps = + (Util.option_map + (Json.lookup j "keep_job_flow_alive_when_no_steps") + Boolean.of_json); + termination_protected = + (Util.option_map (Json.lookup j "termination_protected") + Boolean.of_json); + hadoop_version = + (Util.option_map (Json.lookup j "hadoop_version") String.of_json) + } + end +module StepDetailList = + struct + type t = StepDetail.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StepDetail.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StepDetail.to_query v + let to_json v = `List (List.map StepDetail.to_json v) + let of_json j = Json.to_list StepDetail.of_json j + end +module SupportedProductsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ApplicationList = + struct + type t = Application.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Application.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Application.to_query v + let to_json v = `List (List.map Application.to_json v) + let of_json j = Json.to_list Application.of_json j + end +module Ec2InstanceAttributes = + struct + type t = + { + ec2_key_name: String.t option ; + ec2_subnet_id: String.t option ; + ec2_availability_zone: String.t option ; + iam_instance_profile: String.t option ; + emr_managed_master_security_group: String.t option ; + emr_managed_slave_security_group: String.t option ; + additional_master_security_groups: StringList.t ; + additional_slave_security_groups: StringList.t } + let make ?ec2_key_name ?ec2_subnet_id ?ec2_availability_zone + ?iam_instance_profile ?emr_managed_master_security_group + ?emr_managed_slave_security_group ?(additional_master_security_groups= + []) ?(additional_slave_security_groups= []) () = + { + ec2_key_name; + ec2_subnet_id; + ec2_availability_zone; + iam_instance_profile; + emr_managed_master_security_group; + emr_managed_slave_security_group; + additional_master_security_groups; + additional_slave_security_groups + } + let parse xml = + Some + { + ec2_key_name = + (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); + ec2_subnet_id = + (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); + ec2_availability_zone = + (Util.option_bind (Xml.member "Ec2AvailabilityZone" xml) + String.parse); + iam_instance_profile = + (Util.option_bind (Xml.member "IamInstanceProfile" xml) + String.parse); + emr_managed_master_security_group = + (Util.option_bind + (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse); + emr_managed_slave_security_group = + (Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) + String.parse); + additional_master_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "AdditionalMasterSecurityGroups" xml) + StringList.parse)); + additional_slave_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "AdditionalSlaveSecurityGroups" xml) + StringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AdditionalSlaveSecurityGroups.member", + (StringList.to_query v.additional_slave_security_groups))); + Some + (Query.Pair + ("AdditionalMasterSecurityGroups.member", + (StringList.to_query v.additional_master_security_groups))); + Util.option_map v.emr_managed_slave_security_group + (fun f -> + Query.Pair + ("EmrManagedSlaveSecurityGroup", (String.to_query f))); + Util.option_map v.emr_managed_master_security_group + (fun f -> + Query.Pair + ("EmrManagedMasterSecurityGroup", (String.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> Query.Pair ("IamInstanceProfile", (String.to_query f))); + Util.option_map v.ec2_availability_zone + (fun f -> + Query.Pair ("Ec2AvailabilityZone", (String.to_query f))); + Util.option_map v.ec2_subnet_id + (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); + Util.option_map v.ec2_key_name + (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("additional_slave_security_groups", + (StringList.to_json v.additional_slave_security_groups)); + Some + ("additional_master_security_groups", + (StringList.to_json v.additional_master_security_groups)); + Util.option_map v.emr_managed_slave_security_group + (fun f -> + ("emr_managed_slave_security_group", (String.to_json f))); + Util.option_map v.emr_managed_master_security_group + (fun f -> + ("emr_managed_master_security_group", (String.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> ("iam_instance_profile", (String.to_json f))); + Util.option_map v.ec2_availability_zone + (fun f -> ("ec2_availability_zone", (String.to_json f))); + Util.option_map v.ec2_subnet_id + (fun f -> ("ec2_subnet_id", (String.to_json f))); + Util.option_map v.ec2_key_name + (fun f -> ("ec2_key_name", (String.to_json f)))]) + let of_json j = + { + ec2_key_name = + (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); + ec2_subnet_id = + (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); + ec2_availability_zone = + (Util.option_map (Json.lookup j "ec2_availability_zone") + String.of_json); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + String.of_json); + emr_managed_master_security_group = + (Util.option_map + (Json.lookup j "emr_managed_master_security_group") + String.of_json); + emr_managed_slave_security_group = + (Util.option_map (Json.lookup j "emr_managed_slave_security_group") + String.of_json); + additional_master_security_groups = + (StringList.of_json + (Util.of_option_exn + (Json.lookup j "additional_master_security_groups"))); + additional_slave_security_groups = + (StringList.of_json + (Util.of_option_exn + (Json.lookup j "additional_slave_security_groups"))) + } + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module InstanceGroupConfigList = + struct + type t = InstanceGroupConfig.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceGroupConfig.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceGroupConfig.to_query v + let to_json v = `List (List.map InstanceGroupConfig.to_json v) + let of_json j = Json.to_list InstanceGroupConfig.of_json j + end +module SecurityGroupsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SupportedProductConfig = + struct + type t = { + name: String.t option ; + args: XmlStringList.t } + let make ?name ?(args= []) () = { name; args } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("args", (XmlStringList.to_json v.args)); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + args = + (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + } + end +module StepSummary = + struct + type t = + { + id: String.t option ; + name: String.t option ; + config: HadoopStepConfig.t option ; + action_on_failure: ActionOnFailure.t option ; + status: StepStatus.t option } + let make ?id ?name ?config ?action_on_failure ?status () = + { id; name; config; action_on_failure; status } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + config = + (Util.option_bind (Xml.member "Config" xml) + HadoopStepConfig.parse); + action_on_failure = + (Util.option_bind (Xml.member "ActionOnFailure" xml) + ActionOnFailure.parse); + status = + (Util.option_bind (Xml.member "Status" xml) StepStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (StepStatus.to_query f))); + Util.option_map v.action_on_failure + (fun f -> + Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); + Util.option_map v.config + (fun f -> Query.Pair ("Config", (HadoopStepConfig.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (StepStatus.to_json f))); + Util.option_map v.action_on_failure + (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); + Util.option_map v.config + (fun f -> ("config", (HadoopStepConfig.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + config = + (Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json); + action_on_failure = + (Util.option_map (Json.lookup j "action_on_failure") + ActionOnFailure.of_json); + status = + (Util.option_map (Json.lookup j "status") StepStatus.of_json) + } + end +module InstanceGroupModifyConfig = + struct + type t = + { + instance_group_id: String.t ; + instance_count: Integer.t option ; + e_c2_instance_ids_to_terminate: EC2InstanceIdsToTerminateList.t } + let make ~instance_group_id ?instance_count + ?(e_c2_instance_ids_to_terminate= []) () = + { instance_group_id; instance_count; e_c2_instance_ids_to_terminate } + let parse xml = + Some + { + instance_group_id = + (Xml.required "InstanceGroupId" + (Util.option_bind (Xml.member "InstanceGroupId" xml) + String.parse)); + instance_count = + (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse); + e_c2_instance_ids_to_terminate = + (Util.of_option [] + (Util.option_bind (Xml.member "EC2InstanceIdsToTerminate" xml) + EC2InstanceIdsToTerminateList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EC2InstanceIdsToTerminate.member", + (EC2InstanceIdsToTerminateList.to_query + v.e_c2_instance_ids_to_terminate))); + Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Some + (Query.Pair + ("InstanceGroupId", (String.to_query v.instance_group_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("e_c2_instance_ids_to_terminate", + (EC2InstanceIdsToTerminateList.to_json + v.e_c2_instance_ids_to_terminate)); + Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Some ("instance_group_id", (String.to_json v.instance_group_id))]) + let of_json j = + { + instance_group_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "instance_group_id"))); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json); + e_c2_instance_ids_to_terminate = + (EC2InstanceIdsToTerminateList.of_json + (Util.of_option_exn + (Json.lookup j "e_c2_instance_ids_to_terminate"))) + } + end +module InstanceGroup = + struct + type t = + { + id: String.t option ; + name: String.t option ; + market: MarketType.t option ; + instance_group_type: InstanceGroupType.t option ; + bid_price: String.t option ; + instance_type: String.t option ; + requested_instance_count: Integer.t option ; + running_instance_count: Integer.t option ; + status: InstanceGroupStatus.t option ; + configurations: ConfigurationList.t } + let make ?id ?name ?market ?instance_group_type ?bid_price + ?instance_type ?requested_instance_count ?running_instance_count + ?status ?(configurations= []) () = + { + id; + name; + market; + instance_group_type; + bid_price; + instance_type; + requested_instance_count; + running_instance_count; + status; + configurations + } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + market = + (Util.option_bind (Xml.member "Market" xml) MarketType.parse); + instance_group_type = + (Util.option_bind (Xml.member "InstanceGroupType" xml) + InstanceGroupType.parse); + bid_price = + (Util.option_bind (Xml.member "BidPrice" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "InstanceType" xml) String.parse); + requested_instance_count = + (Util.option_bind (Xml.member "RequestedInstanceCount" xml) + Integer.parse); + running_instance_count = + (Util.option_bind (Xml.member "RunningInstanceCount" xml) + Integer.parse); + status = + (Util.option_bind (Xml.member "Status" xml) + InstanceGroupStatus.parse); + configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "Configurations" xml) + ConfigurationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Configurations.member", + (ConfigurationList.to_query v.configurations))); + Util.option_map v.status + (fun f -> + Query.Pair ("Status", (InstanceGroupStatus.to_query f))); + Util.option_map v.running_instance_count + (fun f -> + Query.Pair ("RunningInstanceCount", (Integer.to_query f))); + Util.option_map v.requested_instance_count + (fun f -> + Query.Pair ("RequestedInstanceCount", (Integer.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (String.to_query f))); + Util.option_map v.bid_price + (fun f -> Query.Pair ("BidPrice", (String.to_query f))); + Util.option_map v.instance_group_type + (fun f -> + Query.Pair + ("InstanceGroupType", (InstanceGroupType.to_query f))); + Util.option_map v.market + (fun f -> Query.Pair ("Market", (MarketType.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("configurations", + (ConfigurationList.to_json v.configurations)); + Util.option_map v.status + (fun f -> ("status", (InstanceGroupStatus.to_json f))); + Util.option_map v.running_instance_count + (fun f -> ("running_instance_count", (Integer.to_json f))); + Util.option_map v.requested_instance_count + (fun f -> ("requested_instance_count", (Integer.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (String.to_json f))); + Util.option_map v.bid_price + (fun f -> ("bid_price", (String.to_json f))); + Util.option_map v.instance_group_type + (fun f -> ("instance_group_type", (InstanceGroupType.to_json f))); + Util.option_map v.market + (fun f -> ("market", (MarketType.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + market = + (Util.option_map (Json.lookup j "market") MarketType.of_json); + instance_group_type = + (Util.option_map (Json.lookup j "instance_group_type") + InstanceGroupType.of_json); + bid_price = + (Util.option_map (Json.lookup j "bid_price") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") String.of_json); + requested_instance_count = + (Util.option_map (Json.lookup j "requested_instance_count") + Integer.of_json); + running_instance_count = + (Util.option_map (Json.lookup j "running_instance_count") + Integer.of_json); + status = + (Util.option_map (Json.lookup j "status") + InstanceGroupStatus.of_json); + configurations = + (ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "configurations"))) + } + end +module Instance = + struct + type t = + { + id: String.t option ; + ec2_instance_id: String.t option ; + public_dns_name: String.t option ; + public_ip_address: String.t option ; + private_dns_name: String.t option ; + private_ip_address: String.t option ; + status: InstanceStatus.t option } + let make ?id ?ec2_instance_id ?public_dns_name ?public_ip_address + ?private_dns_name ?private_ip_address ?status () = + { + id; + ec2_instance_id; + public_dns_name; + public_ip_address; + private_dns_name; + private_ip_address; + status + } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + ec2_instance_id = + (Util.option_bind (Xml.member "Ec2InstanceId" xml) String.parse); + public_dns_name = + (Util.option_bind (Xml.member "PublicDnsName" xml) String.parse); + public_ip_address = + (Util.option_bind (Xml.member "PublicIpAddress" xml) String.parse); + private_dns_name = + (Util.option_bind (Xml.member "PrivateDnsName" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "PrivateIpAddress" xml) + String.parse); + status = + (Util.option_bind (Xml.member "Status" xml) InstanceStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (InstanceStatus.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Util.option_map v.public_ip_address + (fun f -> Query.Pair ("PublicIpAddress", (String.to_query f))); + Util.option_map v.public_dns_name + (fun f -> Query.Pair ("PublicDnsName", (String.to_query f))); + Util.option_map v.ec2_instance_id + (fun f -> Query.Pair ("Ec2InstanceId", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (InstanceStatus.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Util.option_map v.public_ip_address + (fun f -> ("public_ip_address", (String.to_json f))); + Util.option_map v.public_dns_name + (fun f -> ("public_dns_name", (String.to_json f))); + Util.option_map v.ec2_instance_id + (fun f -> ("ec2_instance_id", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + ec2_instance_id = + (Util.option_map (Json.lookup j "ec2_instance_id") String.of_json); + public_dns_name = + (Util.option_map (Json.lookup j "public_dns_name") String.of_json); + public_ip_address = + (Util.option_map (Json.lookup j "public_ip_address") String.of_json); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + status = + (Util.option_map (Json.lookup j "status") InstanceStatus.of_json) + } + end +module ClusterSummary = + struct + type t = + { + id: String.t option ; + name: String.t option ; + status: ClusterStatus.t option ; + normalized_instance_hours: Integer.t option } + let make ?id ?name ?status ?normalized_instance_hours () = + { id; name; status; normalized_instance_hours } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + status = + (Util.option_bind (Xml.member "Status" xml) ClusterStatus.parse); + normalized_instance_hours = + (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.normalized_instance_hours + (fun f -> + Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (ClusterStatus.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.normalized_instance_hours + (fun f -> ("normalized_instance_hours", (Integer.to_json f))); + Util.option_map v.status + (fun f -> ("status", (ClusterStatus.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + status = + (Util.option_map (Json.lookup j "status") ClusterStatus.of_json); + normalized_instance_hours = + (Util.option_map (Json.lookup j "normalized_instance_hours") + Integer.of_json) + } + end +module JobFlowDetail = + struct + type t = + { + job_flow_id: String.t ; + name: String.t ; + log_uri: String.t option ; + ami_version: String.t option ; + execution_status_detail: JobFlowExecutionStatusDetail.t ; + instances: JobFlowInstancesDetail.t ; + steps: StepDetailList.t ; + bootstrap_actions: BootstrapActionDetailList.t ; + supported_products: SupportedProductsList.t ; + visible_to_all_users: Boolean.t option ; + job_flow_role: String.t option ; + service_role: String.t option } + let make ~job_flow_id ~name ?log_uri ?ami_version + ~execution_status_detail ~instances ?(steps= []) + ?(bootstrap_actions= []) ?(supported_products= []) + ?visible_to_all_users ?job_flow_role ?service_role () = + { + job_flow_id; + name; + log_uri; + ami_version; + execution_status_detail; + instances; + steps; + bootstrap_actions; + supported_products; + visible_to_all_users; + job_flow_role; + service_role + } + let parse xml = + Some + { + job_flow_id = + (Xml.required "JobFlowId" + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); + ami_version = + (Util.option_bind (Xml.member "AmiVersion" xml) String.parse); + execution_status_detail = + (Xml.required "ExecutionStatusDetail" + (Util.option_bind (Xml.member "ExecutionStatusDetail" xml) + JobFlowExecutionStatusDetail.parse)); + instances = + (Xml.required "Instances" + (Util.option_bind (Xml.member "Instances" xml) + JobFlowInstancesDetail.parse)); + steps = + (Util.of_option [] + (Util.option_bind (Xml.member "Steps" xml) + StepDetailList.parse)); + bootstrap_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "BootstrapActions" xml) + BootstrapActionDetailList.parse)); + supported_products = + (Util.of_option [] + (Util.option_bind (Xml.member "SupportedProducts" xml) + SupportedProductsList.parse)); + visible_to_all_users = + (Util.option_bind (Xml.member "VisibleToAllUsers" xml) + Boolean.parse); + job_flow_role = + (Util.option_bind (Xml.member "JobFlowRole" xml) String.parse); + service_role = + (Util.option_bind (Xml.member "ServiceRole" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.service_role + (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); + Util.option_map v.job_flow_role + (fun f -> Query.Pair ("JobFlowRole", (String.to_query f))); + Util.option_map v.visible_to_all_users + (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); + Some + (Query.Pair + ("SupportedProducts.member", + (SupportedProductsList.to_query v.supported_products))); + Some + (Query.Pair + ("BootstrapActions.member", + (BootstrapActionDetailList.to_query v.bootstrap_actions))); + Some + (Query.Pair ("Steps.member", (StepDetailList.to_query v.steps))); + Some + (Query.Pair + ("Instances", (JobFlowInstancesDetail.to_query v.instances))); + Some + (Query.Pair + ("ExecutionStatusDetail", + (JobFlowExecutionStatusDetail.to_query + v.execution_status_detail))); + Util.option_map v.ami_version + (fun f -> Query.Pair ("AmiVersion", (String.to_query f))); + Util.option_map v.log_uri + (fun f -> Query.Pair ("LogUri", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.service_role + (fun f -> ("service_role", (String.to_json f))); + Util.option_map v.job_flow_role + (fun f -> ("job_flow_role", (String.to_json f))); + Util.option_map v.visible_to_all_users + (fun f -> ("visible_to_all_users", (Boolean.to_json f))); + Some + ("supported_products", + (SupportedProductsList.to_json v.supported_products)); + Some + ("bootstrap_actions", + (BootstrapActionDetailList.to_json v.bootstrap_actions)); + Some ("steps", (StepDetailList.to_json v.steps)); + Some ("instances", (JobFlowInstancesDetail.to_json v.instances)); + Some + ("execution_status_detail", + (JobFlowExecutionStatusDetail.to_json + v.execution_status_detail)); + Util.option_map v.ami_version + (fun f -> ("ami_version", (String.to_json f))); + Util.option_map v.log_uri + (fun f -> ("log_uri", (String.to_json f))); + Some ("name", (String.to_json v.name)); + Some ("job_flow_id", (String.to_json v.job_flow_id))]) + let of_json j = + { + job_flow_id = + (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); + ami_version = + (Util.option_map (Json.lookup j "ami_version") String.of_json); + execution_status_detail = + (JobFlowExecutionStatusDetail.of_json + (Util.of_option_exn (Json.lookup j "execution_status_detail"))); + instances = + (JobFlowInstancesDetail.of_json + (Util.of_option_exn (Json.lookup j "instances"))); + steps = + (StepDetailList.of_json + (Util.of_option_exn (Json.lookup j "steps"))); + bootstrap_actions = + (BootstrapActionDetailList.of_json + (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); + supported_products = + (SupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "supported_products"))); + visible_to_all_users = + (Util.option_map (Json.lookup j "visible_to_all_users") + Boolean.of_json); + job_flow_role = + (Util.option_map (Json.lookup j "job_flow_role") String.of_json); + service_role = + (Util.option_map (Json.lookup j "service_role") String.of_json) + } + end +module Command = + struct + type t = + { + name: String.t option ; + script_path: String.t option ; + args: StringList.t } + let make ?name ?script_path ?(args= []) () = + { name; script_path; args } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + script_path = + (Util.option_bind (Xml.member "ScriptPath" xml) String.parse); + args = + (Util.of_option [] + (Util.option_bind (Xml.member "Args" xml) StringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Args.member", (StringList.to_query v.args))); + Util.option_map v.script_path + (fun f -> Query.Pair ("ScriptPath", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("args", (StringList.to_json v.args)); + Util.option_map v.script_path + (fun f -> ("script_path", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + script_path = + (Util.option_map (Json.lookup j "script_path") String.of_json); + args = + (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + } + end +module ClusterStateList = + struct + type t = ClusterState.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ClusterState.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ClusterState.to_query v + let to_json v = `List (List.map ClusterState.to_json v) + let of_json j = Json.to_list ClusterState.of_json j + end +module Step = + struct + type t = + { + id: String.t option ; + name: String.t option ; + config: HadoopStepConfig.t option ; + action_on_failure: ActionOnFailure.t option ; + status: StepStatus.t option } + let make ?id ?name ?config ?action_on_failure ?status () = + { id; name; config; action_on_failure; status } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + config = + (Util.option_bind (Xml.member "Config" xml) + HadoopStepConfig.parse); + action_on_failure = + (Util.option_bind (Xml.member "ActionOnFailure" xml) + ActionOnFailure.parse); + status = + (Util.option_bind (Xml.member "Status" xml) StepStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (StepStatus.to_query f))); + Util.option_map v.action_on_failure + (fun f -> + Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); + Util.option_map v.config + (fun f -> Query.Pair ("Config", (HadoopStepConfig.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (StepStatus.to_json f))); + Util.option_map v.action_on_failure + (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); + Util.option_map v.config + (fun f -> ("config", (HadoopStepConfig.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + config = + (Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json); + action_on_failure = + (Util.option_map (Json.lookup j "action_on_failure") + ActionOnFailure.of_json); + status = + (Util.option_map (Json.lookup j "status") StepStatus.of_json) + } + end +module Cluster = + struct + type t = + { + id: String.t ; + name: String.t ; + status: ClusterStatus.t ; + ec2_instance_attributes: Ec2InstanceAttributes.t option ; + log_uri: String.t option ; + requested_ami_version: String.t option ; + running_ami_version: String.t option ; + release_label: String.t option ; + auto_terminate: Boolean.t option ; + termination_protected: Boolean.t option ; + visible_to_all_users: Boolean.t option ; + applications: ApplicationList.t ; + tags: TagList.t ; + service_role: String.t option ; + normalized_instance_hours: Integer.t option ; + master_public_dns_name: String.t option ; + configurations: ConfigurationList.t } + let make ~id ~name ~status ?ec2_instance_attributes ?log_uri + ?requested_ami_version ?running_ami_version ?release_label + ?auto_terminate ?termination_protected ?visible_to_all_users + ?(applications= []) ?(tags= []) ?service_role + ?normalized_instance_hours ?master_public_dns_name ?(configurations= + []) () = + { + id; + name; + status; + ec2_instance_attributes; + log_uri; + requested_ami_version; + running_ami_version; + release_label; + auto_terminate; + termination_protected; + visible_to_all_users; + applications; + tags; + service_role; + normalized_instance_hours; + master_public_dns_name; + configurations + } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + status = + (Xml.required "Status" + (Util.option_bind (Xml.member "Status" xml) + ClusterStatus.parse)); + ec2_instance_attributes = + (Util.option_bind (Xml.member "Ec2InstanceAttributes" xml) + Ec2InstanceAttributes.parse); + log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); + requested_ami_version = + (Util.option_bind (Xml.member "RequestedAmiVersion" xml) + String.parse); + running_ami_version = + (Util.option_bind (Xml.member "RunningAmiVersion" xml) + String.parse); + release_label = + (Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse); + auto_terminate = + (Util.option_bind (Xml.member "AutoTerminate" xml) Boolean.parse); + termination_protected = + (Util.option_bind (Xml.member "TerminationProtected" xml) + Boolean.parse); + visible_to_all_users = + (Util.option_bind (Xml.member "VisibleToAllUsers" xml) + Boolean.parse); + applications = + (Util.of_option [] + (Util.option_bind (Xml.member "Applications" xml) + ApplicationList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + service_role = + (Util.option_bind (Xml.member "ServiceRole" xml) String.parse); + normalized_instance_hours = + (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) + Integer.parse); + master_public_dns_name = + (Util.option_bind (Xml.member "MasterPublicDnsName" xml) + String.parse); + configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "Configurations" xml) + ConfigurationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Configurations.member", + (ConfigurationList.to_query v.configurations))); + Util.option_map v.master_public_dns_name + (fun f -> + Query.Pair ("MasterPublicDnsName", (String.to_query f))); + Util.option_map v.normalized_instance_hours + (fun f -> + Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); + Util.option_map v.service_role + (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some + (Query.Pair + ("Applications.member", + (ApplicationList.to_query v.applications))); + Util.option_map v.visible_to_all_users + (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); + Util.option_map v.termination_protected + (fun f -> + Query.Pair ("TerminationProtected", (Boolean.to_query f))); + Util.option_map v.auto_terminate + (fun f -> Query.Pair ("AutoTerminate", (Boolean.to_query f))); + Util.option_map v.release_label + (fun f -> Query.Pair ("ReleaseLabel", (String.to_query f))); + Util.option_map v.running_ami_version + (fun f -> Query.Pair ("RunningAmiVersion", (String.to_query f))); + Util.option_map v.requested_ami_version + (fun f -> + Query.Pair ("RequestedAmiVersion", (String.to_query f))); + Util.option_map v.log_uri + (fun f -> Query.Pair ("LogUri", (String.to_query f))); + Util.option_map v.ec2_instance_attributes + (fun f -> + Query.Pair + ("Ec2InstanceAttributes", + (Ec2InstanceAttributes.to_query f))); + Some (Query.Pair ("Status", (ClusterStatus.to_query v.status))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("configurations", + (ConfigurationList.to_json v.configurations)); + Util.option_map v.master_public_dns_name + (fun f -> ("master_public_dns_name", (String.to_json f))); + Util.option_map v.normalized_instance_hours + (fun f -> ("normalized_instance_hours", (Integer.to_json f))); + Util.option_map v.service_role + (fun f -> ("service_role", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Some ("applications", (ApplicationList.to_json v.applications)); + Util.option_map v.visible_to_all_users + (fun f -> ("visible_to_all_users", (Boolean.to_json f))); + Util.option_map v.termination_protected + (fun f -> ("termination_protected", (Boolean.to_json f))); + Util.option_map v.auto_terminate + (fun f -> ("auto_terminate", (Boolean.to_json f))); + Util.option_map v.release_label + (fun f -> ("release_label", (String.to_json f))); + Util.option_map v.running_ami_version + (fun f -> ("running_ami_version", (String.to_json f))); + Util.option_map v.requested_ami_version + (fun f -> ("requested_ami_version", (String.to_json f))); + Util.option_map v.log_uri + (fun f -> ("log_uri", (String.to_json f))); + Util.option_map v.ec2_instance_attributes + (fun f -> + ("ec2_instance_attributes", + (Ec2InstanceAttributes.to_json f))); + Some ("status", (ClusterStatus.to_json v.status)); + Some ("name", (String.to_json v.name)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + status = + (ClusterStatus.of_json + (Util.of_option_exn (Json.lookup j "status"))); + ec2_instance_attributes = + (Util.option_map (Json.lookup j "ec2_instance_attributes") + Ec2InstanceAttributes.of_json); + log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); + requested_ami_version = + (Util.option_map (Json.lookup j "requested_ami_version") + String.of_json); + running_ami_version = + (Util.option_map (Json.lookup j "running_ami_version") + String.of_json); + release_label = + (Util.option_map (Json.lookup j "release_label") String.of_json); + auto_terminate = + (Util.option_map (Json.lookup j "auto_terminate") Boolean.of_json); + termination_protected = + (Util.option_map (Json.lookup j "termination_protected") + Boolean.of_json); + visible_to_all_users = + (Util.option_map (Json.lookup j "visible_to_all_users") + Boolean.of_json); + applications = + (ApplicationList.of_json + (Util.of_option_exn (Json.lookup j "applications"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + service_role = + (Util.option_map (Json.lookup j "service_role") String.of_json); + normalized_instance_hours = + (Util.option_map (Json.lookup j "normalized_instance_hours") + Integer.of_json); + master_public_dns_name = + (Util.option_map (Json.lookup j "master_public_dns_name") + String.of_json); + configurations = + (ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "configurations"))) + } + end +module BootstrapActionConfigList = + struct + type t = BootstrapActionConfig.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BootstrapActionConfig.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list BootstrapActionConfig.to_query v + let to_json v = `List (List.map BootstrapActionConfig.to_json v) + let of_json j = Json.to_list BootstrapActionConfig.of_json j + end +module JobFlowInstancesConfig = + struct + type t = + { + master_instance_type: String.t option ; + slave_instance_type: String.t option ; + instance_count: Integer.t option ; + instance_groups: InstanceGroupConfigList.t ; + ec2_key_name: String.t option ; + placement: PlacementType.t option ; + keep_job_flow_alive_when_no_steps: Boolean.t option ; + termination_protected: Boolean.t option ; + hadoop_version: String.t option ; + ec2_subnet_id: String.t option ; + emr_managed_master_security_group: String.t option ; + emr_managed_slave_security_group: String.t option ; + additional_master_security_groups: SecurityGroupsList.t ; + additional_slave_security_groups: SecurityGroupsList.t } + let make ?master_instance_type ?slave_instance_type ?instance_count + ?(instance_groups= []) ?ec2_key_name ?placement + ?keep_job_flow_alive_when_no_steps ?termination_protected + ?hadoop_version ?ec2_subnet_id ?emr_managed_master_security_group + ?emr_managed_slave_security_group ?(additional_master_security_groups= + []) ?(additional_slave_security_groups= []) () = + { + master_instance_type; + slave_instance_type; + instance_count; + instance_groups; + ec2_key_name; + placement; + keep_job_flow_alive_when_no_steps; + termination_protected; + hadoop_version; + ec2_subnet_id; + emr_managed_master_security_group; + emr_managed_slave_security_group; + additional_master_security_groups; + additional_slave_security_groups + } + let parse xml = + Some + { + master_instance_type = + (Util.option_bind (Xml.member "MasterInstanceType" xml) + String.parse); + slave_instance_type = + (Util.option_bind (Xml.member "SlaveInstanceType" xml) + String.parse); + instance_count = + (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse); + instance_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroups" xml) + InstanceGroupConfigList.parse)); + ec2_key_name = + (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); + placement = + (Util.option_bind (Xml.member "Placement" xml) + PlacementType.parse); + keep_job_flow_alive_when_no_steps = + (Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) + Boolean.parse); + termination_protected = + (Util.option_bind (Xml.member "TerminationProtected" xml) + Boolean.parse); + hadoop_version = + (Util.option_bind (Xml.member "HadoopVersion" xml) String.parse); + ec2_subnet_id = + (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); + emr_managed_master_security_group = + (Util.option_bind + (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse); + emr_managed_slave_security_group = + (Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) + String.parse); + additional_master_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "AdditionalMasterSecurityGroups" xml) + SecurityGroupsList.parse)); + additional_slave_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "AdditionalSlaveSecurityGroups" xml) + SecurityGroupsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AdditionalSlaveSecurityGroups.member", + (SecurityGroupsList.to_query + v.additional_slave_security_groups))); + Some + (Query.Pair + ("AdditionalMasterSecurityGroups.member", + (SecurityGroupsList.to_query + v.additional_master_security_groups))); + Util.option_map v.emr_managed_slave_security_group + (fun f -> + Query.Pair + ("EmrManagedSlaveSecurityGroup", (String.to_query f))); + Util.option_map v.emr_managed_master_security_group + (fun f -> + Query.Pair + ("EmrManagedMasterSecurityGroup", (String.to_query f))); + Util.option_map v.ec2_subnet_id + (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); + Util.option_map v.hadoop_version + (fun f -> Query.Pair ("HadoopVersion", (String.to_query f))); + Util.option_map v.termination_protected + (fun f -> + Query.Pair ("TerminationProtected", (Boolean.to_query f))); + Util.option_map v.keep_job_flow_alive_when_no_steps + (fun f -> + Query.Pair + ("KeepJobFlowAliveWhenNoSteps", (Boolean.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (PlacementType.to_query f))); + Util.option_map v.ec2_key_name + (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f))); + Some + (Query.Pair + ("InstanceGroups.member", + (InstanceGroupConfigList.to_query v.instance_groups))); + Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Util.option_map v.slave_instance_type + (fun f -> Query.Pair ("SlaveInstanceType", (String.to_query f))); + Util.option_map v.master_instance_type + (fun f -> Query.Pair ("MasterInstanceType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("additional_slave_security_groups", + (SecurityGroupsList.to_json + v.additional_slave_security_groups)); + Some + ("additional_master_security_groups", + (SecurityGroupsList.to_json + v.additional_master_security_groups)); + Util.option_map v.emr_managed_slave_security_group + (fun f -> + ("emr_managed_slave_security_group", (String.to_json f))); + Util.option_map v.emr_managed_master_security_group + (fun f -> + ("emr_managed_master_security_group", (String.to_json f))); + Util.option_map v.ec2_subnet_id + (fun f -> ("ec2_subnet_id", (String.to_json f))); + Util.option_map v.hadoop_version + (fun f -> ("hadoop_version", (String.to_json f))); + Util.option_map v.termination_protected + (fun f -> ("termination_protected", (Boolean.to_json f))); + Util.option_map v.keep_job_flow_alive_when_no_steps + (fun f -> + ("keep_job_flow_alive_when_no_steps", (Boolean.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (PlacementType.to_json f))); + Util.option_map v.ec2_key_name + (fun f -> ("ec2_key_name", (String.to_json f))); + Some + ("instance_groups", + (InstanceGroupConfigList.to_json v.instance_groups)); + Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Util.option_map v.slave_instance_type + (fun f -> ("slave_instance_type", (String.to_json f))); + Util.option_map v.master_instance_type + (fun f -> ("master_instance_type", (String.to_json f)))]) + let of_json j = + { + master_instance_type = + (Util.option_map (Json.lookup j "master_instance_type") + String.of_json); + slave_instance_type = + (Util.option_map (Json.lookup j "slave_instance_type") + String.of_json); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json); + instance_groups = + (InstanceGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups"))); + ec2_key_name = + (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); + placement = + (Util.option_map (Json.lookup j "placement") PlacementType.of_json); + keep_job_flow_alive_when_no_steps = + (Util.option_map + (Json.lookup j "keep_job_flow_alive_when_no_steps") + Boolean.of_json); + termination_protected = + (Util.option_map (Json.lookup j "termination_protected") + Boolean.of_json); + hadoop_version = + (Util.option_map (Json.lookup j "hadoop_version") String.of_json); + ec2_subnet_id = + (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); + emr_managed_master_security_group = + (Util.option_map + (Json.lookup j "emr_managed_master_security_group") + String.of_json); + emr_managed_slave_security_group = + (Util.option_map (Json.lookup j "emr_managed_slave_security_group") + String.of_json); + additional_master_security_groups = + (SecurityGroupsList.of_json + (Util.of_option_exn + (Json.lookup j "additional_master_security_groups"))); + additional_slave_security_groups = + (SecurityGroupsList.of_json + (Util.of_option_exn + (Json.lookup j "additional_slave_security_groups"))) + } + end +module NewSupportedProductsList = + struct + type t = SupportedProductConfig.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SupportedProductConfig.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list SupportedProductConfig.to_query v + let to_json v = `List (List.map SupportedProductConfig.to_json v) + let of_json j = Json.to_list SupportedProductConfig.of_json j + end +module StepConfigList = + struct + type t = StepConfig.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StepConfig.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StepConfig.to_query v + let to_json v = `List (List.map StepConfig.to_json v) + let of_json j = Json.to_list StepConfig.of_json j + end +module StepSummaryList = + struct + type t = StepSummary.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StepSummary.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StepSummary.to_query v + let to_json v = `List (List.map StepSummary.to_json v) + let of_json j = Json.to_list StepSummary.of_json j + end +module InstanceGroupModifyConfigList = + struct + type t = InstanceGroupModifyConfig.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceGroupModifyConfig.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceGroupModifyConfig.to_query v + let to_json v = `List (List.map InstanceGroupModifyConfig.to_json v) + let of_json j = Json.to_list InstanceGroupModifyConfig.of_json j + end +module InstanceGroupList = + struct + type t = InstanceGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceGroup.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceGroup.to_query v + let to_json v = `List (List.map InstanceGroup.to_json v) + let of_json j = Json.to_list InstanceGroup.of_json j + end +module StepIdsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceList = + struct + type t = Instance.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Instance.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Instance.to_query v + let to_json v = `List (List.map Instance.to_json v) + let of_json j = Json.to_list Instance.of_json j + end +module ClusterSummaryList = + struct + type t = ClusterSummary.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ClusterSummary.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ClusterSummary.to_query v + let to_json v = `List (List.map ClusterSummary.to_json v) + let of_json j = Json.to_list ClusterSummary.of_json j + end +module StepStateList = + struct + type t = StepState.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StepState.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StepState.to_query v + let to_json v = `List (List.map StepState.to_json v) + let of_json j = Json.to_list StepState.of_json j + end +module JobFlowExecutionStateList = + struct + type t = JobFlowExecutionState.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map JobFlowExecutionState.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list JobFlowExecutionState.to_query v + let to_json v = `List (List.map JobFlowExecutionState.to_json v) + let of_json j = Json.to_list JobFlowExecutionState.of_json j + end +module JobFlowDetailList = + struct + type t = JobFlowDetail.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map JobFlowDetail.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list JobFlowDetail.to_query v + let to_json v = `List (List.map JobFlowDetail.to_json v) + let of_json j = Json.to_list JobFlowDetail.of_json j + end +module CommandList = + struct + type t = Command.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Command.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Command.to_query v + let to_json v = `List (List.map Command.to_json v) + let of_json j = Json.to_list Command.of_json j + end +module InstanceGroupIdsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceGroupTypeList = + struct + type t = InstanceGroupType.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceGroupType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceGroupType.to_query v + let to_json v = `List (List.map InstanceGroupType.to_json v) + let of_json j = Json.to_list InstanceGroupType.of_json j + end +module ListInstanceGroupsInput = + struct + type t = { + cluster_id: String.t ; + marker: String.t option } + let make ~cluster_id ?marker () = { cluster_id; marker } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module AddTagsInput = + struct + type t = { + resource_id: String.t ; + tags: TagList.t } + let make ~resource_id ~tags () = { resource_id; tags } + let parse xml = + Some + { + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("resource_id", (String.to_json v.resource_id))]) + let of_json j = + { + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ListClustersInput = + struct + type t = + { + created_after: DateTime.t option ; + created_before: DateTime.t option ; + cluster_states: ClusterStateList.t ; + marker: String.t option } + let make ?created_after ?created_before ?(cluster_states= []) ?marker + () = { created_after; created_before; cluster_states; marker } + let parse xml = + Some + { + created_after = + (Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse); + created_before = + (Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse); + cluster_states = + (Util.of_option [] + (Util.option_bind (Xml.member "ClusterStates" xml) + ClusterStateList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("ClusterStates.member", + (ClusterStateList.to_query v.cluster_states))); + Util.option_map v.created_before + (fun f -> Query.Pair ("CreatedBefore", (DateTime.to_query f))); + Util.option_map v.created_after + (fun f -> Query.Pair ("CreatedAfter", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("cluster_states", (ClusterStateList.to_json v.cluster_states)); + Util.option_map v.created_before + (fun f -> ("created_before", (DateTime.to_json f))); + Util.option_map v.created_after + (fun f -> ("created_after", (DateTime.to_json f)))]) + let of_json j = + { + created_after = + (Util.option_map (Json.lookup j "created_after") DateTime.of_json); + created_before = + (Util.option_map (Json.lookup j "created_before") DateTime.of_json); + cluster_states = + (ClusterStateList.of_json + (Util.of_option_exn (Json.lookup j "cluster_states"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeStepOutput = + struct + type t = { + step: Step.t option } + let make ?step () = { step } + let parse xml = + Some { step = (Util.option_bind (Xml.member "Step" xml) Step.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.step + (fun f -> Query.Pair ("Step", (Step.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.step (fun f -> ("step", (Step.to_json f)))]) + let of_json j = + { step = (Util.option_map (Json.lookup j "step") Step.of_json) } + end +module AddInstanceGroupsInput = + struct + type t = + { + instance_groups: InstanceGroupConfigList.t ; + job_flow_id: String.t } + let make ~instance_groups ~job_flow_id () = + { instance_groups; job_flow_id } + let parse xml = + Some + { + instance_groups = + (Xml.required "InstanceGroups" + (Util.option_bind (Xml.member "InstanceGroups" xml) + InstanceGroupConfigList.parse)); + job_flow_id = + (Xml.required "JobFlowId" + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id))); + Some + (Query.Pair + ("InstanceGroups.member", + (InstanceGroupConfigList.to_query v.instance_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("job_flow_id", (String.to_json v.job_flow_id)); + Some + ("instance_groups", + (InstanceGroupConfigList.to_json v.instance_groups))]) + let of_json j = + { + instance_groups = + (InstanceGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups"))); + job_flow_id = + (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))) + } + end +module SetVisibleToAllUsersInput = + struct + type t = + { + job_flow_ids: XmlStringList.t ; + visible_to_all_users: Boolean.t } + let make ~job_flow_ids ~visible_to_all_users () = + { job_flow_ids; visible_to_all_users } + let parse xml = + Some + { + job_flow_ids = + (Xml.required "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) + XmlStringList.parse)); + visible_to_all_users = + (Xml.required "VisibleToAllUsers" + (Util.option_bind (Xml.member "VisibleToAllUsers" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VisibleToAllUsers", + (Boolean.to_query v.visible_to_all_users))); + Some + (Query.Pair + ("JobFlowIds.member", + (XmlStringList.to_query v.job_flow_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("visible_to_all_users", + (Boolean.to_json v.visible_to_all_users)); + Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) + let of_json j = + { + job_flow_ids = + (XmlStringList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_ids"))); + visible_to_all_users = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "visible_to_all_users"))) + } + end +module ListBootstrapActionsInput = + struct + type t = { + cluster_id: String.t ; + marker: String.t option } + let make ~cluster_id ?marker () = { cluster_id; marker } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeClusterOutput = + struct + type t = { + cluster: Cluster.t } + let make ~cluster () = { cluster } + let parse xml = + Some + { + cluster = + (Xml.required "Cluster" + (Util.option_bind (Xml.member "Cluster" xml) Cluster.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Cluster", (Cluster.to_query v.cluster)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("cluster", (Cluster.to_json v.cluster))]) + let of_json j = + { + cluster = + (Cluster.of_json (Util.of_option_exn (Json.lookup j "cluster"))) + } + end +module DescribeStepInput = + struct + type t = { + cluster_id: String.t ; + step_id: String.t } + let make ~cluster_id ~step_id () = { cluster_id; step_id } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); + step_id = + (Xml.required "StepId" + (Util.option_bind (Xml.member "StepId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("StepId", (String.to_query v.step_id))); + Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("step_id", (String.to_json v.step_id)); + Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); + step_id = + (String.of_json (Util.of_option_exn (Json.lookup j "step_id"))) + } + end +module RunJobFlowInput = + struct + type t = + { + name: String.t ; + log_uri: String.t option ; + additional_info: String.t option ; + ami_version: String.t option ; + release_label: String.t option ; + instances: JobFlowInstancesConfig.t ; + steps: StepConfigList.t ; + bootstrap_actions: BootstrapActionConfigList.t ; + supported_products: SupportedProductsList.t ; + new_supported_products: NewSupportedProductsList.t ; + applications: ApplicationList.t ; + configurations: ConfigurationList.t ; + visible_to_all_users: Boolean.t option ; + job_flow_role: String.t option ; + service_role: String.t option ; + tags: TagList.t } + let make ~name ?log_uri ?additional_info ?ami_version ?release_label + ~instances ?(steps= []) ?(bootstrap_actions= []) + ?(supported_products= []) ?(new_supported_products= []) + ?(applications= []) ?(configurations= []) ?visible_to_all_users + ?job_flow_role ?service_role ?(tags= []) () = + { + name; + log_uri; + additional_info; + ami_version; + release_label; + instances; + steps; + bootstrap_actions; + supported_products; + new_supported_products; + applications; + configurations; + visible_to_all_users; + job_flow_role; + service_role; + tags + } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); + additional_info = + (Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse); + ami_version = + (Util.option_bind (Xml.member "AmiVersion" xml) String.parse); + release_label = + (Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse); + instances = + (Xml.required "Instances" + (Util.option_bind (Xml.member "Instances" xml) + JobFlowInstancesConfig.parse)); + steps = + (Util.of_option [] + (Util.option_bind (Xml.member "Steps" xml) + StepConfigList.parse)); + bootstrap_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "BootstrapActions" xml) + BootstrapActionConfigList.parse)); + supported_products = + (Util.of_option [] + (Util.option_bind (Xml.member "SupportedProducts" xml) + SupportedProductsList.parse)); + new_supported_products = + (Util.of_option [] + (Util.option_bind (Xml.member "NewSupportedProducts" xml) + NewSupportedProductsList.parse)); + applications = + (Util.of_option [] + (Util.option_bind (Xml.member "Applications" xml) + ApplicationList.parse)); + configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "Configurations" xml) + ConfigurationList.parse)); + visible_to_all_users = + (Util.option_bind (Xml.member "VisibleToAllUsers" xml) + Boolean.parse); + job_flow_role = + (Util.option_bind (Xml.member "JobFlowRole" xml) String.parse); + service_role = + (Util.option_bind (Xml.member "ServiceRole" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.service_role + (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); + Util.option_map v.job_flow_role + (fun f -> Query.Pair ("JobFlowRole", (String.to_query f))); + Util.option_map v.visible_to_all_users + (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); + Some + (Query.Pair + ("Configurations.member", + (ConfigurationList.to_query v.configurations))); + Some + (Query.Pair + ("Applications.member", + (ApplicationList.to_query v.applications))); + Some + (Query.Pair + ("NewSupportedProducts.member", + (NewSupportedProductsList.to_query v.new_supported_products))); + Some + (Query.Pair + ("SupportedProducts.member", + (SupportedProductsList.to_query v.supported_products))); + Some + (Query.Pair + ("BootstrapActions.member", + (BootstrapActionConfigList.to_query v.bootstrap_actions))); + Some + (Query.Pair ("Steps.member", (StepConfigList.to_query v.steps))); + Some + (Query.Pair + ("Instances", (JobFlowInstancesConfig.to_query v.instances))); + Util.option_map v.release_label + (fun f -> Query.Pair ("ReleaseLabel", (String.to_query f))); + Util.option_map v.ami_version + (fun f -> Query.Pair ("AmiVersion", (String.to_query f))); + Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); + Util.option_map v.log_uri + (fun f -> Query.Pair ("LogUri", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.service_role + (fun f -> ("service_role", (String.to_json f))); + Util.option_map v.job_flow_role + (fun f -> ("job_flow_role", (String.to_json f))); + Util.option_map v.visible_to_all_users + (fun f -> ("visible_to_all_users", (Boolean.to_json f))); + Some + ("configurations", (ConfigurationList.to_json v.configurations)); + Some ("applications", (ApplicationList.to_json v.applications)); + Some + ("new_supported_products", + (NewSupportedProductsList.to_json v.new_supported_products)); + Some + ("supported_products", + (SupportedProductsList.to_json v.supported_products)); + Some + ("bootstrap_actions", + (BootstrapActionConfigList.to_json v.bootstrap_actions)); + Some ("steps", (StepConfigList.to_json v.steps)); + Some ("instances", (JobFlowInstancesConfig.to_json v.instances)); + Util.option_map v.release_label + (fun f -> ("release_label", (String.to_json f))); + Util.option_map v.ami_version + (fun f -> ("ami_version", (String.to_json f))); + Util.option_map v.additional_info + (fun f -> ("additional_info", (String.to_json f))); + Util.option_map v.log_uri + (fun f -> ("log_uri", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); + additional_info = + (Util.option_map (Json.lookup j "additional_info") String.of_json); + ami_version = + (Util.option_map (Json.lookup j "ami_version") String.of_json); + release_label = + (Util.option_map (Json.lookup j "release_label") String.of_json); + instances = + (JobFlowInstancesConfig.of_json + (Util.of_option_exn (Json.lookup j "instances"))); + steps = + (StepConfigList.of_json + (Util.of_option_exn (Json.lookup j "steps"))); + bootstrap_actions = + (BootstrapActionConfigList.of_json + (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); + supported_products = + (SupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "supported_products"))); + new_supported_products = + (NewSupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "new_supported_products"))); + applications = + (ApplicationList.of_json + (Util.of_option_exn (Json.lookup j "applications"))); + configurations = + (ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "configurations"))); + visible_to_all_users = + (Util.option_map (Json.lookup j "visible_to_all_users") + Boolean.of_json); + job_flow_role = + (Util.option_map (Json.lookup j "job_flow_role") String.of_json); + service_role = + (Util.option_map (Json.lookup j "service_role") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module RemoveTagsInput = + struct + type t = { + resource_id: String.t ; + tag_keys: StringList.t } + let make ~resource_id ~tag_keys () = { resource_id; tag_keys } + let parse xml = + Some + { + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); + tag_keys = + (Xml.required "TagKeys" + (Util.option_bind (Xml.member "TagKeys" xml) StringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TagKeys.member", (StringList.to_query v.tag_keys))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tag_keys", (StringList.to_json v.tag_keys)); + Some ("resource_id", (String.to_json v.resource_id))]) + let of_json j = + { + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + tag_keys = + (StringList.of_json (Util.of_option_exn (Json.lookup j "tag_keys"))) + } + end +module ListStepsOutput = + struct + type t = { + steps: StepSummaryList.t ; + marker: String.t option } + let make ?(steps= []) ?marker () = { steps; marker } + let parse xml = + Some + { + steps = + (Util.of_option [] + (Util.option_bind (Xml.member "Steps" xml) + StepSummaryList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair ("Steps.member", (StepSummaryList.to_query v.steps)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("steps", (StepSummaryList.to_json v.steps))]) + let of_json j = + { + steps = + (StepSummaryList.of_json + (Util.of_option_exn (Json.lookup j "steps"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ModifyInstanceGroupsInput = + struct + type t = { + instance_groups: InstanceGroupModifyConfigList.t } + let make ?(instance_groups= []) () = { instance_groups } + let parse xml = + Some + { + instance_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroups" xml) + InstanceGroupModifyConfigList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceGroups.member", + (InstanceGroupModifyConfigList.to_query v.instance_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_groups", + (InstanceGroupModifyConfigList.to_json v.instance_groups))]) + let of_json j = + { + instance_groups = + (InstanceGroupModifyConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups"))) + } + end +module AddJobFlowStepsInput = + struct + type t = { + job_flow_id: String.t ; + steps: StepConfigList.t } + let make ~job_flow_id ~steps () = { job_flow_id; steps } + let parse xml = + Some + { + job_flow_id = + (Xml.required "JobFlowId" + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)); + steps = + (Xml.required "Steps" + (Util.option_bind (Xml.member "Steps" xml) + StepConfigList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Steps.member", (StepConfigList.to_query v.steps))); + Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("steps", (StepConfigList.to_json v.steps)); + Some ("job_flow_id", (String.to_json v.job_flow_id))]) + let of_json j = + { + job_flow_id = + (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))); + steps = + (StepConfigList.of_json + (Util.of_option_exn (Json.lookup j "steps"))) + } + end +module ListInstanceGroupsOutput = + struct + type t = { + instance_groups: InstanceGroupList.t ; + marker: String.t option } + let make ?(instance_groups= []) ?marker () = + { instance_groups; marker } + let parse xml = + Some + { + instance_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroups" xml) + InstanceGroupList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("InstanceGroups.member", + (InstanceGroupList.to_query v.instance_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("instance_groups", + (InstanceGroupList.to_json v.instance_groups))]) + let of_json j = + { + instance_groups = + (InstanceGroupList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module SetTerminationProtectionInput = + struct + type t = + { + job_flow_ids: XmlStringList.t ; + termination_protected: Boolean.t } + let make ~job_flow_ids ~termination_protected () = + { job_flow_ids; termination_protected } + let parse xml = + Some + { + job_flow_ids = + (Xml.required "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) + XmlStringList.parse)); + termination_protected = + (Xml.required "TerminationProtected" + (Util.option_bind (Xml.member "TerminationProtected" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TerminationProtected", + (Boolean.to_query v.termination_protected))); + Some + (Query.Pair + ("JobFlowIds.member", + (XmlStringList.to_query v.job_flow_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("termination_protected", + (Boolean.to_json v.termination_protected)); + Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) + let of_json j = + { + job_flow_ids = + (XmlStringList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_ids"))); + termination_protected = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "termination_protected"))) + } + end +module AddJobFlowStepsOutput = + struct + type t = { + step_ids: StepIdsList.t } + let make ?(step_ids= []) () = { step_ids } + let parse xml = + Some + { + step_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "StepIds" xml) StepIdsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("StepIds.member", (StepIdsList.to_query v.step_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("step_ids", (StepIdsList.to_json v.step_ids))]) + let of_json j = + { + step_ids = + (StepIdsList.of_json + (Util.of_option_exn (Json.lookup j "step_ids"))) + } + end +module ListInstancesOutput = + struct + type t = { + instances: InstanceList.t ; + marker: String.t option } + let make ?(instances= []) ?marker () = { instances; marker } + let parse xml = + Some + { + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) + InstanceList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("Instances.member", (InstanceList.to_query v.instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("instances", (InstanceList.to_json v.instances))]) + let of_json j = + { + instances = + (InstanceList.of_json + (Util.of_option_exn (Json.lookup j "instances"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InternalServerException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ListClustersOutput = + struct + type t = { + clusters: ClusterSummaryList.t ; + marker: String.t option } + let make ?(clusters= []) ?marker () = { clusters; marker } + let parse xml = + Some + { + clusters = + (Util.of_option [] + (Util.option_bind (Xml.member "Clusters" xml) + ClusterSummaryList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("Clusters.member", (ClusterSummaryList.to_query v.clusters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("clusters", (ClusterSummaryList.to_json v.clusters))]) + let of_json j = + { + clusters = + (ClusterSummaryList.of_json + (Util.of_option_exn (Json.lookup j "clusters"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InvalidRequestException = + struct + type t = { + error_code: String.t option ; + message: String.t option } + let make ?error_code ?message () = { error_code; message } + let parse xml = + Some + { + error_code = + (Util.option_bind (Xml.member "ErrorCode" xml) String.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.error_code + (fun f -> Query.Pair ("ErrorCode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.error_code + (fun f -> ("error_code", (String.to_json f)))]) + let of_json j = + { + error_code = + (Util.option_map (Json.lookup j "error_code") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ListStepsInput = + struct + type t = + { + cluster_id: String.t ; + step_states: StepStateList.t ; + step_ids: XmlStringList.t ; + marker: String.t option } + let make ~cluster_id ?(step_states= []) ?(step_ids= []) ?marker () = + { cluster_id; step_states; step_ids; marker } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); + step_states = + (Util.of_option [] + (Util.option_bind (Xml.member "StepStates" xml) + StepStateList.parse)); + step_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "StepIds" xml) + XmlStringList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("StepIds.member", (XmlStringList.to_query v.step_ids))); + Some + (Query.Pair + ("StepStates.member", (StepStateList.to_query v.step_states))); + Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("step_ids", (XmlStringList.to_json v.step_ids)); + Some ("step_states", (StepStateList.to_json v.step_states)); + Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); + step_states = + (StepStateList.of_json + (Util.of_option_exn (Json.lookup j "step_states"))); + step_ids = + (XmlStringList.of_json + (Util.of_option_exn (Json.lookup j "step_ids"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InternalServerError = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeJobFlowsInput = + struct + type t = + { + created_after: DateTime.t option ; + created_before: DateTime.t option ; + job_flow_ids: XmlStringList.t ; + job_flow_states: JobFlowExecutionStateList.t } + let make ?created_after ?created_before ?(job_flow_ids= []) + ?(job_flow_states= []) () = + { created_after; created_before; job_flow_ids; job_flow_states } + let parse xml = + Some + { + created_after = + (Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse); + created_before = + (Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse); + job_flow_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "JobFlowIds" xml) + XmlStringList.parse)); + job_flow_states = + (Util.of_option [] + (Util.option_bind (Xml.member "JobFlowStates" xml) + JobFlowExecutionStateList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("JobFlowStates.member", + (JobFlowExecutionStateList.to_query v.job_flow_states))); + Some + (Query.Pair + ("JobFlowIds.member", + (XmlStringList.to_query v.job_flow_ids))); + Util.option_map v.created_before + (fun f -> Query.Pair ("CreatedBefore", (DateTime.to_query f))); + Util.option_map v.created_after + (fun f -> Query.Pair ("CreatedAfter", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("job_flow_states", + (JobFlowExecutionStateList.to_json v.job_flow_states)); + Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids)); + Util.option_map v.created_before + (fun f -> ("created_before", (DateTime.to_json f))); + Util.option_map v.created_after + (fun f -> ("created_after", (DateTime.to_json f)))]) + let of_json j = + { + created_after = + (Util.option_map (Json.lookup j "created_after") DateTime.of_json); + created_before = + (Util.option_map (Json.lookup j "created_before") DateTime.of_json); + job_flow_ids = + (XmlStringList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_ids"))); + job_flow_states = + (JobFlowExecutionStateList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_states"))) + } + end +module AddTagsOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveTagsOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeJobFlowsOutput = + struct + type t = { + job_flows: JobFlowDetailList.t } + let make ?(job_flows= []) () = { job_flows } + let parse xml = + Some + { + job_flows = + (Util.of_option [] + (Util.option_bind (Xml.member "JobFlows" xml) + JobFlowDetailList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("JobFlows.member", + (JobFlowDetailList.to_query v.job_flows)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("job_flows", (JobFlowDetailList.to_json v.job_flows))]) + let of_json j = + { + job_flows = + (JobFlowDetailList.of_json + (Util.of_option_exn (Json.lookup j "job_flows"))) + } + end +module ListBootstrapActionsOutput = + struct + type t = { + bootstrap_actions: CommandList.t ; + marker: String.t option } + let make ?(bootstrap_actions= []) ?marker () = + { bootstrap_actions; marker } + let parse xml = + Some + { + bootstrap_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "BootstrapActions" xml) + CommandList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("BootstrapActions.member", + (CommandList.to_query v.bootstrap_actions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("bootstrap_actions", (CommandList.to_json v.bootstrap_actions))]) + let of_json j = + { + bootstrap_actions = + (CommandList.of_json + (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module RunJobFlowOutput = + struct + type t = { + job_flow_id: String.t option } + let make ?job_flow_id () = { job_flow_id } + let parse xml = + Some + { + job_flow_id = + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.job_flow_id + (fun f -> Query.Pair ("JobFlowId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.job_flow_id + (fun f -> ("job_flow_id", (String.to_json f)))]) + let of_json j = + { + job_flow_id = + (Util.option_map (Json.lookup j "job_flow_id") String.of_json) + } + end +module AddInstanceGroupsOutput = + struct + type t = + { + job_flow_id: String.t option ; + instance_group_ids: InstanceGroupIdsList.t } + let make ?job_flow_id ?(instance_group_ids= []) () = + { job_flow_id; instance_group_ids } + let parse xml = + Some + { + job_flow_id = + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse); + instance_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroupIds" xml) + InstanceGroupIdsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceGroupIds.member", + (InstanceGroupIdsList.to_query v.instance_group_ids))); + Util.option_map v.job_flow_id + (fun f -> Query.Pair ("JobFlowId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_group_ids", + (InstanceGroupIdsList.to_json v.instance_group_ids)); + Util.option_map v.job_flow_id + (fun f -> ("job_flow_id", (String.to_json f)))]) + let of_json j = + { + job_flow_id = + (Util.option_map (Json.lookup j "job_flow_id") String.of_json); + instance_group_ids = + (InstanceGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "instance_group_ids"))) + } + end +module TerminateJobFlowsInput = + struct + type t = { + job_flow_ids: XmlStringList.t } + let make ~job_flow_ids () = { job_flow_ids } + let parse xml = + Some + { + job_flow_ids = + (Xml.required "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) + XmlStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("JobFlowIds.member", + (XmlStringList.to_query v.job_flow_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) + let of_json j = + { + job_flow_ids = + (XmlStringList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_ids"))) + } + end +module DescribeClusterInput = + struct + type t = { + cluster_id: String.t } + let make ~cluster_id () = { cluster_id } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))) + } + end +module ListInstancesInput = + struct + type t = + { + cluster_id: String.t ; + instance_group_id: String.t option ; + instance_group_types: InstanceGroupTypeList.t ; + marker: String.t option } + let make ~cluster_id ?instance_group_id ?(instance_group_types= []) + ?marker () = + { cluster_id; instance_group_id; instance_group_types; marker } + let parse xml = + Some + { + cluster_id = + (Xml.required "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); + instance_group_id = + (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse); + instance_group_types = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceGroupTypes" xml) + InstanceGroupTypeList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair + ("InstanceGroupTypes.member", + (InstanceGroupTypeList.to_query v.instance_group_types))); + Util.option_map v.instance_group_id + (fun f -> Query.Pair ("InstanceGroupId", (String.to_query f))); + Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("instance_group_types", + (InstanceGroupTypeList.to_json v.instance_group_types)); + Util.option_map v.instance_group_id + (fun f -> ("instance_group_id", (String.to_json f))); + Some ("cluster_id", (String.to_json v.cluster_id))]) + let of_json j = + { + cluster_id = + (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); + instance_group_id = + (Util.option_map (Json.lookup j "instance_group_id") String.of_json); + instance_group_types = + (InstanceGroupTypeList.of_json + (Util.of_option_exn (Json.lookup j "instance_group_types"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end diff --git a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml new file mode 100644 index 000000000..629f3f735 --- /dev/null +++ b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml @@ -0,0 +1,43 @@ +open OUnit +open Aws_elasticmapreduce + +module TestSuite(Runtime : sig + type 'a m + val run_request : + region:string + -> (module Aws.Call with type input = 'input + and type output = 'output + and type error = 'error) + -> 'input + -> [`Ok of 'output | `Error of 'error Aws.Error.t] m + val un_m : 'a m -> 'a + end) = struct + + let noop_test () = + "Noop ELASTICACHE test succeeds" + @?true + + let test_cases = + [ "ELASTICACHE noop" >:: noop_test ] + + let rec was_successful = + function + | [] -> true + | RSuccess _::t + | RSkip _::t -> + was_successful t + | RFailure _::_ + | RError _::_ + | RTodo _::_ -> + false + let _ = + let suite = "Tests" >::: test_cases in + let verbose = ref false in + let set_verbose _ = verbose := true in + Arg.parse + [("-verbose", Arg.Unit set_verbose, "Run the test in verbose mode.");] + (fun x -> raise (Arg.Bad ("Bad argument : " ^ x))) + ("Usage: " ^ Sys.argv.(0) ^ " [-verbose]"); + if not (was_successful (run_test_tt ~verbose:!verbose suite)) then + exit 1 +end diff --git a/libraries/elasticmapreduce/lib_test/dune b/libraries/elasticmapreduce/lib_test/dune new file mode 100644 index 000000000..98a5b900b --- /dev/null +++ b/libraries/elasticmapreduce/lib_test/dune @@ -0,0 +1,20 @@ +(executables + (names test_async test_lwt) + (flags (:standard -w -27 -w -33)) + (modules test_async test_lwt aws_elasticmapreduce_test) + (libraries aws aws_elasticmapreduce aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) + +(alias + (name runtest) + (deps test_async.exe) + (locks m) + (action (run %{deps}))) + +(alias + (name runtest) + (deps test_lwt.exe) + (locks m) + (action (run %{deps}))) diff --git a/libraries/elasticmapreduce/lib_test/test_async.ml b/libraries/elasticmapreduce/lib_test/test_async.ml new file mode 100644 index 000000000..6ddda6cd5 --- /dev/null +++ b/libraries/elasticmapreduce/lib_test/test_async.ml @@ -0,0 +1,11 @@ +open Aws_elasticmapreduce_test + +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t + + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/elasticmapreduce/lib_test/test_lwt.ml b/libraries/elasticmapreduce/lib_test/test_lwt.ml new file mode 100644 index 000000000..5364d5f98 --- /dev/null +++ b/libraries/elasticmapreduce/lib_test/test_lwt.ml @@ -0,0 +1,11 @@ +open Aws_elasticmapreduce_test + +module T = TestSuite(struct + type 'a m = 'a Lwt.t + + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) From b40770d64f90463ef9b43001a0cbb5ab0e30a812 Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Thu, 5 Sep 2019 08:13:09 +1000 Subject: [PATCH 2/8] Update endpoints.json configuration. --- input/endpoints.json | 1303 ++++-------------------------------------- 1 file changed, 101 insertions(+), 1202 deletions(-) diff --git a/input/endpoints.json b/input/endpoints.json index ead5f1bc1..08cd713b7 100644 --- a/input/endpoints.json +++ b/input/endpoints.json @@ -31,9 +31,6 @@ "eu-central-1" : { "description" : "EU (Frankfurt)" }, - "eu-north-1" : { - "description" : "EU (Stockholm)" - }, "eu-west-1" : { "description" : "EU (Ireland)" }, @@ -74,7 +71,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -96,122 +92,11 @@ "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-2" : { } } }, - "api.ecr" : { - "endpoints" : { - "ap-northeast-1" : { - "credentialScope" : { - "region" : "ap-northeast-1" - }, - "hostname" : "api.ecr.ap-northeast-1.amazonaws.com" - }, - "ap-northeast-2" : { - "credentialScope" : { - "region" : "ap-northeast-2" - }, - "hostname" : "api.ecr.ap-northeast-2.amazonaws.com" - }, - "ap-south-1" : { - "credentialScope" : { - "region" : "ap-south-1" - }, - "hostname" : "api.ecr.ap-south-1.amazonaws.com" - }, - "ap-southeast-1" : { - "credentialScope" : { - "region" : "ap-southeast-1" - }, - "hostname" : "api.ecr.ap-southeast-1.amazonaws.com" - }, - "ap-southeast-2" : { - "credentialScope" : { - "region" : "ap-southeast-2" - }, - "hostname" : "api.ecr.ap-southeast-2.amazonaws.com" - }, - "ca-central-1" : { - "credentialScope" : { - "region" : "ca-central-1" - }, - "hostname" : "api.ecr.ca-central-1.amazonaws.com" - }, - "eu-central-1" : { - "credentialScope" : { - "region" : "eu-central-1" - }, - "hostname" : "api.ecr.eu-central-1.amazonaws.com" - }, - "eu-north-1" : { - "credentialScope" : { - "region" : "eu-north-1" - }, - "hostname" : "api.ecr.eu-north-1.amazonaws.com" - }, - "eu-west-1" : { - "credentialScope" : { - "region" : "eu-west-1" - }, - "hostname" : "api.ecr.eu-west-1.amazonaws.com" - }, - "eu-west-2" : { - "credentialScope" : { - "region" : "eu-west-2" - }, - "hostname" : "api.ecr.eu-west-2.amazonaws.com" - }, - "eu-west-3" : { - "credentialScope" : { - "region" : "eu-west-3" - }, - "hostname" : "api.ecr.eu-west-3.amazonaws.com" - }, - "sa-east-1" : { - "credentialScope" : { - "region" : "sa-east-1" - }, - "hostname" : "api.ecr.sa-east-1.amazonaws.com" - }, - "us-east-1" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "api.ecr.us-east-1.amazonaws.com" - }, - "us-east-2" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "api.ecr.us-east-2.amazonaws.com" - }, - "us-west-1" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "api.ecr.us-west-1.amazonaws.com" - }, - "us-west-2" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "api.ecr.us-west-2.amazonaws.com" - } - } - }, - "api.mediatailor" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-west-2" : { } - } - }, "api.pricing" : { "defaults" : { "credentialScope" : { @@ -223,47 +108,6 @@ "us-east-1" : { } } }, - "api.sagemaker" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "us-east-1" : { }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "api-fips.sagemaker.us-east-1.amazonaws.com" - }, - "us-east-2" : { }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "api-fips.sagemaker.us-east-2.amazonaws.com" - }, - "us-west-1" : { }, - "us-west-1-fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "api-fips.sagemaker.us-west-1.amazonaws.com" - }, - "us-west-2" : { }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "api-fips.sagemaker.us-west-2.amazonaws.com" - } - } - }, "apigateway" : { "endpoints" : { "ap-northeast-1" : { }, @@ -273,7 +117,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -300,7 +143,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -320,39 +162,18 @@ }, "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-west-2" : { } - } - }, - "appsync" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, "us-east-1" : { }, - "us-east-2" : { }, "us-west-2" : { } } }, "athena" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-2" : { } @@ -370,7 +191,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -390,18 +210,10 @@ "protocols" : [ "http", "https" ] }, "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, "us-east-1" : { }, "us-east-2" : { }, - "us-west-1" : { }, "us-west-2" : { } } }, @@ -409,16 +221,12 @@ "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, @@ -449,23 +257,6 @@ "isRegionalized" : false, "partitionEndpoint" : "aws-global" }, - "chime" : { - "defaults" : { - "protocols" : [ "https" ], - "sslCommonName" : "service.chime.aws.amazon.com" - }, - "endpoints" : { - "aws-global" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "service.chime.aws.amazon.com", - "protocols" : [ "https" ] - } - }, - "isRegionalized" : false, - "partitionEndpoint" : "aws-global" - }, "cloud9" : { "endpoints" : { "ap-southeast-1" : { }, @@ -479,7 +270,6 @@ "endpoints" : { "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, @@ -497,7 +287,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -543,16 +332,12 @@ }, "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, @@ -582,7 +367,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -648,12 +432,6 @@ "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, - "fips" : { - "credentialScope" : { - "region" : "ca-central-1" - }, - "hostname" : "codecommit-fips.ca-central-1.amazonaws.com" - }, "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -670,39 +448,14 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, "sa-east-1" : { }, "us-east-1" : { }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "codedeploy-fips.us-east-1.amazonaws.com" - }, "us-east-2" : { }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "codedeploy-fips.us-east-2.amazonaws.com" - }, "us-west-1" : { }, - "us-west-1-fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "codedeploy-fips.us-west-1.amazonaws.com" - }, - "us-west-2" : { }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "codedeploy-fips.us-west-2.amazonaws.com" - } + "us-west-2" : { } } }, "codepipeline" : { @@ -747,7 +500,6 @@ "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, @@ -763,7 +515,6 @@ "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, @@ -792,10 +543,6 @@ "protocols" : [ "https" ] }, "endpoints" : { - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -811,7 +558,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -857,27 +603,12 @@ "us-west-2" : { } } }, - "datasync" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, "dax" : { "endpoints" : { "ap-northeast-1" : { }, "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, "sa-east-1" : { }, "us-east-1" : { }, @@ -900,7 +631,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -925,7 +655,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -936,34 +665,6 @@ "us-west-2" : { } } }, - "docdb" : { - "endpoints" : { - "eu-west-1" : { - "credentialScope" : { - "region" : "eu-west-1" - }, - "hostname" : "rds.eu-west-1.amazonaws.com" - }, - "us-east-1" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "rds.us-east-1.amazonaws.com" - }, - "us-east-2" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "rds.us-east-2.amazonaws.com" - }, - "us-west-2" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "rds.us-west-2.amazonaws.com" - } - } - }, "ds" : { "endpoints" : { "ap-northeast-1" : { }, @@ -994,7 +695,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1024,7 +724,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1035,7 +734,7 @@ "us-west-2" : { } } }, - "ecs" : { + "ecr" : { "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, @@ -1044,7 +743,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1055,7 +753,7 @@ "us-west-2" : { } } }, - "elasticache" : { + "ecs" : { "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, @@ -1064,16 +762,9 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, - "fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "elasticache-fips.us-west-1.amazonaws.com" - }, "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -1081,7 +772,7 @@ "us-west-2" : { } } }, - "elasticbeanstalk" : { + "elasticache" : { "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, @@ -1090,7 +781,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1101,34 +791,48 @@ "us-west-2" : { } } }, - "elasticfilesystem" : { + "elasticbeanstalk" : { "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, + "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, + "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, "us-west-2" : { } } }, - "elasticloadbalancing" : { - "defaults" : { - "protocols" : [ "https" ] - }, + "elasticfilesystem" : { "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticloadbalancing" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1141,7 +845,7 @@ }, "elasticmapreduce" : { "defaults" : { - "protocols" : [ "https" ], + "protocols" : [ "http", "https" ], "sslCommonName" : "{region}.{service}.{dnsSuffix}" }, "endpoints" : { @@ -1154,7 +858,6 @@ "eu-central-1" : { "sslCommonName" : "{service}.{region}.{dnsSuffix}" }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1205,16 +908,9 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, - "fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "es-fips.us-west-1.amazonaws.com" - }, "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -1231,7 +927,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1245,16 +940,10 @@ "firehose" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, @@ -1266,20 +955,7 @@ "protocols" : [ "https" ] }, "endpoints" : { - "ap-northeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-2" : { } - } - }, - "fsx" : { - "endpoints" : { - "eu-west-1" : { }, "us-east-1" : { }, - "us-east-2" : { }, "us-west-2" : { } } }, @@ -1313,11 +989,9 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, @@ -1327,18 +1001,13 @@ "glue" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "ca-central-1" : { }, "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, "us-east-1" : { }, "us-east-2" : { }, - "us-west-1" : { }, "us-west-2" : { } } }, @@ -1350,7 +1019,6 @@ "ap-northeast-1" : { }, "ap-southeast-2" : { }, "eu-central-1" : { }, - "eu-west-1" : { }, "us-east-1" : { }, "us-west-2" : { } }, @@ -1444,16 +1112,6 @@ "us-west-2" : { } } }, - "iotanalytics" : { - "endpoints" : { - "ap-northeast-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-2" : { } - } - }, "kinesis" : { "endpoints" : { "ap-northeast-1" : { }, @@ -1463,7 +1121,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1476,10 +1133,8 @@ }, "kinesisanalytics" : { "endpoints" : { - "eu-central-1" : { }, "eu-west-1" : { }, "us-east-1" : { }, - "us-east-2" : { }, "us-west-2" : { } } }, @@ -1494,12 +1149,6 @@ }, "kms" : { "endpoints" : { - "ProdFips" : { - "credentialScope" : { - "region" : "ca-central-1" - }, - "hostname" : "kms-fips.ca-central-1.amazonaws.com" - }, "ap-northeast-1" : { }, "ap-northeast-2" : { }, "ap-south-1" : { }, @@ -1507,7 +1156,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1527,7 +1175,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1538,21 +1185,6 @@ "us-west-2" : { } } }, - "license-manager" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-2" : { } - } - }, "lightsail" : { "endpoints" : { "ap-northeast-1" : { }, @@ -1579,7 +1211,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1622,13 +1253,9 @@ "medialive" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-west-2" : { } } @@ -1637,7 +1264,6 @@ "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "eu-central-1" : { }, @@ -1645,14 +1271,12 @@ "eu-west-3" : { }, "sa-east-1" : { }, "us-east-1" : { }, - "us-west-1" : { }, "us-west-2" : { } } }, "mediastore" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, "ap-southeast-2" : { }, "eu-central-1" : { }, "eu-west-1" : { }, @@ -1674,7 +1298,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1719,7 +1342,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1730,20 +1352,6 @@ "us-west-2" : { } } }, - "mq" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, "mturk-requester" : { "endpoints" : { "sandbox" : { @@ -1753,64 +1361,6 @@ }, "isRegionalized" : false }, - "neptune" : { - "endpoints" : { - "ap-northeast-1" : { - "credentialScope" : { - "region" : "ap-northeast-1" - }, - "hostname" : "rds.ap-northeast-1.amazonaws.com" - }, - "ap-southeast-1" : { - "credentialScope" : { - "region" : "ap-southeast-1" - }, - "hostname" : "rds.ap-southeast-1.amazonaws.com" - }, - "ap-southeast-2" : { - "credentialScope" : { - "region" : "ap-southeast-2" - }, - "hostname" : "rds.ap-southeast-2.amazonaws.com" - }, - "eu-central-1" : { - "credentialScope" : { - "region" : "eu-central-1" - }, - "hostname" : "rds.eu-central-1.amazonaws.com" - }, - "eu-west-1" : { - "credentialScope" : { - "region" : "eu-west-1" - }, - "hostname" : "rds.eu-west-1.amazonaws.com" - }, - "eu-west-2" : { - "credentialScope" : { - "region" : "eu-west-2" - }, - "hostname" : "rds.eu-west-2.amazonaws.com" - }, - "us-east-1" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "rds.us-east-1.amazonaws.com" - }, - "us-east-2" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "rds.us-east-2.amazonaws.com" - }, - "us-west-2" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "rds.us-west-2.amazonaws.com" - } - } - }, "opsworks" : { "endpoints" : { "ap-northeast-1" : { }, @@ -1862,10 +1412,7 @@ } }, "endpoints" : { - "eu-central-1" : { }, - "eu-west-1" : { }, - "us-east-1" : { }, - "us-west-2" : { } + "us-east-1" : { } } }, "polly" : { @@ -1877,7 +1424,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1897,7 +1443,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1919,7 +1464,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -1933,8 +1477,6 @@ "rekognition" : { "endpoints" : { "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-2" : { }, "eu-west-1" : { }, "us-east-1" : { }, @@ -1951,10 +1493,8 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, - "eu-west-3" : { }, "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -1962,13 +1502,6 @@ "us-west-2" : { } } }, - "robomaker" : { - "endpoints" : { - "eu-west-1" : { }, - "us-east-1" : { }, - "us-west-2" : { } - } - }, "route53" : { "endpoints" : { "aws-global" : { @@ -1986,27 +1519,6 @@ "us-east-1" : { } } }, - "route53resolver" : { - "defaults" : { - "protocols" : [ "https" ] - }, - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, "runtime.lex" : { "defaults" : { "credentialScope" : { @@ -2021,18 +1533,9 @@ }, "runtime.sagemaker" : { "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, "us-east-1" : { }, "us-east-2" : { }, - "us-west-1" : { }, "us-west-2" : { } } }, @@ -2058,7 +1561,6 @@ }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { "hostname" : "s3.eu-west-1.amazonaws.com", "signatureVersions" : [ "s3", "s3v4" ] @@ -2093,262 +1595,78 @@ "isRegionalized" : true, "partitionEndpoint" : "us-east-1" }, - "s3-control" : { + "sagemaker" : { + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "sdb" : { "defaults" : { - "protocols" : [ "https" ], - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "http", "https" ], + "signatureVersions" : [ "v2" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { + "hostname" : "sdb.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "secretsmanager" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "serverlessrepo" : { + "defaults" : { + "protocols" : [ "https" ] }, "endpoints" : { "ap-northeast-1" : { - "credentialScope" : { - "region" : "ap-northeast-1" - }, - "hostname" : "s3-control.ap-northeast-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "ap-northeast-2" : { - "credentialScope" : { - "region" : "ap-northeast-2" - }, - "hostname" : "s3-control.ap-northeast-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "ap-south-1" : { - "credentialScope" : { - "region" : "ap-south-1" - }, - "hostname" : "s3-control.ap-south-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "ap-southeast-1" : { - "credentialScope" : { - "region" : "ap-southeast-1" - }, - "hostname" : "s3-control.ap-southeast-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "ap-southeast-2" : { - "credentialScope" : { - "region" : "ap-southeast-2" - }, - "hostname" : "s3-control.ap-southeast-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "ca-central-1" : { - "credentialScope" : { - "region" : "ca-central-1" - }, - "hostname" : "s3-control.ca-central-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "eu-central-1" : { - "credentialScope" : { - "region" : "eu-central-1" - }, - "hostname" : "s3-control.eu-central-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "eu-north-1" : { - "credentialScope" : { - "region" : "eu-north-1" - }, - "hostname" : "s3-control.eu-north-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] + "protocols" : [ "https" ] }, "eu-west-1" : { - "credentialScope" : { - "region" : "eu-west-1" - }, - "hostname" : "s3-control.eu-west-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "eu-west-2" : { - "credentialScope" : { - "region" : "eu-west-2" - }, - "hostname" : "s3-control.eu-west-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "eu-west-3" : { - "credentialScope" : { - "region" : "eu-west-3" - }, - "hostname" : "s3-control.eu-west-3.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "sa-east-1" : { - "credentialScope" : { - "region" : "sa-east-1" - }, - "hostname" : "s3-control.sa-east-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-east-1" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "s3-control.us-east-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "s3-control-fips.us-east-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-east-2" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "s3-control.us-east-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "s3-control-fips.us-east-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-west-1" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "s3-control.us-west-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-west-1-fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "s3-control-fips.us-west-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-west-2" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "s3-control.us-west-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "s3-control-fips.us-west-2.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - } - } - }, - "sdb" : { - "defaults" : { - "protocols" : [ "http", "https" ], - "signatureVersions" : [ "v2" ] - }, - "endpoints" : { - "ap-northeast-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "eu-west-1" : { }, - "sa-east-1" : { }, - "us-east-1" : { - "hostname" : "sdb.amazonaws.com" - }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, - "secretsmanager" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, - "us-east-1" : { }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "secretsmanager-fips.us-east-1.amazonaws.com" - }, - "us-east-2" : { }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "secretsmanager-fips.us-east-2.amazonaws.com" - }, - "us-west-1" : { }, - "us-west-1-fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "secretsmanager-fips.us-west-1.amazonaws.com" - }, - "us-west-2" : { }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "secretsmanager-fips.us-west-2.amazonaws.com" - } - } - }, - "securityhub" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, - "serverlessrepo" : { - "defaults" : { - "protocols" : [ "https" ] - }, - "endpoints" : { - "ap-northeast-1" : { - "protocols" : [ "https" ] - }, - "ap-northeast-2" : { - "protocols" : [ "https" ] - }, - "ap-south-1" : { - "protocols" : [ "https" ] - }, - "ap-southeast-1" : { - "protocols" : [ "https" ] - }, - "ap-southeast-2" : { - "protocols" : [ "https" ] - }, - "ca-central-1" : { - "protocols" : [ "https" ] - }, - "eu-central-1" : { - "protocols" : [ "https" ] - }, - "eu-west-1" : { - "protocols" : [ "https" ] + "protocols" : [ "https" ] }, "eu-west-2" : { "protocols" : [ "https" ] @@ -2379,64 +1697,28 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, "sa-east-1" : { }, "us-east-1" : { }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "servicecatalog-fips.us-east-1.amazonaws.com" - }, "us-east-2" : { }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "servicecatalog-fips.us-east-2.amazonaws.com" - }, "us-west-1" : { }, - "us-west-1-fips" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "servicecatalog-fips.us-west-1.amazonaws.com" - }, - "us-west-2" : { }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "servicecatalog-fips.us-west-2.amazonaws.com" - } + "us-west-2" : { } } }, "servicediscovery" : { "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, - "us-west-1" : { }, "us-west-2" : { } } }, "shield" : { "defaults" : { "protocols" : [ "https" ], - "sslCommonName" : "shield.us-east-1.amazonaws.com" + "sslCommonName" : "Shield.us-east-1.amazonaws.com" }, "endpoints" : { "us-east-1" : { } @@ -2492,7 +1774,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2516,34 +1797,9 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, - "fips-us-east-1" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "sqs-fips.us-east-1.amazonaws.com" - }, - "fips-us-east-2" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "sqs-fips.us-east-2.amazonaws.com" - }, - "fips-us-west-1" : { - "credentialScope" : { - "region" : "us-west-1" - }, - "hostname" : "sqs-fips.us-west-1.amazonaws.com" - }, - "fips-us-west-2" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "sqs-fips.us-west-2.amazonaws.com" - }, "sa-east-1" : { }, "us-east-1" : { "sslCommonName" : "queue.{dnsSuffix}" @@ -2562,7 +1818,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2577,16 +1832,12 @@ "endpoints" : { "ap-northeast-1" : { }, "ap-northeast-2" : { }, - "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, - "eu-west-3" : { }, - "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, "us-west-1" : { }, @@ -2602,7 +1853,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2628,7 +1878,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2667,7 +1916,6 @@ "aws-global" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2717,7 +1965,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2737,7 +1984,6 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "eu-west-3" : { }, @@ -2748,24 +1994,6 @@ "us-west-2" : { } } }, - "transfer" : { - "endpoints" : { - "ap-northeast-1" : { }, - "ap-northeast-2" : { }, - "ap-south-1" : { }, - "ap-southeast-1" : { }, - "ap-southeast-2" : { }, - "ca-central-1" : { }, - "eu-central-1" : { }, - "eu-west-1" : { }, - "eu-west-2" : { }, - "eu-west-3" : { }, - "us-east-1" : { }, - "us-east-2" : { }, - "us-west-1" : { }, - "us-west-2" : { } - } - }, "translate" : { "defaults" : { "protocols" : [ "https" ] @@ -2773,26 +2001,8 @@ "endpoints" : { "eu-west-1" : { }, "us-east-1" : { }, - "us-east-1-fips" : { - "credentialScope" : { - "region" : "us-east-1" - }, - "hostname" : "translate-fips.us-east-1.amazonaws.com" - }, "us-east-2" : { }, - "us-east-2-fips" : { - "credentialScope" : { - "region" : "us-east-2" - }, - "hostname" : "translate-fips.us-east-2.amazonaws.com" - }, - "us-west-2" : { }, - "us-west-2-fips" : { - "credentialScope" : { - "region" : "us-west-2" - }, - "hostname" : "translate-fips.us-west-2.amazonaws.com" - } + "us-west-2" : { } } }, "waf" : { @@ -2863,10 +2073,8 @@ "ap-southeast-2" : { }, "ca-central-1" : { }, "eu-central-1" : { }, - "eu-north-1" : { }, "eu-west-1" : { }, "eu-west-2" : { }, - "eu-west-3" : { }, "sa-east-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -2894,26 +2102,9 @@ } }, "services" : { - "api.ecr" : { - "endpoints" : { - "cn-north-1" : { - "credentialScope" : { - "region" : "cn-north-1" - }, - "hostname" : "api.ecr.cn-north-1.amazonaws.com.cn" - }, - "cn-northwest-1" : { - "credentialScope" : { - "region" : "cn-northwest-1" - }, - "hostname" : "api.ecr.cn-northwest-1.amazonaws.com.cn" - } - } - }, "apigateway" : { "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } + "cn-north-1" : { } } }, "application-autoscaling" : { @@ -2950,12 +2141,6 @@ "cn-northwest-1" : { } } }, - "codebuild" : { - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - }, "codedeploy" : { "endpoints" : { "cn-north-1" : { }, @@ -2990,18 +2175,6 @@ "cn-northwest-1" : { } } }, - "dms" : { - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - }, - "ds" : { - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - }, "dynamodb" : { "defaults" : { "protocols" : [ "http", "https" ] @@ -3020,10 +2193,14 @@ "cn-northwest-1" : { } } }, + "ecr" : { + "endpoints" : { + "cn-north-1" : { } + } + }, "ecs" : { "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } + "cn-north-1" : { } } }, "elasticache" : { @@ -3049,7 +2226,7 @@ }, "elasticmapreduce" : { "defaults" : { - "protocols" : [ "https" ] + "protocols" : [ "http", "https" ] }, "endpoints" : { "cn-north-1" : { }, @@ -3058,7 +2235,6 @@ }, "es" : { "endpoints" : { - "cn-north-1" : { }, "cn-northwest-1" : { } } }, @@ -3068,17 +2244,6 @@ "cn-northwest-1" : { } } }, - "firehose" : { - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - }, - "gamelift" : { - "endpoints" : { - "cn-north-1" : { } - } - }, "glacier" : { "defaults" : { "protocols" : [ "http", "https" ] @@ -3118,8 +2283,7 @@ }, "lambda" : { "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } + "cn-north-1" : { } } }, "logs" : { @@ -3137,11 +2301,6 @@ "cn-northwest-1" : { } } }, - "polly" : { - "endpoints" : { - "cn-northwest-1" : { } - } - }, "rds" : { "endpoints" : { "cn-north-1" : { }, @@ -3164,28 +2323,6 @@ "cn-northwest-1" : { } } }, - "s3-control" : { - "defaults" : { - "protocols" : [ "https" ], - "signatureVersions" : [ "s3v4" ] - }, - "endpoints" : { - "cn-north-1" : { - "credentialScope" : { - "region" : "cn-north-1" - }, - "hostname" : "s3-control.cn-north-1.amazonaws.com.cn", - "signatureVersions" : [ "s3v4" ] - }, - "cn-northwest-1" : { - "credentialScope" : { - "region" : "cn-northwest-1" - }, - "hostname" : "s3-control.cn-northwest-1.amazonaws.com.cn", - "signatureVersions" : [ "s3v4" ] - } - } - }, "sms" : { "endpoints" : { "cn-north-1" : { }, @@ -3222,12 +2359,6 @@ "cn-northwest-1" : { } } }, - "states" : { - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - }, "storagegateway" : { "endpoints" : { "cn-north-1" : { } @@ -3275,74 +2406,30 @@ "partitionName" : "AWS GovCloud (US)", "regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$", "regions" : { - "us-gov-east-1" : { - "description" : "AWS GovCloud (US-East)" - }, "us-gov-west-1" : { "description" : "AWS GovCloud (US)" } }, "services" : { "acm" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "api.ecr" : { - "endpoints" : { - "us-gov-east-1" : { - "credentialScope" : { - "region" : "us-gov-east-1" - }, - "hostname" : "api.ecr.us-gov-east-1.amazonaws.com" - }, - "us-gov-west-1" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "api.ecr.us-gov-west-1.amazonaws.com" - } - } - }, - "api.sagemaker" : { "endpoints" : { "us-gov-west-1" : { } } }, "apigateway" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "application-autoscaling" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "athena" : { "endpoints" : { "us-gov-west-1" : { } } }, "autoscaling" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { "protocols" : [ "http", "https" ] } } }, - "clouddirectory" : { - "endpoints" : { - "us-gov-west-1" : { } - } - }, "cloudformation" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, @@ -3358,71 +2445,36 @@ } }, "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "cloudtrail" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "codedeploy" : { "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-east-1-fips" : { - "credentialScope" : { - "region" : "us-gov-east-1" - }, - "hostname" : "codedeploy-fips.us-gov-east-1.amazonaws.com" - }, - "us-gov-west-1" : { }, - "us-gov-west-1-fips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "codedeploy-fips.us-gov-west-1.amazonaws.com" - } - } - }, - "config" : { - "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, - "data.iot" : { - "defaults" : { - "credentialScope" : { - "service" : "iotdata" - }, - "protocols" : [ "https" ] - }, + "config" : { "endpoints" : { "us-gov-west-1" : { } } }, "directconnect" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "dms" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "ds" : { "endpoints" : { "us-gov-west-1" : { } } }, "dynamodb" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { }, "us-gov-west-1-fips" : { "credentialScope" : { @@ -3434,42 +2486,31 @@ }, "ec2" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, - "ecs" : { + "ecr" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, - "elasticache" : { + "ecs" : { "endpoints" : { - "fips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "elasticache-fips.us-gov-west-1.amazonaws.com" - }, - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, - "elasticbeanstalk" : { + "elasticache" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, - "elasticfilesystem" : { + "elasticbeanstalk" : { "endpoints" : { "us-gov-west-1" : { } } }, "elasticloadbalancing" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { "protocols" : [ "http", "https" ] } @@ -3477,57 +2518,28 @@ }, "elasticmapreduce" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { - "protocols" : [ "https" ] + "protocols" : [ "http", "https" ] } } }, "es" : { "endpoints" : { - "fips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "es-fips.us-gov-west-1.amazonaws.com" - }, - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "events" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "firehose" : { "endpoints" : { "us-gov-west-1" : { } } }, "glacier" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { "protocols" : [ "http", "https" ] } } }, - "glue" : { - "endpoints" : { - "us-gov-west-1" : { } - } - }, - "guardduty" : { - "defaults" : { - "protocols" : [ "https" ] - }, - "endpoints" : { - "us-gov-west-1" : { } - }, - "isRegionalized" : true - }, "iam" : { "endpoints" : { "aws-us-gov-global" : { @@ -3540,53 +2552,22 @@ "isRegionalized" : false, "partitionEndpoint" : "aws-us-gov-global" }, - "inspector" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "iot" : { - "defaults" : { - "credentialScope" : { - "service" : "execute-api" - } - }, - "endpoints" : { - "us-gov-west-1" : { } - } - }, "kinesis" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "kms" : { "endpoints" : { - "ProdFips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "kms-fips.us-gov-west-1.amazonaws.com" - }, - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "lambda" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "logs" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "mediaconvert" : { "endpoints" : { "us-gov-west-1" : { } } @@ -3603,7 +2584,6 @@ }, "monitoring" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, @@ -3614,13 +2594,11 @@ }, "rds" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "redshift" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, @@ -3629,11 +2607,6 @@ "us-gov-west-1" : { } } }, - "runtime.sagemaker" : { - "endpoints" : { - "us-gov-west-1" : { } - } - }, "s3" : { "defaults" : { "signatureVersions" : [ "s3", "s3v4" ] @@ -3645,67 +2618,24 @@ }, "hostname" : "s3-fips-us-gov-west-1.amazonaws.com" }, - "us-gov-east-1" : { - "hostname" : "s3.us-gov-east-1.amazonaws.com", - "protocols" : [ "http", "https" ] - }, "us-gov-west-1" : { "hostname" : "s3.us-gov-west-1.amazonaws.com", "protocols" : [ "http", "https" ] } } }, - "s3-control" : { - "defaults" : { - "protocols" : [ "https" ], - "signatureVersions" : [ "s3v4" ] - }, - "endpoints" : { - "us-gov-east-1" : { - "credentialScope" : { - "region" : "us-gov-east-1" - }, - "hostname" : "s3-control.us-gov-east-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-gov-east-1-fips" : { - "credentialScope" : { - "region" : "us-gov-east-1" - }, - "hostname" : "s3-control-fips.us-gov-east-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-gov-west-1" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "s3-control.us-gov-west-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - }, - "us-gov-west-1-fips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "s3-control-fips.us-gov-west-1.amazonaws.com", - "signatureVersions" : [ "s3v4" ] - } - } - }, "sms" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "snowball" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "sns" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { "protocols" : [ "http", "https" ] } @@ -3713,7 +2643,6 @@ }, "sqs" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { "protocols" : [ "http", "https" ], "sslCommonName" : "{region}.queue.{dnsSuffix}" @@ -3722,13 +2651,6 @@ }, "ssm" : { "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "states" : { - "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, @@ -3744,7 +2666,6 @@ } }, "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { }, "us-gov-west-1-fips" : { "credentialScope" : { @@ -3756,37 +2677,15 @@ }, "sts" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "swf" : { "endpoints" : { - "us-gov-east-1" : { }, "us-gov-west-1" : { } } }, "tagging" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - }, - "translate" : { - "defaults" : { - "protocols" : [ "https" ] - }, - "endpoints" : { - "us-gov-west-1" : { }, - "us-gov-west-1-fips" : { - "credentialScope" : { - "region" : "us-gov-west-1" - }, - "hostname" : "translate-fips.us-gov-west-1.amazonaws.com" - } - } - }, - "workspaces" : { "endpoints" : { "us-gov-west-1" : { } } From 6312e6a52fea3454cc18b1b1aa824d2a1be34b1e Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Thu, 5 Sep 2019 08:13:24 +1000 Subject: [PATCH 3/8] Re-run endpoint generation. --- lib/endpoints.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/endpoints.ml b/lib/endpoints.ml index 2ba20e0b2..f065eac34 100644 --- a/lib/endpoints.ml +++ b/lib/endpoints.ml @@ -1919,6 +1919,7 @@ 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 = From a7ad51cdf12f3d982d03b18eca3f639474cedf05 Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Thu, 5 Sep 2019 08:13:38 +1000 Subject: [PATCH 4/8] Basic EMR startup / shutdown test. --- .../lib_test/aws_elasticmapreduce_test.ml | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml index 629f3f735..61aa1aae3 100644 --- a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml +++ b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml @@ -13,12 +13,58 @@ module TestSuite(Runtime : sig val un_m : 'a m -> 'a end) = struct - let noop_test () = - "Noop ELASTICACHE test succeeds" - @?true + (* Tag for test EMR instances *) + let test_tag = Types.Tag.make ~key:"client" ~value:"ocaml-aws" () + + let create_describe_shutdown_test () = + let res = Runtime.(un_m (run_request + ~region:"us-east-1" + (module RunJobFlow) + (Types.RunJobFlowInput.make + ~name:"ocaml-aws test EMR" + ~release_label:"emr-5.20.0" + ~applications:([Types.Application.make ()]) + ~tags:(Types.TagList.make [test_tag] ()) + ~service_role:"EMR_DefaultRole" + ~job_flow_role:"EMR_EC2_DefaultRole" + (* TODO Invalid instance profile? What should this be? *) + ~instances:(Types.JobFlowInstancesConfig.make + ~instance_count:1 + ~master_instance_type:"t1.micro" + ~slave_instance_type:"t1.micro" + ()) + ()) + )) in + "Create EMR" + @? begin match res with + | `Ok resp -> + Printf.printf "%s\n" (Yojson.Basic.to_string (Types.RunJobFlowOutput.(to_json (of_json (to_json resp))))); + true + | `Error err -> begin Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false end + end; + + let instance_id = match res with + | `Ok instance -> (match instance.job_flow_id with + | Some job_id -> job_id + | None -> assert false) + | `Error err -> assert false in + + let terminate = Runtime.(un_m (run_request + ~region:"us-east-1" + (module TerminateJobFlows) + (Types.TerminateJobFlowsInput.make ~job_flow_ids:[instance_id] ())) + ) in + + "Shutdown EMR" + @? begin match terminate with + | `Ok resp -> + Printf.printf "Terminating EMR instance %s \n" instance_id; + true + | `Error err -> begin Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false end + end let test_cases = - [ "ELASTICACHE noop" >:: noop_test ] + [ "Create EMR" >:: create_describe_shutdown_test ] let rec was_successful = function From f461068aefbd70f3a0ab61efe088c4ab0fb7954c Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Fri, 6 Sep 2019 08:07:14 +1000 Subject: [PATCH 5/8] Update EMR from botocore. --- input/emr/2009-03-31/examples-1.json | 5 + input/emr/2009-03-31/paginators-1.json | 5 + input/emr/2009-03-31/service-2.json | 2077 +++++++++++++++++++----- input/emr/2009-03-31/waiters-2.json | 44 + 4 files changed, 1680 insertions(+), 451 deletions(-) create mode 100644 input/emr/2009-03-31/examples-1.json diff --git a/input/emr/2009-03-31/examples-1.json b/input/emr/2009-03-31/examples-1.json new file mode 100644 index 000000000..0ea7e3b0b --- /dev/null +++ b/input/emr/2009-03-31/examples-1.json @@ -0,0 +1,5 @@ +{ + "version": "1.0", + "examples": { + } +} diff --git a/input/emr/2009-03-31/paginators-1.json b/input/emr/2009-03-31/paginators-1.json index 8092b5984..67ccf4480 100644 --- a/input/emr/2009-03-31/paginators-1.json +++ b/input/emr/2009-03-31/paginators-1.json @@ -24,6 +24,11 @@ "input_token": "Marker", "output_token": "Marker", "result_key": "Steps" + }, + "ListInstanceFleets": { + "input_token": "Marker", + "output_token": "Marker", + "result_key": "InstanceFleets" } } } diff --git a/input/emr/2009-03-31/service-2.json b/input/emr/2009-03-31/service-2.json index 695352f41..e59cfabf7 100644 --- a/input/emr/2009-03-31/service-2.json +++ b/input/emr/2009-03-31/service-2.json @@ -4,41 +4,41 @@ "apiVersion":"2009-03-31", "endpointPrefix":"elasticmapreduce", "jsonVersion":"1.1", + "protocol":"json", "serviceAbbreviation":"Amazon EMR", "serviceFullName":"Amazon Elastic MapReduce", "signatureVersion":"v4", "targetPrefix":"ElasticMapReduce", "timestampFormat":"unixTimestamp", - "protocol":"json" + "uid":"elasticmapreduce-2009-03-31" }, - "documentation":"

Amazon Elastic MapReduce (Amazon EMR) is a web service that makes it easy to process large amounts of data efficiently. Amazon EMR uses Hadoop processing combined with several AWS products to do tasks such as web indexing, data mining, log file analysis, machine learning, scientific simulation, and data warehousing.

", "operations":{ + "AddInstanceFleet":{ + "name":"AddInstanceFleet", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"AddInstanceFleetInput"}, + "output":{"shape":"AddInstanceFleetOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Adds an instance fleet to a running cluster.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x.

" + }, "AddInstanceGroups":{ "name":"AddInstanceGroups", "http":{ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"AddInstanceGroupsInput", - "documentation":"

Input to an AddInstanceGroups call.

" - }, - "output":{ - "shape":"AddInstanceGroupsOutput", - "documentation":"

Output from an AddInstanceGroups call.

" - }, + "input":{"shape":"AddInstanceGroupsInput"}, + "output":{"shape":"AddInstanceGroupsOutput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

AddInstanceGroups adds an instance group to a running cluster.

" + "documentation":"

Adds one or more instance groups to a running cluster.

" }, "AddJobFlowSteps":{ "name":"AddJobFlowSteps", @@ -46,26 +46,12 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"AddJobFlowStepsInput", - "documentation":"

The input argument to the AddJobFlowSteps operation.

" - }, - "output":{ - "shape":"AddJobFlowStepsOutput", - "documentation":"

The output for the AddJobFlowSteps operation.

" - }, + "input":{"shape":"AddJobFlowStepsInput"}, + "output":{"shape":"AddJobFlowStepsOutput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

AddJobFlowSteps adds new steps to a running job flow. A maximum of 256 steps are allowed in each job flow.

If your job flow is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, go to Add More than 256 Steps to a Job Flow in the Amazon Elastic MapReduce Developer's Guide.

A step specifies the location of a JAR file stored either on the master node of the job flow or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.

Elastic MapReduce executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.

You can only add steps to a job flow that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.

" + "documentation":"

AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using SSH to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

A step specifies the location of a JAR file stored either on the master node of the cluster or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.

Amazon EMR executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.

You can only add steps to a cluster that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.

" }, "AddTags":{ "name":"AddTags", @@ -73,28 +59,55 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"AddTagsInput", - "documentation":"

This input identifies a cluster and a list of tags to attach.

" + "input":{"shape":"AddTagsInput"}, + "output":{"shape":"AddTagsOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" + }, + "CancelSteps":{ + "name":"CancelSteps", + "http":{ + "method":"POST", + "requestUri":"/" }, - "output":{ - "shape":"AddTagsOutput", - "documentation":"

This output indicates the result of adding tags to a resource.

" + "input":{"shape":"CancelStepsInput"}, + "output":{"shape":"CancelStepsOutput"}, + "errors":[ + {"shape":"InternalServerError"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Cancels a pending step or steps in a running cluster. Available only in Amazon EMR versions 4.8.0 and later, excluding version 5.0.0. A maximum of 256 steps are allowed in each CancelSteps request. CancelSteps is idempotent but asynchronous; it does not guarantee a step will be canceled, even if the request is successfully submitted. You can only cancel steps that are in a PENDING state.

" + }, + "CreateSecurityConfiguration":{ + "name":"CreateSecurityConfiguration", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"CreateSecurityConfigurationInput"}, + "output":{"shape":"CreateSecurityConfigurationOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "documentation":"

Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tagging Amazon EMR Resources.

" + "documentation":"

Creates a security configuration, which is stored in the service and can be specified when a cluster is created.

" + }, + "DeleteSecurityConfiguration":{ + "name":"DeleteSecurityConfiguration", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"DeleteSecurityConfigurationInput"}, + "output":{"shape":"DeleteSecurityConfigurationOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Deletes a security configuration.

" }, "DescribeCluster":{ "name":"DescribeCluster", @@ -102,26 +115,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"DescribeClusterInput", - "documentation":"

This input determines which cluster to describe.

" - }, - "output":{ - "shape":"DescribeClusterOutput", - "documentation":"

This output contains the description of the cluster.

" - }, + "input":{"shape":"DescribeClusterInput"}, + "output":{"shape":"DescribeClusterOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], "documentation":"

Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on. For information about the cluster steps, see ListSteps.

" }, @@ -131,27 +129,27 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"DescribeJobFlowsInput", - "documentation":"

The input for the DescribeJobFlows operation.

" - }, - "output":{ - "shape":"DescribeJobFlowsOutput", - "documentation":"

The output for the DescribeJobFlows operation.

" + "input":{"shape":"DescribeJobFlowsInput"}, + "output":{"shape":"DescribeJobFlowsOutput"}, + "errors":[ + {"shape":"InternalServerError"} + ], + "documentation":"

This API is deprecated and will eventually be removed. We recommend you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.

DescribeJobFlows returns a list of job flows that match all of the supplied parameters. The parameters can include a list of job flow IDs, job flow states, and restrictions on job flow creation date and time.

Regardless of supplied parameters, only job flows created within the last two months are returned.

If no parameters are supplied, then job flows matching either of the following criteria are returned:

  • Job flows created and completed in the last two weeks

  • Job flows created within the last two months that are in one of the following states: RUNNING, WAITING, SHUTTING_DOWN, STARTING

Amazon EMR can return a maximum of 512 job flow descriptions.

", + "deprecated":true + }, + "DescribeSecurityConfiguration":{ + "name":"DescribeSecurityConfiguration", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"DescribeSecurityConfigurationInput"}, + "output":{"shape":"DescribeSecurityConfigurationOutput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "deprecated":true, - "documentation":"

This API is deprecated and will eventually be removed. We recommend you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.

DescribeJobFlows returns a list of job flows that match all of the supplied parameters. The parameters can include a list of job flow IDs, job flow states, and restrictions on job flow creation date and time.

Regardless of supplied parameters, only job flows created within the last two months are returned.

If no parameters are supplied, then job flows matching either of the following criteria are returned:

  • Job flows created and completed in the last two weeks
  • Job flows created within the last two months that are in one of the following states: RUNNING, WAITING, SHUTTING_DOWN, STARTING

Amazon Elastic MapReduce can return a maximum of 512 job flow descriptions.

" + "documentation":"

Provides the details of a security configuration by returning the configuration JSON.

" }, "DescribeStep":{ "name":"DescribeStep", @@ -159,26 +157,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"DescribeStepInput", - "documentation":"

This input determines which step to describe.

" - }, - "output":{ - "shape":"DescribeStepOutput", - "documentation":"

This output contains the description of the cluster step.

" - }, + "input":{"shape":"DescribeStepInput"}, + "output":{"shape":"DescribeStepOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], "documentation":"

Provides more detail about the cluster step.

" }, @@ -188,26 +171,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ListBootstrapActionsInput", - "documentation":"

This input determines which bootstrap actions to retrieve.

" - }, - "output":{ - "shape":"ListBootstrapActionsOutput", - "documentation":"

This output contains the boostrap actions detail .

" - }, + "input":{"shape":"ListBootstrapActionsInput"}, + "output":{"shape":"ListBootstrapActionsOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], "documentation":"

Provides information about the bootstrap actions associated with a cluster.

" }, @@ -217,28 +185,27 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ListClustersInput", - "documentation":"

This input determines how the ListClusters action filters the list of clusters that it returns.

" - }, - "output":{ - "shape":"ListClustersOutput", - "documentation":"

This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs, names, and status.

" + "input":{"shape":"ListClustersInput"}, + "output":{"shape":"ListClustersOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Provides the status of all clusters visible to this AWS account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

" + }, + "ListInstanceFleets":{ + "name":"ListInstanceFleets", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"ListInstanceFleetsInput"}, + "output":{"shape":"ListInstanceFleetsOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "documentation":"

Provides the status of all clusters visible to this AWS account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

" + "documentation":"

Lists all available details about the instance fleets in a cluster.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" }, "ListInstanceGroups":{ "name":"ListInstanceGroups", @@ -246,26 +213,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ListInstanceGroupsInput", - "documentation":"

This input determines which instance groups to retrieve.

" - }, - "output":{ - "shape":"ListInstanceGroupsOutput", - "documentation":"

This input determines which instance groups to retrieve.

" - }, + "input":{"shape":"ListInstanceGroupsInput"}, + "output":{"shape":"ListInstanceGroupsOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], "documentation":"

Provides all available details about the instance groups in a cluster.

" }, @@ -275,28 +227,27 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ListInstancesInput", - "documentation":"

This input determines which instances to list.

" - }, - "output":{ - "shape":"ListInstancesOutput", - "documentation":"

This output contains the list of instances.

" + "input":{"shape":"ListInstancesInput"}, + "output":{"shape":"ListInstancesOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Provides information for all active EC2 instances and EC2 instances terminated in the last 30 days, up to a maximum of 2,000. EC2 instances in any of the following states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.

" + }, + "ListSecurityConfigurations":{ + "name":"ListSecurityConfigurations", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"ListSecurityConfigurationsInput"}, + "output":{"shape":"ListSecurityConfigurationsOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "documentation":"

Provides information about the cluster instances that Amazon EMR provisions on behalf of a user when it creates the cluster. For example, this operation indicates when the EC2 instances reach the Ready state, when instances become available to Amazon EMR to use for jobs, and the IP addresses for cluster instances, etc.

" + "documentation":"

Lists all the security configurations visible to this account, providing their creation dates and times, and their names. This call returns a maximum of 50 clusters per call, but returns a marker to track the paging of the cluster list across multiple ListSecurityConfigurations calls.

" }, "ListSteps":{ "name":"ListSteps", @@ -304,28 +255,26 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ListStepsInput", - "documentation":"

This input determines which steps to list.

" - }, - "output":{ - "shape":"ListStepsOutput", - "documentation":"

This output contains the list of steps.

" + "input":{"shape":"ListStepsInput"}, + "output":{"shape":"ListStepsOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Provides a list of steps for the cluster in reverse order unless you specify stepIds with the request.

" + }, + "ModifyInstanceFleet":{ + "name":"ModifyInstanceFleet", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"ModifyInstanceFleetInput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "documentation":"

Provides a list of steps for the cluster.

" + "documentation":"

Modifies the target On-Demand and target Spot capacities for the instance fleet with the specified InstanceFleetID within the cluster specified using ClusterID. The call either succeeds or fails atomically.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" }, "ModifyInstanceGroups":{ "name":"ModifyInstanceGroups", @@ -333,51 +282,45 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"ModifyInstanceGroupsInput", - "documentation":"

Change the size of some instance groups.

" - }, + "input":{"shape":"ModifyInstanceGroupsInput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], "documentation":"

ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.

" }, - "RemoveTags":{ - "name":"RemoveTags", + "PutAutoScalingPolicy":{ + "name":"PutAutoScalingPolicy", "http":{ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"RemoveTagsInput", - "documentation":"

This input identifies a cluster and a list of tags to remove.

" + "input":{"shape":"PutAutoScalingPolicyInput"}, + "output":{"shape":"PutAutoScalingPolicyOutput"}, + "documentation":"

Creates or updates an automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric.

" + }, + "RemoveAutoScalingPolicy":{ + "name":"RemoveAutoScalingPolicy", + "http":{ + "method":"POST", + "requestUri":"/" }, - "output":{ - "shape":"RemoveTagsOutput", - "documentation":"

This output indicates the result of removing tags from a resource.

" + "input":{"shape":"RemoveAutoScalingPolicyInput"}, + "output":{"shape":"RemoveAutoScalingPolicyOutput"}, + "documentation":"

Removes an automatic scaling policy from a specified instance group within an EMR cluster.

" + }, + "RemoveTags":{ + "name":"RemoveTags", + "http":{ + "method":"POST", + "requestUri":"/" }, + "input":{"shape":"RemoveTagsInput"}, + "output":{"shape":"RemoveTagsOutput"}, "errors":[ - { - "shape":"InternalServerException", - "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" - }, - { - "shape":"InvalidRequestException", - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" - } + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} ], - "documentation":"

Removes tags from an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tagging Amazon EMR Resources.

The following example removes the stack tag with value Prod from a cluster:

" + "documentation":"

Removes tags from an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

The following example removes the stack tag with value Prod from a cluster:

" }, "RunJobFlow":{ "name":"RunJobFlow", @@ -385,26 +328,12 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"RunJobFlowInput", - "documentation":"

Input to the RunJobFlow operation.

" - }, - "output":{ - "shape":"RunJobFlowOutput", - "documentation":"

The result of the RunJobFlow operation.

" - }, + "input":{"shape":"RunJobFlowInput"}, + "output":{"shape":"RunJobFlowOutput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

RunJobFlow creates and starts running a new job flow. The job flow will run the steps specified. Once the job flow completes, the cluster is stopped and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the job flow will transition to the WAITING state rather than shutting down once the steps have completed.

For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the job flow and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.

A maximum of 256 steps are allowed in each job flow.

If your job flow is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, go to Add More than 256 Steps to a Job Flow in the Amazon Elastic MapReduce Developer's Guide.

For long running job flows, we recommend that you periodically store your results.

" + "documentation":"

RunJobFlow creates and starts running a new cluster (job flow). The cluster runs the steps specified. After the steps complete, the cluster stops and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the cluster transitions to the WAITING state rather than shutting down after the steps have completed.

For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the cluster and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.

A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

For long running clusters, we recommend that you periodically store your results.

The instance fleets configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow request can contain InstanceFleets parameters or InstanceGroups parameters, but not both.

" }, "SetTerminationProtection":{ "name":"SetTerminationProtection", @@ -412,22 +341,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"SetTerminationProtectionInput", - "documentation":"

The input argument to the TerminationProtection operation.

" - }, + "input":{"shape":"SetTerminationProtectionInput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

SetTerminationProtection locks a job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a job flow is analogous to calling the Amazon EC2 DisableAPITermination API on all of the EC2 instances in a cluster.

SetTerminationProtection is used to prevent accidental termination of a job flow and to ensure that in the event of an error, the instances will persist so you can recover any data stored in their ephemeral instance storage.

To terminate a job flow that has been locked by setting SetTerminationProtection to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false.

For more information, go to Protecting a Job Flow from Termination in the Amazon Elastic MapReduce Developer's Guide.

" + "documentation":"

SetTerminationProtection locks a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 instances in a cluster.

SetTerminationProtection is used to prevent accidental termination of a cluster and to ensure that in the event of an error, the instances persist so that you can recover any data stored in their ephemeral instance storage.

To terminate a cluster that has been locked by setting SetTerminationProtection to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false.

For more information, seeManaging Cluster Termination in the Amazon EMR Management Guide.

" }, "SetVisibleToAllUsers":{ "name":"SetVisibleToAllUsers", @@ -435,22 +353,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"SetVisibleToAllUsersInput", - "documentation":"

The input to the SetVisibleToAllUsers action.

" - }, + "input":{"shape":"SetVisibleToAllUsersInput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

Sets whether all AWS Identity and Access Management (IAM) users under your account can access the specified job flows. This action works on running job flows. You can also set the visibility of a job flow when you launch it using the VisibleToAllUsers parameter of RunJobFlow. The SetVisibleToAllUsers action can be called only by an IAM user who created the job flow or the AWS account that owns the job flow.

" + "documentation":"

Sets whether all AWS Identity and Access Management (IAM) users under your account can access the specified clusters (job flows). This action works on running clusters. You can also set the visibility of a cluster when you launch it using the VisibleToAllUsers parameter of RunJobFlow. The SetVisibleToAllUsers action can be called only by an IAM user who created the cluster or the AWS account that owns the cluster.

" }, "TerminateJobFlows":{ "name":"TerminateJobFlows", @@ -458,22 +365,11 @@ "method":"POST", "requestUri":"/" }, - "input":{ - "shape":"TerminateJobFlowsInput", - "documentation":"

Input to the TerminateJobFlows operation.

" - }, + "input":{"shape":"TerminateJobFlowsInput"}, "errors":[ - { - "shape":"InternalServerError", - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" - } + {"shape":"InternalServerError"} ], - "documentation":"

TerminateJobFlows shuts a list of job flows down. When a job flow is shut down, any step not yet completed is canceled and the EC2 instances on which the job flow is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified when the job flow was created.

The maximum number of JobFlows allowed is 10. The call to TerminateJobFlows is asynchronous. Depending on the configuration of the job flow, it may take up to 5-20 minutes for the job flow to completely terminate and release allocated resources, such as Amazon EC2 instances.

" + "documentation":"

TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow is shut down, any step not yet completed is canceled and the EC2 instances on which the cluster is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified when the cluster was created.

The maximum number of clusters allowed is 10. The call to TerminateJobFlows is asynchronous. Depending on the configuration of the cluster, it may take up to 1-5 minutes for the cluster to completely terminate and release allocated resources, such as Amazon EC2 instances.

" } }, "shapes":{ @@ -486,6 +382,36 @@ "CONTINUE" ] }, + "AddInstanceFleetInput":{ + "type":"structure", + "required":[ + "ClusterId", + "InstanceFleet" + ], + "members":{ + "ClusterId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the cluster.

" + }, + "InstanceFleet":{ + "shape":"InstanceFleetConfig", + "documentation":"

Specifies the configuration of the instance fleet.

" + } + } + }, + "AddInstanceFleetOutput":{ + "type":"structure", + "members":{ + "ClusterId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the cluster.

" + }, + "InstanceFleetId":{ + "shape":"InstanceFleetId", + "documentation":"

The unique identifier of the instance fleet.

" + } + } + }, "AddInstanceGroupsInput":{ "type":"structure", "required":[ @@ -495,7 +421,7 @@ "members":{ "InstanceGroups":{ "shape":"InstanceGroupConfigList", - "documentation":"

Instance Groups to add.

" + "documentation":"

Instance groups to add.

" }, "JobFlowId":{ "shape":"XmlStringMaxLen256", @@ -559,16 +485,24 @@ }, "Tags":{ "shape":"TagList", - "documentation":"

A list of tags to associate with a cluster and propagate to Amazon EC2 instances. Tags are user-defined key/value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.

" + "documentation":"

A list of tags to associate with a cluster and propagate to EC2 instances. Tags are user-defined key/value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.

" } }, - "documentation":"

This input identifies a cluster and a list of tags to attach.

" + "documentation":"

This input identifies a cluster and a list of tags to attach.

" }, "AddTagsOutput":{ "type":"structure", "members":{ }, - "documentation":"

This output indicates the result of adding tags to a resource.

" + "documentation":"

This output indicates the result of adding tags to a resource.

" + }, + "AdjustmentType":{ + "type":"string", + "enum":[ + "CHANGE_IN_CAPACITY", + "PERCENT_CHANGE_IN_CAPACITY", + "EXACT_CAPACITY" + ] }, "Application":{ "type":"structure", @@ -590,13 +524,97 @@ "documentation":"

This option is for advanced users only. This is meta information about third-party applications that third-party vendors use for testing purposes.

" } }, - "documentation":"

An application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument. For more information, see Launch a Job Flow on the MapR Distribution for Hadoop. Currently supported values are:

  • \"mapr-m3\" - launch the job flow using MapR M3 Edition.
  • \"mapr-m5\" - launch the job flow using MapR M5 Edition.
  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition, respectively.

In Amazon EMR releases 4.0 and greater, the only accepted parameter is the application name. To pass arguments to applications, you supply a configuration for each application.

" + "documentation":"

An application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument. For more information, see Using the MapR Distribution for Hadoop. Currently supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.

  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.

  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the cluster using MapR M3 or M5 Edition, respectively.

In Amazon EMR releases 4.x and later, the only accepted parameter is the application name. To pass arguments to applications, you supply a configuration for each application.

" }, "ApplicationList":{ "type":"list", "member":{"shape":"Application"} }, + "AutoScalingPolicy":{ + "type":"structure", + "required":[ + "Constraints", + "Rules" + ], + "members":{ + "Constraints":{ + "shape":"ScalingConstraints", + "documentation":"

The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.

" + }, + "Rules":{ + "shape":"ScalingRuleList", + "documentation":"

The scale-in and scale-out rules that comprise the automatic scaling policy.

" + } + }, + "documentation":"

An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. An automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.

" + }, + "AutoScalingPolicyDescription":{ + "type":"structure", + "members":{ + "Status":{ + "shape":"AutoScalingPolicyStatus", + "documentation":"

The status of an automatic scaling policy.

" + }, + "Constraints":{ + "shape":"ScalingConstraints", + "documentation":"

The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.

" + }, + "Rules":{ + "shape":"ScalingRuleList", + "documentation":"

The scale-in and scale-out rules that comprise the automatic scaling policy.

" + } + }, + "documentation":"

An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.

" + }, + "AutoScalingPolicyState":{ + "type":"string", + "enum":[ + "PENDING", + "ATTACHING", + "ATTACHED", + "DETACHING", + "DETACHED", + "FAILED" + ] + }, + "AutoScalingPolicyStateChangeReason":{ + "type":"structure", + "members":{ + "Code":{ + "shape":"AutoScalingPolicyStateChangeReasonCode", + "documentation":"

The code indicating the reason for the change in status.USER_REQUEST indicates that the scaling policy status was changed by a user. PROVISION_FAILURE indicates that the status change was because the policy failed to provision. CLEANUP_FAILURE indicates an error.

" + }, + "Message":{ + "shape":"String", + "documentation":"

A friendly, more verbose message that accompanies an automatic scaling policy state change.

" + } + }, + "documentation":"

The reason for an AutoScalingPolicyStatus change.

" + }, + "AutoScalingPolicyStateChangeReasonCode":{ + "type":"string", + "enum":[ + "USER_REQUEST", + "PROVISION_FAILURE", + "CLEANUP_FAILURE" + ] + }, + "AutoScalingPolicyStatus":{ + "type":"structure", + "members":{ + "State":{ + "shape":"AutoScalingPolicyState", + "documentation":"

Indicates the status of the automatic scaling policy.

" + }, + "StateChangeReason":{ + "shape":"AutoScalingPolicyStateChangeReason", + "documentation":"

The reason for a change in status.

" + } + }, + "documentation":"

The status of an automatic scaling policy.

" + }, "Boolean":{"type":"boolean"}, + "BooleanObject":{"type":"boolean"}, "BootstrapActionConfig":{ "type":"structure", "required":[ @@ -627,12 +645,113 @@ "documentation":"

A description of the bootstrap action.

" } }, - "documentation":"

Reports the configuration of a bootstrap action in a job flow.

" + "documentation":"

Reports the configuration of a bootstrap action in a cluster (job flow).

" }, "BootstrapActionDetailList":{ "type":"list", "member":{"shape":"BootstrapActionDetail"} }, + "CancelStepsInfo":{ + "type":"structure", + "members":{ + "StepId":{ + "shape":"StepId", + "documentation":"

The encrypted StepId of a step.

" + }, + "Status":{ + "shape":"CancelStepsRequestStatus", + "documentation":"

The status of a CancelSteps Request. The value may be SUBMITTED or FAILED.

" + }, + "Reason":{ + "shape":"String", + "documentation":"

The reason for the failure if the CancelSteps request fails.

" + } + }, + "documentation":"

Specification of the status of a CancelSteps request. Available only in Amazon EMR version 4.8.0 and later, excluding version 5.0.0.

" + }, + "CancelStepsInfoList":{ + "type":"list", + "member":{"shape":"CancelStepsInfo"} + }, + "CancelStepsInput":{ + "type":"structure", + "members":{ + "ClusterId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The ClusterID for which specified steps will be canceled. Use RunJobFlow and ListClusters to get ClusterIDs.

" + }, + "StepIds":{ + "shape":"StepIdsList", + "documentation":"

The list of StepIDs to cancel. Use ListSteps to get steps and their states for the specified cluster.

" + } + }, + "documentation":"

The input argument to the CancelSteps operation.

" + }, + "CancelStepsOutput":{ + "type":"structure", + "members":{ + "CancelStepsInfoList":{ + "shape":"CancelStepsInfoList", + "documentation":"

A list of CancelStepsInfo, which shows the status of specified cancel requests for each StepID specified.

" + } + }, + "documentation":"

The output for the CancelSteps operation.

" + }, + "CancelStepsRequestStatus":{ + "type":"string", + "enum":[ + "SUBMITTED", + "FAILED" + ] + }, + "CloudWatchAlarmDefinition":{ + "type":"structure", + "required":[ + "ComparisonOperator", + "MetricName", + "Period", + "Threshold" + ], + "members":{ + "ComparisonOperator":{ + "shape":"ComparisonOperator", + "documentation":"

Determines how the metric specified by MetricName is compared to the value specified by Threshold.

" + }, + "EvaluationPeriods":{ + "shape":"Integer", + "documentation":"

The number of periods, expressed in seconds using Period, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.

" + }, + "MetricName":{ + "shape":"String", + "documentation":"

The name of the CloudWatch metric that is watched to determine an alarm condition.

" + }, + "Namespace":{ + "shape":"String", + "documentation":"

The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce.

" + }, + "Period":{ + "shape":"Integer", + "documentation":"

The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300.

" + }, + "Statistic":{ + "shape":"Statistic", + "documentation":"

The statistic to apply to the metric associated with the alarm. The default is AVERAGE.

" + }, + "Threshold":{ + "shape":"NonNegativeDouble", + "documentation":"

The value against which the specified statistic is compared.

" + }, + "Unit":{ + "shape":"Unit", + "documentation":"

The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.

" + }, + "Dimensions":{ + "shape":"MetricDimensionList", + "documentation":"

A CloudWatch metric dimension.

" + } + }, + "documentation":"

The definition of a CloudWatch metric alarm, which determines when an automatic scaling activity is triggered. When the defined alarm conditions are satisfied, scaling activity begins.

" + }, "Cluster":{ "type":"structure", "members":{ @@ -648,7 +767,14 @@ "shape":"ClusterStatus", "documentation":"

The current status details about the cluster.

" }, - "Ec2InstanceAttributes":{"shape":"Ec2InstanceAttributes"}, + "Ec2InstanceAttributes":{ + "shape":"Ec2InstanceAttributes", + "documentation":"

Provides information about the EC2 instances in a cluster grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.

" + }, + "InstanceCollectionType":{ + "shape":"InstanceCollectionType", + "documentation":"

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

The instance group configuration of the cluster. A value of INSTANCE_GROUP indicates a uniform instance group configuration. A value of INSTANCE_FLEET indicates an instance fleets configuration.

" + }, "LogUri":{ "shape":"String", "documentation":"

The path to the Amazon S3 location where logs for this cluster are stored.

" @@ -659,11 +785,11 @@ }, "RunningAmiVersion":{ "shape":"String", - "documentation":"

The AMI version running on this cluster.

" + "documentation":"

The AMI version running on this cluster.

" }, "ReleaseLabel":{ "shape":"String", - "documentation":"

The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use amiVersion instead instead of ReleaseLabel.

" + "documentation":"

The release label for the Amazon EMR release.

" }, "AutoTerminate":{ "shape":"Boolean", @@ -675,7 +801,7 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Indicates whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true, all IAM users of that AWS account can view and manage the job flow if they have the proper policy permissions set. If this value is false, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" + "documentation":"

Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and manage the cluster if they have the proper policy permissions set. If this value is false, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" }, "Applications":{ "shape":"ApplicationList", @@ -691,15 +817,43 @@ }, "NormalizedInstanceHours":{ "shape":"Integer", - "documentation":"

An approximation of the cost of the job flow, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" + "documentation":"

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" }, "MasterPublicDnsName":{ "shape":"String", - "documentation":"

The public DNS name of the master EC2 instance.

" + "documentation":"

The DNS name of the master node. If the cluster is on a private subnet, this is the private DNS name. On a public subnet, this is the public DNS name.

" }, "Configurations":{ "shape":"ConfigurationList", - "documentation":"

Amazon EMR releases 4.x or later.

The list of Configurations supplied to the EMR cluster.

" + "documentation":"

Applies only to Amazon EMR releases 4.x and later. The list of Configurations supplied to the EMR cluster.

" + }, + "SecurityConfiguration":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration applied to the cluster.

" + }, + "AutoScalingRole":{ + "shape":"XmlString", + "documentation":"

An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.

" + }, + "ScaleDownBehavior":{ + "shape":"ScaleDownBehavior", + "documentation":"

The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR blacklists and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION is available only in Amazon EMR version 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.

" + }, + "CustomAmiId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.

" + }, + "EbsRootVolumeSize":{ + "shape":"Integer", + "documentation":"

The size, in GiB, of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.

" + }, + "RepoUpgradeOnBoot":{ + "shape":"RepoUpgradeOnBoot", + "documentation":"

Applies only when CustomAmiID is used. Specifies the type of updates that are applied from the Amazon Linux AMI package repositories when an instance boots using the AMI.

" + }, + "KerberosAttributes":{ + "shape":"KerberosAttributes", + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" } }, "documentation":"

The detailed description of the cluster.

" @@ -737,6 +891,7 @@ "INTERNAL_ERROR", "VALIDATION_ERROR", "INSTANCE_FAILURE", + "INSTANCE_FLEET_TIMEOUT", "BOOTSTRAP_FAILURE", "USER_REQUEST", "STEP_FAILURE", @@ -782,7 +937,7 @@ }, "NormalizedInstanceHours":{ "shape":"Integer", - "documentation":"

An approximation of the cost of the job flow, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" + "documentation":"

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" } }, "documentation":"

The summary description of the cluster.

" @@ -831,29 +986,87 @@ "type":"list", "member":{"shape":"Command"} }, + "ComparisonOperator":{ + "type":"string", + "enum":[ + "GREATER_THAN_OR_EQUAL", + "GREATER_THAN", + "LESS_THAN", + "LESS_THAN_OR_EQUAL" + ] + }, "Configuration":{ "type":"structure", "members":{ "Classification":{ "shape":"String", - "documentation":"

The classification of a configuration. For more information see, Amazon EMR Configurations.

" + "documentation":"

The classification within a configuration.

" }, "Configurations":{ "shape":"ConfigurationList", - "documentation":"

A list of configurations you apply to this configuration object.

" + "documentation":"

A list of additional configurations to apply within a configuration object.

" }, "Properties":{ "shape":"StringMap", - "documentation":"

A set of properties supplied to the Configuration object.

" + "documentation":"

A set of properties specified within a configuration classification.

" } }, - "documentation":"

Amazon EMR releases 4.x or later.

Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

" + "documentation":"

Amazon EMR releases 4.x or later.

An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.

" }, "ConfigurationList":{ "type":"list", "member":{"shape":"Configuration"} }, - "Date":{"type":"timestamp"}, + "CreateSecurityConfigurationInput":{ + "type":"structure", + "required":[ + "Name", + "SecurityConfiguration" + ], + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + }, + "SecurityConfiguration":{ + "shape":"String", + "documentation":"

The security configuration details in JSON format. For JSON parameters and examples, see Use Security Configurations to Set Up Cluster Security in the Amazon EMR Management Guide.

" + } + } + }, + "CreateSecurityConfigurationOutput":{ + "type":"structure", + "required":[ + "Name", + "CreationDateTime" + ], + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + }, + "CreationDateTime":{ + "shape":"Date", + "documentation":"

The date and time the security configuration was created.

" + } + } + }, + "Date":{"type":"timestamp"}, + "DeleteSecurityConfigurationInput":{ + "type":"structure", + "required":["Name"], + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + } + } + }, + "DeleteSecurityConfigurationOutput":{ + "type":"structure", + "members":{ + } + }, "DescribeClusterInput":{ "type":"structure", "required":["ClusterId"], @@ -888,7 +1101,7 @@ }, "JobFlowIds":{ "shape":"XmlStringList", - "documentation":"

Return only job flows whose job flow ID is contained in this list.

" + "documentation":"

Return only job flows whose job flow ID is contained in this list.

" }, "JobFlowStates":{ "shape":"JobFlowExecutionStateList", @@ -907,6 +1120,33 @@ }, "documentation":"

The output for the DescribeJobFlows operation.

" }, + "DescribeSecurityConfigurationInput":{ + "type":"structure", + "required":["Name"], + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + } + } + }, + "DescribeSecurityConfigurationOutput":{ + "type":"structure", + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + }, + "SecurityConfiguration":{ + "shape":"String", + "documentation":"

The security configuration details in JSON format.

" + }, + "CreationDateTime":{ + "shape":"Date", + "documentation":"

The date and time the security configuration was created

" + } + } + }, "DescribeStepInput":{ "type":"structure", "required":[ @@ -935,10 +1175,83 @@ }, "documentation":"

This output contains the description of the cluster step.

" }, + "EC2InstanceIdsList":{ + "type":"list", + "member":{"shape":"InstanceId"} + }, "EC2InstanceIdsToTerminateList":{ "type":"list", "member":{"shape":"InstanceId"} }, + "EbsBlockDevice":{ + "type":"structure", + "members":{ + "VolumeSpecification":{ + "shape":"VolumeSpecification", + "documentation":"

EBS volume specifications such as volume type, IOPS, and size (GiB) that will be requested for the EBS volume attached to an EC2 instance in the cluster.

" + }, + "Device":{ + "shape":"String", + "documentation":"

The device name that is exposed to the instance, such as /dev/sdh.

" + } + }, + "documentation":"

Configuration of requested EBS block device associated with the instance group.

" + }, + "EbsBlockDeviceConfig":{ + "type":"structure", + "required":["VolumeSpecification"], + "members":{ + "VolumeSpecification":{ + "shape":"VolumeSpecification", + "documentation":"

EBS volume specifications such as volume type, IOPS, and size (GiB) that will be requested for the EBS volume attached to an EC2 instance in the cluster.

" + }, + "VolumesPerInstance":{ + "shape":"Integer", + "documentation":"

Number of EBS volumes with a specific volume configuration that will be associated with every instance in the instance group

" + } + }, + "documentation":"

Configuration of requested EBS block device associated with the instance group with count of volumes that will be associated to every instance.

" + }, + "EbsBlockDeviceConfigList":{ + "type":"list", + "member":{"shape":"EbsBlockDeviceConfig"} + }, + "EbsBlockDeviceList":{ + "type":"list", + "member":{"shape":"EbsBlockDevice"} + }, + "EbsConfiguration":{ + "type":"structure", + "members":{ + "EbsBlockDeviceConfigs":{ + "shape":"EbsBlockDeviceConfigList", + "documentation":"

An array of Amazon EBS volume specifications attached to a cluster instance.

" + }, + "EbsOptimized":{ + "shape":"BooleanObject", + "documentation":"

Indicates whether an Amazon EBS volume is EBS-optimized.

" + } + }, + "documentation":"

The Amazon EBS configuration of a cluster instance.

" + }, + "EbsVolume":{ + "type":"structure", + "members":{ + "Device":{ + "shape":"String", + "documentation":"

The device name that is exposed to the instance, such as /dev/sdh.

" + }, + "VolumeId":{ + "shape":"String", + "documentation":"

The volume identifier of the EBS volume.

" + } + }, + "documentation":"

EBS block device that's attached to an EC2 instance.

" + }, + "EbsVolumeList":{ + "type":"list", + "member":{"shape":"EbsVolume"} + }, "Ec2InstanceAttributes":{ "type":"structure", "members":{ @@ -948,23 +1261,35 @@ }, "Ec2SubnetId":{ "shape":"String", - "documentation":"

To launch the job flow in Amazon VPC, set this parameter to the identifier of the Amazon VPC subnet where you want the job flow to launch. If you do not specify this value, the job flow is launched in the normal AWS cloud, outside of a VPC.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus, you cannot specify the cc1.4xlarge instance type for nodes of a job flow launched in a VPC.

" + "documentation":"

To launch the cluster in Amazon VPC, set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, the cluster is launched in the normal AWS cloud, outside of a VPC.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus, you cannot specify the cc1.4xlarge instance type for nodes of a cluster launched in a VPC.

" + }, + "RequestedEc2SubnetIds":{ + "shape":"XmlStringMaxLen256List", + "documentation":"

Applies to clusters configured with the instance fleets option. Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among the list of RequestedEc2SubnetIds, and then launches all cluster instances within that Subnet. If this value is not specified, and the account and region support EC2-Classic networks, the cluster launches instances in the EC2-Classic network and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.

" }, "Ec2AvailabilityZone":{ "shape":"String", - "documentation":"

The Availability Zone in which the cluster will run.

" + "documentation":"

The Availability Zone in which the cluster will run.

" + }, + "RequestedEc2AvailabilityZones":{ + "shape":"XmlStringMaxLen256List", + "documentation":"

Applies to clusters configured with the instance fleets option. Specifies one or more Availability Zones in which to launch EC2 cluster instances when the EC2-Classic network configuration is supported. Amazon EMR chooses the Availability Zone with the best fit from among the list of RequestedEc2AvailabilityZones, and then launches all cluster instances within that Availability Zone. If you do not specify this value, Amazon EMR chooses the Availability Zone for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.

" }, "IamInstanceProfile":{ "shape":"String", - "documentation":"

The IAM role that was specified when the job flow was launched. The EC2 instances of the job flow assume this role.

" + "documentation":"

The IAM role that was specified when the cluster was launched. The EC2 instances of the cluster assume this role.

" }, "EmrManagedMasterSecurityGroup":{ "shape":"String", - "documentation":"

The identifier of the Amazon EC2 security group (managed by Amazon Elastic MapReduce) for the master node.

" + "documentation":"

The identifier of the Amazon EC2 security group for the master node.

" }, "EmrManagedSlaveSecurityGroup":{ "shape":"String", - "documentation":"

The identifier of the Amazon EC2 security group (managed by Amazon Elastic MapReduce) for the slave nodes.

" + "documentation":"

The identifier of the Amazon EC2 security group for the slave nodes.

" + }, + "ServiceAccessSecurityGroup":{ + "shape":"String", + "documentation":"

The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets.

" }, "AdditionalMasterSecurityGroups":{ "shape":"StringList", @@ -979,10 +1304,28 @@ }, "ErrorCode":{ "type":"string", - "min":1, - "max":256 + "max":256, + "min":1 }, "ErrorMessage":{"type":"string"}, + "FailureDetails":{ + "type":"structure", + "members":{ + "Reason":{ + "shape":"String", + "documentation":"

The reason for the step failure. In the case where the service cannot successfully determine the root cause of the failure, it returns \"Unknown Error\" as a reason.

" + }, + "Message":{ + "shape":"String", + "documentation":"

The descriptive message including the error the EMR service has identified as the cause of step failure. This is text from an error log that describes the root cause of the failure.

" + }, + "LogFile":{ + "shape":"String", + "documentation":"

The path to the log file where the step failure root cause was originally recorded.

" + } + }, + "documentation":"

The details of the step failure. The service attempts to detect the root cause for many common failures.

" + }, "HadoopJarStepConfig":{ "type":"structure", "required":["Jar"], @@ -1004,7 +1347,7 @@ "documentation":"

A list of command line arguments passed to the JAR file's main function when executed.

" } }, - "documentation":"

A job flow step consisting of a JAR file whose main function will be executed. The main function submits a job for Hadoop to execute and waits for the job to finish or fail.

" + "documentation":"

A job flow step consisting of a JAR file whose main function will be executed. The main function submits a job for Hadoop to execute and waits for the job to finish or fail.

" }, "HadoopStepConfig":{ "type":"structure", @@ -1026,7 +1369,7 @@ "documentation":"

The list of command line arguments to pass to the JAR file's main function for execution.

" } }, - "documentation":"

A cluster step consisting of a JAR file whose main function will be executed. The main function submits a job for Hadoop to execute and waits for the job to finish or fail.

" + "documentation":"

A cluster step consisting of a JAR file whose main function will be executed. The main function submits a job for Hadoop to execute and waits for the job to finish or fail.

" }, "Instance":{ "type":"structure", @@ -1058,10 +1401,232 @@ "Status":{ "shape":"InstanceStatus", "documentation":"

The current status of the instance.

" + }, + "InstanceGroupId":{ + "shape":"String", + "documentation":"

The identifier of the instance group to which this instance belongs.

" + }, + "InstanceFleetId":{ + "shape":"InstanceFleetId", + "documentation":"

The unique identifier of the instance fleet to which an EC2 instance belongs.

" + }, + "Market":{ + "shape":"MarketType", + "documentation":"

The instance purchasing option. Valid values are ON_DEMAND or SPOT.

" + }, + "InstanceType":{ + "shape":"InstanceType", + "documentation":"

The EC2 instance type, for example m3.xlarge.

" + }, + "EbsVolumes":{ + "shape":"EbsVolumeList", + "documentation":"

The list of EBS volumes that are attached to this instance.

" } }, "documentation":"

Represents an EC2 instance provisioned as part of cluster.

" }, + "InstanceCollectionType":{ + "type":"string", + "enum":[ + "INSTANCE_FLEET", + "INSTANCE_GROUP" + ] + }, + "InstanceFleet":{ + "type":"structure", + "members":{ + "Id":{ + "shape":"InstanceFleetId", + "documentation":"

The unique identifier of the instance fleet.

" + }, + "Name":{ + "shape":"XmlStringMaxLen256", + "documentation":"

A friendly name for the instance fleet.

" + }, + "Status":{ + "shape":"InstanceFleetStatus", + "documentation":"

The current status of the instance fleet.

" + }, + "InstanceFleetType":{ + "shape":"InstanceFleetType", + "documentation":"

The node type that the instance fleet hosts. Valid values are MASTER, CORE, or TASK.

" + }, + "TargetOnDemandCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When an On-Demand instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedOnDemandCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.

If not specified or set to 0, only Spot instances are provisioned for the instance fleet using TargetSpotCapacity. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.

" + }, + "TargetSpotCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedSpotCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.

If not specified or set to 0, only On-Demand instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.

" + }, + "ProvisionedOnDemandCapacity":{ + "shape":"WholeNumber", + "documentation":"

The number of On-Demand units that have been provisioned for the instance fleet to fulfill TargetOnDemandCapacity. This provisioned capacity might be less than or greater than TargetOnDemandCapacity.

" + }, + "ProvisionedSpotCapacity":{ + "shape":"WholeNumber", + "documentation":"

The number of Spot units that have been provisioned for this instance fleet to fulfill TargetSpotCapacity. This provisioned capacity might be less than or greater than TargetSpotCapacity.

" + }, + "InstanceTypeSpecifications":{ + "shape":"InstanceTypeSpecificationList", + "documentation":"

The specification for the instance types that comprise an instance fleet. Up to five unique instance specifications may be defined for each instance fleet.

" + }, + "LaunchSpecifications":{ + "shape":"InstanceFleetProvisioningSpecifications", + "documentation":"

Describes the launch specification for an instance fleet.

" + } + }, + "documentation":"

Describes an instance fleet, which is a group of EC2 instances that host a particular node type (master, core, or task) in an Amazon EMR cluster. Instance fleets can consist of a mix of instance types and On-Demand and Spot instances, which are provisioned to meet a defined target capacity.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetConfig":{ + "type":"structure", + "required":["InstanceFleetType"], + "members":{ + "Name":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The friendly name of the instance fleet.

" + }, + "InstanceFleetType":{ + "shape":"InstanceFleetType", + "documentation":"

The node type that the instance fleet hosts. Valid values are MASTER,CORE,and TASK.

" + }, + "TargetOnDemandCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When an On-Demand instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.

If not specified or set to 0, only Spot instances are provisioned for the instance fleet using TargetSpotCapacity. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.

" + }, + "TargetSpotCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.

If not specified or set to 0, only On-Demand instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.

" + }, + "InstanceTypeConfigs":{ + "shape":"InstanceTypeConfigList", + "documentation":"

The instance type configurations that define the EC2 instances in the instance fleet.

" + }, + "LaunchSpecifications":{ + "shape":"InstanceFleetProvisioningSpecifications", + "documentation":"

The launch specification for the instance fleet.

" + } + }, + "documentation":"

The configuration that defines an instance fleet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetConfigList":{ + "type":"list", + "member":{"shape":"InstanceFleetConfig"} + }, + "InstanceFleetId":{"type":"string"}, + "InstanceFleetList":{ + "type":"list", + "member":{"shape":"InstanceFleet"} + }, + "InstanceFleetModifyConfig":{ + "type":"structure", + "required":["InstanceFleetId"], + "members":{ + "InstanceFleetId":{ + "shape":"InstanceFleetId", + "documentation":"

A unique identifier for the instance fleet.

" + }, + "TargetOnDemandCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of On-Demand units for the instance fleet. For more information see InstanceFleetConfig$TargetOnDemandCapacity.

" + }, + "TargetSpotCapacity":{ + "shape":"WholeNumber", + "documentation":"

The target capacity of Spot units for the instance fleet. For more information, see InstanceFleetConfig$TargetSpotCapacity.

" + } + }, + "documentation":"

Configuration parameters for an instance fleet modification request.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetProvisioningSpecifications":{ + "type":"structure", + "required":["SpotSpecification"], + "members":{ + "SpotSpecification":{ + "shape":"SpotProvisioningSpecification", + "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.

" + } + }, + "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetState":{ + "type":"string", + "enum":[ + "PROVISIONING", + "BOOTSTRAPPING", + "RUNNING", + "RESIZING", + "SUSPENDED", + "TERMINATING", + "TERMINATED" + ] + }, + "InstanceFleetStateChangeReason":{ + "type":"structure", + "members":{ + "Code":{ + "shape":"InstanceFleetStateChangeReasonCode", + "documentation":"

A code corresponding to the reason the state change occurred.

" + }, + "Message":{ + "shape":"String", + "documentation":"

An explanatory message.

" + } + }, + "documentation":"

Provides status change reason details for the instance fleet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetStateChangeReasonCode":{ + "type":"string", + "enum":[ + "INTERNAL_ERROR", + "VALIDATION_ERROR", + "INSTANCE_FAILURE", + "CLUSTER_TERMINATED" + ] + }, + "InstanceFleetStatus":{ + "type":"structure", + "members":{ + "State":{ + "shape":"InstanceFleetState", + "documentation":"

A code representing the instance fleet status.

  • PROVISIONING—The instance fleet is provisioning EC2 resources and is not yet ready to run jobs.

  • BOOTSTRAPPING—EC2 instances and other resources have been provisioned and the bootstrap actions specified for the instances are underway.

  • RUNNING—EC2 instances and other resources are running. They are either executing jobs or waiting to execute jobs.

  • RESIZING—A resize operation is underway. EC2 instances are either being added or removed.

  • SUSPENDED—A resize operation could not complete. Existing EC2 instances are running, but instances can't be added or removed.

  • TERMINATING—The instance fleet is terminating EC2 instances.

  • TERMINATED—The instance fleet is no longer active, and all EC2 instances have been terminated.

" + }, + "StateChangeReason":{ + "shape":"InstanceFleetStateChangeReason", + "documentation":"

Provides status change reason details for the instance fleet.

" + }, + "Timeline":{ + "shape":"InstanceFleetTimeline", + "documentation":"

Provides historical timestamps for the instance fleet, including the time of creation, the time it became ready to run jobs, and the time of termination.

" + } + }, + "documentation":"

The status of the instance fleet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetTimeline":{ + "type":"structure", + "members":{ + "CreationDateTime":{ + "shape":"Date", + "documentation":"

The time and date the instance fleet was created.

" + }, + "ReadyDateTime":{ + "shape":"Date", + "documentation":"

The time and date the instance fleet was ready to run jobs.

" + }, + "EndDateTime":{ + "shape":"Date", + "documentation":"

The time and date the instance fleet terminated.

" + } + }, + "documentation":"

Provides historical timestamps for the instance fleet, including the time of creation, the time it became ready to run jobs, and the time of termination.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceFleetType":{ + "type":"string", + "enum":[ + "MASTER", + "CORE", + "TASK" + ] + }, "InstanceGroup":{ "type":"structure", "members":{ @@ -1087,11 +1652,11 @@ }, "InstanceType":{ "shape":"InstanceType", - "documentation":"

The EC2 instance type for all instances in the instance group.

" + "documentation":"

The EC2 instance type for all instances in the instance group.

" }, "RequestedInstanceCount":{ "shape":"Integer", - "documentation":"

The target number of instances for the instance group.

" + "documentation":"

The target number of instances for the instance group.

" }, "RunningInstanceCount":{ "shape":"Integer", @@ -1103,7 +1668,23 @@ }, "Configurations":{ "shape":"ConfigurationList", - "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).

" + "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).

" + }, + "EbsBlockDevices":{ + "shape":"EbsBlockDeviceList", + "documentation":"

The EBS block devices that are mapped to this instance group.

" + }, + "EbsOptimized":{ + "shape":"BooleanObject", + "documentation":"

If the instance group is EBS-optimized. An Amazon EBS-optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O.

" + }, + "ShrinkPolicy":{ + "shape":"ShrinkPolicy", + "documentation":"

Policy for customizing shrink operations.

" + }, + "AutoScalingPolicy":{ + "shape":"AutoScalingPolicyDescription", + "documentation":"

An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.

" } }, "documentation":"

This entity represents an instance group, which is a group of instances that have common purpose. For example, CORE instance group is used for HDFS.

" @@ -1122,7 +1703,7 @@ }, "Market":{ "shape":"MarketType", - "documentation":"

Market type of the Amazon EC2 instances used to create a cluster node.

" + "documentation":"

Market type of the EC2 instances used to create a cluster node.

" }, "InstanceRole":{ "shape":"InstanceRoleType", @@ -1130,19 +1711,27 @@ }, "BidPrice":{ "shape":"XmlStringMaxLen256", - "documentation":"

Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

" + "documentation":"

Bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

" }, "InstanceType":{ "shape":"InstanceType", - "documentation":"

The Amazon EC2 instance type for all instances in the instance group.

" + "documentation":"

The EC2 instance type for all instances in the instance group.

" }, "InstanceCount":{ "shape":"Integer", - "documentation":"

Target number of instances for the instance group.

" + "documentation":"

Target number of instances for the instance group.

" }, "Configurations":{ "shape":"ConfigurationList", - "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).

" + "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).

" + }, + "EbsConfiguration":{ + "shape":"EbsConfiguration", + "documentation":"

EBS configurations that will be attached to each EC2 instance in the instance group.

" + }, + "AutoScalingPolicy":{ + "shape":"AutoScalingPolicy", + "documentation":"

An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.

" } }, "documentation":"

Configuration defining a new instance group.

" @@ -1165,19 +1754,19 @@ "members":{ "InstanceGroupId":{ "shape":"XmlStringMaxLen256", - "documentation":"

Unique identifier for the instance group.

" + "documentation":"

Unique identifier for the instance group.

" }, "Name":{ "shape":"XmlStringMaxLen256", - "documentation":"

Friendly name for the instance group.

" + "documentation":"

Friendly name for the instance group.

" }, "Market":{ "shape":"MarketType", - "documentation":"

Market type of the Amazon EC2 instances used to create a cluster node.

" + "documentation":"

Market type of the EC2 instances used to create a cluster node.

" }, "InstanceRole":{ "shape":"InstanceRoleType", - "documentation":"

Instance group role in the cluster

" + "documentation":"

Instance group role in the cluster

" }, "BidPrice":{ "shape":"XmlStringMaxLen256", @@ -1185,15 +1774,15 @@ }, "InstanceType":{ "shape":"InstanceType", - "documentation":"

Amazon EC2 Instance type.

" + "documentation":"

EC2 instance type.

" }, "InstanceRequestCount":{ "shape":"Integer", - "documentation":"

Target number of instances to run in the instance group.

" + "documentation":"

Target number of instances to run in the instance group.

" }, "InstanceRunningCount":{ "shape":"Integer", - "documentation":"

Actual count of running instances.

" + "documentation":"

Actual count of running instances.

" }, "State":{ "shape":"InstanceGroupState", @@ -1201,11 +1790,11 @@ }, "LastStateChangeReason":{ "shape":"XmlString", - "documentation":"

Details regarding the state of the instance group.

" + "documentation":"

Details regarding the state of the instance group.

" }, "CreationDateTime":{ "shape":"Date", - "documentation":"

The date/time the instance group was created.

" + "documentation":"

The date/time the instance group was created.

" }, "StartDateTime":{ "shape":"Date", @@ -1213,14 +1802,14 @@ }, "ReadyDateTime":{ "shape":"Date", - "documentation":"

The date/time the instance group was available to the cluster.

" + "documentation":"

The date/time the instance group was available to the cluster.

" }, "EndDateTime":{ "shape":"Date", "documentation":"

The date/time the instance group was terminated.

" } }, - "documentation":"

Detailed information about an instance group.

" + "documentation":"

Detailed information about an instance group.

" }, "InstanceGroupDetailList":{ "type":"list", @@ -1249,7 +1838,11 @@ }, "EC2InstanceIdsToTerminate":{ "shape":"EC2InstanceIdsToTerminateList", - "documentation":"

The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.

" + "documentation":"

The EC2 InstanceIds to terminate. After you terminate the instances, the instance group will not return to its original requested size.

" + }, + "ShrinkPolicy":{ + "shape":"ShrinkPolicy", + "documentation":"

Policy for customizing shrink operations.

" } }, "documentation":"

Modify an instance group size.

" @@ -1349,6 +1942,24 @@ "type":"list", "member":{"shape":"Instance"} }, + "InstanceResizePolicy":{ + "type":"structure", + "members":{ + "InstancesToTerminate":{ + "shape":"EC2InstanceIdsList", + "documentation":"

Specific list of instances to be terminated when shrinking an instance group.

" + }, + "InstancesToProtect":{ + "shape":"EC2InstanceIdsList", + "documentation":"

Specific list of instances to be protected when shrinking an instance group.

" + }, + "InstanceTerminationTimeout":{ + "shape":"Integer", + "documentation":"

Decommissioning timeout override for the specific list of instances to be terminated.

" + } + }, + "documentation":"

Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.

" + }, "InstanceRoleType":{ "type":"string", "enum":[ @@ -1391,6 +2002,10 @@ "CLUSTER_TERMINATED" ] }, + "InstanceStateList":{ + "type":"list", + "member":{"shape":"InstanceState"} + }, "InstanceStatus":{ "type":"structure", "members":{ @@ -1429,21 +2044,90 @@ }, "InstanceType":{ "type":"string", - "min":1, "max":256, + "min":1, "pattern":"[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*" }, + "InstanceTypeConfig":{ + "type":"structure", + "required":["InstanceType"], + "members":{ + "InstanceType":{ + "shape":"InstanceType", + "documentation":"

An EC2 instance type, such as m3.xlarge.

" + }, + "WeightedCapacity":{ + "shape":"WholeNumber", + "documentation":"

The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.

" + }, + "BidPrice":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The bid price for each EC2 Spot instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.

" + }, + "BidPriceAsPercentageOfOnDemandPrice":{ + "shape":"NonNegativeDouble", + "documentation":"

The bid price, as a percentage of On-Demand price, for each EC2 Spot instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.

" + }, + "EbsConfiguration":{ + "shape":"EbsConfiguration", + "documentation":"

The configuration of Amazon Elastic Block Storage (EBS) attached to each instance as defined by InstanceType.

" + }, + "Configurations":{ + "shape":"ConfigurationList", + "documentation":"

A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.

" + } + }, + "documentation":"

An instance type configuration for each instance type in an instance fleet, which determines the EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. There can be a maximum of 5 instance type configurations in a fleet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceTypeConfigList":{ + "type":"list", + "member":{"shape":"InstanceTypeConfig"} + }, + "InstanceTypeSpecification":{ + "type":"structure", + "members":{ + "InstanceType":{ + "shape":"InstanceType", + "documentation":"

The EC2 instance type, for example m3.xlarge.

" + }, + "WeightedCapacity":{ + "shape":"WholeNumber", + "documentation":"

The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. Capacity values represent performance characteristics such as vCPUs, memory, or I/O. If not specified, the default value is 1.

" + }, + "BidPrice":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The bid price for each EC2 Spot instance type as defined by InstanceType. Expressed in USD.

" + }, + "BidPriceAsPercentageOfOnDemandPrice":{ + "shape":"NonNegativeDouble", + "documentation":"

The bid price, as a percentage of On-Demand price, for each EC2 Spot instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%).

" + }, + "Configurations":{ + "shape":"ConfigurationList", + "documentation":"

A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR.

" + }, + "EbsBlockDevices":{ + "shape":"EbsBlockDeviceList", + "documentation":"

The configuration of Amazon Elastic Block Storage (EBS) attached to each instance as defined by InstanceType.

" + }, + "EbsOptimized":{ + "shape":"BooleanObject", + "documentation":"

Evaluates to TRUE when the specified InstanceType is EBS-optimized.

" + } + }, + "documentation":"

The configuration specification for each instance type in an instance fleet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "InstanceTypeSpecificationList":{ + "type":"list", + "member":{"shape":"InstanceTypeSpecification"} + }, "Integer":{"type":"integer"}, "InternalServerError":{ "type":"structure", "members":{ }, - "error":{ - "code":"InternalFailure", - "httpStatusCode":500 - }, - "exception":true, - "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

" + "documentation":"

Indicates that an error occurred while processing the request and that the request was not completed.

", + "exception":true }, "InternalServerException":{ "type":"structure", @@ -1453,9 +2137,9 @@ "documentation":"

The message associated with the exception.

" } }, + "documentation":"

This exception occurs when there is an internal failure in the EMR service.

", "exception":true, - "fault":true, - "documentation":"

This exception occurs when there is an internal failure in the EMR service.

" + "fault":true }, "InvalidRequestException":{ "type":"structure", @@ -1469,8 +2153,8 @@ "documentation":"

The message associated with the exception.

" } }, - "exception":true, - "documentation":"

This exception occurs when there is something wrong with user input.

" + "documentation":"

This exception occurs when there is something wrong with user input.

", + "exception":true }, "JobFlowDetail":{ "type":"structure", @@ -1491,11 +2175,11 @@ }, "LogUri":{ "shape":"XmlString", - "documentation":"

The location in Amazon S3 where log files for the job are stored.

" + "documentation":"

The location in Amazon S3 where log files for the job are stored.

" }, "AmiVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

The version of the AMI used to initialize Amazon EC2 instances in the job flow. For a list of AMI versions currently supported by Amazon ElasticMapReduce, go to AMI Versions Supported in Elastic MapReduce in the Amazon Elastic MapReduce Developer Guide.

" + "documentation":"

Used only for version 2.x and 3.x of Amazon EMR. The version of the AMI used to initialize Amazon EC2 instances in the job flow. For a list of AMI versions supported by Amazon EMR, see AMI Versions Supported in EMR in the Amazon EMR Developer Guide.

" }, "ExecutionStatusDetail":{ "shape":"JobFlowExecutionStatusDetail", @@ -1519,7 +2203,7 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Specifies whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the job flow. If it is set to false, only the IAM user that created the job flow can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" + "documentation":"

Specifies whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the cluster. If it is set to false, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" }, "JobFlowRole":{ "shape":"XmlString", @@ -1528,9 +2212,17 @@ "ServiceRole":{ "shape":"XmlString", "documentation":"

The IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf.

" + }, + "AutoScalingRole":{ + "shape":"XmlString", + "documentation":"

An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. The IAM role provides a way for the automatic scaling feature to get the required permissions it needs to launch and terminate EC2 instances in an instance group.

" + }, + "ScaleDownBehavior":{ + "shape":"ScaleDownBehavior", + "documentation":"

The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR blacklists and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon EMR version 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.

" } }, - "documentation":"

A description of a job flow.

" + "documentation":"

A description of a cluster (job flow).

" }, "JobFlowDetailList":{ "type":"list", @@ -1538,6 +2230,7 @@ }, "JobFlowExecutionState":{ "type":"string", + "documentation":"

The type of instance.

", "enum":[ "STARTING", "BOOTSTRAPPING", @@ -1547,8 +2240,7 @@ "TERMINATED", "COMPLETED", "FAILED" - ], - "documentation":"

The type of instance.

A small instance

A large instance

" + ] }, "JobFlowExecutionStateList":{ "type":"list", @@ -1586,7 +2278,7 @@ "documentation":"

Description of the job flow last changed state.

" } }, - "documentation":"

Describes the status of the job flow.

" + "documentation":"

Describes the status of the cluster (job flow).

" }, "JobFlowInstancesConfig":{ "type":"structure", @@ -1601,43 +2293,55 @@ }, "InstanceCount":{ "shape":"Integer", - "documentation":"

The number of Amazon EC2 instances used to execute the job flow.

" + "documentation":"

The number of EC2 instances in the cluster.

" }, "InstanceGroups":{ "shape":"InstanceGroupConfigList", - "documentation":"

Configuration for the job flow's instance groups.

" + "documentation":"

Configuration for the instance groups in a cluster.

" + }, + "InstanceFleets":{ + "shape":"InstanceFleetConfigList", + "documentation":"

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

Describes the EC2 instances and instance configurations for clusters that use the instance fleet configuration.

" }, "Ec2KeyName":{ "shape":"XmlStringMaxLen256", - "documentation":"

The name of the Amazon EC2 key pair that can be used to ssh to the master node as the user called \"hadoop.\"

" + "documentation":"

The name of the EC2 key pair that can be used to ssh to the master node as the user called \"hadoop.\"

" }, "Placement":{ "shape":"PlacementType", - "documentation":"

The Availability Zone the job flow will run in.

" + "documentation":"

The Availability Zone in which the cluster runs.

" }, "KeepJobFlowAliveWhenNoSteps":{ "shape":"Boolean", - "documentation":"

Specifies whether the job flow should be kept alive after completing all steps.

" + "documentation":"

Specifies whether the cluster should remain available after completing all steps.

" }, "TerminationProtected":{ "shape":"Boolean", - "documentation":"

Specifies whether to lock the job flow to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job flow error.

" + "documentation":"

Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job-flow error.

" }, "HadoopVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

The Hadoop version for the job flow. Valid inputs are \"0.18\" (deprecated), \"0.20\" (deprecated), \"0.20.205\" (deprecated), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.

" + "documentation":"

The Hadoop version for the cluster. Valid inputs are \"0.18\" (deprecated), \"0.20\" (deprecated), \"0.20.205\" (deprecated), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.

" }, "Ec2SubnetId":{ "shape":"XmlStringMaxLen256", - "documentation":"

To launch the job flow in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the job flow to launch. If you do not specify this value, the job flow is launched in the normal Amazon Web Services cloud, outside of an Amazon VPC.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus you cannot specify the cc1.4xlarge instance type for nodes of a job flow launched in a Amazon VPC.

" + "documentation":"

Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, the cluster launches in the normal Amazon Web Services cloud, outside of an Amazon VPC, if the account launching the cluster supports EC2 Classic networks in the region where the cluster launches.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus you cannot specify the cc1.4xlarge instance type for clusters launched in an Amazon VPC.

" + }, + "Ec2SubnetIds":{ + "shape":"XmlStringMaxLen256List", + "documentation":"

Applies to clusters that use the instance fleet configuration. When multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and launches instances in the optimal subnet.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" }, "EmrManagedMasterSecurityGroup":{ "shape":"XmlStringMaxLen256", - "documentation":"

The identifier of the Amazon EC2 security group (managed by Amazon ElasticMapReduce) for the master node.

" + "documentation":"

The identifier of the Amazon EC2 security group for the master node.

" }, "EmrManagedSlaveSecurityGroup":{ "shape":"XmlStringMaxLen256", - "documentation":"

The identifier of the Amazon EC2 security group (managed by Amazon ElasticMapReduce) for the slave nodes.

" + "documentation":"

The identifier of the Amazon EC2 security group for the slave nodes.

" + }, + "ServiceAccessSecurityGroup":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets.

" }, "AdditionalMasterSecurityGroups":{ "shape":"SecurityGroupsList", @@ -1648,7 +2352,7 @@ "documentation":"

A list of additional Amazon EC2 security group IDs for the slave nodes.

" } }, - "documentation":"

A description of the Amazon EC2 instance running the job flow. A valid JobFlowInstancesConfig must contain at least InstanceGroups, which is the recommended configuration. However, a valid alternative is to have MasterInstanceType, SlaveInstanceType, and InstanceCount (all three must be present).

" + "documentation":"

A description of the Amazon EC2 instance on which the cluster (job flow) runs. A valid JobFlowInstancesConfig must contain either InstanceGroups or InstanceFleets, which is the recommended configuration. They cannot be used together. You may also have MasterInstanceType, SlaveInstanceType, and InstanceCount (all three must be present), but we don't recommend this configuration.

" }, "JobFlowInstancesDetail":{ "type":"structure", @@ -1664,7 +2368,7 @@ }, "MasterPublicDnsName":{ "shape":"XmlString", - "documentation":"

The DNS name of the master node.

" + "documentation":"

The DNS name of the master node. If the cluster is on a private subnet, this is the private DNS name. On a public subnet, this is the public DNS name.

" }, "MasterInstanceId":{ "shape":"XmlString", @@ -1680,38 +2384,68 @@ }, "InstanceGroups":{ "shape":"InstanceGroupDetailList", - "documentation":"

Details about the job flow's instance groups.

" + "documentation":"

Details about the instance groups in a cluster.

" }, "NormalizedInstanceHours":{ "shape":"Integer", - "documentation":"

An approximation of the cost of the job flow, represented in m1.small/hours. This value is incremented once for every hour an m1.small runs. Larger instances are weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" + "documentation":"

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time for every hour that an m1.small runs. Larger instances are weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" }, "Ec2KeyName":{ "shape":"XmlStringMaxLen256", - "documentation":"

The name of an Amazon EC2 key pair that can be used to ssh to the master node of job flow.

" + "documentation":"

The name of an Amazon EC2 key pair that can be used to ssh to the master node.

" }, "Ec2SubnetId":{ "shape":"XmlStringMaxLen256", - "documentation":"

For job flows launched within Amazon Virtual Private Cloud, this value specifies the identifier of the subnet where the job flow was launched.

" + "documentation":"

For clusters launched within Amazon Virtual Private Cloud, this is the identifier of the subnet where the cluster was launched.

" }, "Placement":{ "shape":"PlacementType", - "documentation":"

The Amazon EC2 Availability Zone for the job flow.

" + "documentation":"

The Amazon EC2 Availability Zone for the cluster.

" }, "KeepJobFlowAliveWhenNoSteps":{ "shape":"Boolean", - "documentation":"

Specifies whether the job flow should terminate after completing all steps.

" + "documentation":"

Specifies whether the cluster should remain available after completing all steps.

" }, "TerminationProtected":{ "shape":"Boolean", - "documentation":"

Specifies whether the Amazon EC2 instances in the cluster are protected from termination by API calls, user intervention, or in the event of a job flow error.

" + "documentation":"

Specifies whether the Amazon EC2 instances in the cluster are protected from termination by API calls, user intervention, or in the event of a job-flow error.

" }, "HadoopVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

The Hadoop version for the job flow.

" + "documentation":"

The Hadoop version for the cluster.

" + } + }, + "documentation":"

Specify the type of Amazon EC2 instances that the cluster (job flow) runs on.

" + }, + "KerberosAttributes":{ + "type":"structure", + "required":[ + "Realm", + "KdcAdminPassword" + ], + "members":{ + "Realm":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL.

" + }, + "KdcAdminPassword":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the cluster.

" + }, + "CrossRealmTrustPrincipalPassword":{ + "shape":"XmlStringMaxLen256", + "documentation":"

Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal password, which must be identical across realms.

" + }, + "ADDomainJoinUser":{ + "shape":"XmlStringMaxLen256", + "documentation":"

Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient privileges to join resources to the domain.

" + }, + "ADDomainJoinPassword":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The Active Directory password for ADDomainJoinUser.

" } }, - "documentation":"

Specify the type of Amazon EC2 instances to run the job flow on.

" + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" }, "KeyValue":{ "type":"structure", @@ -1737,11 +2471,11 @@ "members":{ "ClusterId":{ "shape":"ClusterId", - "documentation":"

The cluster identifier for the bootstrap actions to list .

" + "documentation":"

The cluster identifier for the bootstrap actions to list.

" }, "Marker":{ "shape":"Marker", - "documentation":"

The pagination token that indicates the next set of results to retrieve .

" + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" } }, "documentation":"

This input determines which bootstrap actions to retrieve.

" @@ -1751,33 +2485,33 @@ "members":{ "BootstrapActions":{ "shape":"CommandList", - "documentation":"

The bootstrap actions associated with the cluster .

" + "documentation":"

The bootstrap actions associated with the cluster.

" }, "Marker":{ "shape":"Marker", - "documentation":"

The pagination token that indicates the next set of results to retrieve .

" + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" } }, - "documentation":"

This output contains the boostrap actions detail .

" + "documentation":"

This output contains the bootstrap actions detail.

" }, "ListClustersInput":{ "type":"structure", "members":{ "CreatedAfter":{ "shape":"Date", - "documentation":"

The creation date and time beginning value filter for listing clusters .

" + "documentation":"

The creation date and time beginning value filter for listing clusters.

" }, "CreatedBefore":{ "shape":"Date", - "documentation":"

The creation date and time end value filter for listing clusters .

" + "documentation":"

The creation date and time end value filter for listing clusters.

" }, "ClusterStates":{ "shape":"ClusterStateList", - "documentation":"

The cluster state filters to apply when listing clusters.

" + "documentation":"

The cluster state filters to apply when listing clusters.

" }, "Marker":{ "shape":"Marker", - "documentation":"

The pagination token that indicates the next set of results to retrieve.

" + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" } }, "documentation":"

This input determines how the ListClusters action filters the list of clusters that it returns.

" @@ -1787,15 +2521,42 @@ "members":{ "Clusters":{ "shape":"ClusterSummaryList", - "documentation":"

The list of clusters for the account based on the given filters.

" + "documentation":"

The list of clusters for the account based on the given filters.

" }, "Marker":{ "shape":"Marker", - "documentation":"

The pagination token that indicates the next set of results to retrieve.

" + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" } }, "documentation":"

This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs, names, and status.

" }, + "ListInstanceFleetsInput":{ + "type":"structure", + "required":["ClusterId"], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

The unique identifier of the cluster.

" + }, + "Marker":{ + "shape":"Marker", + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" + } + } + }, + "ListInstanceFleetsOutput":{ + "type":"structure", + "members":{ + "InstanceFleets":{ + "shape":"InstanceFleetList", + "documentation":"

The list of instance fleets for the cluster and given filters.

" + }, + "Marker":{ + "shape":"Marker", + "documentation":"

The pagination token that indicates the next set of results to retrieve.

" + } + } + }, "ListInstanceGroupsInput":{ "type":"structure", "required":["ClusterId"], @@ -1841,6 +2602,18 @@ "shape":"InstanceGroupTypeList", "documentation":"

The type of instance group for which to list the instances.

" }, + "InstanceFleetId":{ + "shape":"InstanceFleetId", + "documentation":"

The unique identifier of the instance fleet.

" + }, + "InstanceFleetType":{ + "shape":"InstanceFleetType", + "documentation":"

The node type of the instance fleet. For example MASTER, CORE, or TASK.

" + }, + "InstanceStates":{ + "shape":"InstanceStateList", + "documentation":"

A list of instance states that will filter the instances returned with this request.

" + }, "Marker":{ "shape":"Marker", "documentation":"

The pagination token that indicates the next set of results to retrieve.

" @@ -1862,6 +2635,28 @@ }, "documentation":"

This output contains the list of instances.

" }, + "ListSecurityConfigurationsInput":{ + "type":"structure", + "members":{ + "Marker":{ + "shape":"Marker", + "documentation":"

The pagination token that indicates the set of results to retrieve.

" + } + } + }, + "ListSecurityConfigurationsOutput":{ + "type":"structure", + "members":{ + "SecurityConfigurations":{ + "shape":"SecurityConfigurationList", + "documentation":"

The creation date and time, and name, of each security configuration.

" + }, + "Marker":{ + "shape":"Marker", + "documentation":"

A pagination token that indicates the next set of results to retrieve. Include the marker in the next ListSecurityConfiguration call to retrieve the next page of results, if required.

" + } + } + }, "ListStepsInput":{ "type":"structure", "required":["ClusterId"], @@ -1897,7 +2692,7 @@ "documentation":"

The pagination token that indicates the next set of results to retrieve.

" } }, - "documentation":"

This output contains the list of steps.

" + "documentation":"

This output contains the list of steps returned in reverse order. This means that the last step is the first element in the list.

" }, "Marker":{"type":"string"}, "MarketType":{ @@ -1907,9 +2702,48 @@ "SPOT" ] }, + "MetricDimension":{ + "type":"structure", + "members":{ + "Key":{ + "shape":"String", + "documentation":"

The dimension name.

" + }, + "Value":{ + "shape":"String", + "documentation":"

The dimension value.

" + } + }, + "documentation":"

A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId}. This enables the rule to bootstrap when the cluster ID becomes available.

" + }, + "MetricDimensionList":{ + "type":"list", + "member":{"shape":"MetricDimension"} + }, + "ModifyInstanceFleetInput":{ + "type":"structure", + "required":[ + "ClusterId", + "InstanceFleet" + ], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

The unique identifier of the cluster.

" + }, + "InstanceFleet":{ + "shape":"InstanceFleetModifyConfig", + "documentation":"

The unique identifier of the instance fleet.

" + } + } + }, "ModifyInstanceGroupsInput":{ "type":"structure", "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

The ID of the cluster to which the instance group belongs.

" + }, "InstanceGroups":{ "shape":"InstanceGroupModifyConfigList", "documentation":"

Instance groups to change.

" @@ -1921,16 +2755,84 @@ "type":"list", "member":{"shape":"SupportedProductConfig"} }, + "NonNegativeDouble":{ + "type":"double", + "min":0.0 + }, "PlacementType":{ "type":"structure", - "required":["AvailabilityZone"], "members":{ "AvailabilityZone":{ "shape":"XmlString", - "documentation":"

The Amazon EC2 Availability Zone for the job flow.

" + "documentation":"

The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used for uniform instance groups, while AvailabilityZones (plural) is used for instance fleets.

" + }, + "AvailabilityZones":{ + "shape":"XmlStringMaxLen256List", + "documentation":"

When multiple Availability Zones are specified, Amazon EMR evaluates them and launches instances in the optimal Availability Zone. AvailabilityZones is used for instance fleets, while AvailabilityZone (singular) is used for uniform instance groups.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" } }, - "documentation":"

The Amazon EC2 location for the job flow.

" + "documentation":"

The Amazon EC2 Availability Zone configuration of the cluster (job flow).

" + }, + "PutAutoScalingPolicyInput":{ + "type":"structure", + "required":[ + "ClusterId", + "InstanceGroupId", + "AutoScalingPolicy" + ], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

" + }, + "InstanceGroupId":{ + "shape":"InstanceGroupId", + "documentation":"

Specifies the ID of the instance group to which the automatic scaling policy is applied.

" + }, + "AutoScalingPolicy":{ + "shape":"AutoScalingPolicy", + "documentation":"

Specifies the definition of the automatic scaling policy.

" + } + } + }, + "PutAutoScalingPolicyOutput":{ + "type":"structure", + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

" + }, + "InstanceGroupId":{ + "shape":"InstanceGroupId", + "documentation":"

Specifies the ID of the instance group to which the scaling policy is applied.

" + }, + "AutoScalingPolicy":{ + "shape":"AutoScalingPolicyDescription", + "documentation":"

The automatic scaling policy definition.

" + } + } + }, + "RemoveAutoScalingPolicyInput":{ + "type":"structure", + "required":[ + "ClusterId", + "InstanceGroupId" + ], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

" + }, + "InstanceGroupId":{ + "shape":"InstanceGroupId", + "documentation":"

Specifies the ID of the instance group to which the scaling policy is applied.

" + } + } + }, + "RemoveAutoScalingPolicyOutput":{ + "type":"structure", + "members":{ + } }, "RemoveTagsInput":{ "type":"structure", @@ -1948,13 +2850,20 @@ "documentation":"

A list of tag keys to remove from a resource.

" } }, - "documentation":"

This input identifies a cluster and a list of tags to remove.

" + "documentation":"

This input identifies a cluster and a list of tags to remove.

" }, "RemoveTagsOutput":{ "type":"structure", "members":{ }, - "documentation":"

This output indicates the result of removing tags from a resource.

" + "documentation":"

This output indicates the result of removing tags from a resource.

" + }, + "RepoUpgradeOnBoot":{ + "type":"string", + "enum":[ + "SECURITY", + "NONE" + ] }, "ResourceId":{"type":"string"}, "RunJobFlowInput":{ @@ -1978,47 +2887,47 @@ }, "AmiVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use ReleaseLabel.

The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. The following values are valid:

  • The version number of the AMI to use, for example, \"2.0.\"

If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above.

For details about the AMI versions currently supported by Amazon Elastic MapReduce, go to AMI Versions Supported in Elastic MapReduce in the Amazon Elastic MapReduce Developer's Guide.

" + "documentation":"

For Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, the Linux AMI is determined by the ReleaseLabel specified or by CustomAmiID. The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. For details about the AMI versions currently supported in EMR version 3.x and 2.x, see AMI Versions Supported in EMR in the Amazon EMR Developer Guide.

If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20), you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above.

Previously, the EMR AMI version API parameter options allowed you to use latest for the latest AMI version rather than specify a numerical value. Some regions no longer support this deprecated option as they only have a newer release label version of EMR, which requires you to specify an EMR release label release (EMR 4.x or later).

" }, "ReleaseLabel":{ "shape":"XmlStringMaxLen256", - "documentation":"

Amazon EMR releases 4.x or later.

The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use amiVersion instead instead of ReleaseLabel.

" + "documentation":"

The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use AmiVersion instead.

" }, "Instances":{ "shape":"JobFlowInstancesConfig", - "documentation":"

A specification of the number and type of Amazon EC2 instances on which to run the job flow.

" + "documentation":"

A specification of the number and type of Amazon EC2 instances.

" }, "Steps":{ "shape":"StepConfigList", - "documentation":"

A list of steps to be executed by the job flow.

" + "documentation":"

A list of steps to run.

" }, "BootstrapActions":{ "shape":"BootstrapActionConfigList", - "documentation":"

A list of bootstrap actions that will be run before Hadoop is started on the cluster nodes.

" + "documentation":"

A list of bootstrap actions to run before Hadoop starts on the cluster nodes.

" }, "SupportedProducts":{ "shape":"SupportedProductsList", - "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use Applications.

A list of strings that indicates third-party software to use with the job flow. For more information, go to Use Third Party Applications with Amazon EMR. Currently supported values are:

  • \"mapr-m3\" - launch the job flow using MapR M3 Edition.
  • \"mapr-m5\" - launch the job flow using MapR M5 Edition.
" + "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use. For more information, see the Amazon EMR Developer Guide. Currently supported values are:

  • \"mapr-m3\" - launch the job flow using MapR M3 Edition.

  • \"mapr-m5\" - launch the job flow using MapR M5 Edition.

" }, "NewSupportedProducts":{ "shape":"NewSupportedProductsList", - "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use Applications.

A list of strings that indicates third-party software to use with the job flow that accepts a user argument list. EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action arguments. For more information, see Launch a Job Flow on the MapR Distribution for Hadoop. Currently supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.
  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.
  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition respectively.
  • \"mapr-m7\" - launch the cluster using MapR M7 Edition.
  • \"hunk\" - launch the cluster with the Hunk Big Data Analtics Platform.
  • \"hue\"- launch the cluster with Hue installed.
  • \"spark\" - launch the cluster with Apache Spark installed.
  • \"ganglia\" - launch the cluster with the Ganglia Monitoring System installed.
" + "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use with the job flow that accepts a user argument list. EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action arguments. For more information, see \"Launch a Job Flow on the MapR Distribution for Hadoop\" in the Amazon EMR Developer Guide. Supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.

  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.

  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition respectively.

  • \"mapr-m7\" - launch the cluster using MapR M7 Edition.

  • \"hunk\" - launch the cluster with the Hunk Big Data Analtics Platform.

  • \"hue\"- launch the cluster with Hue installed.

  • \"spark\" - launch the cluster with Apache Spark installed.

  • \"ganglia\" - launch the cluster with the Ganglia Monitoring System installed.

" }, "Applications":{ "shape":"ApplicationList", - "documentation":"

Amazon EMR releases 4.x or later.

A list of applications for the cluster. Valid values are: \"Hadoop\", \"Hive\", \"Mahout\", \"Pig\", and \"Spark.\" They are case insensitive.

" + "documentation":"

For Amazon EMR releases 4.0 and later. A list of applications for the cluster. Valid values are: \"Hadoop\", \"Hive\", \"Mahout\", \"Pig\", and \"Spark.\" They are case insensitive.

" }, "Configurations":{ "shape":"ConfigurationList", - "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for the EMR cluster you are creating.

" + "documentation":"

For Amazon EMR releases 4.0 and later. The list of configurations supplied for the EMR cluster you are creating.

" }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the job flow. If it is set to false, only the IAM user that created the job flow can view and manage it.

" + "documentation":"

Whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the cluster. If it is set to false, only the IAM user that created the cluster can view and manage it.

" }, "JobFlowRole":{ "shape":"XmlString", - "documentation":"

An IAM role for the job flow. The EC2 instances of the job flow assume this role. The default role is EMRJobflowDefault. In order to use the default role, you must have already created it using the CLI.

" + "documentation":"

Also called instance profile and EC2 role. An IAM role for an EMR cluster. The EC2 instances of the cluster assume this role. The default role is EMR_EC2_DefaultRole. In order to use the default role, you must have already created it using the CLI or console.

" }, "ServiceRole":{ "shape":"XmlString", @@ -2027,6 +2936,34 @@ "Tags":{ "shape":"TagList", "documentation":"

A list of tags to associate with a cluster and propagate to Amazon EC2 instances.

" + }, + "SecurityConfiguration":{ + "shape":"XmlString", + "documentation":"

The name of a security configuration to apply to the cluster.

" + }, + "AutoScalingRole":{ + "shape":"XmlString", + "documentation":"

An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.

" + }, + "ScaleDownBehavior":{ + "shape":"ScaleDownBehavior", + "documentation":"

Specifies the way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR blacklists and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon EMR version 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.

" + }, + "CustomAmiId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it launches cluster EC2 instances. For more information about custom AMIs in Amazon EMR, see Using a Custom AMI in the Amazon EMR Management Guide. If omitted, the cluster uses the base Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and 3.x, use AmiVersion instead.

For information about creating a custom AMI, see Creating an Amazon EBS-Backed Linux AMI in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For information about finding an AMI ID, see Finding a Linux AMI.

" + }, + "EbsRootVolumeSize":{ + "shape":"Integer", + "documentation":"

The size, in GiB, of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.

" + }, + "RepoUpgradeOnBoot":{ + "shape":"RepoUpgradeOnBoot", + "documentation":"

Applies only when CustomAmiID is used. Specifies which updates from the Amazon Linux AMI package repositories to apply automatically when the instance boots using the AMI. If omitted, the default is SECURITY, which indicates that only security updates are applied. If NONE is specified, no updates are applied, and all updates must be applied manually.

" + }, + "KerberosAttributes":{ + "shape":"KerberosAttributes", + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" } }, "documentation":"

Input to the RunJobFlow operation.

" @@ -2041,6 +2978,88 @@ }, "documentation":"

The result of the RunJobFlow operation.

" }, + "ScaleDownBehavior":{ + "type":"string", + "enum":[ + "TERMINATE_AT_INSTANCE_HOUR", + "TERMINATE_AT_TASK_COMPLETION" + ] + }, + "ScalingAction":{ + "type":"structure", + "required":["SimpleScalingPolicyConfiguration"], + "members":{ + "Market":{ + "shape":"MarketType", + "documentation":"

Not available for instance groups. Instance groups use the market type specified for the group.

" + }, + "SimpleScalingPolicyConfiguration":{ + "shape":"SimpleScalingPolicyConfiguration", + "documentation":"

The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.

" + } + }, + "documentation":"

The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.

" + }, + "ScalingConstraints":{ + "type":"structure", + "required":[ + "MinCapacity", + "MaxCapacity" + ], + "members":{ + "MinCapacity":{ + "shape":"Integer", + "documentation":"

The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.

" + }, + "MaxCapacity":{ + "shape":"Integer", + "documentation":"

The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.

" + } + }, + "documentation":"

The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activities triggered by automatic scaling rules will not cause an instance group to grow above or below these limits.

" + }, + "ScalingRule":{ + "type":"structure", + "required":[ + "Name", + "Action", + "Trigger" + ], + "members":{ + "Name":{ + "shape":"String", + "documentation":"

The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.

" + }, + "Description":{ + "shape":"String", + "documentation":"

A friendly, more verbose description of the automatic scaling rule.

" + }, + "Action":{ + "shape":"ScalingAction", + "documentation":"

The conditions that trigger an automatic scaling activity.

" + }, + "Trigger":{ + "shape":"ScalingTrigger", + "documentation":"

The CloudWatch alarm definition that determines when automatic scaling activity is triggered.

" + } + }, + "documentation":"

A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.

" + }, + "ScalingRuleList":{ + "type":"list", + "member":{"shape":"ScalingRule"} + }, + "ScalingTrigger":{ + "type":"structure", + "required":["CloudWatchAlarmDefinition"], + "members":{ + "CloudWatchAlarmDefinition":{ + "shape":"CloudWatchAlarmDefinition", + "documentation":"

The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.

" + } + }, + "documentation":"

The conditions that trigger an automatic scaling activity.

" + }, "ScriptBootstrapActionConfig":{ "type":"structure", "required":["Path"], @@ -2056,6 +3075,24 @@ }, "documentation":"

Configuration of the script to run during a bootstrap action.

" }, + "SecurityConfigurationList":{ + "type":"list", + "member":{"shape":"SecurityConfigurationSummary"} + }, + "SecurityConfigurationSummary":{ + "type":"structure", + "members":{ + "Name":{ + "shape":"XmlString", + "documentation":"

The name of the security configuration.

" + }, + "CreationDateTime":{ + "shape":"Date", + "documentation":"

The date and time the security configuration was created.

" + } + }, + "documentation":"

The creation date and time, and name, of a security configuration.

" + }, "SecurityGroupsList":{ "type":"list", "member":{"shape":"XmlStringMaxLen256"} @@ -2069,11 +3106,11 @@ "members":{ "JobFlowIds":{ "shape":"XmlStringList", - "documentation":"

A list of strings that uniquely identify the job flows to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

" + "documentation":"

A list of strings that uniquely identify the clusters to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .

" }, "TerminationProtected":{ "shape":"Boolean", - "documentation":"

A Boolean that indicates whether to protect the job flow and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

" + "documentation":"

A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.

" } }, "documentation":"

The input argument to the TerminationProtection operation.

" @@ -2091,11 +3128,83 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Whether the specified job flows are visible to all IAM users of the AWS account associated with the job flow. If this value is set to True, all IAM users of that AWS account can view and, if they have the proper IAM policy permissions set, manage the job flows. If it is set to False, only the IAM user that created a job flow can view and manage it.

" + "documentation":"

Whether the specified clusters are visible to all IAM users of the AWS account associated with the cluster. If this value is set to True, all IAM users of that AWS account can view and, if they have the proper IAM policy permissions set, manage the clusters. If it is set to False, only the IAM user that created a cluster can view and manage it.

" } }, "documentation":"

The input to the SetVisibleToAllUsers action.

" }, + "ShrinkPolicy":{ + "type":"structure", + "members":{ + "DecommissionTimeout":{ + "shape":"Integer", + "documentation":"

The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout.

" + }, + "InstanceResizePolicy":{ + "shape":"InstanceResizePolicy", + "documentation":"

Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.

" + } + }, + "documentation":"

Policy for customizing shrink operations. Allows configuration of decommissioning timeout and targeted instance shrinking.

" + }, + "SimpleScalingPolicyConfiguration":{ + "type":"structure", + "required":["ScalingAdjustment"], + "members":{ + "AdjustmentType":{ + "shape":"AdjustmentType", + "documentation":"

The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment, which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment, which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment, which should be expressed as a positive integer.

" + }, + "ScalingAdjustment":{ + "shape":"Integer", + "documentation":"

The amount by which to scale in or scale out, based on the specified AdjustmentType. A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY, the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY, the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.

" + }, + "CoolDown":{ + "shape":"Integer", + "documentation":"

The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.

" + } + }, + "documentation":"

An automatic scaling configuration, which describes how the policy adds or removes instances, the cooldown period, and the number of EC2 instances that will be added each time the CloudWatch metric alarm condition is satisfied.

" + }, + "SpotProvisioningSpecification":{ + "type":"structure", + "required":[ + "TimeoutDurationMinutes", + "TimeoutAction" + ], + "members":{ + "TimeoutDurationMinutes":{ + "shape":"WholeNumber", + "documentation":"

The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.

" + }, + "TimeoutAction":{ + "shape":"SpotProvisioningTimeoutAction", + "documentation":"

The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired. Spot instances are not uprovisioned within the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.

" + }, + "BlockDurationMinutes":{ + "shape":"WholeNumber", + "documentation":"

The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.

" + } + }, + "documentation":"

The launch specification for Spot instances in the instance fleet, which determines the defined duration and provisioning timeout behavior.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + }, + "SpotProvisioningTimeoutAction":{ + "type":"string", + "enum":[ + "SWITCH_TO_ON_DEMAND", + "TERMINATE_CLUSTER" + ] + }, + "Statistic":{ + "type":"string", + "enum":[ + "SAMPLE_COUNT", + "AVERAGE", + "SUM", + "MINIMUM", + "MAXIMUM" + ] + }, "Step":{ "type":"structure", "members":{ @@ -2109,15 +3218,15 @@ }, "Config":{ "shape":"HadoopStepConfig", - "documentation":"

The Hadoop job configuration of the cluster step.

" + "documentation":"

The Hadoop job configuration of the cluster step.

" }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" + "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" }, "Status":{ "shape":"StepStatus", - "documentation":"

The current execution status details of the cluster step.

" + "documentation":"

The current execution status details of the cluster step.

" } }, "documentation":"

This represents a step in a cluster.

" @@ -2131,18 +3240,18 @@ "members":{ "Name":{ "shape":"XmlStringMaxLen256", - "documentation":"

The name of the job flow step.

" + "documentation":"

The name of the step.

" }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

The action to take if the job flow step fails.

" + "documentation":"

The action to take if the step fails.

" }, "HadoopJarStep":{ "shape":"HadoopJarStepConfig", - "documentation":"

The JAR file used for the job flow step.

" + "documentation":"

The JAR file used for the step.

" } }, - "documentation":"

Specification of a job flow step.

" + "documentation":"

Specification of a cluster (job flow) step.

" }, "StepConfigList":{ "type":"list", @@ -2191,7 +3300,7 @@ "members":{ "State":{ "shape":"StepExecutionState", - "documentation":"

The state of the job flow step.

" + "documentation":"

The state of the step.

" }, "CreationDateTime":{ "shape":"Date", @@ -2221,6 +3330,7 @@ "type":"string", "enum":[ "PENDING", + "CANCEL_PENDING", "RUNNING", "COMPLETED", "CANCELLED", @@ -2233,14 +3343,14 @@ "members":{ "Code":{ "shape":"StepStateChangeReasonCode", - "documentation":"

The programmable code for the state change reason. Note: Currently, the service provides no code for the state change.

" + "documentation":"

The programmable code for the state change reason. Note: Currently, the service provides no code for the state change.

" }, "Message":{ "shape":"String", - "documentation":"

The descriptive message for the state change reason.

" + "documentation":"

The descriptive message for the state change reason.

" } }, - "documentation":"

The details of the step state change reason.

" + "documentation":"

The details of the step state change reason.

" }, "StepStateChangeReasonCode":{ "type":"string", @@ -2255,41 +3365,45 @@ "members":{ "State":{ "shape":"StepState", - "documentation":"

The execution state of the cluster step.

" + "documentation":"

The execution state of the cluster step.

" }, "StateChangeReason":{ "shape":"StepStateChangeReason", - "documentation":"

The reason for the step execution status change.

" + "documentation":"

The reason for the step execution status change.

" + }, + "FailureDetails":{ + "shape":"FailureDetails", + "documentation":"

The details for the step failure including reason, message, and log file path where the root cause was identified.

" }, "Timeline":{ "shape":"StepTimeline", - "documentation":"

The timeline of the cluster step status over time.

" + "documentation":"

The timeline of the cluster step status over time.

" } }, - "documentation":"

The execution status details of the cluster step.

" + "documentation":"

The execution status details of the cluster step.

" }, "StepSummary":{ "type":"structure", "members":{ "Id":{ "shape":"StepId", - "documentation":"

The identifier of the cluster step.

" + "documentation":"

The identifier of the cluster step.

" }, "Name":{ "shape":"String", - "documentation":"

The name of the cluster step.

" + "documentation":"

The name of the cluster step.

" }, "Config":{ "shape":"HadoopStepConfig", - "documentation":"

The Hadoop job configuration of the cluster step.

" + "documentation":"

The Hadoop job configuration of the cluster step.

" }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" + "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" }, "Status":{ "shape":"StepStatus", - "documentation":"

The current execution status details of the cluster step.

" + "documentation":"

The current execution status details of the cluster step.

" } }, "documentation":"

The summary of the cluster step.

" @@ -2303,18 +3417,18 @@ "members":{ "CreationDateTime":{ "shape":"Date", - "documentation":"

The date and time when the cluster step was created.

" + "documentation":"

The date and time when the cluster step was created.

" }, "StartDateTime":{ "shape":"Date", - "documentation":"

The date and time when the cluster step execution started.

" + "documentation":"

The date and time when the cluster step execution started.

" }, "EndDateTime":{ "shape":"Date", - "documentation":"

The date and time when the cluster step execution completed or failed.

" + "documentation":"

The date and time when the cluster step execution completed or failed.

" } }, - "documentation":"

The timeline of the cluster step lifecycle.

" + "documentation":"

The timeline of the cluster step lifecycle.

" }, "String":{"type":"string"}, "StringList":{ @@ -2338,7 +3452,7 @@ "documentation":"

The list of user-supplied arguments.

" } }, - "documentation":"

The list of supported product configurations which allow user-supplied arguments. EMR accepts these arguments and forwards them to the corresponding installation script as bootstrap action arguments.

" + "documentation":"

The list of supported product configurations which allow user-supplied arguments. EMR accepts these arguments and forwards them to the corresponding installation script as bootstrap action arguments.

" }, "SupportedProductsList":{ "type":"list", @@ -2349,14 +3463,14 @@ "members":{ "Key":{ "shape":"String", - "documentation":"

A user-defined key, which is the minimum required information for a valid tag. For more information, see Tagging Amazon EMR Resources.

" + "documentation":"

A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .

" }, "Value":{ "shape":"String", - "documentation":"

A user-defined value, which is optional in a tag. For more information, see Tagging Amazon EMR Resources.

" + "documentation":"

A user-defined value, which is optional in a tag. For more information, see Tag Clusters.

" } }, - "documentation":"

A key/value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clu\\ sters to track your Amazon EMR resource allocation costs. For more information, see Tagging Amazon EMR Resources.

" + "documentation":"

A key/value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" }, "TagList":{ "type":"list", @@ -2373,10 +3487,68 @@ }, "documentation":"

Input to the TerminateJobFlows operation.

" }, + "Unit":{ + "type":"string", + "enum":[ + "NONE", + "SECONDS", + "MICRO_SECONDS", + "MILLI_SECONDS", + "BYTES", + "KILO_BYTES", + "MEGA_BYTES", + "GIGA_BYTES", + "TERA_BYTES", + "BITS", + "KILO_BITS", + "MEGA_BITS", + "GIGA_BITS", + "TERA_BITS", + "PERCENT", + "COUNT", + "BYTES_PER_SECOND", + "KILO_BYTES_PER_SECOND", + "MEGA_BYTES_PER_SECOND", + "GIGA_BYTES_PER_SECOND", + "TERA_BYTES_PER_SECOND", + "BITS_PER_SECOND", + "KILO_BITS_PER_SECOND", + "MEGA_BITS_PER_SECOND", + "GIGA_BITS_PER_SECOND", + "TERA_BITS_PER_SECOND", + "COUNT_PER_SECOND" + ] + }, + "VolumeSpecification":{ + "type":"structure", + "required":[ + "VolumeType", + "SizeInGB" + ], + "members":{ + "VolumeType":{ + "shape":"String", + "documentation":"

The volume type. Volume types supported are gp2, io1, standard.

" + }, + "Iops":{ + "shape":"Integer", + "documentation":"

The number of I/O operations per second (IOPS) that the volume supports.

" + }, + "SizeInGB":{ + "shape":"Integer", + "documentation":"

The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.

" + } + }, + "documentation":"

EBS volume specifications such as volume type, IOPS, and size (GiB) that will be requested for the EBS volume attached to an EC2 instance in the cluster.

" + }, + "WholeNumber":{ + "type":"integer", + "min":0 + }, "XmlString":{ "type":"string", - "min":0, "max":10280, + "min":0, "pattern":"[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*" }, "XmlStringList":{ @@ -2385,11 +3557,14 @@ }, "XmlStringMaxLen256":{ "type":"string", - "min":0, "max":256, + "min":0, "pattern":"[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*" + }, + "XmlStringMaxLen256List":{ + "type":"list", + "member":{"shape":"XmlStringMaxLen256"} } }, - "examples":{ - } + "documentation":"

Amazon EMR is a web service that makes it easy to process large amounts of data efficiently. Amazon EMR uses Hadoop processing combined with several AWS products to do tasks such as web indexing, data mining, log file analysis, machine learning, scientific simulation, and data warehousing.

" } diff --git a/input/emr/2009-03-31/waiters-2.json b/input/emr/2009-03-31/waiters-2.json index 9c68bdda0..abba8c3c2 100644 --- a/input/emr/2009-03-31/waiters-2.json +++ b/input/emr/2009-03-31/waiters-2.json @@ -37,6 +37,50 @@ "expected": "TERMINATED_WITH_ERRORS" } ] + }, + "StepComplete": { + "delay": 30, + "operation": "DescribeStep", + "maxAttempts": 60, + "acceptors": [ + { + "state": "success", + "matcher": "path", + "argument": "Step.Status.State", + "expected": "COMPLETED" + }, + { + "state": "failure", + "matcher": "path", + "argument": "Step.Status.State", + "expected": "FAILED" + }, + { + "state": "failure", + "matcher": "path", + "argument": "Step.Status.State", + "expected": "CANCELLED" + } + ] + }, + "ClusterTerminated": { + "delay": 30, + "operation": "DescribeCluster", + "maxAttempts": 60, + "acceptors": [ + { + "state": "success", + "matcher": "path", + "argument": "Cluster.Status.State", + "expected": "TERMINATED" + }, + { + "state": "failure", + "matcher": "path", + "argument": "Cluster.Status.State", + "expected": "TERMINATED_WITH_ERRORS" + } + ] } } } From c0d5cad25d2e03f531a888bdf4159fcc15eb1e9a Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Fri, 6 Sep 2019 08:07:45 +1000 Subject: [PATCH 6/8] Run EMR code gen. --- ...apreduce.opam => aws-elasticmapreduce.opam | 2 +- lib/endpoints.ml | 1 - .../elasticmapreduce/lib/addInstanceFleet.ml | 59 + .../elasticmapreduce/lib/addInstanceFleet.mli | 10 + .../elasticmapreduce/lib/addInstanceGroups.ml | 71 +- .../lib/addInstanceGroups.mli | 7 +- .../elasticmapreduce/lib/addJobFlowSteps.ml | 69 +- .../elasticmapreduce/lib/addJobFlowSteps.mli | 7 +- libraries/elasticmapreduce/lib/addTags.ml | 30 +- libraries/elasticmapreduce/lib/addTags.mli | 7 +- libraries/elasticmapreduce/lib/cancelSteps.ml | 57 + .../elasticmapreduce/lib/cancelSteps.mli | 10 + .../lib/createSecurityConfiguration.ml | 62 + .../lib/createSecurityConfiguration.mli | 10 + .../lib/deleteSecurityConfiguration.ml | 37 + .../lib/deleteSecurityConfiguration.mli | 10 + .../elasticmapreduce/lib/describeCluster.ml | 67 +- .../elasticmapreduce/lib/describeCluster.mli | 7 +- .../elasticmapreduce/lib/describeJobFlows.ml | 70 +- .../elasticmapreduce/lib/describeJobFlows.mli | 7 +- .../lib/describeSecurityConfiguration.ml | 62 + .../lib/describeSecurityConfiguration.mli | 10 + .../elasticmapreduce/lib/describeStep.ml | 66 +- .../elasticmapreduce/lib/describeStep.mli | 7 +- libraries/elasticmapreduce/lib/dune | 7 +- .../elasticmapreduce/lib/errors_internal.ml | 121 +- .../lib/listBootstrapActions.ml | 69 +- .../lib/listBootstrapActions.mli | 7 +- .../elasticmapreduce/lib/listClusters.ml | 66 +- .../elasticmapreduce/lib/listClusters.mli | 7 +- .../lib/listInstanceFleets.ml | 59 + .../lib/listInstanceFleets.mli | 10 + .../lib/listInstanceGroups.ml | 69 +- .../lib/listInstanceGroups.mli | 7 +- .../elasticmapreduce/lib/listInstances.ml | 66 +- .../elasticmapreduce/lib/listInstances.mli | 7 +- .../lib/listSecurityConfigurations.ml | 62 + .../lib/listSecurityConfigurations.mli | 10 + libraries/elasticmapreduce/lib/listSteps.ml | 64 +- libraries/elasticmapreduce/lib/listSteps.mli | 7 +- .../lib/modifyInstanceFleet.ml | 36 + .../lib/modifyInstanceFleet.mli | 10 + .../lib/modifyInstanceGroups.ml | 32 +- .../lib/modifyInstanceGroups.mli | 7 +- .../lib/putAutoScalingPolicy.ml | 59 + .../lib/putAutoScalingPolicy.mli | 10 + .../lib/removeAutoScalingPolicy.ml | 37 + .../lib/removeAutoScalingPolicy.mli | 10 + libraries/elasticmapreduce/lib/removeTags.ml | 31 +- libraries/elasticmapreduce/lib/removeTags.mli | 7 +- libraries/elasticmapreduce/lib/runJobFlow.ml | 67 +- libraries/elasticmapreduce/lib/runJobFlow.mli | 7 +- .../lib/setTerminationProtection.ml | 32 +- .../lib/setTerminationProtection.mli | 7 +- .../lib/setVisibleToAllUsers.ml | 32 +- .../lib/setVisibleToAllUsers.mli | 7 +- .../elasticmapreduce/lib/terminateJobFlows.ml | 32 +- .../lib/terminateJobFlows.mli | 7 +- libraries/elasticmapreduce/lib/types.ml | 13771 ++++++++++------ .../lib_test/aws_elasticmapreduce_test.ml | 146 +- libraries/elasticmapreduce/lib_test/dune | 25 +- .../elasticmapreduce/lib_test/test_async.ml | 16 +- .../elasticmapreduce/lib_test/test_lwt.ml | 16 +- libraries/sts/lib_test/test_async.ml | 4 +- 64 files changed, 10117 insertions(+), 5674 deletions(-) rename aws_elasticmapreduce.opam => aws-elasticmapreduce.opam (97%) create mode 100644 libraries/elasticmapreduce/lib/addInstanceFleet.ml create mode 100644 libraries/elasticmapreduce/lib/addInstanceFleet.mli create mode 100644 libraries/elasticmapreduce/lib/cancelSteps.ml create mode 100644 libraries/elasticmapreduce/lib/cancelSteps.mli create mode 100644 libraries/elasticmapreduce/lib/createSecurityConfiguration.ml create mode 100644 libraries/elasticmapreduce/lib/createSecurityConfiguration.mli create mode 100644 libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml create mode 100644 libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli create mode 100644 libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml create mode 100644 libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli create mode 100644 libraries/elasticmapreduce/lib/listInstanceFleets.ml create mode 100644 libraries/elasticmapreduce/lib/listInstanceFleets.mli create mode 100644 libraries/elasticmapreduce/lib/listSecurityConfigurations.ml create mode 100644 libraries/elasticmapreduce/lib/listSecurityConfigurations.mli create mode 100644 libraries/elasticmapreduce/lib/modifyInstanceFleet.ml create mode 100644 libraries/elasticmapreduce/lib/modifyInstanceFleet.mli create mode 100644 libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml create mode 100644 libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli create mode 100644 libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml create mode 100644 libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli diff --git a/aws_elasticmapreduce.opam b/aws-elasticmapreduce.opam similarity index 97% rename from aws_elasticmapreduce.opam rename to aws-elasticmapreduce.opam index 439c0d563..8841f2479 100644 --- a/aws_elasticmapreduce.opam +++ b/aws-elasticmapreduce.opam @@ -18,5 +18,5 @@ build: [ ] depends: [ "aws" {>= "0.1.0"} - "dune" {build} + "dune" ] diff --git a/lib/endpoints.ml b/lib/endpoints.ml index f065eac34..2ba20e0b2 100644 --- a/lib/endpoints.ml +++ b/lib/endpoints.ml @@ -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 = diff --git a/libraries/elasticmapreduce/lib/addInstanceFleet.ml b/libraries/elasticmapreduce/lib/addInstanceFleet.ml new file mode 100644 index 000000000..9a43df61f --- /dev/null +++ b/libraries/elasticmapreduce/lib/addInstanceFleet.ml @@ -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 diff --git a/libraries/elasticmapreduce/lib/addInstanceFleet.mli b/libraries/elasticmapreduce/lib/addInstanceFleet.mli new file mode 100644 index 000000000..3d30c5af9 --- /dev/null +++ b/libraries/elasticmapreduce/lib/addInstanceFleet.mli @@ -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 diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.ml b/libraries/elasticmapreduce/lib/addInstanceGroups.ml index b86673eab..863f3343e 100644 --- a/libraries/elasticmapreduce/lib/addInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.ml @@ -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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.mli b/libraries/elasticmapreduce/lib/addInstanceGroups.mli index f8b16b12a..2abedad93 100644 --- a/libraries/elasticmapreduce/lib/addInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.mli @@ -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) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml index 17618aabf..7016344a2 100644 --- a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml @@ -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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.mli b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli index 0ee5d2483..4d6479969 100644 --- a/libraries/elasticmapreduce/lib/addJobFlowSteps.mli +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli @@ -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) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/addTags.ml b/libraries/elasticmapreduce/lib/addTags.ml index 731ec5bc6..ea1aaa99d 100644 --- a/libraries/elasticmapreduce/lib/addTags.ml +++ b/libraries/elasticmapreduce/lib/addTags.ml @@ -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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/addTags.mli b/libraries/elasticmapreduce/lib/addTags.mli index c14e3958b..c407166aa 100644 --- a/libraries/elasticmapreduce/lib/addTags.mli +++ b/libraries/elasticmapreduce/lib/addTags.mli @@ -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) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/cancelSteps.ml b/libraries/elasticmapreduce/lib/cancelSteps.ml new file mode 100644 index 000000000..7c5bde01d --- /dev/null +++ b/libraries/elasticmapreduce/lib/cancelSteps.ml @@ -0,0 +1,57 @@ +open Types +open Aws + +type input = CancelStepsInput.t + +type output = CancelStepsOutput.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", [ "CancelSteps" ] ] + (Util.drop_empty + (Uri.query_of_encoded (Query.render (CancelStepsInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "CancelStepsResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp CancelStepsOutput.parse) + (let open Error in + BadResponse { body; message = "Could not find well formed CancelStepsOutput." }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing CancelStepsOutput - 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 diff --git a/libraries/elasticmapreduce/lib/cancelSteps.mli b/libraries/elasticmapreduce/lib/cancelSteps.mli new file mode 100644 index 000000000..49e909f8f --- /dev/null +++ b/libraries/elasticmapreduce/lib/cancelSteps.mli @@ -0,0 +1,10 @@ +open Types + +type input = CancelStepsInput.t + +type output = CancelStepsOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml new file mode 100644 index 000000000..4f580ab7f --- /dev/null +++ b/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml @@ -0,0 +1,62 @@ +open Types +open Aws + +type input = CreateSecurityConfigurationInput.t + +type output = CreateSecurityConfigurationOutput.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", [ "CreateSecurityConfiguration" ] ] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (CreateSecurityConfigurationInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "CreateSecurityConfigurationResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp CreateSecurityConfigurationOutput.parse) + (let open Error in + BadResponse + { body + ; message = "Could not find well formed CreateSecurityConfigurationOutput." + }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing CreateSecurityConfigurationOutput - 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 diff --git a/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli new file mode 100644 index 000000000..1ef1d0f21 --- /dev/null +++ b/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli @@ -0,0 +1,10 @@ +open Types + +type input = CreateSecurityConfigurationInput.t + +type output = CreateSecurityConfigurationOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml new file mode 100644 index 000000000..6b7980ce0 --- /dev/null +++ b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml @@ -0,0 +1,37 @@ +open Types +open Aws + +type input = DeleteSecurityConfigurationInput.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", [ "DeleteSecurityConfiguration" ] ] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DeleteSecurityConfigurationInput.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 diff --git a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli new file mode 100644 index 000000000..f5f80664d --- /dev/null +++ b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli @@ -0,0 +1,10 @@ +open Types + +type input = DeleteSecurityConfigurationInput.t + +type output = unit + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/describeCluster.ml b/libraries/elasticmapreduce/lib/describeCluster.ml index 3740b91f1..d014f1807 100644 --- a/libraries/elasticmapreduce/lib/describeCluster.ml +++ b/libraries/elasticmapreduce/lib/describeCluster.ml @@ -1,57 +1,58 @@ open Types open Aws + type input = DescribeClusterInput.t + type output = DescribeClusterOutput.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", ["DescribeCluster"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "DescribeCluster" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (DescribeClusterInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (DescribeClusterInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeClusterResponse" (snd xml) in try - Util.or_error (Util.option_bind resp DescribeClusterOutput.parse) + Util.or_error + (Util.option_bind resp DescribeClusterOutput.parse) (let open Error in - BadResponse - { - body; - message = "Could not find well formed DescribeClusterOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing DescribeClusterOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse + { body; message = "Could not find well formed DescribeClusterOutput." }) + 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 DescribeClusterOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/describeCluster.mli b/libraries/elasticmapreduce/lib/describeCluster.mli index 1783e849c..5ce8ada8f 100644 --- a/libraries/elasticmapreduce/lib/describeCluster.mli +++ b/libraries/elasticmapreduce/lib/describeCluster.mli @@ -1,7 +1,10 @@ open Types + type input = DescribeClusterInput.t + type output = DescribeClusterOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.ml b/libraries/elasticmapreduce/lib/describeJobFlows.ml index d23e59710..1b7e40ef4 100644 --- a/libraries/elasticmapreduce/lib/describeJobFlows.ml +++ b/libraries/elasticmapreduce/lib/describeJobFlows.ml @@ -1,57 +1,59 @@ open Types open Aws + type input = DescribeJobFlowsInput.t + type output = DescribeJobFlowsOutput.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", ["DescribeJobFlows"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "DescribeJobFlows" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (DescribeJobFlowsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (DescribeJobFlowsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeJobFlowsResponse" (snd xml) in try - Util.or_error (Util.option_bind resp DescribeJobFlowsOutput.parse) + Util.or_error + (Util.option_bind resp DescribeJobFlowsOutput.parse) (let open Error in - BadResponse - { - body; - message = "Could not find well formed DescribeJobFlowsOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing DescribeJobFlowsOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse + { body; message = "Could not find well formed DescribeJobFlowsOutput." }) + 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 DescribeJobFlowsOutput - 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.mli b/libraries/elasticmapreduce/lib/describeJobFlows.mli index 41738ac9a..c524b971a 100644 --- a/libraries/elasticmapreduce/lib/describeJobFlows.mli +++ b/libraries/elasticmapreduce/lib/describeJobFlows.mli @@ -1,7 +1,10 @@ open Types + type input = DescribeJobFlowsInput.t + type output = DescribeJobFlowsOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml new file mode 100644 index 000000000..463b92d9d --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml @@ -0,0 +1,62 @@ +open Types +open Aws + +type input = DescribeSecurityConfigurationInput.t + +type output = DescribeSecurityConfigurationOutput.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", [ "DescribeSecurityConfiguration" ] ] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DescribeSecurityConfigurationInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "DescribeSecurityConfigurationResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp DescribeSecurityConfigurationOutput.parse) + (let open Error in + BadResponse + { body + ; message = "Could not find well formed DescribeSecurityConfigurationOutput." + }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing DescribeSecurityConfigurationOutput - 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 diff --git a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli new file mode 100644 index 000000000..fee5c0e1a --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli @@ -0,0 +1,10 @@ +open Types + +type input = DescribeSecurityConfigurationInput.t + +type output = DescribeSecurityConfigurationOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/describeStep.ml b/libraries/elasticmapreduce/lib/describeStep.ml index 953a0cffa..efe7109b8 100644 --- a/libraries/elasticmapreduce/lib/describeStep.ml +++ b/libraries/elasticmapreduce/lib/describeStep.ml @@ -1,57 +1,57 @@ open Types open Aws + type input = DescribeStepInput.t + type output = DescribeStepOutput.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", ["DescribeStep"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "DescribeStep" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (DescribeStepInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (DescribeStepInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeStepResponse" (snd xml) in try - Util.or_error (Util.option_bind resp DescribeStepOutput.parse) + Util.or_error + (Util.option_bind resp DescribeStepOutput.parse) (let open Error in - BadResponse - { - body; - message = "Could not find well formed DescribeStepOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing DescribeStepOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse { body; message = "Could not find well formed DescribeStepOutput." }) + 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 DescribeStepOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/describeStep.mli b/libraries/elasticmapreduce/lib/describeStep.mli index 8871af090..74c79349d 100644 --- a/libraries/elasticmapreduce/lib/describeStep.mli +++ b/libraries/elasticmapreduce/lib/describeStep.mli @@ -1,7 +1,10 @@ open Types + type input = DescribeStepInput.t + type output = DescribeStepOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/dune b/libraries/elasticmapreduce/lib/dune index 0a8d7b51b..fd6e572f2 100644 --- a/libraries/elasticmapreduce/lib/dune +++ b/libraries/elasticmapreduce/lib/dune @@ -1,6 +1,7 @@ (library - (name aws_elasticmapreduce) - (public_name aws_elasticmapreduce) + (name aws_elasticmapreduce) + (public_name aws-elasticmapreduce) (synopsis "aws-Amazon Elastic MapReduce") - (flags (:standard -w -27)) + (flags + (:standard -w -27)) (libraries aws)) diff --git a/libraries/elasticmapreduce/lib/errors_internal.ml b/libraries/elasticmapreduce/lib/errors_internal.ml index 08cd36c3f..21ef98bf5 100644 --- a/libraries/elasticmapreduce/lib/errors_internal.ml +++ b/libraries/elasticmapreduce/lib/errors_internal.ml @@ -1,60 +1,64 @@ type t = - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InternalServerException - | InvalidAction - | InvalidClientTokenId - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidRequestException - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InternalServerError + | InternalServerException + | InvalidAction + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidRequestException + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited + let common = - [UnsupportedProtocol; - UnknownParameter; - UnauthorizedOperation; - RequestLimitExceeded; - PendingVerification; - InvalidParameter; - IdempotentParameterMismatch; - DryRunOperation; - Blocked; - AuthFailure; - ValidationError; - Throttling; - ServiceUnavailable; - RequestExpired; - OptInRequired; - MissingParameter; - MissingAuthenticationToken; - MissingAction; - MalformedQueryString; - InvalidQueryParameter; - InvalidParameterValue; - InvalidParameterCombination; - InvalidClientTokenId; - InvalidAction; - InternalFailure; - IncompleteSignature] + [ UnsupportedProtocol + ; UnknownParameter + ; UnauthorizedOperation + ; RequestLimitExceeded + ; PendingVerification + ; InvalidParameter + ; IdempotentParameterMismatch + ; DryRunOperation + ; Blocked + ; AuthFailure + ; ValidationError + ; Throttling + ; ServiceUnavailable + ; RequestExpired + ; OptInRequired + ; MissingParameter + ; MissingAuthenticationToken + ; MissingAction + ; MalformedQueryString + ; InvalidQueryParameter + ; InvalidParameterValue + ; InvalidParameterCombination + ; InvalidClientTokenId + ; InvalidAction + ; InternalFailure + ; IncompleteSignature + ] + let to_http_code e = match e with | AuthFailure -> None @@ -63,6 +67,7 @@ let to_http_code e = | IdempotentParameterMismatch -> None | IncompleteSignature -> Some 400 | InternalFailure -> Some 500 + | InternalServerError -> None | InternalServerException -> None | InvalidAction -> Some 400 | InvalidClientTokenId -> Some 403 @@ -86,6 +91,7 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None + let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -94,6 +100,7 @@ let to_string e = | IdempotentParameterMismatch -> "IdempotentParameterMismatch" | IncompleteSignature -> "IncompleteSignature" | InternalFailure -> "InternalFailure" + | InternalServerError -> "InternalServerError" | InternalServerException -> "InternalServerException" | InvalidAction -> "InvalidAction" | InvalidClientTokenId -> "InvalidClientTokenId" @@ -117,6 +124,7 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" + let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -125,6 +133,7 @@ let of_string e = | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch | "IncompleteSignature" -> Some IncompleteSignature | "InternalFailure" -> Some InternalFailure + | "InternalServerError" -> Some InternalServerError | "InternalServerException" -> Some InternalServerException | "InvalidAction" -> Some InvalidAction | "InvalidClientTokenId" -> Some InvalidClientTokenId @@ -148,4 +157,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None \ No newline at end of file + | _ -> None diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.ml b/libraries/elasticmapreduce/lib/listBootstrapActions.ml index 34cfaf1b8..d6058ed0d 100644 --- a/libraries/elasticmapreduce/lib/listBootstrapActions.ml +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.ml @@ -1,58 +1,59 @@ open Types open Aws + type input = ListBootstrapActionsInput.t + type output = ListBootstrapActionsOutput.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", ["ListBootstrapActions"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "ListBootstrapActions" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ListBootstrapActionsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ListBootstrapActionsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListBootstrapActionsResponse" (snd xml) in try - Util.or_error (Util.option_bind resp ListBootstrapActionsOutput.parse) + Util.or_error + (Util.option_bind resp ListBootstrapActionsOutput.parse) (let open Error in - BadResponse - { - body; - message = - "Could not find well formed ListBootstrapActionsOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing ListBootstrapActionsOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse + { body; message = "Could not find well formed ListBootstrapActionsOutput." }) + 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 ListBootstrapActionsOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.mli b/libraries/elasticmapreduce/lib/listBootstrapActions.mli index 6952f38bc..abb1264d0 100644 --- a/libraries/elasticmapreduce/lib/listBootstrapActions.mli +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.mli @@ -1,7 +1,10 @@ open Types + type input = ListBootstrapActionsInput.t + type output = ListBootstrapActionsOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listClusters.ml b/libraries/elasticmapreduce/lib/listClusters.ml index 46baea1b7..81a0660cd 100644 --- a/libraries/elasticmapreduce/lib/listClusters.ml +++ b/libraries/elasticmapreduce/lib/listClusters.ml @@ -1,57 +1,57 @@ open Types open Aws + type input = ListClustersInput.t + type output = ListClustersOutput.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", ["ListClusters"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "ListClusters" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ListClustersInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ListClustersInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListClustersResponse" (snd xml) in try - Util.or_error (Util.option_bind resp ListClustersOutput.parse) + Util.or_error + (Util.option_bind resp ListClustersOutput.parse) (let open Error in - BadResponse - { - body; - message = "Could not find well formed ListClustersOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing ListClustersOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse { body; message = "Could not find well formed ListClustersOutput." }) + 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 ListClustersOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/listClusters.mli b/libraries/elasticmapreduce/lib/listClusters.mli index 17a20059e..162a86c58 100644 --- a/libraries/elasticmapreduce/lib/listClusters.mli +++ b/libraries/elasticmapreduce/lib/listClusters.mli @@ -1,7 +1,10 @@ open Types + type input = ListClustersInput.t + type output = ListClustersOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listInstanceFleets.ml b/libraries/elasticmapreduce/lib/listInstanceFleets.ml new file mode 100644 index 000000000..59592afba --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstanceFleets.ml @@ -0,0 +1,59 @@ +open Types +open Aws + +type input = ListInstanceFleetsInput.t + +type output = ListInstanceFleetsOutput.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", [ "ListInstanceFleets" ] ] + (Util.drop_empty + (Uri.query_of_encoded (Query.render (ListInstanceFleetsInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListInstanceFleetsResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp ListInstanceFleetsOutput.parse) + (let open Error in + BadResponse + { body; message = "Could not find well formed ListInstanceFleetsOutput." }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing ListInstanceFleetsOutput - 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 diff --git a/libraries/elasticmapreduce/lib/listInstanceFleets.mli b/libraries/elasticmapreduce/lib/listInstanceFleets.mli new file mode 100644 index 000000000..a920ff8a6 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listInstanceFleets.mli @@ -0,0 +1,10 @@ +open Types + +type input = ListInstanceFleetsInput.t + +type output = ListInstanceFleetsOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.ml b/libraries/elasticmapreduce/lib/listInstanceGroups.ml index 995681844..a33d8ea50 100644 --- a/libraries/elasticmapreduce/lib/listInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.ml @@ -1,58 +1,59 @@ open Types open Aws + type input = ListInstanceGroupsInput.t + type output = ListInstanceGroupsOutput.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", ["ListInstanceGroups"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "ListInstanceGroups" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ListInstanceGroupsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ListInstanceGroupsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListInstanceGroupsResponse" (snd xml) in try - Util.or_error (Util.option_bind resp ListInstanceGroupsOutput.parse) + Util.or_error + (Util.option_bind resp ListInstanceGroupsOutput.parse) (let open Error in - BadResponse - { - body; - message = - "Could not find well formed ListInstanceGroupsOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing ListInstanceGroupsOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse + { body; message = "Could not find well formed ListInstanceGroupsOutput." }) + 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 ListInstanceGroupsOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.mli b/libraries/elasticmapreduce/lib/listInstanceGroups.mli index d12808bdd..bf03f65ec 100644 --- a/libraries/elasticmapreduce/lib/listInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.mli @@ -1,7 +1,10 @@ open Types + type input = ListInstanceGroupsInput.t + type output = ListInstanceGroupsOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listInstances.ml b/libraries/elasticmapreduce/lib/listInstances.ml index 2bfdd7820..fb8004c39 100644 --- a/libraries/elasticmapreduce/lib/listInstances.ml +++ b/libraries/elasticmapreduce/lib/listInstances.ml @@ -1,57 +1,57 @@ open Types open Aws + type input = ListInstancesInput.t + type output = ListInstancesOutput.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", ["ListInstances"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "ListInstances" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ListInstancesInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ListInstancesInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListInstancesResponse" (snd xml) in try - Util.or_error (Util.option_bind resp ListInstancesOutput.parse) + Util.or_error + (Util.option_bind resp ListInstancesOutput.parse) (let open Error in - BadResponse - { - body; - message = "Could not find well formed ListInstancesOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing ListInstancesOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse { body; message = "Could not find well formed ListInstancesOutput." }) + 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 ListInstancesOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/listInstances.mli b/libraries/elasticmapreduce/lib/listInstances.mli index 8774b3f7f..81f8a294e 100644 --- a/libraries/elasticmapreduce/lib/listInstances.mli +++ b/libraries/elasticmapreduce/lib/listInstances.mli @@ -1,7 +1,10 @@ open Types + type input = ListInstancesInput.t + type output = ListInstancesOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml b/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml new file mode 100644 index 000000000..5e6f9290d --- /dev/null +++ b/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml @@ -0,0 +1,62 @@ +open Types +open Aws + +type input = ListSecurityConfigurationsInput.t + +type output = ListSecurityConfigurationsOutput.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", [ "ListSecurityConfigurations" ] ] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListSecurityConfigurationsInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListSecurityConfigurationsResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp ListSecurityConfigurationsOutput.parse) + (let open Error in + BadResponse + { body + ; message = "Could not find well formed ListSecurityConfigurationsOutput." + }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing ListSecurityConfigurationsOutput - 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 diff --git a/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli b/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli new file mode 100644 index 000000000..92fc5a8f3 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli @@ -0,0 +1,10 @@ +open Types + +type input = ListSecurityConfigurationsInput.t + +type output = ListSecurityConfigurationsOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/listSteps.ml b/libraries/elasticmapreduce/lib/listSteps.ml index 462852bf9..2879a37b8 100644 --- a/libraries/elasticmapreduce/lib/listSteps.ml +++ b/libraries/elasticmapreduce/lib/listSteps.ml @@ -1,54 +1,56 @@ open Types open Aws + type input = ListStepsInput.t + type output = ListStepsOutput.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", ["ListSteps"])] + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [ "Version", [ "2009-03-31" ]; "Action", [ "ListSteps" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ListStepsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ListStepsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListStepsResponse" (snd xml) in try - Util.or_error (Util.option_bind resp ListStepsOutput.parse) + Util.or_error + (Util.option_bind resp ListStepsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListStepsOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing ListStepsOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse { body; message = "Could not find well formed ListStepsOutput." }) + 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 ListStepsOutput - 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)) + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/listSteps.mli b/libraries/elasticmapreduce/lib/listSteps.mli index d76719a19..12a0fc6b3 100644 --- a/libraries/elasticmapreduce/lib/listSteps.mli +++ b/libraries/elasticmapreduce/lib/listSteps.mli @@ -1,7 +1,10 @@ open Types + type input = ListStepsInput.t + type output = ListStepsOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml b/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml new file mode 100644 index 000000000..955b12201 --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml @@ -0,0 +1,36 @@ +open Types +open Aws + +type input = ModifyInstanceFleetInput.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", [ "ModifyInstanceFleet" ] ] + (Util.drop_empty + (Uri.query_of_encoded (Query.render (ModifyInstanceFleetInput.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 diff --git a/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli b/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli new file mode 100644 index 000000000..c45eb271c --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli @@ -0,0 +1,10 @@ +open Types + +type input = ModifyInstanceFleetInput.t + +type output = unit + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml index 944f0f421..ae31119d6 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml @@ -1,30 +1,36 @@ open Types open Aws + type input = ModifyInstanceGroupsInput.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))) + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [("Version", ["2009-03-31"]); ("Action", ["ModifyInstanceGroups"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "ModifyInstanceGroups" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (ModifyInstanceGroupsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (ModifyInstanceGroupsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = `Ok () + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli index d50398fb5..e08b0efb8 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli @@ -1,7 +1,10 @@ open Types + type input = ModifyInstanceGroupsInput.t + type output = unit + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml new file mode 100644 index 000000000..526b15d85 --- /dev/null +++ b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml @@ -0,0 +1,59 @@ +open Types +open Aws + +type input = PutAutoScalingPolicyInput.t + +type output = PutAutoScalingPolicyOutput.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", [ "PutAutoScalingPolicy" ] ] + (Util.drop_empty + (Uri.query_of_encoded (Query.render (PutAutoScalingPolicyInput.to_query req))))) + in + `POST, uri, [] + +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "PutAutoScalingPolicyResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp PutAutoScalingPolicyOutput.parse) + (let open Error in + BadResponse + { body; message = "Could not find well formed PutAutoScalingPolicyOutput." }) + with Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { body + ; message = + "Error parsing PutAutoScalingPolicyOutput - 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 diff --git a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli new file mode 100644 index 000000000..ca2320dae --- /dev/null +++ b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli @@ -0,0 +1,10 @@ +open Types + +type input = PutAutoScalingPolicyInput.t + +type output = PutAutoScalingPolicyOutput.t + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml new file mode 100644 index 000000000..e2b889359 --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml @@ -0,0 +1,37 @@ +open Types +open Aws + +type input = RemoveAutoScalingPolicyInput.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", [ "RemoveAutoScalingPolicy" ] ] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (RemoveAutoScalingPolicyInput.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 diff --git a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli new file mode 100644 index 000000000..e732d46be --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli @@ -0,0 +1,10 @@ +open Types + +type input = RemoveAutoScalingPolicyInput.t + +type output = unit + +type error = Errors_internal.t + +include + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/removeTags.ml b/libraries/elasticmapreduce/lib/removeTags.ml index 1b64b0008..8e190a4d6 100644 --- a/libraries/elasticmapreduce/lib/removeTags.ml +++ b/libraries/elasticmapreduce/lib/removeTags.ml @@ -1,29 +1,36 @@ open Types open Aws + type input = RemoveTagsInput.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", ["RemoveTags"])] + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [ "Version", [ "2009-03-31" ]; "Action", [ "RemoveTags" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (RemoveTagsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (RemoveTagsInput.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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/removeTags.mli b/libraries/elasticmapreduce/lib/removeTags.mli index e9948fe9a..db40a6a91 100644 --- a/libraries/elasticmapreduce/lib/removeTags.mli +++ b/libraries/elasticmapreduce/lib/removeTags.mli @@ -1,7 +1,10 @@ open Types + type input = RemoveTagsInput.t + type output = unit + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/runJobFlow.ml b/libraries/elasticmapreduce/lib/runJobFlow.ml index fca21a44d..9fd0835e8 100644 --- a/libraries/elasticmapreduce/lib/runJobFlow.ml +++ b/libraries/elasticmapreduce/lib/runJobFlow.ml @@ -1,54 +1,57 @@ open Types open Aws + type input = RunJobFlowInput.t + type output = RunJobFlowOutput.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", ["RunJobFlow"])] + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [ "Version", [ "2009-03-31" ]; "Action", [ "RunJobFlow" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (RunJobFlowInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (RunJobFlowInput.to_query req))))) + in + `POST, uri, [] + let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RunJobFlowResponse" (snd xml) in try - Util.or_error (Util.option_bind resp RunJobFlowOutput.parse) + Util.or_error + (Util.option_bind resp RunJobFlowOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RunJobFlowOutput." - }) - with - | Xml.RequiredFieldMissing msg -> - let open Error in - `Error - (BadResponse - { - body; - message = - ("Error parsing RunJobFlowOutput - missing field in body or children: " - ^ msg) - }) - with - | Failure msg -> + BadResponse { body; message = "Could not find well formed RunJobFlowOutput." }) + 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 RunJobFlowOutput - 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/runJobFlow.mli b/libraries/elasticmapreduce/lib/runJobFlow.mli index 7f98c47d5..9ae381049 100644 --- a/libraries/elasticmapreduce/lib/runJobFlow.mli +++ b/libraries/elasticmapreduce/lib/runJobFlow.mli @@ -1,7 +1,10 @@ open Types + type input = RunJobFlowInput.t + type output = RunJobFlowOutput.t + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.ml b/libraries/elasticmapreduce/lib/setTerminationProtection.ml index 81266be59..7955461ac 100644 --- a/libraries/elasticmapreduce/lib/setTerminationProtection.ml +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.ml @@ -1,31 +1,37 @@ open Types open Aws + type input = SetTerminationProtectionInput.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))) + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [("Version", ["2009-03-31"]); - ("Action", ["SetTerminationProtection"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "SetTerminationProtection" ] ] (Util.drop_empty (Uri.query_of_encoded - (Query.render (SetTerminationProtectionInput.to_query req))))) in - (`POST, uri, []) + (Query.render (SetTerminationProtectionInput.to_query req))))) + in + `POST, uri, [] + let of_http body = `Ok () + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.mli b/libraries/elasticmapreduce/lib/setTerminationProtection.mli index 4a60af7b9..ded3618de 100644 --- a/libraries/elasticmapreduce/lib/setTerminationProtection.mli +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.mli @@ -1,7 +1,10 @@ open Types + type input = SetTerminationProtectionInput.t + type output = unit + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml index 8aa76f4d8..9c5bde5d6 100644 --- a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml @@ -1,30 +1,36 @@ open Types open Aws + type input = SetVisibleToAllUsersInput.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))) + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [("Version", ["2009-03-31"]); ("Action", ["SetVisibleToAllUsers"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "SetVisibleToAllUsers" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (SetVisibleToAllUsersInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (SetVisibleToAllUsersInput.to_query req))))) + in + `POST, uri, [] + let of_http body = `Ok () + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli index 33cf90e7b..48ff0217c 100644 --- a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli @@ -1,7 +1,10 @@ open Types + type input = SetVisibleToAllUsersInput.t + type output = unit + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.ml b/libraries/elasticmapreduce/lib/terminateJobFlows.ml index e9cddc3cb..7faab154c 100644 --- a/libraries/elasticmapreduce/lib/terminateJobFlows.ml +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.ml @@ -1,30 +1,36 @@ open Types open Aws + type input = TerminateJobFlowsInput.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))) + (Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [("Version", ["2009-03-31"]); ("Action", ["TerminateJobFlows"])] + [ "Version", [ "2009-03-31" ]; "Action", [ "TerminateJobFlows" ] ] (Util.drop_empty - (Uri.query_of_encoded - (Query.render (TerminateJobFlowsInput.to_query req))))) in - (`POST, uri, []) + (Uri.query_of_encoded (Query.render (TerminateJobFlowsInput.to_query req))))) + in + `POST, uri, [] + let of_http body = `Ok () + 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 \ No newline at end of file + | None -> None diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.mli b/libraries/elasticmapreduce/lib/terminateJobFlows.mli index 9ededcdb0..575e5557f 100644 --- a/libraries/elasticmapreduce/lib/terminateJobFlows.mli +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.mli @@ -1,7 +1,10 @@ open Types + type input = TerminateJobFlowsInput.t + type output = unit + type error = Errors_internal.t + include - (Aws.Call with type input := input and type output := output and type - error := error) \ No newline at end of file + Aws.Call with type input := input and type output := output and type error := error diff --git a/libraries/elasticmapreduce/lib/types.ml b/libraries/elasticmapreduce/lib/types.ml index 69b8879c5..05c3255a1 100644 --- a/libraries/elasticmapreduce/lib/types.ml +++ b/libraries/elasticmapreduce/lib/types.ml @@ -1,5165 +1,8850 @@ open Aws open Aws.BaseTypes open CalendarLib + type calendar = Calendar.t -module KeyValue = - struct - type t = { - key: String.t option ; - value: String.t option } - let make ?key ?value () = { key; value } - let parse xml = - Some - { - key = (Util.option_bind (Xml.member "Key" xml) String.parse); - value = (Util.option_bind (Xml.member "Value" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.value - (fun f -> Query.Pair ("Value", (String.to_query f))); - Util.option_map v.key - (fun f -> Query.Pair ("Key", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.value (fun f -> ("value", (String.to_json f))); - Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) - let of_json j = - { - key = (Util.option_map (Json.lookup j "key") String.of_json); - value = (Util.option_map (Json.lookup j "value") String.of_json) + +module MetricDimension = struct + type t = + { key : String.t option + ; value : String.t option + } + + let make ?key ?value () = { key; value } + + let parse xml = + Some + { key = Util.option_bind (Xml.member "Key" xml) String.parse + ; value = Util.option_bind (Xml.member "Value" xml) String.parse } - end -module XmlStringList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module KeyValueList = - struct - type t = KeyValue.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map KeyValue.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list KeyValue.to_query v - let to_json v = `List (List.map KeyValue.to_json v) - let of_json j = Json.to_list KeyValue.of_json j - end -module ScriptBootstrapActionConfig = - struct - type t = { - path: String.t ; - args: XmlStringList.t } - let make ~path ?(args= []) () = { path; args } - let parse xml = - Some - { - path = - (Xml.required "Path" - (Util.option_bind (Xml.member "Path" xml) String.parse)); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); - Some (Query.Pair ("Path", (String.to_query v.path)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("args", (XmlStringList.to_json v.args)); - Some ("path", (String.to_json v.path))]) - let of_json j = - { - path = (String.of_json (Util.of_option_exn (Json.lookup j "path"))); - args = - (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) + ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> "value", String.to_json f) + ; Util.option_map v.key (fun f -> "key", String.to_json f) + ]) + + let of_json j = + { key = Util.option_map (Json.lookup j "key") String.of_json + ; value = Util.option_map (Json.lookup j "value") String.of_json + } +end + +module VolumeSpecification = struct + type t = + { volume_type : String.t + ; iops : Integer.t option + ; size_in_g_b : Integer.t + } + + let make ~volume_type ?iops ~size_in_g_b () = { volume_type; iops; size_in_g_b } + + let parse xml = + Some + { volume_type = + Xml.required + "VolumeType" + (Util.option_bind (Xml.member "VolumeType" xml) String.parse) + ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse + ; size_in_g_b = + Xml.required + "SizeInGB" + (Util.option_bind (Xml.member "SizeInGB" xml) Integer.parse) } - end -module InstanceGroupState = - struct - type t = - | PROVISIONING - | BOOTSTRAPPING - | RUNNING - | RESIZING - | SUSPENDED - | TERMINATING - | TERMINATED - | ARRESTED - | SHUTTING_DOWN - | ENDED - let str_to_t = - [("ENDED", ENDED); - ("SHUTTING_DOWN", SHUTTING_DOWN); - ("ARRESTED", ARRESTED); - ("TERMINATED", TERMINATED); - ("TERMINATING", TERMINATING); - ("SUSPENDED", SUSPENDED); - ("RESIZING", RESIZING); - ("RUNNING", RUNNING); - ("BOOTSTRAPPING", BOOTSTRAPPING); - ("PROVISIONING", PROVISIONING)] - let t_to_str = - [(ENDED, "ENDED"); - (SHUTTING_DOWN, "SHUTTING_DOWN"); - (ARRESTED, "ARRESTED"); - (TERMINATED, "TERMINATED"); - (TERMINATING, "TERMINATING"); - (SUSPENDED, "SUSPENDED"); - (RESIZING, "RESIZING"); - (RUNNING, "RUNNING"); - (BOOTSTRAPPING, "BOOTSTRAPPING"); - (PROVISIONING, "PROVISIONING")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceRoleType = - struct - type t = - | MASTER - | CORE - | TASK - let str_to_t = [("TASK", TASK); ("CORE", CORE); ("MASTER", MASTER)] - let t_to_str = [(TASK, "TASK"); (CORE, "CORE"); (MASTER, "MASTER")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module MarketType = - struct - type t = - | ON_DEMAND - | SPOT - let str_to_t = [("SPOT", SPOT); ("ON_DEMAND", ON_DEMAND)] - let t_to_str = [(SPOT, "SPOT"); (ON_DEMAND, "ON_DEMAND")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module ActionOnFailure = - struct - type t = - | TERMINATE_JOB_FLOW - | TERMINATE_CLUSTER - | CANCEL_AND_WAIT - | CONTINUE - let str_to_t = - [("CONTINUE", CONTINUE); - ("CANCEL_AND_WAIT", CANCEL_AND_WAIT); - ("TERMINATE_CLUSTER", TERMINATE_CLUSTER); - ("TERMINATE_JOB_FLOW", TERMINATE_JOB_FLOW)] - let t_to_str = - [(CONTINUE, "CONTINUE"); - (CANCEL_AND_WAIT, "CANCEL_AND_WAIT"); - (TERMINATE_CLUSTER, "TERMINATE_CLUSTER"); - (TERMINATE_JOB_FLOW, "TERMINATE_JOB_FLOW")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module HadoopJarStepConfig = - struct - type t = - { - properties: KeyValueList.t ; - jar: String.t ; - main_class: String.t option ; - args: XmlStringList.t } - let make ?(properties= []) ~jar ?main_class ?(args= []) () = - { properties; jar; main_class; args } - let parse xml = - Some - { - properties = - (Util.of_option [] - (Util.option_bind (Xml.member "Properties" xml) - KeyValueList.parse)); - jar = - (Xml.required "Jar" - (Util.option_bind (Xml.member "Jar" xml) String.parse)); - main_class = - (Util.option_bind (Xml.member "MainClass" xml) String.parse); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); - Util.option_map v.main_class - (fun f -> Query.Pair ("MainClass", (String.to_query f))); - Some (Query.Pair ("Jar", (String.to_query v.jar))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("SizeInGB", Integer.to_query v.size_in_g_b)) + ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) + ; Some (Query.Pair ("VolumeType", String.to_query v.volume_type)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("size_in_g_b", Integer.to_json v.size_in_g_b) + ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) + ; Some ("volume_type", String.to_json v.volume_type) + ]) + + let of_json j = + { volume_type = String.of_json (Util.of_option_exn (Json.lookup j "volume_type")) + ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json + ; size_in_g_b = Integer.of_json (Util.of_option_exn (Json.lookup j "size_in_g_b")) + } +end + +module AdjustmentType = struct + type t = + | CHANGE_IN_CAPACITY + | PERCENT_CHANGE_IN_CAPACITY + | EXACT_CAPACITY + + let str_to_t = + [ "EXACT_CAPACITY", EXACT_CAPACITY + ; "PERCENT_CHANGE_IN_CAPACITY", PERCENT_CHANGE_IN_CAPACITY + ; "CHANGE_IN_CAPACITY", CHANGE_IN_CAPACITY + ] + + let t_to_str = + [ EXACT_CAPACITY, "EXACT_CAPACITY" + ; PERCENT_CHANGE_IN_CAPACITY, "PERCENT_CHANGE_IN_CAPACITY" + ; CHANGE_IN_CAPACITY, "CHANGE_IN_CAPACITY" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ComparisonOperator = struct + type t = + | GREATER_THAN_OR_EQUAL + | GREATER_THAN + | LESS_THAN + | LESS_THAN_OR_EQUAL + + let str_to_t = + [ "LESS_THAN_OR_EQUAL", LESS_THAN_OR_EQUAL + ; "LESS_THAN", LESS_THAN + ; "GREATER_THAN", GREATER_THAN + ; "GREATER_THAN_OR_EQUAL", GREATER_THAN_OR_EQUAL + ] + + let t_to_str = + [ LESS_THAN_OR_EQUAL, "LESS_THAN_OR_EQUAL" + ; LESS_THAN, "LESS_THAN" + ; GREATER_THAN, "GREATER_THAN" + ; GREATER_THAN_OR_EQUAL, "GREATER_THAN_OR_EQUAL" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module MetricDimensionList = struct + type t = MetricDimension.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map MetricDimension.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list MetricDimension.to_query v + + let to_json v = `List (List.map MetricDimension.to_json v) + + let of_json j = Json.to_list MetricDimension.of_json j +end + +module Statistic = struct + type t = + | SAMPLE_COUNT + | AVERAGE + | SUM + | MINIMUM + | MAXIMUM + + let str_to_t = + [ "MAXIMUM", MAXIMUM + ; "MINIMUM", MINIMUM + ; "SUM", SUM + ; "AVERAGE", AVERAGE + ; "SAMPLE_COUNT", SAMPLE_COUNT + ] + + let t_to_str = + [ MAXIMUM, "MAXIMUM" + ; MINIMUM, "MINIMUM" + ; SUM, "SUM" + ; AVERAGE, "AVERAGE" + ; SAMPLE_COUNT, "SAMPLE_COUNT" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module Unit = struct + type t = + | NONE + | SECONDS + | MICRO_SECONDS + | MILLI_SECONDS + | BYTES + | KILO_BYTES + | MEGA_BYTES + | GIGA_BYTES + | TERA_BYTES + | BITS + | KILO_BITS + | MEGA_BITS + | GIGA_BITS + | TERA_BITS + | PERCENT + | COUNT + | BYTES_PER_SECOND + | KILO_BYTES_PER_SECOND + | MEGA_BYTES_PER_SECOND + | GIGA_BYTES_PER_SECOND + | TERA_BYTES_PER_SECOND + | BITS_PER_SECOND + | KILO_BITS_PER_SECOND + | MEGA_BITS_PER_SECOND + | GIGA_BITS_PER_SECOND + | TERA_BITS_PER_SECOND + | COUNT_PER_SECOND + + let str_to_t = + [ "COUNT_PER_SECOND", COUNT_PER_SECOND + ; "TERA_BITS_PER_SECOND", TERA_BITS_PER_SECOND + ; "GIGA_BITS_PER_SECOND", GIGA_BITS_PER_SECOND + ; "MEGA_BITS_PER_SECOND", MEGA_BITS_PER_SECOND + ; "KILO_BITS_PER_SECOND", KILO_BITS_PER_SECOND + ; "BITS_PER_SECOND", BITS_PER_SECOND + ; "TERA_BYTES_PER_SECOND", TERA_BYTES_PER_SECOND + ; "GIGA_BYTES_PER_SECOND", GIGA_BYTES_PER_SECOND + ; "MEGA_BYTES_PER_SECOND", MEGA_BYTES_PER_SECOND + ; "KILO_BYTES_PER_SECOND", KILO_BYTES_PER_SECOND + ; "BYTES_PER_SECOND", BYTES_PER_SECOND + ; "COUNT", COUNT + ; "PERCENT", PERCENT + ; "TERA_BITS", TERA_BITS + ; "GIGA_BITS", GIGA_BITS + ; "MEGA_BITS", MEGA_BITS + ; "KILO_BITS", KILO_BITS + ; "BITS", BITS + ; "TERA_BYTES", TERA_BYTES + ; "GIGA_BYTES", GIGA_BYTES + ; "MEGA_BYTES", MEGA_BYTES + ; "KILO_BYTES", KILO_BYTES + ; "BYTES", BYTES + ; "MILLI_SECONDS", MILLI_SECONDS + ; "MICRO_SECONDS", MICRO_SECONDS + ; "SECONDS", SECONDS + ; "NONE", NONE + ] + + let t_to_str = + [ COUNT_PER_SECOND, "COUNT_PER_SECOND" + ; TERA_BITS_PER_SECOND, "TERA_BITS_PER_SECOND" + ; GIGA_BITS_PER_SECOND, "GIGA_BITS_PER_SECOND" + ; MEGA_BITS_PER_SECOND, "MEGA_BITS_PER_SECOND" + ; KILO_BITS_PER_SECOND, "KILO_BITS_PER_SECOND" + ; BITS_PER_SECOND, "BITS_PER_SECOND" + ; TERA_BYTES_PER_SECOND, "TERA_BYTES_PER_SECOND" + ; GIGA_BYTES_PER_SECOND, "GIGA_BYTES_PER_SECOND" + ; MEGA_BYTES_PER_SECOND, "MEGA_BYTES_PER_SECOND" + ; KILO_BYTES_PER_SECOND, "KILO_BYTES_PER_SECOND" + ; BYTES_PER_SECOND, "BYTES_PER_SECOND" + ; COUNT, "COUNT" + ; PERCENT, "PERCENT" + ; TERA_BITS, "TERA_BITS" + ; GIGA_BITS, "GIGA_BITS" + ; MEGA_BITS, "MEGA_BITS" + ; KILO_BITS, "KILO_BITS" + ; BITS, "BITS" + ; TERA_BYTES, "TERA_BYTES" + ; GIGA_BYTES, "GIGA_BYTES" + ; MEGA_BYTES, "MEGA_BYTES" + ; KILO_BYTES, "KILO_BYTES" + ; BYTES, "BYTES" + ; MILLI_SECONDS, "MILLI_SECONDS" + ; MICRO_SECONDS, "MICRO_SECONDS" + ; SECONDS, "SECONDS" + ; NONE, "NONE" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module EbsBlockDeviceConfig = struct + type t = + { volume_specification : VolumeSpecification.t + ; volumes_per_instance : Integer.t option + } + + let make ~volume_specification ?volumes_per_instance () = + { volume_specification; volumes_per_instance } + + let parse xml = + Some + { volume_specification = + Xml.required + "VolumeSpecification" + (Util.option_bind + (Xml.member "VolumeSpecification" xml) + VolumeSpecification.parse) + ; volumes_per_instance = + Util.option_bind (Xml.member "VolumesPerInstance" xml) Integer.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.volumes_per_instance (fun f -> + Query.Pair ("VolumesPerInstance", Integer.to_query f)) + ; Some (Query.Pair - ("Properties.member", (KeyValueList.to_query v.properties)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("args", (XmlStringList.to_json v.args)); - Util.option_map v.main_class - (fun f -> ("main_class", (String.to_json f))); - Some ("jar", (String.to_json v.jar)); - Some ("properties", (KeyValueList.to_json v.properties))]) - let of_json j = - { - properties = - (KeyValueList.of_json - (Util.of_option_exn (Json.lookup j "properties"))); - jar = (String.of_json (Util.of_option_exn (Json.lookup j "jar"))); - main_class = - (Util.option_map (Json.lookup j "main_class") String.of_json); - args = - (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + ( "VolumeSpecification" + , VolumeSpecification.to_query v.volume_specification )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.volumes_per_instance (fun f -> + "volumes_per_instance", Integer.to_json f) + ; Some + ("volume_specification", VolumeSpecification.to_json v.volume_specification) + ]) + + let of_json j = + { volume_specification = + VolumeSpecification.of_json + (Util.of_option_exn (Json.lookup j "volume_specification")) + ; volumes_per_instance = + Util.option_map (Json.lookup j "volumes_per_instance") Integer.of_json + } +end + +module MarketType = struct + type t = + | ON_DEMAND + | SPOT + + let str_to_t = [ "SPOT", SPOT; "ON_DEMAND", ON_DEMAND ] + + let t_to_str = [ SPOT, "SPOT"; ON_DEMAND, "ON_DEMAND" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module SimpleScalingPolicyConfiguration = struct + type t = + { adjustment_type : AdjustmentType.t option + ; scaling_adjustment : Integer.t + ; cool_down : Integer.t option + } + + let make ?adjustment_type ~scaling_adjustment ?cool_down () = + { adjustment_type; scaling_adjustment; cool_down } + + let parse xml = + Some + { adjustment_type = + Util.option_bind (Xml.member "AdjustmentType" xml) AdjustmentType.parse + ; scaling_adjustment = + Xml.required + "ScalingAdjustment" + (Util.option_bind (Xml.member "ScalingAdjustment" xml) Integer.parse) + ; cool_down = Util.option_bind (Xml.member "CoolDown" xml) Integer.parse } - end -module StepExecutionState = - struct - type t = - | PENDING - | RUNNING - | CONTINUE - | COMPLETED - | CANCELLED - | FAILED - | INTERRUPTED - let str_to_t = - [("INTERRUPTED", INTERRUPTED); - ("FAILED", FAILED); - ("CANCELLED", CANCELLED); - ("COMPLETED", COMPLETED); - ("CONTINUE", CONTINUE); - ("RUNNING", RUNNING); - ("PENDING", PENDING)] - let t_to_str = - [(INTERRUPTED, "INTERRUPTED"); - (FAILED, "FAILED"); - (CANCELLED, "CANCELLED"); - (COMPLETED, "COMPLETED"); - (CONTINUE, "CONTINUE"); - (RUNNING, "RUNNING"); - (PENDING, "PENDING")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module StringMap = - struct - type t = (String.t, String.t) Hashtbl.t - let make elems () = elems - let parse xml = None - let to_query v = - Query.to_query_hashtbl String.to_string String.to_query v - let to_json v = - `Assoc - (Hashtbl.fold - (fun k -> - fun v -> - fun acc -> ((String.to_string k), (String.to_json v)) :: acc) - v []) - let of_json j = Json.to_hashtbl String.of_string String.of_json j - end -module StepStateChangeReasonCode = - struct - type t = - | NONE - let str_to_t = [("NONE", NONE)] - let t_to_str = [(NONE, "NONE")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceGroupStateChangeReasonCode = - struct - type t = - | INTERNAL_ERROR - | VALIDATION_ERROR - | INSTANCE_FAILURE - | CLUSTER_TERMINATED - let str_to_t = - [("CLUSTER_TERMINATED", CLUSTER_TERMINATED); - ("INSTANCE_FAILURE", INSTANCE_FAILURE); - ("VALIDATION_ERROR", VALIDATION_ERROR); - ("INTERNAL_ERROR", INTERNAL_ERROR)] - let t_to_str = - [(CLUSTER_TERMINATED, "CLUSTER_TERMINATED"); - (INSTANCE_FAILURE, "INSTANCE_FAILURE"); - (VALIDATION_ERROR, "VALIDATION_ERROR"); - (INTERNAL_ERROR, "INTERNAL_ERROR")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceStateChangeReasonCode = - struct - type t = - | INTERNAL_ERROR - | VALIDATION_ERROR - | INSTANCE_FAILURE - | BOOTSTRAP_FAILURE - | CLUSTER_TERMINATED - let str_to_t = - [("CLUSTER_TERMINATED", CLUSTER_TERMINATED); - ("BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE); - ("INSTANCE_FAILURE", INSTANCE_FAILURE); - ("VALIDATION_ERROR", VALIDATION_ERROR); - ("INTERNAL_ERROR", INTERNAL_ERROR)] - let t_to_str = - [(CLUSTER_TERMINATED, "CLUSTER_TERMINATED"); - (BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE"); - (INSTANCE_FAILURE, "INSTANCE_FAILURE"); - (VALIDATION_ERROR, "VALIDATION_ERROR"); - (INTERNAL_ERROR, "INTERNAL_ERROR")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module ClusterStateChangeReasonCode = - struct - type t = - | INTERNAL_ERROR - | VALIDATION_ERROR - | INSTANCE_FAILURE - | BOOTSTRAP_FAILURE - | USER_REQUEST - | STEP_FAILURE - | ALL_STEPS_COMPLETED - let str_to_t = - [("ALL_STEPS_COMPLETED", ALL_STEPS_COMPLETED); - ("STEP_FAILURE", STEP_FAILURE); - ("USER_REQUEST", USER_REQUEST); - ("BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE); - ("INSTANCE_FAILURE", INSTANCE_FAILURE); - ("VALIDATION_ERROR", VALIDATION_ERROR); - ("INTERNAL_ERROR", INTERNAL_ERROR)] - let t_to_str = - [(ALL_STEPS_COMPLETED, "ALL_STEPS_COMPLETED"); - (STEP_FAILURE, "STEP_FAILURE"); - (USER_REQUEST, "USER_REQUEST"); - (BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE"); - (INSTANCE_FAILURE, "INSTANCE_FAILURE"); - (VALIDATION_ERROR, "VALIDATION_ERROR"); - (INTERNAL_ERROR, "INTERNAL_ERROR")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module BootstrapActionConfig = - struct - type t = - { - name: String.t ; - script_bootstrap_action: ScriptBootstrapActionConfig.t } - let make ~name ~script_bootstrap_action () = - { name; script_bootstrap_action } - let parse xml = - Some - { - name = - (Xml.required "Name" - (Util.option_bind (Xml.member "Name" xml) String.parse)); - script_bootstrap_action = - (Xml.required "ScriptBootstrapAction" - (Util.option_bind (Xml.member "ScriptBootstrapAction" xml) - ScriptBootstrapActionConfig.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("ScriptBootstrapAction", - (ScriptBootstrapActionConfig.to_query - v.script_bootstrap_action))); - Some (Query.Pair ("Name", (String.to_query v.name)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("script_bootstrap_action", - (ScriptBootstrapActionConfig.to_json - v.script_bootstrap_action)); - Some ("name", (String.to_json v.name))]) - let of_json j = - { - name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); - script_bootstrap_action = - (ScriptBootstrapActionConfig.of_json - (Util.of_option_exn (Json.lookup j "script_bootstrap_action"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.cool_down (fun f -> + Query.Pair ("CoolDown", Integer.to_query f)) + ; Some (Query.Pair ("ScalingAdjustment", Integer.to_query v.scaling_adjustment)) + ; Util.option_map v.adjustment_type (fun f -> + Query.Pair ("AdjustmentType", AdjustmentType.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.cool_down (fun f -> "cool_down", Integer.to_json f) + ; Some ("scaling_adjustment", Integer.to_json v.scaling_adjustment) + ; Util.option_map v.adjustment_type (fun f -> + "adjustment_type", AdjustmentType.to_json f) + ]) + + let of_json j = + { adjustment_type = + Util.option_map (Json.lookup j "adjustment_type") AdjustmentType.of_json + ; scaling_adjustment = + Integer.of_json (Util.of_option_exn (Json.lookup j "scaling_adjustment")) + ; cool_down = Util.option_map (Json.lookup j "cool_down") Integer.of_json + } +end + +module CloudWatchAlarmDefinition = struct + type t = + { comparison_operator : ComparisonOperator.t + ; evaluation_periods : Integer.t option + ; metric_name : String.t + ; namespace : String.t option + ; period : Integer.t + ; statistic : Statistic.t option + ; threshold : Double.t + ; unit : Unit.t option + ; dimensions : MetricDimensionList.t + } + + let make + ~comparison_operator + ?evaluation_periods + ~metric_name + ?namespace + ~period + ?statistic + ~threshold + ?unit + ?(dimensions = []) + () = + { comparison_operator + ; evaluation_periods + ; metric_name + ; namespace + ; period + ; statistic + ; threshold + ; unit + ; dimensions + } + + let parse xml = + Some + { comparison_operator = + Xml.required + "ComparisonOperator" + (Util.option_bind + (Xml.member "ComparisonOperator" xml) + ComparisonOperator.parse) + ; evaluation_periods = + Util.option_bind (Xml.member "EvaluationPeriods" xml) Integer.parse + ; metric_name = + Xml.required + "MetricName" + (Util.option_bind (Xml.member "MetricName" xml) String.parse) + ; namespace = Util.option_bind (Xml.member "Namespace" xml) String.parse + ; period = + Xml.required "Period" (Util.option_bind (Xml.member "Period" xml) Integer.parse) + ; statistic = Util.option_bind (Xml.member "Statistic" xml) Statistic.parse + ; threshold = + Xml.required + "Threshold" + (Util.option_bind (Xml.member "Threshold" xml) Double.parse) + ; unit = Util.option_bind (Xml.member "Unit" xml) Unit.parse + ; dimensions = + Util.of_option + [] + (Util.option_bind (Xml.member "Dimensions" xml) MetricDimensionList.parse) } - end -module InstanceGroupDetail = - struct - type t = - { - instance_group_id: String.t option ; - name: String.t option ; - market: MarketType.t ; - instance_role: InstanceRoleType.t ; - bid_price: String.t option ; - instance_type: String.t ; - instance_request_count: Integer.t ; - instance_running_count: Integer.t ; - state: InstanceGroupState.t ; - last_state_change_reason: String.t option ; - creation_date_time: DateTime.t ; - start_date_time: DateTime.t option ; - ready_date_time: DateTime.t option ; - end_date_time: DateTime.t option } - let make ?instance_group_id ?name ~market ~instance_role ?bid_price - ~instance_type ~instance_request_count ~instance_running_count - ~state ?last_state_change_reason ~creation_date_time - ?start_date_time ?ready_date_time ?end_date_time () = - { - instance_group_id; - name; - market; - instance_role; - bid_price; - instance_type; - instance_request_count; - instance_running_count; - state; - last_state_change_reason; - creation_date_time; - start_date_time; - ready_date_time; - end_date_time + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("Dimensions.member", MetricDimensionList.to_query v.dimensions)) + ; Util.option_map v.unit (fun f -> Query.Pair ("Unit", Unit.to_query f)) + ; Some (Query.Pair ("Threshold", Double.to_query v.threshold)) + ; Util.option_map v.statistic (fun f -> + Query.Pair ("Statistic", Statistic.to_query f)) + ; Some (Query.Pair ("Period", Integer.to_query v.period)) + ; Util.option_map v.namespace (fun f -> + Query.Pair ("Namespace", String.to_query f)) + ; Some (Query.Pair ("MetricName", String.to_query v.metric_name)) + ; Util.option_map v.evaluation_periods (fun f -> + Query.Pair ("EvaluationPeriods", Integer.to_query f)) + ; Some + (Query.Pair + ("ComparisonOperator", ComparisonOperator.to_query v.comparison_operator)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("dimensions", MetricDimensionList.to_json v.dimensions) + ; Util.option_map v.unit (fun f -> "unit", Unit.to_json f) + ; Some ("threshold", Double.to_json v.threshold) + ; Util.option_map v.statistic (fun f -> "statistic", Statistic.to_json f) + ; Some ("period", Integer.to_json v.period) + ; Util.option_map v.namespace (fun f -> "namespace", String.to_json f) + ; Some ("metric_name", String.to_json v.metric_name) + ; Util.option_map v.evaluation_periods (fun f -> + "evaluation_periods", Integer.to_json f) + ; Some ("comparison_operator", ComparisonOperator.to_json v.comparison_operator) + ]) + + let of_json j = + { comparison_operator = + ComparisonOperator.of_json + (Util.of_option_exn (Json.lookup j "comparison_operator")) + ; evaluation_periods = + Util.option_map (Json.lookup j "evaluation_periods") Integer.of_json + ; metric_name = String.of_json (Util.of_option_exn (Json.lookup j "metric_name")) + ; namespace = Util.option_map (Json.lookup j "namespace") String.of_json + ; period = Integer.of_json (Util.of_option_exn (Json.lookup j "period")) + ; statistic = Util.option_map (Json.lookup j "statistic") Statistic.of_json + ; threshold = Double.of_json (Util.of_option_exn (Json.lookup j "threshold")) + ; unit = Util.option_map (Json.lookup j "unit") Unit.of_json + ; dimensions = + MetricDimensionList.of_json (Util.of_option_exn (Json.lookup j "dimensions")) + } +end + +module KeyValue = struct + type t = + { key : String.t option + ; value : String.t option + } + + let make ?key ?value () = { key; value } + + let parse xml = + Some + { key = Util.option_bind (Xml.member "Key" xml) String.parse + ; value = Util.option_bind (Xml.member "Value" xml) String.parse } - let parse xml = - Some - { - instance_group_id = - (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse); - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - market = - (Xml.required "Market" - (Util.option_bind (Xml.member "Market" xml) MarketType.parse)); - instance_role = - (Xml.required "InstanceRole" - (Util.option_bind (Xml.member "InstanceRole" xml) - InstanceRoleType.parse)); - bid_price = - (Util.option_bind (Xml.member "BidPrice" xml) String.parse); - instance_type = - (Xml.required "InstanceType" - (Util.option_bind (Xml.member "InstanceType" xml) String.parse)); - instance_request_count = - (Xml.required "InstanceRequestCount" - (Util.option_bind (Xml.member "InstanceRequestCount" xml) - Integer.parse)); - instance_running_count = - (Xml.required "InstanceRunningCount" - (Util.option_bind (Xml.member "InstanceRunningCount" xml) - Integer.parse)); - state = - (Xml.required "State" - (Util.option_bind (Xml.member "State" xml) - InstanceGroupState.parse)); - last_state_change_reason = - (Util.option_bind (Xml.member "LastStateChangeReason" xml) - String.parse); - creation_date_time = - (Xml.required "CreationDateTime" - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse)); - start_date_time = - (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); - ready_date_time = - (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.ready_date_time - (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); - Util.option_map v.start_date_time - (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) + ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> "value", String.to_json f) + ; Util.option_map v.key (fun f -> "key", String.to_json f) + ]) + + let of_json j = + { key = Util.option_map (Json.lookup j "key") String.of_json + ; value = Util.option_map (Json.lookup j "value") String.of_json + } +end + +module StringMap = struct + type t = (String.t, String.t) Hashtbl.t + + let make elems () = elems + + let parse xml = None + + let to_query v = Query.to_query_hashtbl String.to_string String.to_query v + + let to_json v = + `Assoc + (Hashtbl.fold (fun k v acc -> (String.to_string k, String.to_json v) :: acc) v []) + + let of_json j = Json.to_hashtbl String.of_string String.of_json j +end + +module EbsBlockDeviceConfigList = struct + type t = EbsBlockDeviceConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map EbsBlockDeviceConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list EbsBlockDeviceConfig.to_query v + + let to_json v = `List (List.map EbsBlockDeviceConfig.to_json v) + + let of_json j = Json.to_list EbsBlockDeviceConfig.of_json j +end + +module ScalingAction = struct + type t = + { market : MarketType.t option + ; simple_scaling_policy_configuration : SimpleScalingPolicyConfiguration.t + } + + let make ?market ~simple_scaling_policy_configuration () = + { market; simple_scaling_policy_configuration } + + let parse xml = + Some + { market = Util.option_bind (Xml.member "Market" xml) MarketType.parse + ; simple_scaling_policy_configuration = + Xml.required + "SimpleScalingPolicyConfiguration" + (Util.option_bind + (Xml.member "SimpleScalingPolicyConfiguration" xml) + SimpleScalingPolicyConfiguration.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("CreationDateTime", - (DateTime.to_query v.creation_date_time))); - Util.option_map v.last_state_change_reason - (fun f -> - Query.Pair ("LastStateChangeReason", (String.to_query f))); - Some (Query.Pair ("State", (InstanceGroupState.to_query v.state))); - Some + ( "SimpleScalingPolicyConfiguration" + , SimpleScalingPolicyConfiguration.to_query + v.simple_scaling_policy_configuration )) + ; Util.option_map v.market (fun f -> + Query.Pair ("Market", MarketType.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "simple_scaling_policy_configuration" + , SimpleScalingPolicyConfiguration.to_json + v.simple_scaling_policy_configuration ) + ; Util.option_map v.market (fun f -> "market", MarketType.to_json f) + ]) + + let of_json j = + { market = Util.option_map (Json.lookup j "market") MarketType.of_json + ; simple_scaling_policy_configuration = + SimpleScalingPolicyConfiguration.of_json + (Util.of_option_exn (Json.lookup j "simple_scaling_policy_configuration")) + } +end + +module ScalingTrigger = struct + type t = { cloud_watch_alarm_definition : CloudWatchAlarmDefinition.t } + + let make ~cloud_watch_alarm_definition () = { cloud_watch_alarm_definition } + + let parse xml = + Some + { cloud_watch_alarm_definition = + Xml.required + "CloudWatchAlarmDefinition" + (Util.option_bind + (Xml.member "CloudWatchAlarmDefinition" xml) + CloudWatchAlarmDefinition.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("InstanceRunningCount", - (Integer.to_query v.instance_running_count))); - Some + ( "CloudWatchAlarmDefinition" + , CloudWatchAlarmDefinition.to_query v.cloud_watch_alarm_definition )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "cloud_watch_alarm_definition" + , CloudWatchAlarmDefinition.to_json v.cloud_watch_alarm_definition ) + ]) + + let of_json j = + { cloud_watch_alarm_definition = + CloudWatchAlarmDefinition.of_json + (Util.of_option_exn (Json.lookup j "cloud_watch_alarm_definition")) + } +end + +module XmlStringList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module KeyValueList = struct + type t = KeyValue.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map KeyValue.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list KeyValue.to_query v + + let to_json v = `List (List.map KeyValue.to_json v) + + let of_json j = Json.to_list KeyValue.of_json j +end + +module SpotProvisioningTimeoutAction = struct + type t = + | SWITCH_TO_ON_DEMAND + | TERMINATE_CLUSTER + + let str_to_t = + [ "TERMINATE_CLUSTER", TERMINATE_CLUSTER; "SWITCH_TO_ON_DEMAND", SWITCH_TO_ON_DEMAND ] + + let t_to_str = + [ TERMINATE_CLUSTER, "TERMINATE_CLUSTER"; SWITCH_TO_ON_DEMAND, "SWITCH_TO_ON_DEMAND" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ConfigurationList = struct + type t = Configuration.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map Configuration.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list Configuration.to_query v + + let to_json v = `List (List.map Configuration.to_json v) + + let of_json j = Json.to_list Configuration.of_json j +end + +module Configuration = struct + type t = + { classification : String.t option + ; configurations : ConfigurationList.t + ; properties : StringMap.t option + } + + let make ?classification ?(configurations = []) ?properties () = + { classification; configurations; properties } + + let parse xml = + Some + { classification = Util.option_bind (Xml.member "Classification" xml) String.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; properties = Util.option_bind (Xml.member "Properties" xml) StringMap.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.properties (fun f -> + Query.Pair ("Properties", StringMap.to_query f)) + ; Some (Query.Pair - ("InstanceRequestCount", - (Integer.to_query v.instance_request_count))); - Some - (Query.Pair ("InstanceType", (String.to_query v.instance_type))); - Util.option_map v.bid_price - (fun f -> Query.Pair ("BidPrice", (String.to_query f))); - Some + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.classification (fun f -> + Query.Pair ("Classification", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.properties (fun f -> "properties", StringMap.to_json f) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.classification (fun f -> "classification", String.to_json f) + ]) + + let of_json j = + { classification = Util.option_map (Json.lookup j "classification") String.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; properties = Util.option_map (Json.lookup j "properties") StringMap.of_json + } +end + +module EbsConfiguration = struct + type t = + { ebs_block_device_configs : EbsBlockDeviceConfigList.t + ; ebs_optimized : Boolean.t option + } + + let make ?(ebs_block_device_configs = []) ?ebs_optimized () = + { ebs_block_device_configs; ebs_optimized } + + let parse xml = + Some + { ebs_block_device_configs = + Util.of_option + [] + (Util.option_bind + (Xml.member "EbsBlockDeviceConfigs" xml) + EbsBlockDeviceConfigList.parse) + ; ebs_optimized = Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.ebs_optimized (fun f -> + Query.Pair ("EbsOptimized", Boolean.to_query f)) + ; Some (Query.Pair - ("InstanceRole", (InstanceRoleType.to_query v.instance_role))); - Some (Query.Pair ("Market", (MarketType.to_query v.market))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f))); - Util.option_map v.instance_group_id - (fun f -> Query.Pair ("InstanceGroupId", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.ready_date_time - (fun f -> ("ready_date_time", (DateTime.to_json f))); - Util.option_map v.start_date_time - (fun f -> ("start_date_time", (DateTime.to_json f))); - Some - ("creation_date_time", (DateTime.to_json v.creation_date_time)); - Util.option_map v.last_state_change_reason - (fun f -> ("last_state_change_reason", (String.to_json f))); - Some ("state", (InstanceGroupState.to_json v.state)); - Some - ("instance_running_count", - (Integer.to_json v.instance_running_count)); - Some - ("instance_request_count", - (Integer.to_json v.instance_request_count)); - Some ("instance_type", (String.to_json v.instance_type)); - Util.option_map v.bid_price - (fun f -> ("bid_price", (String.to_json f))); - Some ("instance_role", (InstanceRoleType.to_json v.instance_role)); - Some ("market", (MarketType.to_json v.market)); - Util.option_map v.name (fun f -> ("name", (String.to_json f))); - Util.option_map v.instance_group_id - (fun f -> ("instance_group_id", (String.to_json f)))]) - let of_json j = - { - instance_group_id = - (Util.option_map (Json.lookup j "instance_group_id") String.of_json); - name = (Util.option_map (Json.lookup j "name") String.of_json); - market = - (MarketType.of_json (Util.of_option_exn (Json.lookup j "market"))); - instance_role = - (InstanceRoleType.of_json - (Util.of_option_exn (Json.lookup j "instance_role"))); - bid_price = - (Util.option_map (Json.lookup j "bid_price") String.of_json); - instance_type = - (String.of_json - (Util.of_option_exn (Json.lookup j "instance_type"))); - instance_request_count = - (Integer.of_json - (Util.of_option_exn (Json.lookup j "instance_request_count"))); - instance_running_count = - (Integer.of_json - (Util.of_option_exn (Json.lookup j "instance_running_count"))); - state = - (InstanceGroupState.of_json - (Util.of_option_exn (Json.lookup j "state"))); - last_state_change_reason = - (Util.option_map (Json.lookup j "last_state_change_reason") - String.of_json); - creation_date_time = - (DateTime.of_json - (Util.of_option_exn (Json.lookup j "creation_date_time"))); - start_date_time = - (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); - ready_date_time = - (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + ( "EbsBlockDeviceConfigs.member" + , EbsBlockDeviceConfigList.to_query v.ebs_block_device_configs )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) + ; Some + ( "ebs_block_device_configs" + , EbsBlockDeviceConfigList.to_json v.ebs_block_device_configs ) + ]) + + let of_json j = + { ebs_block_device_configs = + EbsBlockDeviceConfigList.of_json + (Util.of_option_exn (Json.lookup j "ebs_block_device_configs")) + ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json + } +end + +module ScalingRule = struct + type t = + { name : String.t + ; description : String.t option + ; action : ScalingAction.t + ; trigger : ScalingTrigger.t + } + + let make ~name ?description ~action ~trigger () = { name; description; action; trigger } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; description = Util.option_bind (Xml.member "Description" xml) String.parse + ; action = + Xml.required + "Action" + (Util.option_bind (Xml.member "Action" xml) ScalingAction.parse) + ; trigger = + Xml.required + "Trigger" + (Util.option_bind (Xml.member "Trigger" xml) ScalingTrigger.parse) } - end -module StepConfig = - struct - type t = - { - name: String.t ; - action_on_failure: ActionOnFailure.t option ; - hadoop_jar_step: HadoopJarStepConfig.t } - let make ~name ?action_on_failure ~hadoop_jar_step () = - { name; action_on_failure; hadoop_jar_step } - let parse xml = - Some - { - name = - (Xml.required "Name" - (Util.option_bind (Xml.member "Name" xml) String.parse)); - action_on_failure = - (Util.option_bind (Xml.member "ActionOnFailure" xml) - ActionOnFailure.parse); - hadoop_jar_step = - (Xml.required "HadoopJarStep" - (Util.option_bind (Xml.member "HadoopJarStep" xml) - HadoopJarStepConfig.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("HadoopJarStep", - (HadoopJarStepConfig.to_query v.hadoop_jar_step))); - Util.option_map v.action_on_failure - (fun f -> - Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); - Some (Query.Pair ("Name", (String.to_query v.name)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("hadoop_jar_step", - (HadoopJarStepConfig.to_json v.hadoop_jar_step)); - Util.option_map v.action_on_failure - (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); - Some ("name", (String.to_json v.name))]) - let of_json j = - { - name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); - action_on_failure = - (Util.option_map (Json.lookup j "action_on_failure") - ActionOnFailure.of_json); - hadoop_jar_step = - (HadoopJarStepConfig.of_json - (Util.of_option_exn (Json.lookup j "hadoop_jar_step"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Trigger", ScalingTrigger.to_query v.trigger)) + ; Some (Query.Pair ("Action", ScalingAction.to_query v.action)) + ; Util.option_map v.description (fun f -> + Query.Pair ("Description", String.to_query f)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("trigger", ScalingTrigger.to_json v.trigger) + ; Some ("action", ScalingAction.to_json v.action) + ; Util.option_map v.description (fun f -> "description", String.to_json f) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; description = Util.option_map (Json.lookup j "description") String.of_json + ; action = ScalingAction.of_json (Util.of_option_exn (Json.lookup j "action")) + ; trigger = ScalingTrigger.of_json (Util.of_option_exn (Json.lookup j "trigger")) + } +end + +module EbsBlockDevice = struct + type t = + { volume_specification : VolumeSpecification.t option + ; device : String.t option + } + + let make ?volume_specification ?device () = { volume_specification; device } + + let parse xml = + Some + { volume_specification = + Util.option_bind + (Xml.member "VolumeSpecification" xml) + VolumeSpecification.parse + ; device = Util.option_bind (Xml.member "Device" xml) String.parse } - end -module StepExecutionStatusDetail = - struct - type t = - { - state: StepExecutionState.t ; - creation_date_time: DateTime.t ; - start_date_time: DateTime.t option ; - end_date_time: DateTime.t option ; - last_state_change_reason: String.t option } - let make ~state ~creation_date_time ?start_date_time ?end_date_time - ?last_state_change_reason () = - { - state; - creation_date_time; - start_date_time; - end_date_time; - last_state_change_reason + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.device (fun f -> Query.Pair ("Device", String.to_query f)) + ; Util.option_map v.volume_specification (fun f -> + Query.Pair ("VolumeSpecification", VolumeSpecification.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.device (fun f -> "device", String.to_json f) + ; Util.option_map v.volume_specification (fun f -> + "volume_specification", VolumeSpecification.to_json f) + ]) + + let of_json j = + { volume_specification = + Util.option_map (Json.lookup j "volume_specification") VolumeSpecification.of_json + ; device = Util.option_map (Json.lookup j "device") String.of_json + } +end + +module AutoScalingPolicyStateChangeReasonCode = struct + type t = + | USER_REQUEST + | PROVISION_FAILURE + | CLEANUP_FAILURE + + let str_to_t = + [ "CLEANUP_FAILURE", CLEANUP_FAILURE + ; "PROVISION_FAILURE", PROVISION_FAILURE + ; "USER_REQUEST", USER_REQUEST + ] + + let t_to_str = + [ CLEANUP_FAILURE, "CLEANUP_FAILURE" + ; PROVISION_FAILURE, "PROVISION_FAILURE" + ; USER_REQUEST, "USER_REQUEST" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ScriptBootstrapActionConfig = struct + type t = + { path : String.t + ; args : XmlStringList.t + } + + let make ~path ?(args = []) () = { path; args } + + let parse xml = + Some + { path = Xml.required "Path" (Util.option_bind (Xml.member "Path" xml) String.parse) + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Args.member", XmlStringList.to_query v.args)) + ; Some (Query.Pair ("Path", String.to_query v.path)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("args", XmlStringList.to_json v.args) + ; Some ("path", String.to_json v.path) + ]) + + let of_json j = + { path = String.of_json (Util.of_option_exn (Json.lookup j "path")) + ; args = XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args")) + } +end + +module InstanceGroupState = struct + type t = + | PROVISIONING + | BOOTSTRAPPING + | RUNNING + | RESIZING + | SUSPENDED + | TERMINATING + | TERMINATED + | ARRESTED + | SHUTTING_DOWN + | ENDED + + let str_to_t = + [ "ENDED", ENDED + ; "SHUTTING_DOWN", SHUTTING_DOWN + ; "ARRESTED", ARRESTED + ; "TERMINATED", TERMINATED + ; "TERMINATING", TERMINATING + ; "SUSPENDED", SUSPENDED + ; "RESIZING", RESIZING + ; "RUNNING", RUNNING + ; "BOOTSTRAPPING", BOOTSTRAPPING + ; "PROVISIONING", PROVISIONING + ] + + let t_to_str = + [ ENDED, "ENDED" + ; SHUTTING_DOWN, "SHUTTING_DOWN" + ; ARRESTED, "ARRESTED" + ; TERMINATED, "TERMINATED" + ; TERMINATING, "TERMINATING" + ; SUSPENDED, "SUSPENDED" + ; RESIZING, "RESIZING" + ; RUNNING, "RUNNING" + ; BOOTSTRAPPING, "BOOTSTRAPPING" + ; PROVISIONING, "PROVISIONING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceRoleType = struct + type t = + | MASTER + | CORE + | TASK + + let str_to_t = [ "TASK", TASK; "CORE", CORE; "MASTER", MASTER ] + + let t_to_str = [ TASK, "TASK"; CORE, "CORE"; MASTER, "MASTER" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ActionOnFailure = struct + type t = + | TERMINATE_JOB_FLOW + | TERMINATE_CLUSTER + | CANCEL_AND_WAIT + | CONTINUE + + let str_to_t = + [ "CONTINUE", CONTINUE + ; "CANCEL_AND_WAIT", CANCEL_AND_WAIT + ; "TERMINATE_CLUSTER", TERMINATE_CLUSTER + ; "TERMINATE_JOB_FLOW", TERMINATE_JOB_FLOW + ] + + let t_to_str = + [ CONTINUE, "CONTINUE" + ; CANCEL_AND_WAIT, "CANCEL_AND_WAIT" + ; TERMINATE_CLUSTER, "TERMINATE_CLUSTER" + ; TERMINATE_JOB_FLOW, "TERMINATE_JOB_FLOW" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module HadoopJarStepConfig = struct + type t = + { properties : KeyValueList.t + ; jar : String.t + ; main_class : String.t option + ; args : XmlStringList.t + } + + let make ?(properties = []) ~jar ?main_class ?(args = []) () = + { properties; jar; main_class; args } + + let parse xml = + Some + { properties = + Util.of_option + [] + (Util.option_bind (Xml.member "Properties" xml) KeyValueList.parse) + ; jar = Xml.required "Jar" (Util.option_bind (Xml.member "Jar" xml) String.parse) + ; main_class = Util.option_bind (Xml.member "MainClass" xml) String.parse + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Args.member", XmlStringList.to_query v.args)) + ; Util.option_map v.main_class (fun f -> + Query.Pair ("MainClass", String.to_query f)) + ; Some (Query.Pair ("Jar", String.to_query v.jar)) + ; Some (Query.Pair ("Properties.member", KeyValueList.to_query v.properties)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("args", XmlStringList.to_json v.args) + ; Util.option_map v.main_class (fun f -> "main_class", String.to_json f) + ; Some ("jar", String.to_json v.jar) + ; Some ("properties", KeyValueList.to_json v.properties) + ]) + + let of_json j = + { properties = KeyValueList.of_json (Util.of_option_exn (Json.lookup j "properties")) + ; jar = String.of_json (Util.of_option_exn (Json.lookup j "jar")) + ; main_class = Util.option_map (Json.lookup j "main_class") String.of_json + ; args = XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args")) + } +end + +module StepExecutionState = struct + type t = + | PENDING + | RUNNING + | CONTINUE + | COMPLETED + | CANCELLED + | FAILED + | INTERRUPTED + + let str_to_t = + [ "INTERRUPTED", INTERRUPTED + ; "FAILED", FAILED + ; "CANCELLED", CANCELLED + ; "COMPLETED", COMPLETED + ; "CONTINUE", CONTINUE + ; "RUNNING", RUNNING + ; "PENDING", PENDING + ] + + let t_to_str = + [ INTERRUPTED, "INTERRUPTED" + ; FAILED, "FAILED" + ; CANCELLED, "CANCELLED" + ; COMPLETED, "COMPLETED" + ; CONTINUE, "CONTINUE" + ; RUNNING, "RUNNING" + ; PENDING, "PENDING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module SpotProvisioningSpecification = struct + type t = + { timeout_duration_minutes : Integer.t + ; timeout_action : SpotProvisioningTimeoutAction.t + ; block_duration_minutes : Integer.t option + } + + let make ~timeout_duration_minutes ~timeout_action ?block_duration_minutes () = + { timeout_duration_minutes; timeout_action; block_duration_minutes } + + let parse xml = + Some + { timeout_duration_minutes = + Xml.required + "TimeoutDurationMinutes" + (Util.option_bind (Xml.member "TimeoutDurationMinutes" xml) Integer.parse) + ; timeout_action = + Xml.required + "TimeoutAction" + (Util.option_bind + (Xml.member "TimeoutAction" xml) + SpotProvisioningTimeoutAction.parse) + ; block_duration_minutes = + Util.option_bind (Xml.member "BlockDurationMinutes" xml) Integer.parse } - let parse xml = - Some - { - state = - (Xml.required "State" - (Util.option_bind (Xml.member "State" xml) - StepExecutionState.parse)); - creation_date_time = - (Xml.required "CreationDateTime" - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse)); - start_date_time = - (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse); - last_state_change_reason = - (Util.option_bind (Xml.member "LastStateChangeReason" xml) - String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.last_state_change_reason - (fun f -> - Query.Pair ("LastStateChangeReason", (String.to_query f))); - Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.start_date_time - (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.block_duration_minutes (fun f -> + Query.Pair ("BlockDurationMinutes", Integer.to_query f)) + ; Some (Query.Pair - ("CreationDateTime", - (DateTime.to_query v.creation_date_time))); - Some (Query.Pair ("State", (StepExecutionState.to_query v.state)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.last_state_change_reason - (fun f -> ("last_state_change_reason", (String.to_json f))); - Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.start_date_time - (fun f -> ("start_date_time", (DateTime.to_json f))); - Some - ("creation_date_time", (DateTime.to_json v.creation_date_time)); - Some ("state", (StepExecutionState.to_json v.state))]) - let of_json j = - { - state = - (StepExecutionState.of_json - (Util.of_option_exn (Json.lookup j "state"))); - creation_date_time = - (DateTime.of_json - (Util.of_option_exn (Json.lookup j "creation_date_time"))); - start_date_time = - (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json); - last_state_change_reason = - (Util.option_map (Json.lookup j "last_state_change_reason") - String.of_json) + ("TimeoutAction", SpotProvisioningTimeoutAction.to_query v.timeout_action)) + ; Some + (Query.Pair + ("TimeoutDurationMinutes", Integer.to_query v.timeout_duration_minutes)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.block_duration_minutes (fun f -> + "block_duration_minutes", Integer.to_json f) + ; Some ("timeout_action", SpotProvisioningTimeoutAction.to_json v.timeout_action) + ; Some ("timeout_duration_minutes", Integer.to_json v.timeout_duration_minutes) + ]) + + let of_json j = + { timeout_duration_minutes = + Integer.of_json (Util.of_option_exn (Json.lookup j "timeout_duration_minutes")) + ; timeout_action = + SpotProvisioningTimeoutAction.of_json + (Util.of_option_exn (Json.lookup j "timeout_action")) + ; block_duration_minutes = + Util.option_map (Json.lookup j "block_duration_minutes") Integer.of_json + } +end + +module InstanceTypeConfig = struct + type t = + { instance_type : String.t + ; weighted_capacity : Integer.t option + ; bid_price : String.t option + ; bid_price_as_percentage_of_on_demand_price : Double.t option + ; ebs_configuration : EbsConfiguration.t option + ; configurations : ConfigurationList.t + } + + let make + ~instance_type + ?weighted_capacity + ?bid_price + ?bid_price_as_percentage_of_on_demand_price + ?ebs_configuration + ?(configurations = []) + () = + { instance_type + ; weighted_capacity + ; bid_price + ; bid_price_as_percentage_of_on_demand_price + ; ebs_configuration + ; configurations + } + + let parse xml = + Some + { instance_type = + Xml.required + "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse) + ; weighted_capacity = + Util.option_bind (Xml.member "WeightedCapacity" xml) Integer.parse + ; bid_price = Util.option_bind (Xml.member "BidPrice" xml) String.parse + ; bid_price_as_percentage_of_on_demand_price = + Util.option_bind + (Xml.member "BidPriceAsPercentageOfOnDemandPrice" xml) + Double.parse + ; ebs_configuration = + Util.option_bind (Xml.member "EbsConfiguration" xml) EbsConfiguration.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) } - end -module StringList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module rec ConfigurationList : sig - type t = Configuration.t list - val parse : Ezxmlm.nodes -> Configuration.t list option - val to_query : t -> Query.t - val to_json : t -> Json.t - val of_json : Json.t -> t - val make : t -> unit -> t -end = - struct - type t = Configuration.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map Configuration.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list Configuration.to_query v - let to_json v = `List (List.map Configuration.to_json v) - let of_json j = Json.to_list Configuration.of_json j - end - and Configuration : sig - type t = - { - classification: String.t option ; - configurations: ConfigurationList.t ; - properties: StringMap.t option } - val parse : Ezxmlm.nodes -> t option - val to_query : t -> Query.t - val to_json : t -> Json.t - val of_json : Json.t -> t - val make : ?classification:string -> ?configurations:ConfigurationList.t -> ?properties:StringMap.t -> unit -> t - end = - struct - type t = - { - classification: String.t option ; - configurations: ConfigurationList.t ; - properties: StringMap.t option } - let make ?classification ?(configurations= []) ?properties () = - { classification; configurations; properties } - let parse xml = - Some - { - classification = - (Util.option_bind (Xml.member "Classification" xml) String.parse); - configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "Configurations" xml) - ConfigurationList.parse)); - properties = - (Util.option_bind (Xml.member "Properties" xml) StringMap.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.properties - (fun f -> Query.Pair ("Properties", (StringMap.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("Configurations.member", - (ConfigurationList.to_query v.configurations))); - Util.option_map v.classification - (fun f -> Query.Pair ("Classification", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.properties - (fun f -> ("properties", (StringMap.to_json f))); - Some - ("configurations", (ConfigurationList.to_json v.configurations)); - Util.option_map v.classification - (fun f -> ("classification", (String.to_json f)))]) - let of_json j = - { - classification = - (Util.option_map (Json.lookup j "classification") String.of_json); - configurations = - (ConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "configurations"))); - properties = - (Util.option_map (Json.lookup j "properties") StringMap.of_json) + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.ebs_configuration (fun f -> + Query.Pair ("EbsConfiguration", EbsConfiguration.to_query f)) + ; Util.option_map v.bid_price_as_percentage_of_on_demand_price (fun f -> + Query.Pair ("BidPriceAsPercentageOfOnDemandPrice", Double.to_query f)) + ; Util.option_map v.bid_price (fun f -> + Query.Pair ("BidPrice", String.to_query f)) + ; Util.option_map v.weighted_capacity (fun f -> + Query.Pair ("WeightedCapacity", Integer.to_query f)) + ; Some (Query.Pair ("InstanceType", String.to_query v.instance_type)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.ebs_configuration (fun f -> + "ebs_configuration", EbsConfiguration.to_json f) + ; Util.option_map v.bid_price_as_percentage_of_on_demand_price (fun f -> + "bid_price_as_percentage_of_on_demand_price", Double.to_json f) + ; Util.option_map v.bid_price (fun f -> "bid_price", String.to_json f) + ; Util.option_map v.weighted_capacity (fun f -> + "weighted_capacity", Integer.to_json f) + ; Some ("instance_type", String.to_json v.instance_type) + ]) + + let of_json j = + { instance_type = String.of_json (Util.of_option_exn (Json.lookup j "instance_type")) + ; weighted_capacity = + Util.option_map (Json.lookup j "weighted_capacity") Integer.of_json + ; bid_price = Util.option_map (Json.lookup j "bid_price") String.of_json + ; bid_price_as_percentage_of_on_demand_price = + Util.option_map + (Json.lookup j "bid_price_as_percentage_of_on_demand_price") + Double.of_json + ; ebs_configuration = + Util.option_map (Json.lookup j "ebs_configuration") EbsConfiguration.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + } +end + +module ScalingConstraints = struct + type t = + { min_capacity : Integer.t + ; max_capacity : Integer.t + } + + let make ~min_capacity ~max_capacity () = { min_capacity; max_capacity } + + let parse xml = + Some + { min_capacity = + Xml.required + "MinCapacity" + (Util.option_bind (Xml.member "MinCapacity" xml) Integer.parse) + ; max_capacity = + Xml.required + "MaxCapacity" + (Util.option_bind (Xml.member "MaxCapacity" xml) Integer.parse) } - end -module StepState = - struct - type t = - | PENDING - | RUNNING - | COMPLETED - | CANCELLED - | FAILED - | INTERRUPTED - let str_to_t = - [("INTERRUPTED", INTERRUPTED); - ("FAILED", FAILED); - ("CANCELLED", CANCELLED); - ("COMPLETED", COMPLETED); - ("RUNNING", RUNNING); - ("PENDING", PENDING)] - let t_to_str = - [(INTERRUPTED, "INTERRUPTED"); - (FAILED, "FAILED"); - (CANCELLED, "CANCELLED"); - (COMPLETED, "COMPLETED"); - (RUNNING, "RUNNING"); - (PENDING, "PENDING")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module StepStateChangeReason = - struct - type t = - { - code: StepStateChangeReasonCode.t option ; - message: String.t option } - let make ?code ?message () = { code; message } - let parse xml = - Some - { - code = - (Util.option_bind (Xml.member "Code" xml) - StepStateChangeReasonCode.parse); - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f))); - Util.option_map v.code - (fun f -> - Query.Pair ("Code", (StepStateChangeReasonCode.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f))); - Util.option_map v.code - (fun f -> ("code", (StepStateChangeReasonCode.to_json f)))]) - let of_json j = - { - code = - (Util.option_map (Json.lookup j "code") - StepStateChangeReasonCode.of_json); - message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("MaxCapacity", Integer.to_query v.max_capacity)) + ; Some (Query.Pair ("MinCapacity", Integer.to_query v.min_capacity)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("max_capacity", Integer.to_json v.max_capacity) + ; Some ("min_capacity", Integer.to_json v.min_capacity) + ]) + + let of_json j = + { min_capacity = Integer.of_json (Util.of_option_exn (Json.lookup j "min_capacity")) + ; max_capacity = Integer.of_json (Util.of_option_exn (Json.lookup j "max_capacity")) + } +end + +module ScalingRuleList = struct + type t = ScalingRule.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map ScalingRule.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list ScalingRule.to_query v + + let to_json v = `List (List.map ScalingRule.to_json v) + + let of_json j = Json.to_list ScalingRule.of_json j +end + +module InstanceFleetStateChangeReasonCode = struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | CLUSTER_TERMINATED + + let str_to_t = + [ "CLUSTER_TERMINATED", CLUSTER_TERMINATED + ; "INSTANCE_FAILURE", INSTANCE_FAILURE + ; "VALIDATION_ERROR", VALIDATION_ERROR + ; "INTERNAL_ERROR", INTERNAL_ERROR + ] + + let t_to_str = + [ CLUSTER_TERMINATED, "CLUSTER_TERMINATED" + ; INSTANCE_FAILURE, "INSTANCE_FAILURE" + ; VALIDATION_ERROR, "VALIDATION_ERROR" + ; INTERNAL_ERROR, "INTERNAL_ERROR" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module EbsBlockDeviceList = struct + type t = EbsBlockDevice.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map EbsBlockDevice.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list EbsBlockDevice.to_query v + + let to_json v = `List (List.map EbsBlockDevice.to_json v) + + let of_json j = Json.to_list EbsBlockDevice.of_json j +end + +module StepStateChangeReasonCode = struct + type t = NONE + + let str_to_t = [ "NONE", NONE ] + + let t_to_str = [ NONE, "NONE" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module EC2InstanceIdsList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module AutoScalingPolicyState = struct + type t = + | PENDING + | ATTACHING + | ATTACHED + | DETACHING + | DETACHED + | FAILED + + let str_to_t = + [ "FAILED", FAILED + ; "DETACHED", DETACHED + ; "DETACHING", DETACHING + ; "ATTACHED", ATTACHED + ; "ATTACHING", ATTACHING + ; "PENDING", PENDING + ] + + let t_to_str = + [ FAILED, "FAILED" + ; DETACHED, "DETACHED" + ; DETACHING, "DETACHING" + ; ATTACHED, "ATTACHED" + ; ATTACHING, "ATTACHING" + ; PENDING, "PENDING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module AutoScalingPolicyStateChangeReason = struct + type t = + { code : AutoScalingPolicyStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = + Util.option_bind + (Xml.member "Code" xml) + AutoScalingPolicyStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - end -module StepTimeline = - struct - type t = - { - creation_date_time: DateTime.t option ; - start_date_time: DateTime.t option ; - end_date_time: DateTime.t option } - let make ?creation_date_time ?start_date_time ?end_date_time () = - { creation_date_time; start_date_time; end_date_time } - let parse xml = - Some - { - creation_date_time = - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse); - start_date_time = - (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.start_date_time - (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); - Util.option_map v.creation_date_time - (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.start_date_time - (fun f -> ("start_date_time", (DateTime.to_json f))); - Util.option_map v.creation_date_time - (fun f -> ("creation_date_time", (DateTime.to_json f)))]) - let of_json j = - { - creation_date_time = - (Util.option_map (Json.lookup j "creation_date_time") - DateTime.of_json); - start_date_time = - (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", AutoScalingPolicyStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> + "code", AutoScalingPolicyStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = + Util.option_map + (Json.lookup j "code") + AutoScalingPolicyStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module InstanceGroupStateChangeReasonCode = struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | CLUSTER_TERMINATED + + let str_to_t = + [ "CLUSTER_TERMINATED", CLUSTER_TERMINATED + ; "INSTANCE_FAILURE", INSTANCE_FAILURE + ; "VALIDATION_ERROR", VALIDATION_ERROR + ; "INTERNAL_ERROR", INTERNAL_ERROR + ] + + let t_to_str = + [ CLUSTER_TERMINATED, "CLUSTER_TERMINATED" + ; INSTANCE_FAILURE, "INSTANCE_FAILURE" + ; VALIDATION_ERROR, "VALIDATION_ERROR" + ; INTERNAL_ERROR, "INTERNAL_ERROR" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceStateChangeReasonCode = struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | BOOTSTRAP_FAILURE + | CLUSTER_TERMINATED + + let str_to_t = + [ "CLUSTER_TERMINATED", CLUSTER_TERMINATED + ; "BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE + ; "INSTANCE_FAILURE", INSTANCE_FAILURE + ; "VALIDATION_ERROR", VALIDATION_ERROR + ; "INTERNAL_ERROR", INTERNAL_ERROR + ] + + let t_to_str = + [ CLUSTER_TERMINATED, "CLUSTER_TERMINATED" + ; BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE" + ; INSTANCE_FAILURE, "INSTANCE_FAILURE" + ; VALIDATION_ERROR, "VALIDATION_ERROR" + ; INTERNAL_ERROR, "INTERNAL_ERROR" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ClusterStateChangeReasonCode = struct + type t = + | INTERNAL_ERROR + | VALIDATION_ERROR + | INSTANCE_FAILURE + | INSTANCE_FLEET_TIMEOUT + | BOOTSTRAP_FAILURE + | USER_REQUEST + | STEP_FAILURE + | ALL_STEPS_COMPLETED + + let str_to_t = + [ "ALL_STEPS_COMPLETED", ALL_STEPS_COMPLETED + ; "STEP_FAILURE", STEP_FAILURE + ; "USER_REQUEST", USER_REQUEST + ; "BOOTSTRAP_FAILURE", BOOTSTRAP_FAILURE + ; "INSTANCE_FLEET_TIMEOUT", INSTANCE_FLEET_TIMEOUT + ; "INSTANCE_FAILURE", INSTANCE_FAILURE + ; "VALIDATION_ERROR", VALIDATION_ERROR + ; "INTERNAL_ERROR", INTERNAL_ERROR + ] + + let t_to_str = + [ ALL_STEPS_COMPLETED, "ALL_STEPS_COMPLETED" + ; STEP_FAILURE, "STEP_FAILURE" + ; USER_REQUEST, "USER_REQUEST" + ; BOOTSTRAP_FAILURE, "BOOTSTRAP_FAILURE" + ; INSTANCE_FLEET_TIMEOUT, "INSTANCE_FLEET_TIMEOUT" + ; INSTANCE_FAILURE, "INSTANCE_FAILURE" + ; VALIDATION_ERROR, "VALIDATION_ERROR" + ; INTERNAL_ERROR, "INTERNAL_ERROR" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module BootstrapActionConfig = struct + type t = + { name : String.t + ; script_bootstrap_action : ScriptBootstrapActionConfig.t + } + + let make ~name ~script_bootstrap_action () = { name; script_bootstrap_action } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; script_bootstrap_action = + Xml.required + "ScriptBootstrapAction" + (Util.option_bind + (Xml.member "ScriptBootstrapAction" xml) + ScriptBootstrapActionConfig.parse) } - end -module InstanceGroupStateChangeReason = - struct - type t = - { - code: InstanceGroupStateChangeReasonCode.t option ; - message: String.t option } - let make ?code ?message () = { code; message } - let parse xml = - Some - { - code = - (Util.option_bind (Xml.member "Code" xml) - InstanceGroupStateChangeReasonCode.parse); - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f))); - Util.option_map v.code - (fun f -> - Query.Pair - ("Code", (InstanceGroupStateChangeReasonCode.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f))); - Util.option_map v.code - (fun f -> - ("code", (InstanceGroupStateChangeReasonCode.to_json f)))]) - let of_json j = - { - code = - (Util.option_map (Json.lookup j "code") - InstanceGroupStateChangeReasonCode.of_json); - message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "ScriptBootstrapAction" + , ScriptBootstrapActionConfig.to_query v.script_bootstrap_action )) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "script_bootstrap_action" + , ScriptBootstrapActionConfig.to_json v.script_bootstrap_action ) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; script_bootstrap_action = + ScriptBootstrapActionConfig.of_json + (Util.of_option_exn (Json.lookup j "script_bootstrap_action")) + } +end + +module InstanceGroupDetail = struct + type t = + { instance_group_id : String.t option + ; name : String.t option + ; market : MarketType.t + ; instance_role : InstanceRoleType.t + ; bid_price : String.t option + ; instance_type : String.t + ; instance_request_count : Integer.t + ; instance_running_count : Integer.t + ; state : InstanceGroupState.t + ; last_state_change_reason : String.t option + ; creation_date_time : DateTime.t + ; start_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make + ?instance_group_id + ?name + ~market + ~instance_role + ?bid_price + ~instance_type + ~instance_request_count + ~instance_running_count + ~state + ?last_state_change_reason + ~creation_date_time + ?start_date_time + ?ready_date_time + ?end_date_time + () = + { instance_group_id + ; name + ; market + ; instance_role + ; bid_price + ; instance_type + ; instance_request_count + ; instance_running_count + ; state + ; last_state_change_reason + ; creation_date_time + ; start_date_time + ; ready_date_time + ; end_date_time + } + + let parse xml = + Some + { instance_group_id = + Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; market = + Xml.required + "Market" + (Util.option_bind (Xml.member "Market" xml) MarketType.parse) + ; instance_role = + Xml.required + "InstanceRole" + (Util.option_bind (Xml.member "InstanceRole" xml) InstanceRoleType.parse) + ; bid_price = Util.option_bind (Xml.member "BidPrice" xml) String.parse + ; instance_type = + Xml.required + "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse) + ; instance_request_count = + Xml.required + "InstanceRequestCount" + (Util.option_bind (Xml.member "InstanceRequestCount" xml) Integer.parse) + ; instance_running_count = + Xml.required + "InstanceRunningCount" + (Util.option_bind (Xml.member "InstanceRunningCount" xml) Integer.parse) + ; state = + Xml.required + "State" + (Util.option_bind (Xml.member "State" xml) InstanceGroupState.parse) + ; last_state_change_reason = + Util.option_bind (Xml.member "LastStateChangeReason" xml) String.parse + ; creation_date_time = + Xml.required + "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse) + ; start_date_time = Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module InstanceGroupTimeline = - struct - type t = - { - creation_date_time: DateTime.t option ; - ready_date_time: DateTime.t option ; - end_date_time: DateTime.t option } - let make ?creation_date_time ?ready_date_time ?end_date_time () = - { creation_date_time; ready_date_time; end_date_time } - let parse xml = - Some - { - creation_date_time = - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse); - ready_date_time = - (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.ready_date_time - (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); - Util.option_map v.creation_date_time - (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.ready_date_time - (fun f -> ("ready_date_time", (DateTime.to_json f))); - Util.option_map v.creation_date_time - (fun f -> ("creation_date_time", (DateTime.to_json f)))]) - let of_json j = - { - creation_date_time = - (Util.option_map (Json.lookup j "creation_date_time") - DateTime.of_json); - ready_date_time = - (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.start_date_time (fun f -> + Query.Pair ("StartDateTime", DateTime.to_query f)) + ; Some (Query.Pair ("CreationDateTime", DateTime.to_query v.creation_date_time)) + ; Util.option_map v.last_state_change_reason (fun f -> + Query.Pair ("LastStateChangeReason", String.to_query f)) + ; Some (Query.Pair ("State", InstanceGroupState.to_query v.state)) + ; Some + (Query.Pair + ("InstanceRunningCount", Integer.to_query v.instance_running_count)) + ; Some + (Query.Pair + ("InstanceRequestCount", Integer.to_query v.instance_request_count)) + ; Some (Query.Pair ("InstanceType", String.to_query v.instance_type)) + ; Util.option_map v.bid_price (fun f -> + Query.Pair ("BidPrice", String.to_query f)) + ; Some (Query.Pair ("InstanceRole", InstanceRoleType.to_query v.instance_role)) + ; Some (Query.Pair ("Market", MarketType.to_query v.market)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.instance_group_id (fun f -> + Query.Pair ("InstanceGroupId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.start_date_time (fun f -> + "start_date_time", DateTime.to_json f) + ; Some ("creation_date_time", DateTime.to_json v.creation_date_time) + ; Util.option_map v.last_state_change_reason (fun f -> + "last_state_change_reason", String.to_json f) + ; Some ("state", InstanceGroupState.to_json v.state) + ; Some ("instance_running_count", Integer.to_json v.instance_running_count) + ; Some ("instance_request_count", Integer.to_json v.instance_request_count) + ; Some ("instance_type", String.to_json v.instance_type) + ; Util.option_map v.bid_price (fun f -> "bid_price", String.to_json f) + ; Some ("instance_role", InstanceRoleType.to_json v.instance_role) + ; Some ("market", MarketType.to_json v.market) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.instance_group_id (fun f -> + "instance_group_id", String.to_json f) + ]) + + let of_json j = + { instance_group_id = + Util.option_map (Json.lookup j "instance_group_id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; market = MarketType.of_json (Util.of_option_exn (Json.lookup j "market")) + ; instance_role = + InstanceRoleType.of_json (Util.of_option_exn (Json.lookup j "instance_role")) + ; bid_price = Util.option_map (Json.lookup j "bid_price") String.of_json + ; instance_type = String.of_json (Util.of_option_exn (Json.lookup j "instance_type")) + ; instance_request_count = + Integer.of_json (Util.of_option_exn (Json.lookup j "instance_request_count")) + ; instance_running_count = + Integer.of_json (Util.of_option_exn (Json.lookup j "instance_running_count")) + ; state = InstanceGroupState.of_json (Util.of_option_exn (Json.lookup j "state")) + ; last_state_change_reason = + Util.option_map (Json.lookup j "last_state_change_reason") String.of_json + ; creation_date_time = + DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date_time")) + ; start_date_time = Util.option_map (Json.lookup j "start_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module XmlStringMaxLen256List = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module StepConfig = struct + type t = + { name : String.t + ; action_on_failure : ActionOnFailure.t option + ; hadoop_jar_step : HadoopJarStepConfig.t + } + + let make ~name ?action_on_failure ~hadoop_jar_step () = + { name; action_on_failure; hadoop_jar_step } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; action_on_failure = + Util.option_bind (Xml.member "ActionOnFailure" xml) ActionOnFailure.parse + ; hadoop_jar_step = + Xml.required + "HadoopJarStep" + (Util.option_bind (Xml.member "HadoopJarStep" xml) HadoopJarStepConfig.parse) } - end -module InstanceState = - struct - type t = - | AWAITING_FULFILLMENT - | PROVISIONING - | BOOTSTRAPPING - | RUNNING - | TERMINATED - let str_to_t = - [("TERMINATED", TERMINATED); - ("RUNNING", RUNNING); - ("BOOTSTRAPPING", BOOTSTRAPPING); - ("PROVISIONING", PROVISIONING); - ("AWAITING_FULFILLMENT", AWAITING_FULFILLMENT)] - let t_to_str = - [(TERMINATED, "TERMINATED"); - (RUNNING, "RUNNING"); - (BOOTSTRAPPING, "BOOTSTRAPPING"); - (PROVISIONING, "PROVISIONING"); - (AWAITING_FULFILLMENT, "AWAITING_FULFILLMENT")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceStateChangeReason = - struct - type t = - { - code: InstanceStateChangeReasonCode.t option ; - message: String.t option } - let make ?code ?message () = { code; message } - let parse xml = - Some - { - code = - (Util.option_bind (Xml.member "Code" xml) - InstanceStateChangeReasonCode.parse); - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f))); - Util.option_map v.code - (fun f -> - Query.Pair - ("Code", (InstanceStateChangeReasonCode.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f))); - Util.option_map v.code - (fun f -> ("code", (InstanceStateChangeReasonCode.to_json f)))]) - let of_json j = - { - code = - (Util.option_map (Json.lookup j "code") - InstanceStateChangeReasonCode.of_json); - message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("HadoopJarStep", HadoopJarStepConfig.to_query v.hadoop_jar_step)) + ; Util.option_map v.action_on_failure (fun f -> + Query.Pair ("ActionOnFailure", ActionOnFailure.to_query f)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("hadoop_jar_step", HadoopJarStepConfig.to_json v.hadoop_jar_step) + ; Util.option_map v.action_on_failure (fun f -> + "action_on_failure", ActionOnFailure.to_json f) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; action_on_failure = + Util.option_map (Json.lookup j "action_on_failure") ActionOnFailure.of_json + ; hadoop_jar_step = + HadoopJarStepConfig.of_json (Util.of_option_exn (Json.lookup j "hadoop_jar_step")) + } +end + +module StepExecutionStatusDetail = struct + type t = + { state : StepExecutionState.t + ; creation_date_time : DateTime.t + ; start_date_time : DateTime.t option + ; end_date_time : DateTime.t option + ; last_state_change_reason : String.t option + } + + let make + ~state + ~creation_date_time + ?start_date_time + ?end_date_time + ?last_state_change_reason + () = + { state + ; creation_date_time + ; start_date_time + ; end_date_time + ; last_state_change_reason + } + + let parse xml = + Some + { state = + Xml.required + "State" + (Util.option_bind (Xml.member "State" xml) StepExecutionState.parse) + ; creation_date_time = + Xml.required + "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse) + ; start_date_time = Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse + ; last_state_change_reason = + Util.option_bind (Xml.member "LastStateChangeReason" xml) String.parse } - end -module InstanceTimeline = - struct - type t = - { - creation_date_time: DateTime.t option ; - ready_date_time: DateTime.t option ; - end_date_time: DateTime.t option } - let make ?creation_date_time ?ready_date_time ?end_date_time () = - { creation_date_time; ready_date_time; end_date_time } - let parse xml = - Some - { - creation_date_time = - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse); - ready_date_time = - (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.ready_date_time - (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); - Util.option_map v.creation_date_time - (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.ready_date_time - (fun f -> ("ready_date_time", (DateTime.to_json f))); - Util.option_map v.creation_date_time - (fun f -> ("creation_date_time", (DateTime.to_json f)))]) - let of_json j = - { - creation_date_time = - (Util.option_map (Json.lookup j "creation_date_time") - DateTime.of_json); - ready_date_time = - (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.last_state_change_reason (fun f -> + Query.Pair ("LastStateChangeReason", String.to_query f)) + ; Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.start_date_time (fun f -> + Query.Pair ("StartDateTime", DateTime.to_query f)) + ; Some (Query.Pair ("CreationDateTime", DateTime.to_query v.creation_date_time)) + ; Some (Query.Pair ("State", StepExecutionState.to_query v.state)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.last_state_change_reason (fun f -> + "last_state_change_reason", String.to_json f) + ; Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.start_date_time (fun f -> + "start_date_time", DateTime.to_json f) + ; Some ("creation_date_time", DateTime.to_json v.creation_date_time) + ; Some ("state", StepExecutionState.to_json v.state) + ]) + + let of_json j = + { state = StepExecutionState.of_json (Util.of_option_exn (Json.lookup j "state")) + ; creation_date_time = + DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date_time")) + ; start_date_time = Util.option_map (Json.lookup j "start_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + ; last_state_change_reason = + Util.option_map (Json.lookup j "last_state_change_reason") String.of_json + } +end + +module StringList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module InstanceFleetProvisioningSpecifications = struct + type t = { spot_specification : SpotProvisioningSpecification.t } + + let make ~spot_specification () = { spot_specification } + + let parse xml = + Some + { spot_specification = + Xml.required + "SpotSpecification" + (Util.option_bind + (Xml.member "SpotSpecification" xml) + SpotProvisioningSpecification.parse) } - end -module ClusterState = - struct - type t = - | STARTING - | BOOTSTRAPPING - | RUNNING - | WAITING - | TERMINATING - | TERMINATED - | TERMINATED_WITH_ERRORS - let str_to_t = - [("TERMINATED_WITH_ERRORS", TERMINATED_WITH_ERRORS); - ("TERMINATED", TERMINATED); - ("TERMINATING", TERMINATING); - ("WAITING", WAITING); - ("RUNNING", RUNNING); - ("BOOTSTRAPPING", BOOTSTRAPPING); - ("STARTING", STARTING)] - let t_to_str = - [(TERMINATED_WITH_ERRORS, "TERMINATED_WITH_ERRORS"); - (TERMINATED, "TERMINATED"); - (TERMINATING, "TERMINATING"); - (WAITING, "WAITING"); - (RUNNING, "RUNNING"); - (BOOTSTRAPPING, "BOOTSTRAPPING"); - (STARTING, "STARTING")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module ClusterStateChangeReason = - struct - type t = - { - code: ClusterStateChangeReasonCode.t option ; - message: String.t option } - let make ?code ?message () = { code; message } - let parse xml = - Some - { - code = - (Util.option_bind (Xml.member "Code" xml) - ClusterStateChangeReasonCode.parse); - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f))); - Util.option_map v.code - (fun f -> - Query.Pair - ("Code", (ClusterStateChangeReasonCode.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f))); - Util.option_map v.code - (fun f -> ("code", (ClusterStateChangeReasonCode.to_json f)))]) - let of_json j = - { - code = - (Util.option_map (Json.lookup j "code") - ClusterStateChangeReasonCode.of_json); - message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "SpotSpecification" + , SpotProvisioningSpecification.to_query v.spot_specification )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "spot_specification" + , SpotProvisioningSpecification.to_json v.spot_specification ) + ]) + + let of_json j = + { spot_specification = + SpotProvisioningSpecification.of_json + (Util.of_option_exn (Json.lookup j "spot_specification")) + } +end + +module InstanceFleetType = struct + type t = + | MASTER + | CORE + | TASK + + let str_to_t = [ "TASK", TASK; "CORE", CORE; "MASTER", MASTER ] + + let t_to_str = [ TASK, "TASK"; CORE, "CORE"; MASTER, "MASTER" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceTypeConfigList = struct + type t = InstanceTypeConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceTypeConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceTypeConfig.to_query v + + let to_json v = `List (List.map InstanceTypeConfig.to_json v) + + let of_json j = Json.to_list InstanceTypeConfig.of_json j +end + +module AutoScalingPolicy = struct + type t = + { constraints : ScalingConstraints.t + ; rules : ScalingRuleList.t + } + + let make ~constraints ~rules () = { constraints; rules } + + let parse xml = + Some + { constraints = + Xml.required + "Constraints" + (Util.option_bind (Xml.member "Constraints" xml) ScalingConstraints.parse) + ; rules = + Xml.required + "Rules" + (Util.option_bind (Xml.member "Rules" xml) ScalingRuleList.parse) } - end -module ClusterTimeline = - struct - type t = - { - creation_date_time: DateTime.t option ; - ready_date_time: DateTime.t option ; - end_date_time: DateTime.t option } - let make ?creation_date_time ?ready_date_time ?end_date_time () = - { creation_date_time; ready_date_time; end_date_time } - let parse xml = - Some - { - creation_date_time = - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse); - ready_date_time = - (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.ready_date_time - (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); - Util.option_map v.creation_date_time - (fun f -> Query.Pair ("CreationDateTime", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.ready_date_time - (fun f -> ("ready_date_time", (DateTime.to_json f))); - Util.option_map v.creation_date_time - (fun f -> ("creation_date_time", (DateTime.to_json f)))]) - let of_json j = - { - creation_date_time = - (Util.option_map (Json.lookup j "creation_date_time") - DateTime.of_json); - ready_date_time = - (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Rules.member", ScalingRuleList.to_query v.rules)) + ; Some (Query.Pair ("Constraints", ScalingConstraints.to_query v.constraints)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("rules", ScalingRuleList.to_json v.rules) + ; Some ("constraints", ScalingConstraints.to_json v.constraints) + ]) + + let of_json j = + { constraints = + ScalingConstraints.of_json (Util.of_option_exn (Json.lookup j "constraints")) + ; rules = ScalingRuleList.of_json (Util.of_option_exn (Json.lookup j "rules")) + } +end + +module InstanceFleetState = struct + type t = + | PROVISIONING + | BOOTSTRAPPING + | RUNNING + | RESIZING + | SUSPENDED + | TERMINATING + | TERMINATED + + let str_to_t = + [ "TERMINATED", TERMINATED + ; "TERMINATING", TERMINATING + ; "SUSPENDED", SUSPENDED + ; "RESIZING", RESIZING + ; "RUNNING", RUNNING + ; "BOOTSTRAPPING", BOOTSTRAPPING + ; "PROVISIONING", PROVISIONING + ] + + let t_to_str = + [ TERMINATED, "TERMINATED" + ; TERMINATING, "TERMINATING" + ; SUSPENDED, "SUSPENDED" + ; RESIZING, "RESIZING" + ; RUNNING, "RUNNING" + ; BOOTSTRAPPING, "BOOTSTRAPPING" + ; PROVISIONING, "PROVISIONING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceFleetStateChangeReason = struct + type t = + { code : InstanceFleetStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = + Util.option_bind + (Xml.member "Code" xml) + InstanceFleetStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - end -module BootstrapActionDetail = - struct - type t = { - bootstrap_action_config: BootstrapActionConfig.t option } - let make ?bootstrap_action_config () = { bootstrap_action_config } - let parse xml = - Some - { - bootstrap_action_config = - (Util.option_bind (Xml.member "BootstrapActionConfig" xml) - BootstrapActionConfig.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.bootstrap_action_config - (fun f -> - Query.Pair - ("BootstrapActionConfig", - (BootstrapActionConfig.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.bootstrap_action_config - (fun f -> - ("bootstrap_action_config", - (BootstrapActionConfig.to_json f)))]) - let of_json j = - { - bootstrap_action_config = - (Util.option_map (Json.lookup j "bootstrap_action_config") - BootstrapActionConfig.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", InstanceFleetStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> + "code", InstanceFleetStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = + Util.option_map (Json.lookup j "code") InstanceFleetStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module InstanceFleetTimeline = struct + type t = + { creation_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + + let parse xml = + Some + { creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module JobFlowExecutionState = - struct - type t = - | STARTING - | BOOTSTRAPPING - | RUNNING - | WAITING - | SHUTTING_DOWN - | TERMINATED - | COMPLETED - | FAILED - let str_to_t = - [("FAILED", FAILED); - ("COMPLETED", COMPLETED); - ("TERMINATED", TERMINATED); - ("SHUTTING_DOWN", SHUTTING_DOWN); - ("WAITING", WAITING); - ("RUNNING", RUNNING); - ("BOOTSTRAPPING", BOOTSTRAPPING); - ("STARTING", STARTING)] - let t_to_str = - [(FAILED, "FAILED"); - (COMPLETED, "COMPLETED"); - (TERMINATED, "TERMINATED"); - (SHUTTING_DOWN, "SHUTTING_DOWN"); - (WAITING, "WAITING"); - (RUNNING, "RUNNING"); - (BOOTSTRAPPING, "BOOTSTRAPPING"); - (STARTING, "STARTING")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceGroupDetailList = - struct - type t = InstanceGroupDetail.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map InstanceGroupDetail.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list InstanceGroupDetail.to_query v - let to_json v = `List (List.map InstanceGroupDetail.to_json v) - let of_json j = Json.to_list InstanceGroupDetail.of_json j - end -module PlacementType = - struct - type t = { - availability_zone: String.t } - let make ~availability_zone () = { availability_zone } - let parse xml = - Some - { - availability_zone = - (Xml.required "AvailabilityZone" - (Util.option_bind (Xml.member "AvailabilityZone" xml) - String.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("AvailabilityZone", (String.to_query v.availability_zone)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("availability_zone", (String.to_json v.availability_zone))]) - let of_json j = - { - availability_zone = - (String.of_json - (Util.of_option_exn (Json.lookup j "availability_zone"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ]) + + let of_json j = + { creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module InstanceTypeSpecification = struct + type t = + { instance_type : String.t option + ; weighted_capacity : Integer.t option + ; bid_price : String.t option + ; bid_price_as_percentage_of_on_demand_price : Double.t option + ; configurations : ConfigurationList.t + ; ebs_block_devices : EbsBlockDeviceList.t + ; ebs_optimized : Boolean.t option + } + + let make + ?instance_type + ?weighted_capacity + ?bid_price + ?bid_price_as_percentage_of_on_demand_price + ?(configurations = []) + ?(ebs_block_devices = []) + ?ebs_optimized + () = + { instance_type + ; weighted_capacity + ; bid_price + ; bid_price_as_percentage_of_on_demand_price + ; configurations + ; ebs_block_devices + ; ebs_optimized + } + + let parse xml = + Some + { instance_type = Util.option_bind (Xml.member "InstanceType" xml) String.parse + ; weighted_capacity = + Util.option_bind (Xml.member "WeightedCapacity" xml) Integer.parse + ; bid_price = Util.option_bind (Xml.member "BidPrice" xml) String.parse + ; bid_price_as_percentage_of_on_demand_price = + Util.option_bind + (Xml.member "BidPriceAsPercentageOfOnDemandPrice" xml) + Double.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; ebs_block_devices = + Util.of_option + [] + (Util.option_bind (Xml.member "EbsBlockDevices" xml) EbsBlockDeviceList.parse) + ; ebs_optimized = Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse } - end -module StepDetail = - struct - type t = - { - step_config: StepConfig.t ; - execution_status_detail: StepExecutionStatusDetail.t } - let make ~step_config ~execution_status_detail () = - { step_config; execution_status_detail } - let parse xml = - Some - { - step_config = - (Xml.required "StepConfig" - (Util.option_bind (Xml.member "StepConfig" xml) - StepConfig.parse)); - execution_status_detail = - (Xml.required "ExecutionStatusDetail" - (Util.option_bind (Xml.member "ExecutionStatusDetail" xml) - StepExecutionStatusDetail.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("ExecutionStatusDetail", - (StepExecutionStatusDetail.to_query - v.execution_status_detail))); - Some - (Query.Pair ("StepConfig", (StepConfig.to_query v.step_config)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("execution_status_detail", - (StepExecutionStatusDetail.to_json v.execution_status_detail)); - Some ("step_config", (StepConfig.to_json v.step_config))]) - let of_json j = - { - step_config = - (StepConfig.of_json - (Util.of_option_exn (Json.lookup j "step_config"))); - execution_status_detail = - (StepExecutionStatusDetail.of_json - (Util.of_option_exn (Json.lookup j "execution_status_detail"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.ebs_optimized (fun f -> + Query.Pair ("EbsOptimized", Boolean.to_query f)) + ; Some + (Query.Pair + ("EbsBlockDevices.member", EbsBlockDeviceList.to_query v.ebs_block_devices)) + ; Some + (Query.Pair + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.bid_price_as_percentage_of_on_demand_price (fun f -> + Query.Pair ("BidPriceAsPercentageOfOnDemandPrice", Double.to_query f)) + ; Util.option_map v.bid_price (fun f -> + Query.Pair ("BidPrice", String.to_query f)) + ; Util.option_map v.weighted_capacity (fun f -> + Query.Pair ("WeightedCapacity", Integer.to_query f)) + ; Util.option_map v.instance_type (fun f -> + Query.Pair ("InstanceType", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) + ; Some ("ebs_block_devices", EbsBlockDeviceList.to_json v.ebs_block_devices) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.bid_price_as_percentage_of_on_demand_price (fun f -> + "bid_price_as_percentage_of_on_demand_price", Double.to_json f) + ; Util.option_map v.bid_price (fun f -> "bid_price", String.to_json f) + ; Util.option_map v.weighted_capacity (fun f -> + "weighted_capacity", Integer.to_json f) + ; Util.option_map v.instance_type (fun f -> "instance_type", String.to_json f) + ]) + + let of_json j = + { instance_type = Util.option_map (Json.lookup j "instance_type") String.of_json + ; weighted_capacity = + Util.option_map (Json.lookup j "weighted_capacity") Integer.of_json + ; bid_price = Util.option_map (Json.lookup j "bid_price") String.of_json + ; bid_price_as_percentage_of_on_demand_price = + Util.option_map + (Json.lookup j "bid_price_as_percentage_of_on_demand_price") + Double.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; ebs_block_devices = + EbsBlockDeviceList.of_json + (Util.of_option_exn (Json.lookup j "ebs_block_devices")) + ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json + } +end + +module FailureDetails = struct + type t = + { reason : String.t option + ; message : String.t option + ; log_file : String.t option + } + + let make ?reason ?message ?log_file () = { reason; message; log_file } + + let parse xml = + Some + { reason = Util.option_bind (Xml.member "Reason" xml) String.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse + ; log_file = Util.option_bind (Xml.member "LogFile" xml) String.parse } - end -module Application = - struct - type t = - { - name: String.t option ; - version: String.t option ; - args: StringList.t ; - additional_info: StringMap.t option } - let make ?name ?version ?(args= []) ?additional_info () = - { name; version; args; additional_info } - let parse xml = - Some - { - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - version = - (Util.option_bind (Xml.member "Version" xml) String.parse); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) StringList.parse)); - additional_info = - (Util.option_bind (Xml.member "AdditionalInfo" xml) - StringMap.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.additional_info - (fun f -> Query.Pair ("AdditionalInfo", (StringMap.to_query f))); - Some (Query.Pair ("Args.member", (StringList.to_query v.args))); - Util.option_map v.version - (fun f -> Query.Pair ("Version", (String.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.additional_info - (fun f -> ("additional_info", (StringMap.to_json f))); - Some ("args", (StringList.to_json v.args)); - Util.option_map v.version - (fun f -> ("version", (String.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) - let of_json j = - { - name = (Util.option_map (Json.lookup j "name") String.of_json); - version = (Util.option_map (Json.lookup j "version") String.of_json); - args = - (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))); - additional_info = - (Util.option_map (Json.lookup j "additional_info") - StringMap.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.log_file (fun f -> Query.Pair ("LogFile", String.to_query f)) + ; Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.reason (fun f -> Query.Pair ("Reason", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.log_file (fun f -> "log_file", String.to_json f) + ; Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.reason (fun f -> "reason", String.to_json f) + ]) + + let of_json j = + { reason = Util.option_map (Json.lookup j "reason") String.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + ; log_file = Util.option_map (Json.lookup j "log_file") String.of_json + } +end + +module StepState = struct + type t = + | PENDING + | CANCEL_PENDING + | RUNNING + | COMPLETED + | CANCELLED + | FAILED + | INTERRUPTED + + let str_to_t = + [ "INTERRUPTED", INTERRUPTED + ; "FAILED", FAILED + ; "CANCELLED", CANCELLED + ; "COMPLETED", COMPLETED + ; "RUNNING", RUNNING + ; "CANCEL_PENDING", CANCEL_PENDING + ; "PENDING", PENDING + ] + + let t_to_str = + [ INTERRUPTED, "INTERRUPTED" + ; FAILED, "FAILED" + ; CANCELLED, "CANCELLED" + ; COMPLETED, "COMPLETED" + ; RUNNING, "RUNNING" + ; CANCEL_PENDING, "CANCEL_PENDING" + ; PENDING, "PENDING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module StepStateChangeReason = struct + type t = + { code : StepStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = Util.option_bind (Xml.member "Code" xml) StepStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - end -module Tag = - struct - type t = { - key: String.t option ; - value: String.t option } - let make ?key ?value () = { key; value } - let parse xml = - Some - { - key = (Util.option_bind (Xml.member "Key" xml) String.parse); - value = (Util.option_bind (Xml.member "Value" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.value - (fun f -> Query.Pair ("Value", (String.to_query f))); - Util.option_map v.key - (fun f -> Query.Pair ("Key", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.value (fun f -> ("value", (String.to_json f))); - Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) - let of_json j = - { - key = (Util.option_map (Json.lookup j "key") String.of_json); - value = (Util.option_map (Json.lookup j "value") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", StepStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> "code", StepStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = Util.option_map (Json.lookup j "code") StepStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module StepTimeline = struct + type t = + { creation_date_time : DateTime.t option + ; start_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make ?creation_date_time ?start_date_time ?end_date_time () = + { creation_date_time; start_date_time; end_date_time } + + let parse xml = + Some + { creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + ; start_date_time = Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module InstanceGroupConfig = - struct - type t = - { - name: String.t option ; - market: MarketType.t option ; - instance_role: InstanceRoleType.t ; - bid_price: String.t option ; - instance_type: String.t ; - instance_count: Integer.t ; - configurations: ConfigurationList.t } - let make ?name ?market ~instance_role ?bid_price ~instance_type - ~instance_count ?(configurations= []) () = - { - name; - market; - instance_role; - bid_price; - instance_type; - instance_count; - configurations + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.start_date_time (fun f -> + Query.Pair ("StartDateTime", DateTime.to_query f)) + ; Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.start_date_time (fun f -> + "start_date_time", DateTime.to_json f) + ; Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ]) + + let of_json j = + { creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + ; start_date_time = Util.option_map (Json.lookup j "start_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module InstanceResizePolicy = struct + type t = + { instances_to_terminate : EC2InstanceIdsList.t + ; instances_to_protect : EC2InstanceIdsList.t + ; instance_termination_timeout : Integer.t option + } + + let make + ?(instances_to_terminate = []) + ?(instances_to_protect = []) + ?instance_termination_timeout + () = + { instances_to_terminate; instances_to_protect; instance_termination_timeout } + + let parse xml = + Some + { instances_to_terminate = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstancesToTerminate" xml) + EC2InstanceIdsList.parse) + ; instances_to_protect = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstancesToProtect" xml) + EC2InstanceIdsList.parse) + ; instance_termination_timeout = + Util.option_bind (Xml.member "InstanceTerminationTimeout" xml) Integer.parse } - let parse xml = - Some - { - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - market = - (Util.option_bind (Xml.member "Market" xml) MarketType.parse); - instance_role = - (Xml.required "InstanceRole" - (Util.option_bind (Xml.member "InstanceRole" xml) - InstanceRoleType.parse)); - bid_price = - (Util.option_bind (Xml.member "BidPrice" xml) String.parse); - instance_type = - (Xml.required "InstanceType" - (Util.option_bind (Xml.member "InstanceType" xml) String.parse)); - instance_count = - (Xml.required "InstanceCount" - (Util.option_bind (Xml.member "InstanceCount" xml) - Integer.parse)); - configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "Configurations" xml) - ConfigurationList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("Configurations.member", - (ConfigurationList.to_query v.configurations))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.instance_termination_timeout (fun f -> + Query.Pair ("InstanceTerminationTimeout", Integer.to_query f)) + ; Some (Query.Pair - ("InstanceCount", (Integer.to_query v.instance_count))); - Some - (Query.Pair ("InstanceType", (String.to_query v.instance_type))); - Util.option_map v.bid_price - (fun f -> Query.Pair ("BidPrice", (String.to_query f))); - Some + ( "InstancesToProtect.member" + , EC2InstanceIdsList.to_query v.instances_to_protect )) + ; Some (Query.Pair - ("InstanceRole", (InstanceRoleType.to_query v.instance_role))); - Util.option_map v.market - (fun f -> Query.Pair ("Market", (MarketType.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("configurations", - (ConfigurationList.to_json v.configurations)); - Some ("instance_count", (Integer.to_json v.instance_count)); - Some ("instance_type", (String.to_json v.instance_type)); - Util.option_map v.bid_price - (fun f -> ("bid_price", (String.to_json f))); - Some ("instance_role", (InstanceRoleType.to_json v.instance_role)); - Util.option_map v.market - (fun f -> ("market", (MarketType.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) - let of_json j = - { - name = (Util.option_map (Json.lookup j "name") String.of_json); - market = - (Util.option_map (Json.lookup j "market") MarketType.of_json); - instance_role = - (InstanceRoleType.of_json - (Util.of_option_exn (Json.lookup j "instance_role"))); - bid_price = - (Util.option_map (Json.lookup j "bid_price") String.of_json); - instance_type = - (String.of_json - (Util.of_option_exn (Json.lookup j "instance_type"))); - instance_count = - (Integer.of_json - (Util.of_option_exn (Json.lookup j "instance_count"))); - configurations = - (ConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "configurations"))) + ( "InstancesToTerminate.member" + , EC2InstanceIdsList.to_query v.instances_to_terminate )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.instance_termination_timeout (fun f -> + "instance_termination_timeout", Integer.to_json f) + ; Some ("instances_to_protect", EC2InstanceIdsList.to_json v.instances_to_protect) + ; Some + ( "instances_to_terminate" + , EC2InstanceIdsList.to_json v.instances_to_terminate ) + ]) + + let of_json j = + { instances_to_terminate = + EC2InstanceIdsList.of_json + (Util.of_option_exn (Json.lookup j "instances_to_terminate")) + ; instances_to_protect = + EC2InstanceIdsList.of_json + (Util.of_option_exn (Json.lookup j "instances_to_protect")) + ; instance_termination_timeout = + Util.option_map (Json.lookup j "instance_termination_timeout") Integer.of_json + } +end + +module AutoScalingPolicyStatus = struct + type t = + { state : AutoScalingPolicyState.t option + ; state_change_reason : AutoScalingPolicyStateChangeReason.t option + } + + let make ?state ?state_change_reason () = { state; state_change_reason } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) AutoScalingPolicyState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + AutoScalingPolicyStateChangeReason.parse } - end -module HadoopStepConfig = - struct - type t = - { - jar: String.t option ; - properties: StringMap.t option ; - main_class: String.t option ; - args: StringList.t } - let make ?jar ?properties ?main_class ?(args= []) () = - { jar; properties; main_class; args } - let parse xml = - Some - { - jar = (Util.option_bind (Xml.member "Jar" xml) String.parse); - properties = - (Util.option_bind (Xml.member "Properties" xml) StringMap.parse); - main_class = - (Util.option_bind (Xml.member "MainClass" xml) String.parse); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) StringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("Args.member", (StringList.to_query v.args))); - Util.option_map v.main_class - (fun f -> Query.Pair ("MainClass", (String.to_query f))); - Util.option_map v.properties - (fun f -> Query.Pair ("Properties", (StringMap.to_query f))); - Util.option_map v.jar - (fun f -> Query.Pair ("Jar", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("args", (StringList.to_json v.args)); - Util.option_map v.main_class - (fun f -> ("main_class", (String.to_json f))); - Util.option_map v.properties - (fun f -> ("properties", (StringMap.to_json f))); - Util.option_map v.jar (fun f -> ("jar", (String.to_json f)))]) - let of_json j = - { - jar = (Util.option_map (Json.lookup j "jar") String.of_json); - properties = - (Util.option_map (Json.lookup j "properties") StringMap.of_json); - main_class = - (Util.option_map (Json.lookup j "main_class") String.of_json); - args = - (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.state_change_reason (fun f -> + Query.Pair + ("StateChangeReason", AutoScalingPolicyStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> + Query.Pair ("State", AutoScalingPolicyState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.state_change_reason (fun f -> + "state_change_reason", AutoScalingPolicyStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", AutoScalingPolicyState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") AutoScalingPolicyState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + AutoScalingPolicyStateChangeReason.of_json + } +end + +module InstanceGroupStateChangeReason = struct + type t = + { code : InstanceGroupStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = + Util.option_bind + (Xml.member "Code" xml) + InstanceGroupStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - end -module StepStatus = - struct - type t = - { - state: StepState.t option ; - state_change_reason: StepStateChangeReason.t option ; - timeline: StepTimeline.t option } - let make ?state ?state_change_reason ?timeline () = - { state; state_change_reason; timeline } - let parse xml = - Some - { - state = (Util.option_bind (Xml.member "State" xml) StepState.parse); - state_change_reason = - (Util.option_bind (Xml.member "StateChangeReason" xml) - StepStateChangeReason.parse); - timeline = - (Util.option_bind (Xml.member "Timeline" xml) StepTimeline.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> Query.Pair ("Timeline", (StepTimeline.to_query f))); - Util.option_map v.state_change_reason - (fun f -> - Query.Pair - ("StateChangeReason", (StepStateChangeReason.to_query f))); - Util.option_map v.state - (fun f -> Query.Pair ("State", (StepState.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> ("timeline", (StepTimeline.to_json f))); - Util.option_map v.state_change_reason - (fun f -> - ("state_change_reason", (StepStateChangeReason.to_json f))); - Util.option_map v.state - (fun f -> ("state", (StepState.to_json f)))]) - let of_json j = - { - state = (Util.option_map (Json.lookup j "state") StepState.of_json); - state_change_reason = - (Util.option_map (Json.lookup j "state_change_reason") - StepStateChangeReason.of_json); - timeline = - (Util.option_map (Json.lookup j "timeline") StepTimeline.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", InstanceGroupStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> + "code", InstanceGroupStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = + Util.option_map (Json.lookup j "code") InstanceGroupStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module InstanceGroupTimeline = struct + type t = + { creation_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + + let parse xml = + Some + { creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module EC2InstanceIdsToTerminateList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module InstanceGroupStatus = - struct - type t = - { - state: InstanceGroupState.t option ; - state_change_reason: InstanceGroupStateChangeReason.t option ; - timeline: InstanceGroupTimeline.t option } - let make ?state ?state_change_reason ?timeline () = - { state; state_change_reason; timeline } - let parse xml = - Some - { - state = - (Util.option_bind (Xml.member "State" xml) - InstanceGroupState.parse); - state_change_reason = - (Util.option_bind (Xml.member "StateChangeReason" xml) - InstanceGroupStateChangeReason.parse); - timeline = - (Util.option_bind (Xml.member "Timeline" xml) - InstanceGroupTimeline.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> - Query.Pair ("Timeline", (InstanceGroupTimeline.to_query f))); - Util.option_map v.state_change_reason - (fun f -> - Query.Pair - ("StateChangeReason", - (InstanceGroupStateChangeReason.to_query f))); - Util.option_map v.state - (fun f -> Query.Pair ("State", (InstanceGroupState.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> ("timeline", (InstanceGroupTimeline.to_json f))); - Util.option_map v.state_change_reason - (fun f -> - ("state_change_reason", - (InstanceGroupStateChangeReason.to_json f))); - Util.option_map v.state - (fun f -> ("state", (InstanceGroupState.to_json f)))]) - let of_json j = - { - state = - (Util.option_map (Json.lookup j "state") InstanceGroupState.of_json); - state_change_reason = - (Util.option_map (Json.lookup j "state_change_reason") - InstanceGroupStateChangeReason.of_json); - timeline = - (Util.option_map (Json.lookup j "timeline") - InstanceGroupTimeline.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ]) + + let of_json j = + { creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module EbsVolume = struct + type t = + { device : String.t option + ; volume_id : String.t option + } + + let make ?device ?volume_id () = { device; volume_id } + + let parse xml = + Some + { device = Util.option_bind (Xml.member "Device" xml) String.parse + ; volume_id = Util.option_bind (Xml.member "VolumeId" xml) String.parse } - end -module InstanceGroupType = - struct - type t = - | MASTER - | CORE - | TASK - let str_to_t = [("TASK", TASK); ("CORE", CORE); ("MASTER", MASTER)] - let t_to_str = [(TASK, "TASK"); (CORE, "CORE"); (MASTER, "MASTER")] - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - let make v () = v - let parse xml = - Util.option_bind (String.parse xml) - (fun s -> Util.list_find str_to_t s) - let to_query v = - Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - let to_json v = - String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - let of_json j = - Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) - end -module InstanceStatus = - struct - type t = - { - state: InstanceState.t option ; - state_change_reason: InstanceStateChangeReason.t option ; - timeline: InstanceTimeline.t option } - let make ?state ?state_change_reason ?timeline () = - { state; state_change_reason; timeline } - let parse xml = - Some - { - state = - (Util.option_bind (Xml.member "State" xml) InstanceState.parse); - state_change_reason = - (Util.option_bind (Xml.member "StateChangeReason" xml) - InstanceStateChangeReason.parse); - timeline = - (Util.option_bind (Xml.member "Timeline" xml) - InstanceTimeline.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> - Query.Pair ("Timeline", (InstanceTimeline.to_query f))); - Util.option_map v.state_change_reason - (fun f -> - Query.Pair - ("StateChangeReason", - (InstanceStateChangeReason.to_query f))); - Util.option_map v.state - (fun f -> Query.Pair ("State", (InstanceState.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> ("timeline", (InstanceTimeline.to_json f))); - Util.option_map v.state_change_reason - (fun f -> - ("state_change_reason", - (InstanceStateChangeReason.to_json f))); - Util.option_map v.state - (fun f -> ("state", (InstanceState.to_json f)))]) - let of_json j = - { - state = - (Util.option_map (Json.lookup j "state") InstanceState.of_json); - state_change_reason = - (Util.option_map (Json.lookup j "state_change_reason") - InstanceStateChangeReason.of_json); - timeline = - (Util.option_map (Json.lookup j "timeline") - InstanceTimeline.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.volume_id (fun f -> + Query.Pair ("VolumeId", String.to_query f)) + ; Util.option_map v.device (fun f -> Query.Pair ("Device", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) + ; Util.option_map v.device (fun f -> "device", String.to_json f) + ]) + + let of_json j = + { device = Util.option_map (Json.lookup j "device") String.of_json + ; volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json + } +end + +module InstanceState = struct + type t = + | AWAITING_FULFILLMENT + | PROVISIONING + | BOOTSTRAPPING + | RUNNING + | TERMINATED + + let str_to_t = + [ "TERMINATED", TERMINATED + ; "RUNNING", RUNNING + ; "BOOTSTRAPPING", BOOTSTRAPPING + ; "PROVISIONING", PROVISIONING + ; "AWAITING_FULFILLMENT", AWAITING_FULFILLMENT + ] + + let t_to_str = + [ TERMINATED, "TERMINATED" + ; RUNNING, "RUNNING" + ; BOOTSTRAPPING, "BOOTSTRAPPING" + ; PROVISIONING, "PROVISIONING" + ; AWAITING_FULFILLMENT, "AWAITING_FULFILLMENT" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceStateChangeReason = struct + type t = + { code : InstanceStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = + Util.option_bind (Xml.member "Code" xml) InstanceStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - end -module ClusterStatus = - struct - type t = - { - state: ClusterState.t option ; - state_change_reason: ClusterStateChangeReason.t option ; - timeline: ClusterTimeline.t option } - let make ?state ?state_change_reason ?timeline () = - { state; state_change_reason; timeline } - let parse xml = - Some - { - state = - (Util.option_bind (Xml.member "State" xml) ClusterState.parse); - state_change_reason = - (Util.option_bind (Xml.member "StateChangeReason" xml) - ClusterStateChangeReason.parse); - timeline = - (Util.option_bind (Xml.member "Timeline" xml) - ClusterTimeline.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> Query.Pair ("Timeline", (ClusterTimeline.to_query f))); - Util.option_map v.state_change_reason - (fun f -> - Query.Pair - ("StateChangeReason", - (ClusterStateChangeReason.to_query f))); - Util.option_map v.state - (fun f -> Query.Pair ("State", (ClusterState.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.timeline - (fun f -> ("timeline", (ClusterTimeline.to_json f))); - Util.option_map v.state_change_reason - (fun f -> - ("state_change_reason", (ClusterStateChangeReason.to_json f))); - Util.option_map v.state - (fun f -> ("state", (ClusterState.to_json f)))]) - let of_json j = - { - state = - (Util.option_map (Json.lookup j "state") ClusterState.of_json); - state_change_reason = - (Util.option_map (Json.lookup j "state_change_reason") - ClusterStateChangeReason.of_json); - timeline = - (Util.option_map (Json.lookup j "timeline") ClusterTimeline.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", InstanceStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> + "code", InstanceStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = Util.option_map (Json.lookup j "code") InstanceStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module InstanceTimeline = struct + type t = + { creation_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + + let parse xml = + Some + { creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module BootstrapActionDetailList = - struct - type t = BootstrapActionDetail.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map BootstrapActionDetail.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list BootstrapActionDetail.to_query v - let to_json v = `List (List.map BootstrapActionDetail.to_json v) - let of_json j = Json.to_list BootstrapActionDetail.of_json j - end -module JobFlowExecutionStatusDetail = - struct - type t = - { - state: JobFlowExecutionState.t ; - creation_date_time: DateTime.t ; - start_date_time: DateTime.t option ; - ready_date_time: DateTime.t option ; - end_date_time: DateTime.t option ; - last_state_change_reason: String.t option } - let make ~state ~creation_date_time ?start_date_time ?ready_date_time - ?end_date_time ?last_state_change_reason () = - { - state; - creation_date_time; - start_date_time; - ready_date_time; - end_date_time; - last_state_change_reason + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ]) + + let of_json j = + { creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module ClusterState = struct + type t = + | STARTING + | BOOTSTRAPPING + | RUNNING + | WAITING + | TERMINATING + | TERMINATED + | TERMINATED_WITH_ERRORS + + let str_to_t = + [ "TERMINATED_WITH_ERRORS", TERMINATED_WITH_ERRORS + ; "TERMINATED", TERMINATED + ; "TERMINATING", TERMINATING + ; "WAITING", WAITING + ; "RUNNING", RUNNING + ; "BOOTSTRAPPING", BOOTSTRAPPING + ; "STARTING", STARTING + ] + + let t_to_str = + [ TERMINATED_WITH_ERRORS, "TERMINATED_WITH_ERRORS" + ; TERMINATED, "TERMINATED" + ; TERMINATING, "TERMINATING" + ; WAITING, "WAITING" + ; RUNNING, "RUNNING" + ; BOOTSTRAPPING, "BOOTSTRAPPING" + ; STARTING, "STARTING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ClusterStateChangeReason = struct + type t = + { code : ClusterStateChangeReasonCode.t option + ; message : String.t option + } + + let make ?code ?message () = { code; message } + + let parse xml = + Some + { code = Util.option_bind (Xml.member "Code" xml) ClusterStateChangeReasonCode.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse } - let parse xml = - Some - { - state = - (Xml.required "State" - (Util.option_bind (Xml.member "State" xml) - JobFlowExecutionState.parse)); - creation_date_time = - (Xml.required "CreationDateTime" - (Util.option_bind (Xml.member "CreationDateTime" xml) - DateTime.parse)); - start_date_time = - (Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse); - ready_date_time = - (Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse); - end_date_time = - (Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse); - last_state_change_reason = - (Util.option_bind (Xml.member "LastStateChangeReason" xml) - String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.last_state_change_reason - (fun f -> - Query.Pair ("LastStateChangeReason", (String.to_query f))); - Util.option_map v.end_date_time - (fun f -> Query.Pair ("EndDateTime", (DateTime.to_query f))); - Util.option_map v.ready_date_time - (fun f -> Query.Pair ("ReadyDateTime", (DateTime.to_query f))); - Util.option_map v.start_date_time - (fun f -> Query.Pair ("StartDateTime", (DateTime.to_query f))); - Some - (Query.Pair - ("CreationDateTime", - (DateTime.to_query v.creation_date_time))); - Some - (Query.Pair ("State", (JobFlowExecutionState.to_query v.state)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.last_state_change_reason - (fun f -> ("last_state_change_reason", (String.to_json f))); - Util.option_map v.end_date_time - (fun f -> ("end_date_time", (DateTime.to_json f))); - Util.option_map v.ready_date_time - (fun f -> ("ready_date_time", (DateTime.to_json f))); - Util.option_map v.start_date_time - (fun f -> ("start_date_time", (DateTime.to_json f))); - Some - ("creation_date_time", (DateTime.to_json v.creation_date_time)); - Some ("state", (JobFlowExecutionState.to_json v.state))]) - let of_json j = - { - state = - (JobFlowExecutionState.of_json - (Util.of_option_exn (Json.lookup j "state"))); - creation_date_time = - (DateTime.of_json - (Util.of_option_exn (Json.lookup j "creation_date_time"))); - start_date_time = - (Util.option_map (Json.lookup j "start_date_time") DateTime.of_json); - ready_date_time = - (Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json); - end_date_time = - (Util.option_map (Json.lookup j "end_date_time") DateTime.of_json); - last_state_change_reason = - (Util.option_map (Json.lookup j "last_state_change_reason") - String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.code (fun f -> + Query.Pair ("Code", ClusterStateChangeReasonCode.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.code (fun f -> + "code", ClusterStateChangeReasonCode.to_json f) + ]) + + let of_json j = + { code = Util.option_map (Json.lookup j "code") ClusterStateChangeReasonCode.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module ClusterTimeline = struct + type t = + { creation_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + } + + let make ?creation_date_time ?ready_date_time ?end_date_time () = + { creation_date_time; ready_date_time; end_date_time } + + let parse xml = + Some + { creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse } - end -module JobFlowInstancesDetail = - struct - type t = - { - master_instance_type: String.t ; - master_public_dns_name: String.t option ; - master_instance_id: String.t option ; - slave_instance_type: String.t ; - instance_count: Integer.t ; - instance_groups: InstanceGroupDetailList.t ; - normalized_instance_hours: Integer.t option ; - ec2_key_name: String.t option ; - ec2_subnet_id: String.t option ; - placement: PlacementType.t option ; - keep_job_flow_alive_when_no_steps: Boolean.t option ; - termination_protected: Boolean.t option ; - hadoop_version: String.t option } - let make ~master_instance_type ?master_public_dns_name - ?master_instance_id ~slave_instance_type ~instance_count - ?(instance_groups= []) ?normalized_instance_hours ?ec2_key_name - ?ec2_subnet_id ?placement ?keep_job_flow_alive_when_no_steps - ?termination_protected ?hadoop_version () = - { - master_instance_type; - master_public_dns_name; - master_instance_id; - slave_instance_type; - instance_count; - instance_groups; - normalized_instance_hours; - ec2_key_name; - ec2_subnet_id; - placement; - keep_job_flow_alive_when_no_steps; - termination_protected; - hadoop_version + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ]) + + let of_json j = + { creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + } +end + +module BootstrapActionDetail = struct + type t = { bootstrap_action_config : BootstrapActionConfig.t option } + + let make ?bootstrap_action_config () = { bootstrap_action_config } + + let parse xml = + Some + { bootstrap_action_config = + Util.option_bind + (Xml.member "BootstrapActionConfig" xml) + BootstrapActionConfig.parse } - let parse xml = - Some - { - master_instance_type = - (Xml.required "MasterInstanceType" - (Util.option_bind (Xml.member "MasterInstanceType" xml) - String.parse)); - master_public_dns_name = - (Util.option_bind (Xml.member "MasterPublicDnsName" xml) - String.parse); - master_instance_id = - (Util.option_bind (Xml.member "MasterInstanceId" xml) - String.parse); - slave_instance_type = - (Xml.required "SlaveInstanceType" - (Util.option_bind (Xml.member "SlaveInstanceType" xml) - String.parse)); - instance_count = - (Xml.required "InstanceCount" - (Util.option_bind (Xml.member "InstanceCount" xml) - Integer.parse)); - instance_groups = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroups" xml) - InstanceGroupDetailList.parse)); - normalized_instance_hours = - (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) - Integer.parse); - ec2_key_name = - (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); - ec2_subnet_id = - (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); - placement = - (Util.option_bind (Xml.member "Placement" xml) - PlacementType.parse); - keep_job_flow_alive_when_no_steps = - (Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) - Boolean.parse); - termination_protected = - (Util.option_bind (Xml.member "TerminationProtected" xml) - Boolean.parse); - hadoop_version = - (Util.option_bind (Xml.member "HadoopVersion" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.hadoop_version - (fun f -> Query.Pair ("HadoopVersion", (String.to_query f))); - Util.option_map v.termination_protected - (fun f -> - Query.Pair ("TerminationProtected", (Boolean.to_query f))); - Util.option_map v.keep_job_flow_alive_when_no_steps - (fun f -> - Query.Pair - ("KeepJobFlowAliveWhenNoSteps", (Boolean.to_query f))); - Util.option_map v.placement - (fun f -> Query.Pair ("Placement", (PlacementType.to_query f))); - Util.option_map v.ec2_subnet_id - (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); - Util.option_map v.ec2_key_name - (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f))); - Util.option_map v.normalized_instance_hours - (fun f -> - Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); - Some - (Query.Pair - ("InstanceGroups.member", - (InstanceGroupDetailList.to_query v.instance_groups))); - Some - (Query.Pair - ("InstanceCount", (Integer.to_query v.instance_count))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.bootstrap_action_config (fun f -> + Query.Pair ("BootstrapActionConfig", BootstrapActionConfig.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.bootstrap_action_config (fun f -> + "bootstrap_action_config", BootstrapActionConfig.to_json f) + ]) + + let of_json j = + { bootstrap_action_config = + Util.option_map + (Json.lookup j "bootstrap_action_config") + BootstrapActionConfig.of_json + } +end + +module JobFlowExecutionState = struct + type t = + | STARTING + | BOOTSTRAPPING + | RUNNING + | WAITING + | SHUTTING_DOWN + | TERMINATED + | COMPLETED + | FAILED + + let str_to_t = + [ "FAILED", FAILED + ; "COMPLETED", COMPLETED + ; "TERMINATED", TERMINATED + ; "SHUTTING_DOWN", SHUTTING_DOWN + ; "WAITING", WAITING + ; "RUNNING", RUNNING + ; "BOOTSTRAPPING", BOOTSTRAPPING + ; "STARTING", STARTING + ] + + let t_to_str = + [ FAILED, "FAILED" + ; COMPLETED, "COMPLETED" + ; TERMINATED, "TERMINATED" + ; SHUTTING_DOWN, "SHUTTING_DOWN" + ; WAITING, "WAITING" + ; RUNNING, "RUNNING" + ; BOOTSTRAPPING, "BOOTSTRAPPING" + ; STARTING, "STARTING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module InstanceGroupDetailList = struct + type t = InstanceGroupDetail.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceGroupDetail.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceGroupDetail.to_query v + + let to_json v = `List (List.map InstanceGroupDetail.to_json v) + + let of_json j = Json.to_list InstanceGroupDetail.of_json j +end + +module PlacementType = struct + type t = + { availability_zone : String.t option + ; availability_zones : XmlStringMaxLen256List.t + } + + let make ?availability_zone ?(availability_zones = []) () = + { availability_zone; availability_zones } + + let parse xml = + Some + { availability_zone = + Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse + ; availability_zones = + Util.of_option + [] + (Util.option_bind + (Xml.member "AvailabilityZones" xml) + XmlStringMaxLen256List.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("SlaveInstanceType", - (String.to_query v.slave_instance_type))); - Util.option_map v.master_instance_id - (fun f -> Query.Pair ("MasterInstanceId", (String.to_query f))); - Util.option_map v.master_public_dns_name - (fun f -> - Query.Pair ("MasterPublicDnsName", (String.to_query f))); - Some + ( "AvailabilityZones.member" + , XmlStringMaxLen256List.to_query v.availability_zones )) + ; Util.option_map v.availability_zone (fun f -> + Query.Pair ("AvailabilityZone", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("availability_zones", XmlStringMaxLen256List.to_json v.availability_zones) + ; Util.option_map v.availability_zone (fun f -> + "availability_zone", String.to_json f) + ]) + + let of_json j = + { availability_zone = + Util.option_map (Json.lookup j "availability_zone") String.of_json + ; availability_zones = + XmlStringMaxLen256List.of_json + (Util.of_option_exn (Json.lookup j "availability_zones")) + } +end + +module StepDetail = struct + type t = + { step_config : StepConfig.t + ; execution_status_detail : StepExecutionStatusDetail.t + } + + let make ~step_config ~execution_status_detail () = + { step_config; execution_status_detail } + + let parse xml = + Some + { step_config = + Xml.required + "StepConfig" + (Util.option_bind (Xml.member "StepConfig" xml) StepConfig.parse) + ; execution_status_detail = + Xml.required + "ExecutionStatusDetail" + (Util.option_bind + (Xml.member "ExecutionStatusDetail" xml) + StepExecutionStatusDetail.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("MasterInstanceType", - (String.to_query v.master_instance_type)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.hadoop_version - (fun f -> ("hadoop_version", (String.to_json f))); - Util.option_map v.termination_protected - (fun f -> ("termination_protected", (Boolean.to_json f))); - Util.option_map v.keep_job_flow_alive_when_no_steps - (fun f -> - ("keep_job_flow_alive_when_no_steps", (Boolean.to_json f))); - Util.option_map v.placement - (fun f -> ("placement", (PlacementType.to_json f))); - Util.option_map v.ec2_subnet_id - (fun f -> ("ec2_subnet_id", (String.to_json f))); - Util.option_map v.ec2_key_name - (fun f -> ("ec2_key_name", (String.to_json f))); - Util.option_map v.normalized_instance_hours - (fun f -> ("normalized_instance_hours", (Integer.to_json f))); - Some - ("instance_groups", - (InstanceGroupDetailList.to_json v.instance_groups)); - Some ("instance_count", (Integer.to_json v.instance_count)); - Some - ("slave_instance_type", (String.to_json v.slave_instance_type)); - Util.option_map v.master_instance_id - (fun f -> ("master_instance_id", (String.to_json f))); - Util.option_map v.master_public_dns_name - (fun f -> ("master_public_dns_name", (String.to_json f))); - Some - ("master_instance_type", - (String.to_json v.master_instance_type))]) - let of_json j = - { - master_instance_type = - (String.of_json - (Util.of_option_exn (Json.lookup j "master_instance_type"))); - master_public_dns_name = - (Util.option_map (Json.lookup j "master_public_dns_name") - String.of_json); - master_instance_id = - (Util.option_map (Json.lookup j "master_instance_id") - String.of_json); - slave_instance_type = - (String.of_json - (Util.of_option_exn (Json.lookup j "slave_instance_type"))); - instance_count = - (Integer.of_json - (Util.of_option_exn (Json.lookup j "instance_count"))); - instance_groups = - (InstanceGroupDetailList.of_json - (Util.of_option_exn (Json.lookup j "instance_groups"))); - normalized_instance_hours = - (Util.option_map (Json.lookup j "normalized_instance_hours") - Integer.of_json); - ec2_key_name = - (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); - ec2_subnet_id = - (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); - placement = - (Util.option_map (Json.lookup j "placement") PlacementType.of_json); - keep_job_flow_alive_when_no_steps = - (Util.option_map - (Json.lookup j "keep_job_flow_alive_when_no_steps") - Boolean.of_json); - termination_protected = - (Util.option_map (Json.lookup j "termination_protected") - Boolean.of_json); - hadoop_version = - (Util.option_map (Json.lookup j "hadoop_version") String.of_json) + ( "ExecutionStatusDetail" + , StepExecutionStatusDetail.to_query v.execution_status_detail )) + ; Some (Query.Pair ("StepConfig", StepConfig.to_query v.step_config)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "execution_status_detail" + , StepExecutionStatusDetail.to_json v.execution_status_detail ) + ; Some ("step_config", StepConfig.to_json v.step_config) + ]) + + let of_json j = + { step_config = StepConfig.of_json (Util.of_option_exn (Json.lookup j "step_config")) + ; execution_status_detail = + StepExecutionStatusDetail.of_json + (Util.of_option_exn (Json.lookup j "execution_status_detail")) + } +end + +module Application = struct + type t = + { name : String.t option + ; version : String.t option + ; args : StringList.t + ; additional_info : StringMap.t option + } + + let make ?name ?version ?(args = []) ?additional_info () = + { name; version; args; additional_info } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; version = Util.option_bind (Xml.member "Version" xml) String.parse + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) StringList.parse) + ; additional_info = + Util.option_bind (Xml.member "AdditionalInfo" xml) StringMap.parse } - end -module StepDetailList = - struct - type t = StepDetail.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map StepDetail.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list StepDetail.to_query v - let to_json v = `List (List.map StepDetail.to_json v) - let of_json j = Json.to_list StepDetail.of_json j - end -module SupportedProductsList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module ApplicationList = - struct - type t = Application.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map Application.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list Application.to_query v - let to_json v = `List (List.map Application.to_json v) - let of_json j = Json.to_list Application.of_json j - end -module Ec2InstanceAttributes = - struct - type t = - { - ec2_key_name: String.t option ; - ec2_subnet_id: String.t option ; - ec2_availability_zone: String.t option ; - iam_instance_profile: String.t option ; - emr_managed_master_security_group: String.t option ; - emr_managed_slave_security_group: String.t option ; - additional_master_security_groups: StringList.t ; - additional_slave_security_groups: StringList.t } - let make ?ec2_key_name ?ec2_subnet_id ?ec2_availability_zone - ?iam_instance_profile ?emr_managed_master_security_group - ?emr_managed_slave_security_group ?(additional_master_security_groups= - []) ?(additional_slave_security_groups= []) () = - { - ec2_key_name; - ec2_subnet_id; - ec2_availability_zone; - iam_instance_profile; - emr_managed_master_security_group; - emr_managed_slave_security_group; - additional_master_security_groups; - additional_slave_security_groups + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.additional_info (fun f -> + Query.Pair ("AdditionalInfo", StringMap.to_query f)) + ; Some (Query.Pair ("Args.member", StringList.to_query v.args)) + ; Util.option_map v.version (fun f -> Query.Pair ("Version", String.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.additional_info (fun f -> + "additional_info", StringMap.to_json f) + ; Some ("args", StringList.to_json v.args) + ; Util.option_map v.version (fun f -> "version", String.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; version = Util.option_map (Json.lookup j "version") String.of_json + ; args = StringList.of_json (Util.of_option_exn (Json.lookup j "args")) + ; additional_info = + Util.option_map (Json.lookup j "additional_info") StringMap.of_json + } +end + +module Tag = struct + type t = + { key : String.t option + ; value : String.t option + } + + let make ?key ?value () = { key; value } + + let parse xml = + Some + { key = Util.option_bind (Xml.member "Key" xml) String.parse + ; value = Util.option_bind (Xml.member "Value" xml) String.parse } - let parse xml = - Some - { - ec2_key_name = - (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); - ec2_subnet_id = - (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); - ec2_availability_zone = - (Util.option_bind (Xml.member "Ec2AvailabilityZone" xml) - String.parse); - iam_instance_profile = - (Util.option_bind (Xml.member "IamInstanceProfile" xml) - String.parse); - emr_managed_master_security_group = + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) + ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.value (fun f -> "value", String.to_json f) + ; Util.option_map v.key (fun f -> "key", String.to_json f) + ]) + + let of_json j = + { key = Util.option_map (Json.lookup j "key") String.of_json + ; value = Util.option_map (Json.lookup j "value") String.of_json + } +end + +module InstanceFleetConfig = struct + type t = + { name : String.t option + ; instance_fleet_type : InstanceFleetType.t + ; target_on_demand_capacity : Integer.t option + ; target_spot_capacity : Integer.t option + ; instance_type_configs : InstanceTypeConfigList.t + ; launch_specifications : InstanceFleetProvisioningSpecifications.t option + } + + let make + ?name + ~instance_fleet_type + ?target_on_demand_capacity + ?target_spot_capacity + ?(instance_type_configs = []) + ?launch_specifications + () = + { name + ; instance_fleet_type + ; target_on_demand_capacity + ; target_spot_capacity + ; instance_type_configs + ; launch_specifications + } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; instance_fleet_type = + Xml.required + "InstanceFleetType" (Util.option_bind - (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse); - emr_managed_slave_security_group = - (Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) - String.parse); - additional_master_security_groups = - (Util.of_option [] - (Util.option_bind - (Xml.member "AdditionalMasterSecurityGroups" xml) - StringList.parse)); - additional_slave_security_groups = - (Util.of_option [] - (Util.option_bind - (Xml.member "AdditionalSlaveSecurityGroups" xml) - StringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("AdditionalSlaveSecurityGroups.member", - (StringList.to_query v.additional_slave_security_groups))); - Some + (Xml.member "InstanceFleetType" xml) + InstanceFleetType.parse) + ; target_on_demand_capacity = + Util.option_bind (Xml.member "TargetOnDemandCapacity" xml) Integer.parse + ; target_spot_capacity = + Util.option_bind (Xml.member "TargetSpotCapacity" xml) Integer.parse + ; instance_type_configs = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceTypeConfigs" xml) + InstanceTypeConfigList.parse) + ; launch_specifications = + Util.option_bind + (Xml.member "LaunchSpecifications" xml) + InstanceFleetProvisioningSpecifications.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.launch_specifications (fun f -> + Query.Pair + ( "LaunchSpecifications" + , InstanceFleetProvisioningSpecifications.to_query f )) + ; Some + (Query.Pair + ( "InstanceTypeConfigs.member" + , InstanceTypeConfigList.to_query v.instance_type_configs )) + ; Util.option_map v.target_spot_capacity (fun f -> + Query.Pair ("TargetSpotCapacity", Integer.to_query f)) + ; Util.option_map v.target_on_demand_capacity (fun f -> + Query.Pair ("TargetOnDemandCapacity", Integer.to_query f)) + ; Some (Query.Pair - ("AdditionalMasterSecurityGroups.member", - (StringList.to_query v.additional_master_security_groups))); - Util.option_map v.emr_managed_slave_security_group - (fun f -> - Query.Pair - ("EmrManagedSlaveSecurityGroup", (String.to_query f))); - Util.option_map v.emr_managed_master_security_group - (fun f -> - Query.Pair - ("EmrManagedMasterSecurityGroup", (String.to_query f))); - Util.option_map v.iam_instance_profile - (fun f -> Query.Pair ("IamInstanceProfile", (String.to_query f))); - Util.option_map v.ec2_availability_zone - (fun f -> - Query.Pair ("Ec2AvailabilityZone", (String.to_query f))); - Util.option_map v.ec2_subnet_id - (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); - Util.option_map v.ec2_key_name - (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("additional_slave_security_groups", - (StringList.to_json v.additional_slave_security_groups)); - Some - ("additional_master_security_groups", - (StringList.to_json v.additional_master_security_groups)); - Util.option_map v.emr_managed_slave_security_group - (fun f -> - ("emr_managed_slave_security_group", (String.to_json f))); - Util.option_map v.emr_managed_master_security_group - (fun f -> - ("emr_managed_master_security_group", (String.to_json f))); - Util.option_map v.iam_instance_profile - (fun f -> ("iam_instance_profile", (String.to_json f))); - Util.option_map v.ec2_availability_zone - (fun f -> ("ec2_availability_zone", (String.to_json f))); - Util.option_map v.ec2_subnet_id - (fun f -> ("ec2_subnet_id", (String.to_json f))); - Util.option_map v.ec2_key_name - (fun f -> ("ec2_key_name", (String.to_json f)))]) - let of_json j = - { - ec2_key_name = - (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); - ec2_subnet_id = - (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); - ec2_availability_zone = - (Util.option_map (Json.lookup j "ec2_availability_zone") - String.of_json); - iam_instance_profile = - (Util.option_map (Json.lookup j "iam_instance_profile") - String.of_json); - emr_managed_master_security_group = - (Util.option_map - (Json.lookup j "emr_managed_master_security_group") - String.of_json); - emr_managed_slave_security_group = - (Util.option_map (Json.lookup j "emr_managed_slave_security_group") - String.of_json); - additional_master_security_groups = - (StringList.of_json - (Util.of_option_exn - (Json.lookup j "additional_master_security_groups"))); - additional_slave_security_groups = - (StringList.of_json - (Util.of_option_exn - (Json.lookup j "additional_slave_security_groups"))) + ("InstanceFleetType", InstanceFleetType.to_query v.instance_fleet_type)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.launch_specifications (fun f -> + "launch_specifications", InstanceFleetProvisioningSpecifications.to_json f) + ; Some + ( "instance_type_configs" + , InstanceTypeConfigList.to_json v.instance_type_configs ) + ; Util.option_map v.target_spot_capacity (fun f -> + "target_spot_capacity", Integer.to_json f) + ; Util.option_map v.target_on_demand_capacity (fun f -> + "target_on_demand_capacity", Integer.to_json f) + ; Some ("instance_fleet_type", InstanceFleetType.to_json v.instance_fleet_type) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; instance_fleet_type = + InstanceFleetType.of_json + (Util.of_option_exn (Json.lookup j "instance_fleet_type")) + ; target_on_demand_capacity = + Util.option_map (Json.lookup j "target_on_demand_capacity") Integer.of_json + ; target_spot_capacity = + Util.option_map (Json.lookup j "target_spot_capacity") Integer.of_json + ; instance_type_configs = + InstanceTypeConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_type_configs")) + ; launch_specifications = + Util.option_map + (Json.lookup j "launch_specifications") + InstanceFleetProvisioningSpecifications.of_json + } +end + +module InstanceGroupConfig = struct + type t = + { name : String.t option + ; market : MarketType.t option + ; instance_role : InstanceRoleType.t + ; bid_price : String.t option + ; instance_type : String.t + ; instance_count : Integer.t + ; configurations : ConfigurationList.t + ; ebs_configuration : EbsConfiguration.t option + ; auto_scaling_policy : AutoScalingPolicy.t option + } + + let make + ?name + ?market + ~instance_role + ?bid_price + ~instance_type + ~instance_count + ?(configurations = []) + ?ebs_configuration + ?auto_scaling_policy + () = + { name + ; market + ; instance_role + ; bid_price + ; instance_type + ; instance_count + ; configurations + ; ebs_configuration + ; auto_scaling_policy + } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; market = Util.option_bind (Xml.member "Market" xml) MarketType.parse + ; instance_role = + Xml.required + "InstanceRole" + (Util.option_bind (Xml.member "InstanceRole" xml) InstanceRoleType.parse) + ; bid_price = Util.option_bind (Xml.member "BidPrice" xml) String.parse + ; instance_type = + Xml.required + "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse) + ; instance_count = + Xml.required + "InstanceCount" + (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse) + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; ebs_configuration = + Util.option_bind (Xml.member "EbsConfiguration" xml) EbsConfiguration.parse + ; auto_scaling_policy = + Util.option_bind (Xml.member "AutoScalingPolicy" xml) AutoScalingPolicy.parse } - end -module TagList = - struct - type t = Tag.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map Tag.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list Tag.to_query v - let to_json v = `List (List.map Tag.to_json v) - let of_json j = Json.to_list Tag.of_json j - end -module InstanceGroupConfigList = - struct - type t = InstanceGroupConfig.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map InstanceGroupConfig.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list InstanceGroupConfig.to_query v - let to_json v = `List (List.map InstanceGroupConfig.to_json v) - let of_json j = Json.to_list InstanceGroupConfig.of_json j - end -module SecurityGroupsList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module SupportedProductConfig = - struct - type t = { - name: String.t option ; - args: XmlStringList.t } - let make ?name ?(args= []) () = { name; args } - let parse xml = - Some - { - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair ("Args.member", (XmlStringList.to_query v.args))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("args", (XmlStringList.to_json v.args)); - Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) - let of_json j = - { - name = (Util.option_map (Json.lookup j "name") String.of_json); - args = - (XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + Query.Pair ("AutoScalingPolicy", AutoScalingPolicy.to_query f)) + ; Util.option_map v.ebs_configuration (fun f -> + Query.Pair ("EbsConfiguration", EbsConfiguration.to_query f)) + ; Some + (Query.Pair + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Some (Query.Pair ("InstanceCount", Integer.to_query v.instance_count)) + ; Some (Query.Pair ("InstanceType", String.to_query v.instance_type)) + ; Util.option_map v.bid_price (fun f -> + Query.Pair ("BidPrice", String.to_query f)) + ; Some (Query.Pair ("InstanceRole", InstanceRoleType.to_query v.instance_role)) + ; Util.option_map v.market (fun f -> + Query.Pair ("Market", MarketType.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + "auto_scaling_policy", AutoScalingPolicy.to_json f) + ; Util.option_map v.ebs_configuration (fun f -> + "ebs_configuration", EbsConfiguration.to_json f) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Some ("instance_count", Integer.to_json v.instance_count) + ; Some ("instance_type", String.to_json v.instance_type) + ; Util.option_map v.bid_price (fun f -> "bid_price", String.to_json f) + ; Some ("instance_role", InstanceRoleType.to_json v.instance_role) + ; Util.option_map v.market (fun f -> "market", MarketType.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; market = Util.option_map (Json.lookup j "market") MarketType.of_json + ; instance_role = + InstanceRoleType.of_json (Util.of_option_exn (Json.lookup j "instance_role")) + ; bid_price = Util.option_map (Json.lookup j "bid_price") String.of_json + ; instance_type = String.of_json (Util.of_option_exn (Json.lookup j "instance_type")) + ; instance_count = + Integer.of_json (Util.of_option_exn (Json.lookup j "instance_count")) + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; ebs_configuration = + Util.option_map (Json.lookup j "ebs_configuration") EbsConfiguration.of_json + ; auto_scaling_policy = + Util.option_map (Json.lookup j "auto_scaling_policy") AutoScalingPolicy.of_json + } +end + +module InstanceFleetStatus = struct + type t = + { state : InstanceFleetState.t option + ; state_change_reason : InstanceFleetStateChangeReason.t option + ; timeline : InstanceFleetTimeline.t option + } + + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) InstanceFleetState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + InstanceFleetStateChangeReason.parse + ; timeline = + Util.option_bind (Xml.member "Timeline" xml) InstanceFleetTimeline.parse } - end -module StepSummary = - struct - type t = - { - id: String.t option ; - name: String.t option ; - config: HadoopStepConfig.t option ; - action_on_failure: ActionOnFailure.t option ; - status: StepStatus.t option } - let make ?id ?name ?config ?action_on_failure ?status () = - { id; name; config; action_on_failure; status } - let parse xml = - Some - { - id = (Util.option_bind (Xml.member "Id" xml) String.parse); - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - config = - (Util.option_bind (Xml.member "Config" xml) - HadoopStepConfig.parse); - action_on_failure = - (Util.option_bind (Xml.member "ActionOnFailure" xml) - ActionOnFailure.parse); - status = - (Util.option_bind (Xml.member "Status" xml) StepStatus.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> Query.Pair ("Status", (StepStatus.to_query f))); - Util.option_map v.action_on_failure - (fun f -> - Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); - Util.option_map v.config - (fun f -> Query.Pair ("Config", (HadoopStepConfig.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f))); - Util.option_map v.id - (fun f -> Query.Pair ("Id", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> ("status", (StepStatus.to_json f))); - Util.option_map v.action_on_failure - (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); - Util.option_map v.config - (fun f -> ("config", (HadoopStepConfig.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f))); - Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) - let of_json j = - { - id = (Util.option_map (Json.lookup j "id") String.of_json); - name = (Util.option_map (Json.lookup j "name") String.of_json); - config = - (Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json); - action_on_failure = - (Util.option_map (Json.lookup j "action_on_failure") - ActionOnFailure.of_json); - status = - (Util.option_map (Json.lookup j "status") StepStatus.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + Query.Pair ("Timeline", InstanceFleetTimeline.to_query f)) + ; Util.option_map v.state_change_reason (fun f -> + Query.Pair ("StateChangeReason", InstanceFleetStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> + Query.Pair ("State", InstanceFleetState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + "timeline", InstanceFleetTimeline.to_json f) + ; Util.option_map v.state_change_reason (fun f -> + "state_change_reason", InstanceFleetStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", InstanceFleetState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") InstanceFleetState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + InstanceFleetStateChangeReason.of_json + ; timeline = Util.option_map (Json.lookup j "timeline") InstanceFleetTimeline.of_json + } +end + +module InstanceTypeSpecificationList = struct + type t = InstanceTypeSpecification.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceTypeSpecification.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceTypeSpecification.to_query v + + let to_json v = `List (List.map InstanceTypeSpecification.to_json v) + + let of_json j = Json.to_list InstanceTypeSpecification.of_json j +end + +module HadoopStepConfig = struct + type t = + { jar : String.t option + ; properties : StringMap.t option + ; main_class : String.t option + ; args : StringList.t + } + + let make ?jar ?properties ?main_class ?(args = []) () = + { jar; properties; main_class; args } + + let parse xml = + Some + { jar = Util.option_bind (Xml.member "Jar" xml) String.parse + ; properties = Util.option_bind (Xml.member "Properties" xml) StringMap.parse + ; main_class = Util.option_bind (Xml.member "MainClass" xml) String.parse + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) StringList.parse) } - end -module InstanceGroupModifyConfig = - struct - type t = - { - instance_group_id: String.t ; - instance_count: Integer.t option ; - e_c2_instance_ids_to_terminate: EC2InstanceIdsToTerminateList.t } - let make ~instance_group_id ?instance_count - ?(e_c2_instance_ids_to_terminate= []) () = - { instance_group_id; instance_count; e_c2_instance_ids_to_terminate } - let parse xml = - Some - { - instance_group_id = - (Xml.required "InstanceGroupId" - (Util.option_bind (Xml.member "InstanceGroupId" xml) - String.parse)); - instance_count = - (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse); - e_c2_instance_ids_to_terminate = - (Util.of_option [] - (Util.option_bind (Xml.member "EC2InstanceIdsToTerminate" xml) - EC2InstanceIdsToTerminateList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("EC2InstanceIdsToTerminate.member", - (EC2InstanceIdsToTerminateList.to_query - v.e_c2_instance_ids_to_terminate))); - Util.option_map v.instance_count - (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); - Some - (Query.Pair - ("InstanceGroupId", (String.to_query v.instance_group_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("e_c2_instance_ids_to_terminate", - (EC2InstanceIdsToTerminateList.to_json - v.e_c2_instance_ids_to_terminate)); - Util.option_map v.instance_count - (fun f -> ("instance_count", (Integer.to_json f))); - Some ("instance_group_id", (String.to_json v.instance_group_id))]) - let of_json j = - { - instance_group_id = - (String.of_json - (Util.of_option_exn (Json.lookup j "instance_group_id"))); - instance_count = - (Util.option_map (Json.lookup j "instance_count") Integer.of_json); - e_c2_instance_ids_to_terminate = - (EC2InstanceIdsToTerminateList.of_json - (Util.of_option_exn - (Json.lookup j "e_c2_instance_ids_to_terminate"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Args.member", StringList.to_query v.args)) + ; Util.option_map v.main_class (fun f -> + Query.Pair ("MainClass", String.to_query f)) + ; Util.option_map v.properties (fun f -> + Query.Pair ("Properties", StringMap.to_query f)) + ; Util.option_map v.jar (fun f -> Query.Pair ("Jar", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("args", StringList.to_json v.args) + ; Util.option_map v.main_class (fun f -> "main_class", String.to_json f) + ; Util.option_map v.properties (fun f -> "properties", StringMap.to_json f) + ; Util.option_map v.jar (fun f -> "jar", String.to_json f) + ]) + + let of_json j = + { jar = Util.option_map (Json.lookup j "jar") String.of_json + ; properties = Util.option_map (Json.lookup j "properties") StringMap.of_json + ; main_class = Util.option_map (Json.lookup j "main_class") String.of_json + ; args = StringList.of_json (Util.of_option_exn (Json.lookup j "args")) + } +end + +module StepStatus = struct + type t = + { state : StepState.t option + ; state_change_reason : StepStateChangeReason.t option + ; failure_details : FailureDetails.t option + ; timeline : StepTimeline.t option + } + + let make ?state ?state_change_reason ?failure_details ?timeline () = + { state; state_change_reason; failure_details; timeline } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) StepState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + StepStateChangeReason.parse + ; failure_details = + Util.option_bind (Xml.member "FailureDetails" xml) FailureDetails.parse + ; timeline = Util.option_bind (Xml.member "Timeline" xml) StepTimeline.parse } - end -module InstanceGroup = - struct - type t = - { - id: String.t option ; - name: String.t option ; - market: MarketType.t option ; - instance_group_type: InstanceGroupType.t option ; - bid_price: String.t option ; - instance_type: String.t option ; - requested_instance_count: Integer.t option ; - running_instance_count: Integer.t option ; - status: InstanceGroupStatus.t option ; - configurations: ConfigurationList.t } - let make ?id ?name ?market ?instance_group_type ?bid_price - ?instance_type ?requested_instance_count ?running_instance_count - ?status ?(configurations= []) () = - { - id; - name; - market; - instance_group_type; - bid_price; - instance_type; - requested_instance_count; - running_instance_count; - status; - configurations + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + Query.Pair ("Timeline", StepTimeline.to_query f)) + ; Util.option_map v.failure_details (fun f -> + Query.Pair ("FailureDetails", FailureDetails.to_query f)) + ; Util.option_map v.state_change_reason (fun f -> + Query.Pair ("StateChangeReason", StepStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> Query.Pair ("State", StepState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> "timeline", StepTimeline.to_json f) + ; Util.option_map v.failure_details (fun f -> + "failure_details", FailureDetails.to_json f) + ; Util.option_map v.state_change_reason (fun f -> + "state_change_reason", StepStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", StepState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") StepState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + StepStateChangeReason.of_json + ; failure_details = + Util.option_map (Json.lookup j "failure_details") FailureDetails.of_json + ; timeline = Util.option_map (Json.lookup j "timeline") StepTimeline.of_json + } +end + +module EC2InstanceIdsToTerminateList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module ShrinkPolicy = struct + type t = + { decommission_timeout : Integer.t option + ; instance_resize_policy : InstanceResizePolicy.t option + } + + let make ?decommission_timeout ?instance_resize_policy () = + { decommission_timeout; instance_resize_policy } + + let parse xml = + Some + { decommission_timeout = + Util.option_bind (Xml.member "DecommissionTimeout" xml) Integer.parse + ; instance_resize_policy = + Util.option_bind + (Xml.member "InstanceResizePolicy" xml) + InstanceResizePolicy.parse } - let parse xml = - Some - { - id = (Util.option_bind (Xml.member "Id" xml) String.parse); - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - market = - (Util.option_bind (Xml.member "Market" xml) MarketType.parse); - instance_group_type = - (Util.option_bind (Xml.member "InstanceGroupType" xml) - InstanceGroupType.parse); - bid_price = - (Util.option_bind (Xml.member "BidPrice" xml) String.parse); - instance_type = - (Util.option_bind (Xml.member "InstanceType" xml) String.parse); - requested_instance_count = - (Util.option_bind (Xml.member "RequestedInstanceCount" xml) - Integer.parse); - running_instance_count = - (Util.option_bind (Xml.member "RunningInstanceCount" xml) - Integer.parse); - status = - (Util.option_bind (Xml.member "Status" xml) - InstanceGroupStatus.parse); - configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "Configurations" xml) - ConfigurationList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("Configurations.member", - (ConfigurationList.to_query v.configurations))); - Util.option_map v.status - (fun f -> - Query.Pair ("Status", (InstanceGroupStatus.to_query f))); - Util.option_map v.running_instance_count - (fun f -> - Query.Pair ("RunningInstanceCount", (Integer.to_query f))); - Util.option_map v.requested_instance_count - (fun f -> - Query.Pair ("RequestedInstanceCount", (Integer.to_query f))); - Util.option_map v.instance_type - (fun f -> Query.Pair ("InstanceType", (String.to_query f))); - Util.option_map v.bid_price - (fun f -> Query.Pair ("BidPrice", (String.to_query f))); - Util.option_map v.instance_group_type - (fun f -> - Query.Pair - ("InstanceGroupType", (InstanceGroupType.to_query f))); - Util.option_map v.market - (fun f -> Query.Pair ("Market", (MarketType.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f))); - Util.option_map v.id - (fun f -> Query.Pair ("Id", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("configurations", - (ConfigurationList.to_json v.configurations)); - Util.option_map v.status - (fun f -> ("status", (InstanceGroupStatus.to_json f))); - Util.option_map v.running_instance_count - (fun f -> ("running_instance_count", (Integer.to_json f))); - Util.option_map v.requested_instance_count - (fun f -> ("requested_instance_count", (Integer.to_json f))); - Util.option_map v.instance_type - (fun f -> ("instance_type", (String.to_json f))); - Util.option_map v.bid_price - (fun f -> ("bid_price", (String.to_json f))); - Util.option_map v.instance_group_type - (fun f -> ("instance_group_type", (InstanceGroupType.to_json f))); - Util.option_map v.market - (fun f -> ("market", (MarketType.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f))); - Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) - let of_json j = - { - id = (Util.option_map (Json.lookup j "id") String.of_json); - name = (Util.option_map (Json.lookup j "name") String.of_json); - market = - (Util.option_map (Json.lookup j "market") MarketType.of_json); - instance_group_type = - (Util.option_map (Json.lookup j "instance_group_type") - InstanceGroupType.of_json); - bid_price = - (Util.option_map (Json.lookup j "bid_price") String.of_json); - instance_type = - (Util.option_map (Json.lookup j "instance_type") String.of_json); - requested_instance_count = - (Util.option_map (Json.lookup j "requested_instance_count") - Integer.of_json); - running_instance_count = - (Util.option_map (Json.lookup j "running_instance_count") - Integer.of_json); - status = - (Util.option_map (Json.lookup j "status") - InstanceGroupStatus.of_json); - configurations = - (ConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "configurations"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.instance_resize_policy (fun f -> + Query.Pair ("InstanceResizePolicy", InstanceResizePolicy.to_query f)) + ; Util.option_map v.decommission_timeout (fun f -> + Query.Pair ("DecommissionTimeout", Integer.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.instance_resize_policy (fun f -> + "instance_resize_policy", InstanceResizePolicy.to_json f) + ; Util.option_map v.decommission_timeout (fun f -> + "decommission_timeout", Integer.to_json f) + ]) + + let of_json j = + { decommission_timeout = + Util.option_map (Json.lookup j "decommission_timeout") Integer.of_json + ; instance_resize_policy = + Util.option_map + (Json.lookup j "instance_resize_policy") + InstanceResizePolicy.of_json + } +end + +module AutoScalingPolicyDescription = struct + type t = + { status : AutoScalingPolicyStatus.t option + ; constraints : ScalingConstraints.t option + ; rules : ScalingRuleList.t + } + + let make ?status ?constraints ?(rules = []) () = { status; constraints; rules } + + let parse xml = + Some + { status = Util.option_bind (Xml.member "Status" xml) AutoScalingPolicyStatus.parse + ; constraints = + Util.option_bind (Xml.member "Constraints" xml) ScalingConstraints.parse + ; rules = + Util.of_option + [] + (Util.option_bind (Xml.member "Rules" xml) ScalingRuleList.parse) } - end -module Instance = - struct - type t = - { - id: String.t option ; - ec2_instance_id: String.t option ; - public_dns_name: String.t option ; - public_ip_address: String.t option ; - private_dns_name: String.t option ; - private_ip_address: String.t option ; - status: InstanceStatus.t option } - let make ?id ?ec2_instance_id ?public_dns_name ?public_ip_address - ?private_dns_name ?private_ip_address ?status () = - { - id; - ec2_instance_id; - public_dns_name; - public_ip_address; - private_dns_name; - private_ip_address; - status + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Rules.member", ScalingRuleList.to_query v.rules)) + ; Util.option_map v.constraints (fun f -> + Query.Pair ("Constraints", ScalingConstraints.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", AutoScalingPolicyStatus.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("rules", ScalingRuleList.to_json v.rules) + ; Util.option_map v.constraints (fun f -> + "constraints", ScalingConstraints.to_json f) + ; Util.option_map v.status (fun f -> "status", AutoScalingPolicyStatus.to_json f) + ]) + + let of_json j = + { status = Util.option_map (Json.lookup j "status") AutoScalingPolicyStatus.of_json + ; constraints = + Util.option_map (Json.lookup j "constraints") ScalingConstraints.of_json + ; rules = ScalingRuleList.of_json (Util.of_option_exn (Json.lookup j "rules")) + } +end + +module InstanceGroupStatus = struct + type t = + { state : InstanceGroupState.t option + ; state_change_reason : InstanceGroupStateChangeReason.t option + ; timeline : InstanceGroupTimeline.t option + } + + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) InstanceGroupState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + InstanceGroupStateChangeReason.parse + ; timeline = + Util.option_bind (Xml.member "Timeline" xml) InstanceGroupTimeline.parse } - let parse xml = - Some - { - id = (Util.option_bind (Xml.member "Id" xml) String.parse); - ec2_instance_id = - (Util.option_bind (Xml.member "Ec2InstanceId" xml) String.parse); - public_dns_name = - (Util.option_bind (Xml.member "PublicDnsName" xml) String.parse); - public_ip_address = - (Util.option_bind (Xml.member "PublicIpAddress" xml) String.parse); - private_dns_name = - (Util.option_bind (Xml.member "PrivateDnsName" xml) String.parse); - private_ip_address = - (Util.option_bind (Xml.member "PrivateIpAddress" xml) - String.parse); - status = - (Util.option_bind (Xml.member "Status" xml) InstanceStatus.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> Query.Pair ("Status", (InstanceStatus.to_query f))); - Util.option_map v.private_ip_address - (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); - Util.option_map v.private_dns_name - (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); - Util.option_map v.public_ip_address - (fun f -> Query.Pair ("PublicIpAddress", (String.to_query f))); - Util.option_map v.public_dns_name - (fun f -> Query.Pair ("PublicDnsName", (String.to_query f))); - Util.option_map v.ec2_instance_id - (fun f -> Query.Pair ("Ec2InstanceId", (String.to_query f))); - Util.option_map v.id - (fun f -> Query.Pair ("Id", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> ("status", (InstanceStatus.to_json f))); - Util.option_map v.private_ip_address - (fun f -> ("private_ip_address", (String.to_json f))); - Util.option_map v.private_dns_name - (fun f -> ("private_dns_name", (String.to_json f))); - Util.option_map v.public_ip_address - (fun f -> ("public_ip_address", (String.to_json f))); - Util.option_map v.public_dns_name - (fun f -> ("public_dns_name", (String.to_json f))); - Util.option_map v.ec2_instance_id - (fun f -> ("ec2_instance_id", (String.to_json f))); - Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) - let of_json j = - { - id = (Util.option_map (Json.lookup j "id") String.of_json); - ec2_instance_id = - (Util.option_map (Json.lookup j "ec2_instance_id") String.of_json); - public_dns_name = - (Util.option_map (Json.lookup j "public_dns_name") String.of_json); - public_ip_address = - (Util.option_map (Json.lookup j "public_ip_address") String.of_json); - private_dns_name = - (Util.option_map (Json.lookup j "private_dns_name") String.of_json); - private_ip_address = - (Util.option_map (Json.lookup j "private_ip_address") - String.of_json); - status = - (Util.option_map (Json.lookup j "status") InstanceStatus.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + Query.Pair ("Timeline", InstanceGroupTimeline.to_query f)) + ; Util.option_map v.state_change_reason (fun f -> + Query.Pair ("StateChangeReason", InstanceGroupStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> + Query.Pair ("State", InstanceGroupState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + "timeline", InstanceGroupTimeline.to_json f) + ; Util.option_map v.state_change_reason (fun f -> + "state_change_reason", InstanceGroupStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", InstanceGroupState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") InstanceGroupState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + InstanceGroupStateChangeReason.of_json + ; timeline = Util.option_map (Json.lookup j "timeline") InstanceGroupTimeline.of_json + } +end + +module InstanceGroupType = struct + type t = + | MASTER + | CORE + | TASK + + let str_to_t = [ "TASK", TASK; "CORE", CORE; "MASTER", MASTER ] + + let t_to_str = [ TASK, "TASK"; CORE, "CORE"; MASTER, "MASTER" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module EbsVolumeList = struct + type t = EbsVolume.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map EbsVolume.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list EbsVolume.to_query v + + let to_json v = `List (List.map EbsVolume.to_json v) + + let of_json j = Json.to_list EbsVolume.of_json j +end + +module InstanceStatus = struct + type t = + { state : InstanceState.t option + ; state_change_reason : InstanceStateChangeReason.t option + ; timeline : InstanceTimeline.t option + } + + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) InstanceState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + InstanceStateChangeReason.parse + ; timeline = Util.option_bind (Xml.member "Timeline" xml) InstanceTimeline.parse } - end -module ClusterSummary = - struct - type t = - { - id: String.t option ; - name: String.t option ; - status: ClusterStatus.t option ; - normalized_instance_hours: Integer.t option } - let make ?id ?name ?status ?normalized_instance_hours () = - { id; name; status; normalized_instance_hours } - let parse xml = - Some - { - id = (Util.option_bind (Xml.member "Id" xml) String.parse); - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - status = - (Util.option_bind (Xml.member "Status" xml) ClusterStatus.parse); - normalized_instance_hours = - (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) - Integer.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.normalized_instance_hours - (fun f -> - Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); - Util.option_map v.status - (fun f -> Query.Pair ("Status", (ClusterStatus.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f))); - Util.option_map v.id - (fun f -> Query.Pair ("Id", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.normalized_instance_hours - (fun f -> ("normalized_instance_hours", (Integer.to_json f))); - Util.option_map v.status - (fun f -> ("status", (ClusterStatus.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f))); - Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) - let of_json j = - { - id = (Util.option_map (Json.lookup j "id") String.of_json); - name = (Util.option_map (Json.lookup j "name") String.of_json); - status = - (Util.option_map (Json.lookup j "status") ClusterStatus.of_json); - normalized_instance_hours = - (Util.option_map (Json.lookup j "normalized_instance_hours") - Integer.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + Query.Pair ("Timeline", InstanceTimeline.to_query f)) + ; Util.option_map v.state_change_reason (fun f -> + Query.Pair ("StateChangeReason", InstanceStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> + Query.Pair ("State", InstanceState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> "timeline", InstanceTimeline.to_json f) + ; Util.option_map v.state_change_reason (fun f -> + "state_change_reason", InstanceStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", InstanceState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") InstanceState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + InstanceStateChangeReason.of_json + ; timeline = Util.option_map (Json.lookup j "timeline") InstanceTimeline.of_json + } +end + +module ClusterStatus = struct + type t = + { state : ClusterState.t option + ; state_change_reason : ClusterStateChangeReason.t option + ; timeline : ClusterTimeline.t option + } + + let make ?state ?state_change_reason ?timeline () = + { state; state_change_reason; timeline } + + let parse xml = + Some + { state = Util.option_bind (Xml.member "State" xml) ClusterState.parse + ; state_change_reason = + Util.option_bind + (Xml.member "StateChangeReason" xml) + ClusterStateChangeReason.parse + ; timeline = Util.option_bind (Xml.member "Timeline" xml) ClusterTimeline.parse } - end -module JobFlowDetail = - struct - type t = - { - job_flow_id: String.t ; - name: String.t ; - log_uri: String.t option ; - ami_version: String.t option ; - execution_status_detail: JobFlowExecutionStatusDetail.t ; - instances: JobFlowInstancesDetail.t ; - steps: StepDetailList.t ; - bootstrap_actions: BootstrapActionDetailList.t ; - supported_products: SupportedProductsList.t ; - visible_to_all_users: Boolean.t option ; - job_flow_role: String.t option ; - service_role: String.t option } - let make ~job_flow_id ~name ?log_uri ?ami_version - ~execution_status_detail ~instances ?(steps= []) - ?(bootstrap_actions= []) ?(supported_products= []) - ?visible_to_all_users ?job_flow_role ?service_role () = - { - job_flow_id; - name; - log_uri; - ami_version; - execution_status_detail; - instances; - steps; - bootstrap_actions; - supported_products; - visible_to_all_users; - job_flow_role; - service_role + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> + Query.Pair ("Timeline", ClusterTimeline.to_query f)) + ; Util.option_map v.state_change_reason (fun f -> + Query.Pair ("StateChangeReason", ClusterStateChangeReason.to_query f)) + ; Util.option_map v.state (fun f -> + Query.Pair ("State", ClusterState.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.timeline (fun f -> "timeline", ClusterTimeline.to_json f) + ; Util.option_map v.state_change_reason (fun f -> + "state_change_reason", ClusterStateChangeReason.to_json f) + ; Util.option_map v.state (fun f -> "state", ClusterState.to_json f) + ]) + + let of_json j = + { state = Util.option_map (Json.lookup j "state") ClusterState.of_json + ; state_change_reason = + Util.option_map + (Json.lookup j "state_change_reason") + ClusterStateChangeReason.of_json + ; timeline = Util.option_map (Json.lookup j "timeline") ClusterTimeline.of_json + } +end + +module BootstrapActionDetailList = struct + type t = BootstrapActionDetail.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map BootstrapActionDetail.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list BootstrapActionDetail.to_query v + + let to_json v = `List (List.map BootstrapActionDetail.to_json v) + + let of_json j = Json.to_list BootstrapActionDetail.of_json j +end + +module JobFlowExecutionStatusDetail = struct + type t = + { state : JobFlowExecutionState.t + ; creation_date_time : DateTime.t + ; start_date_time : DateTime.t option + ; ready_date_time : DateTime.t option + ; end_date_time : DateTime.t option + ; last_state_change_reason : String.t option + } + + let make + ~state + ~creation_date_time + ?start_date_time + ?ready_date_time + ?end_date_time + ?last_state_change_reason + () = + { state + ; creation_date_time + ; start_date_time + ; ready_date_time + ; end_date_time + ; last_state_change_reason + } + + let parse xml = + Some + { state = + Xml.required + "State" + (Util.option_bind (Xml.member "State" xml) JobFlowExecutionState.parse) + ; creation_date_time = + Xml.required + "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse) + ; start_date_time = Util.option_bind (Xml.member "StartDateTime" xml) DateTime.parse + ; ready_date_time = Util.option_bind (Xml.member "ReadyDateTime" xml) DateTime.parse + ; end_date_time = Util.option_bind (Xml.member "EndDateTime" xml) DateTime.parse + ; last_state_change_reason = + Util.option_bind (Xml.member "LastStateChangeReason" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.last_state_change_reason (fun f -> + Query.Pair ("LastStateChangeReason", String.to_query f)) + ; Util.option_map v.end_date_time (fun f -> + Query.Pair ("EndDateTime", DateTime.to_query f)) + ; Util.option_map v.ready_date_time (fun f -> + Query.Pair ("ReadyDateTime", DateTime.to_query f)) + ; Util.option_map v.start_date_time (fun f -> + Query.Pair ("StartDateTime", DateTime.to_query f)) + ; Some (Query.Pair ("CreationDateTime", DateTime.to_query v.creation_date_time)) + ; Some (Query.Pair ("State", JobFlowExecutionState.to_query v.state)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.last_state_change_reason (fun f -> + "last_state_change_reason", String.to_json f) + ; Util.option_map v.end_date_time (fun f -> "end_date_time", DateTime.to_json f) + ; Util.option_map v.ready_date_time (fun f -> + "ready_date_time", DateTime.to_json f) + ; Util.option_map v.start_date_time (fun f -> + "start_date_time", DateTime.to_json f) + ; Some ("creation_date_time", DateTime.to_json v.creation_date_time) + ; Some ("state", JobFlowExecutionState.to_json v.state) + ]) + + let of_json j = + { state = JobFlowExecutionState.of_json (Util.of_option_exn (Json.lookup j "state")) + ; creation_date_time = + DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date_time")) + ; start_date_time = Util.option_map (Json.lookup j "start_date_time") DateTime.of_json + ; ready_date_time = Util.option_map (Json.lookup j "ready_date_time") DateTime.of_json + ; end_date_time = Util.option_map (Json.lookup j "end_date_time") DateTime.of_json + ; last_state_change_reason = + Util.option_map (Json.lookup j "last_state_change_reason") String.of_json + } +end + +module JobFlowInstancesDetail = struct + type t = + { master_instance_type : String.t + ; master_public_dns_name : String.t option + ; master_instance_id : String.t option + ; slave_instance_type : String.t + ; instance_count : Integer.t + ; instance_groups : InstanceGroupDetailList.t + ; normalized_instance_hours : Integer.t option + ; ec2_key_name : String.t option + ; ec2_subnet_id : String.t option + ; placement : PlacementType.t option + ; keep_job_flow_alive_when_no_steps : Boolean.t option + ; termination_protected : Boolean.t option + ; hadoop_version : String.t option + } + + let make + ~master_instance_type + ?master_public_dns_name + ?master_instance_id + ~slave_instance_type + ~instance_count + ?(instance_groups = []) + ?normalized_instance_hours + ?ec2_key_name + ?ec2_subnet_id + ?placement + ?keep_job_flow_alive_when_no_steps + ?termination_protected + ?hadoop_version + () = + { master_instance_type + ; master_public_dns_name + ; master_instance_id + ; slave_instance_type + ; instance_count + ; instance_groups + ; normalized_instance_hours + ; ec2_key_name + ; ec2_subnet_id + ; placement + ; keep_job_flow_alive_when_no_steps + ; termination_protected + ; hadoop_version + } + + let parse xml = + Some + { master_instance_type = + Xml.required + "MasterInstanceType" + (Util.option_bind (Xml.member "MasterInstanceType" xml) String.parse) + ; master_public_dns_name = + Util.option_bind (Xml.member "MasterPublicDnsName" xml) String.parse + ; master_instance_id = + Util.option_bind (Xml.member "MasterInstanceId" xml) String.parse + ; slave_instance_type = + Xml.required + "SlaveInstanceType" + (Util.option_bind (Xml.member "SlaveInstanceType" xml) String.parse) + ; instance_count = + Xml.required + "InstanceCount" + (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse) + ; instance_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceGroups" xml) + InstanceGroupDetailList.parse) + ; normalized_instance_hours = + Util.option_bind (Xml.member "NormalizedInstanceHours" xml) Integer.parse + ; ec2_key_name = Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse + ; ec2_subnet_id = Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse + ; placement = Util.option_bind (Xml.member "Placement" xml) PlacementType.parse + ; keep_job_flow_alive_when_no_steps = + Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) Boolean.parse + ; termination_protected = + Util.option_bind (Xml.member "TerminationProtected" xml) Boolean.parse + ; hadoop_version = Util.option_bind (Xml.member "HadoopVersion" xml) String.parse } - let parse xml = - Some - { - job_flow_id = - (Xml.required "JobFlowId" - (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)); - name = - (Xml.required "Name" - (Util.option_bind (Xml.member "Name" xml) String.parse)); - log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); - ami_version = - (Util.option_bind (Xml.member "AmiVersion" xml) String.parse); - execution_status_detail = - (Xml.required "ExecutionStatusDetail" - (Util.option_bind (Xml.member "ExecutionStatusDetail" xml) - JobFlowExecutionStatusDetail.parse)); - instances = - (Xml.required "Instances" - (Util.option_bind (Xml.member "Instances" xml) - JobFlowInstancesDetail.parse)); - steps = - (Util.of_option [] - (Util.option_bind (Xml.member "Steps" xml) - StepDetailList.parse)); - bootstrap_actions = - (Util.of_option [] - (Util.option_bind (Xml.member "BootstrapActions" xml) - BootstrapActionDetailList.parse)); - supported_products = - (Util.of_option [] - (Util.option_bind (Xml.member "SupportedProducts" xml) - SupportedProductsList.parse)); - visible_to_all_users = - (Util.option_bind (Xml.member "VisibleToAllUsers" xml) - Boolean.parse); - job_flow_role = - (Util.option_bind (Xml.member "JobFlowRole" xml) String.parse); - service_role = - (Util.option_bind (Xml.member "ServiceRole" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.service_role - (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); - Util.option_map v.job_flow_role - (fun f -> Query.Pair ("JobFlowRole", (String.to_query f))); - Util.option_map v.visible_to_all_users - (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.hadoop_version (fun f -> + Query.Pair ("HadoopVersion", String.to_query f)) + ; Util.option_map v.termination_protected (fun f -> + Query.Pair ("TerminationProtected", Boolean.to_query f)) + ; Util.option_map v.keep_job_flow_alive_when_no_steps (fun f -> + Query.Pair ("KeepJobFlowAliveWhenNoSteps", Boolean.to_query f)) + ; Util.option_map v.placement (fun f -> + Query.Pair ("Placement", PlacementType.to_query f)) + ; Util.option_map v.ec2_subnet_id (fun f -> + Query.Pair ("Ec2SubnetId", String.to_query f)) + ; Util.option_map v.ec2_key_name (fun f -> + Query.Pair ("Ec2KeyName", String.to_query f)) + ; Util.option_map v.normalized_instance_hours (fun f -> + Query.Pair ("NormalizedInstanceHours", Integer.to_query f)) + ; Some (Query.Pair - ("SupportedProducts.member", - (SupportedProductsList.to_query v.supported_products))); - Some + ( "InstanceGroups.member" + , InstanceGroupDetailList.to_query v.instance_groups )) + ; Some (Query.Pair ("InstanceCount", Integer.to_query v.instance_count)) + ; Some (Query.Pair ("SlaveInstanceType", String.to_query v.slave_instance_type)) + ; Util.option_map v.master_instance_id (fun f -> + Query.Pair ("MasterInstanceId", String.to_query f)) + ; Util.option_map v.master_public_dns_name (fun f -> + Query.Pair ("MasterPublicDnsName", String.to_query f)) + ; Some + (Query.Pair ("MasterInstanceType", String.to_query v.master_instance_type)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.hadoop_version (fun f -> "hadoop_version", String.to_json f) + ; Util.option_map v.termination_protected (fun f -> + "termination_protected", Boolean.to_json f) + ; Util.option_map v.keep_job_flow_alive_when_no_steps (fun f -> + "keep_job_flow_alive_when_no_steps", Boolean.to_json f) + ; Util.option_map v.placement (fun f -> "placement", PlacementType.to_json f) + ; Util.option_map v.ec2_subnet_id (fun f -> "ec2_subnet_id", String.to_json f) + ; Util.option_map v.ec2_key_name (fun f -> "ec2_key_name", String.to_json f) + ; Util.option_map v.normalized_instance_hours (fun f -> + "normalized_instance_hours", Integer.to_json f) + ; Some ("instance_groups", InstanceGroupDetailList.to_json v.instance_groups) + ; Some ("instance_count", Integer.to_json v.instance_count) + ; Some ("slave_instance_type", String.to_json v.slave_instance_type) + ; Util.option_map v.master_instance_id (fun f -> + "master_instance_id", String.to_json f) + ; Util.option_map v.master_public_dns_name (fun f -> + "master_public_dns_name", String.to_json f) + ; Some ("master_instance_type", String.to_json v.master_instance_type) + ]) + + let of_json j = + { master_instance_type = + String.of_json (Util.of_option_exn (Json.lookup j "master_instance_type")) + ; master_public_dns_name = + Util.option_map (Json.lookup j "master_public_dns_name") String.of_json + ; master_instance_id = + Util.option_map (Json.lookup j "master_instance_id") String.of_json + ; slave_instance_type = + String.of_json (Util.of_option_exn (Json.lookup j "slave_instance_type")) + ; instance_count = + Integer.of_json (Util.of_option_exn (Json.lookup j "instance_count")) + ; instance_groups = + InstanceGroupDetailList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups")) + ; normalized_instance_hours = + Util.option_map (Json.lookup j "normalized_instance_hours") Integer.of_json + ; ec2_key_name = Util.option_map (Json.lookup j "ec2_key_name") String.of_json + ; ec2_subnet_id = Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json + ; placement = Util.option_map (Json.lookup j "placement") PlacementType.of_json + ; keep_job_flow_alive_when_no_steps = + Util.option_map + (Json.lookup j "keep_job_flow_alive_when_no_steps") + Boolean.of_json + ; termination_protected = + Util.option_map (Json.lookup j "termination_protected") Boolean.of_json + ; hadoop_version = Util.option_map (Json.lookup j "hadoop_version") String.of_json + } +end + +module ScaleDownBehavior = struct + type t = + | TERMINATE_AT_INSTANCE_HOUR + | TERMINATE_AT_TASK_COMPLETION + + let str_to_t = + [ "TERMINATE_AT_TASK_COMPLETION", TERMINATE_AT_TASK_COMPLETION + ; "TERMINATE_AT_INSTANCE_HOUR", TERMINATE_AT_INSTANCE_HOUR + ] + + let t_to_str = + [ TERMINATE_AT_TASK_COMPLETION, "TERMINATE_AT_TASK_COMPLETION" + ; TERMINATE_AT_INSTANCE_HOUR, "TERMINATE_AT_INSTANCE_HOUR" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module StepDetailList = struct + type t = StepDetail.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map StepDetail.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list StepDetail.to_query v + + let to_json v = `List (List.map StepDetail.to_json v) + + let of_json j = Json.to_list StepDetail.of_json j +end + +module SupportedProductsList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module CancelStepsRequestStatus = struct + type t = + | SUBMITTED + | FAILED + + let str_to_t = [ "FAILED", FAILED; "SUBMITTED", SUBMITTED ] + + let t_to_str = [ FAILED, "FAILED"; SUBMITTED, "SUBMITTED" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module ApplicationList = struct + type t = Application.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map Application.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list Application.to_query v + + let to_json v = `List (List.map Application.to_json v) + + let of_json j = Json.to_list Application.of_json j +end + +module Ec2InstanceAttributes = struct + type t = + { ec2_key_name : String.t option + ; ec2_subnet_id : String.t option + ; requested_ec2_subnet_ids : XmlStringMaxLen256List.t + ; ec2_availability_zone : String.t option + ; requested_ec2_availability_zones : XmlStringMaxLen256List.t + ; iam_instance_profile : String.t option + ; emr_managed_master_security_group : String.t option + ; emr_managed_slave_security_group : String.t option + ; service_access_security_group : String.t option + ; additional_master_security_groups : StringList.t + ; additional_slave_security_groups : StringList.t + } + + let make + ?ec2_key_name + ?ec2_subnet_id + ?(requested_ec2_subnet_ids = []) + ?ec2_availability_zone + ?(requested_ec2_availability_zones = []) + ?iam_instance_profile + ?emr_managed_master_security_group + ?emr_managed_slave_security_group + ?service_access_security_group + ?(additional_master_security_groups = []) + ?(additional_slave_security_groups = []) + () = + { ec2_key_name + ; ec2_subnet_id + ; requested_ec2_subnet_ids + ; ec2_availability_zone + ; requested_ec2_availability_zones + ; iam_instance_profile + ; emr_managed_master_security_group + ; emr_managed_slave_security_group + ; service_access_security_group + ; additional_master_security_groups + ; additional_slave_security_groups + } + + let parse xml = + Some + { ec2_key_name = Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse + ; ec2_subnet_id = Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse + ; requested_ec2_subnet_ids = + Util.of_option + [] + (Util.option_bind + (Xml.member "RequestedEc2SubnetIds" xml) + XmlStringMaxLen256List.parse) + ; ec2_availability_zone = + Util.option_bind (Xml.member "Ec2AvailabilityZone" xml) String.parse + ; requested_ec2_availability_zones = + Util.of_option + [] + (Util.option_bind + (Xml.member "RequestedEc2AvailabilityZones" xml) + XmlStringMaxLen256List.parse) + ; iam_instance_profile = + Util.option_bind (Xml.member "IamInstanceProfile" xml) String.parse + ; emr_managed_master_security_group = + Util.option_bind (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse + ; emr_managed_slave_security_group = + Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) String.parse + ; service_access_security_group = + Util.option_bind (Xml.member "ServiceAccessSecurityGroup" xml) String.parse + ; additional_master_security_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "AdditionalMasterSecurityGroups" xml) + StringList.parse) + ; additional_slave_security_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "AdditionalSlaveSecurityGroups" xml) + StringList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("BootstrapActions.member", - (BootstrapActionDetailList.to_query v.bootstrap_actions))); - Some - (Query.Pair ("Steps.member", (StepDetailList.to_query v.steps))); - Some + ( "AdditionalSlaveSecurityGroups.member" + , StringList.to_query v.additional_slave_security_groups )) + ; Some (Query.Pair - ("Instances", (JobFlowInstancesDetail.to_query v.instances))); - Some + ( "AdditionalMasterSecurityGroups.member" + , StringList.to_query v.additional_master_security_groups )) + ; Util.option_map v.service_access_security_group (fun f -> + Query.Pair ("ServiceAccessSecurityGroup", String.to_query f)) + ; Util.option_map v.emr_managed_slave_security_group (fun f -> + Query.Pair ("EmrManagedSlaveSecurityGroup", String.to_query f)) + ; Util.option_map v.emr_managed_master_security_group (fun f -> + Query.Pair ("EmrManagedMasterSecurityGroup", String.to_query f)) + ; Util.option_map v.iam_instance_profile (fun f -> + Query.Pair ("IamInstanceProfile", String.to_query f)) + ; Some (Query.Pair - ("ExecutionStatusDetail", - (JobFlowExecutionStatusDetail.to_query - v.execution_status_detail))); - Util.option_map v.ami_version - (fun f -> Query.Pair ("AmiVersion", (String.to_query f))); - Util.option_map v.log_uri - (fun f -> Query.Pair ("LogUri", (String.to_query f))); - Some (Query.Pair ("Name", (String.to_query v.name))); - Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.service_role - (fun f -> ("service_role", (String.to_json f))); - Util.option_map v.job_flow_role - (fun f -> ("job_flow_role", (String.to_json f))); - Util.option_map v.visible_to_all_users - (fun f -> ("visible_to_all_users", (Boolean.to_json f))); - Some - ("supported_products", - (SupportedProductsList.to_json v.supported_products)); - Some - ("bootstrap_actions", - (BootstrapActionDetailList.to_json v.bootstrap_actions)); - Some ("steps", (StepDetailList.to_json v.steps)); - Some ("instances", (JobFlowInstancesDetail.to_json v.instances)); - Some - ("execution_status_detail", - (JobFlowExecutionStatusDetail.to_json - v.execution_status_detail)); - Util.option_map v.ami_version - (fun f -> ("ami_version", (String.to_json f))); - Util.option_map v.log_uri - (fun f -> ("log_uri", (String.to_json f))); - Some ("name", (String.to_json v.name)); - Some ("job_flow_id", (String.to_json v.job_flow_id))]) - let of_json j = - { - job_flow_id = - (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))); - name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); - log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); - ami_version = - (Util.option_map (Json.lookup j "ami_version") String.of_json); - execution_status_detail = - (JobFlowExecutionStatusDetail.of_json - (Util.of_option_exn (Json.lookup j "execution_status_detail"))); - instances = - (JobFlowInstancesDetail.of_json - (Util.of_option_exn (Json.lookup j "instances"))); - steps = - (StepDetailList.of_json - (Util.of_option_exn (Json.lookup j "steps"))); - bootstrap_actions = - (BootstrapActionDetailList.of_json - (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); - supported_products = - (SupportedProductsList.of_json - (Util.of_option_exn (Json.lookup j "supported_products"))); - visible_to_all_users = - (Util.option_map (Json.lookup j "visible_to_all_users") - Boolean.of_json); - job_flow_role = - (Util.option_map (Json.lookup j "job_flow_role") String.of_json); - service_role = - (Util.option_map (Json.lookup j "service_role") String.of_json) + ( "RequestedEc2AvailabilityZones.member" + , XmlStringMaxLen256List.to_query v.requested_ec2_availability_zones )) + ; Util.option_map v.ec2_availability_zone (fun f -> + Query.Pair ("Ec2AvailabilityZone", String.to_query f)) + ; Some + (Query.Pair + ( "RequestedEc2SubnetIds.member" + , XmlStringMaxLen256List.to_query v.requested_ec2_subnet_ids )) + ; Util.option_map v.ec2_subnet_id (fun f -> + Query.Pair ("Ec2SubnetId", String.to_query f)) + ; Util.option_map v.ec2_key_name (fun f -> + Query.Pair ("Ec2KeyName", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "additional_slave_security_groups" + , StringList.to_json v.additional_slave_security_groups ) + ; Some + ( "additional_master_security_groups" + , StringList.to_json v.additional_master_security_groups ) + ; Util.option_map v.service_access_security_group (fun f -> + "service_access_security_group", String.to_json f) + ; Util.option_map v.emr_managed_slave_security_group (fun f -> + "emr_managed_slave_security_group", String.to_json f) + ; Util.option_map v.emr_managed_master_security_group (fun f -> + "emr_managed_master_security_group", String.to_json f) + ; Util.option_map v.iam_instance_profile (fun f -> + "iam_instance_profile", String.to_json f) + ; Some + ( "requested_ec2_availability_zones" + , XmlStringMaxLen256List.to_json v.requested_ec2_availability_zones ) + ; Util.option_map v.ec2_availability_zone (fun f -> + "ec2_availability_zone", String.to_json f) + ; Some + ( "requested_ec2_subnet_ids" + , XmlStringMaxLen256List.to_json v.requested_ec2_subnet_ids ) + ; Util.option_map v.ec2_subnet_id (fun f -> "ec2_subnet_id", String.to_json f) + ; Util.option_map v.ec2_key_name (fun f -> "ec2_key_name", String.to_json f) + ]) + + let of_json j = + { ec2_key_name = Util.option_map (Json.lookup j "ec2_key_name") String.of_json + ; ec2_subnet_id = Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json + ; requested_ec2_subnet_ids = + XmlStringMaxLen256List.of_json + (Util.of_option_exn (Json.lookup j "requested_ec2_subnet_ids")) + ; ec2_availability_zone = + Util.option_map (Json.lookup j "ec2_availability_zone") String.of_json + ; requested_ec2_availability_zones = + XmlStringMaxLen256List.of_json + (Util.of_option_exn (Json.lookup j "requested_ec2_availability_zones")) + ; iam_instance_profile = + Util.option_map (Json.lookup j "iam_instance_profile") String.of_json + ; emr_managed_master_security_group = + Util.option_map (Json.lookup j "emr_managed_master_security_group") String.of_json + ; emr_managed_slave_security_group = + Util.option_map (Json.lookup j "emr_managed_slave_security_group") String.of_json + ; service_access_security_group = + Util.option_map (Json.lookup j "service_access_security_group") String.of_json + ; additional_master_security_groups = + StringList.of_json + (Util.of_option_exn (Json.lookup j "additional_master_security_groups")) + ; additional_slave_security_groups = + StringList.of_json + (Util.of_option_exn (Json.lookup j "additional_slave_security_groups")) + } +end + +module InstanceCollectionType = struct + type t = + | INSTANCE_FLEET + | INSTANCE_GROUP + + let str_to_t = [ "INSTANCE_GROUP", INSTANCE_GROUP; "INSTANCE_FLEET", INSTANCE_FLEET ] + + let t_to_str = [ INSTANCE_GROUP, "INSTANCE_GROUP"; INSTANCE_FLEET, "INSTANCE_FLEET" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module KerberosAttributes = struct + type t = + { realm : String.t + ; kdc_admin_password : String.t + ; cross_realm_trust_principal_password : String.t option + ; a_d_domain_join_user : String.t option + ; a_d_domain_join_password : String.t option + } + + let make + ~realm + ~kdc_admin_password + ?cross_realm_trust_principal_password + ?a_d_domain_join_user + ?a_d_domain_join_password + () = + { realm + ; kdc_admin_password + ; cross_realm_trust_principal_password + ; a_d_domain_join_user + ; a_d_domain_join_password + } + + let parse xml = + Some + { realm = + Xml.required "Realm" (Util.option_bind (Xml.member "Realm" xml) String.parse) + ; kdc_admin_password = + Xml.required + "KdcAdminPassword" + (Util.option_bind (Xml.member "KdcAdminPassword" xml) String.parse) + ; cross_realm_trust_principal_password = + Util.option_bind + (Xml.member "CrossRealmTrustPrincipalPassword" xml) + String.parse + ; a_d_domain_join_user = + Util.option_bind (Xml.member "ADDomainJoinUser" xml) String.parse + ; a_d_domain_join_password = + Util.option_bind (Xml.member "ADDomainJoinPassword" xml) String.parse } - end -module Command = - struct - type t = - { - name: String.t option ; - script_path: String.t option ; - args: StringList.t } - let make ?name ?script_path ?(args= []) () = - { name; script_path; args } - let parse xml = - Some - { - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - script_path = - (Util.option_bind (Xml.member "ScriptPath" xml) String.parse); - args = - (Util.of_option [] - (Util.option_bind (Xml.member "Args" xml) StringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("Args.member", (StringList.to_query v.args))); - Util.option_map v.script_path - (fun f -> Query.Pair ("ScriptPath", (String.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("args", (StringList.to_json v.args)); - Util.option_map v.script_path - (fun f -> ("script_path", (String.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) - let of_json j = - { - name = (Util.option_map (Json.lookup j "name") String.of_json); - script_path = - (Util.option_map (Json.lookup j "script_path") String.of_json); - args = - (StringList.of_json (Util.of_option_exn (Json.lookup j "args"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.a_d_domain_join_password (fun f -> + Query.Pair ("ADDomainJoinPassword", String.to_query f)) + ; Util.option_map v.a_d_domain_join_user (fun f -> + Query.Pair ("ADDomainJoinUser", String.to_query f)) + ; Util.option_map v.cross_realm_trust_principal_password (fun f -> + Query.Pair ("CrossRealmTrustPrincipalPassword", String.to_query f)) + ; Some (Query.Pair ("KdcAdminPassword", String.to_query v.kdc_admin_password)) + ; Some (Query.Pair ("Realm", String.to_query v.realm)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.a_d_domain_join_password (fun f -> + "a_d_domain_join_password", String.to_json f) + ; Util.option_map v.a_d_domain_join_user (fun f -> + "a_d_domain_join_user", String.to_json f) + ; Util.option_map v.cross_realm_trust_principal_password (fun f -> + "cross_realm_trust_principal_password", String.to_json f) + ; Some ("kdc_admin_password", String.to_json v.kdc_admin_password) + ; Some ("realm", String.to_json v.realm) + ]) + + let of_json j = + { realm = String.of_json (Util.of_option_exn (Json.lookup j "realm")) + ; kdc_admin_password = + String.of_json (Util.of_option_exn (Json.lookup j "kdc_admin_password")) + ; cross_realm_trust_principal_password = + Util.option_map + (Json.lookup j "cross_realm_trust_principal_password") + String.of_json + ; a_d_domain_join_user = + Util.option_map (Json.lookup j "a_d_domain_join_user") String.of_json + ; a_d_domain_join_password = + Util.option_map (Json.lookup j "a_d_domain_join_password") String.of_json + } +end + +module RepoUpgradeOnBoot = struct + type t = + | SECURITY + | NONE + + let str_to_t = [ "NONE", NONE; "SECURITY", SECURITY ] + + let t_to_str = [ NONE, "NONE"; SECURITY, "SECURITY" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module TagList = struct + type t = Tag.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map Tag.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list Tag.to_query v + + let to_json v = `List (List.map Tag.to_json v) + + let of_json j = Json.to_list Tag.of_json j +end + +module InstanceFleetConfigList = struct + type t = InstanceFleetConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceFleetConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceFleetConfig.to_query v + + let to_json v = `List (List.map InstanceFleetConfig.to_json v) + + let of_json j = Json.to_list InstanceFleetConfig.of_json j +end + +module InstanceGroupConfigList = struct + type t = InstanceGroupConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceGroupConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceGroupConfig.to_query v + + let to_json v = `List (List.map InstanceGroupConfig.to_json v) + + let of_json j = Json.to_list InstanceGroupConfig.of_json j +end + +module SecurityGroupsList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module SupportedProductConfig = struct + type t = + { name : String.t option + ; args : XmlStringList.t + } + + let make ?name ?(args = []) () = { name; args } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) XmlStringList.parse) } - end -module ClusterStateList = - struct - type t = ClusterState.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map ClusterState.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list ClusterState.to_query v - let to_json v = `List (List.map ClusterState.to_json v) - let of_json j = Json.to_list ClusterState.of_json j - end -module Step = - struct - type t = - { - id: String.t option ; - name: String.t option ; - config: HadoopStepConfig.t option ; - action_on_failure: ActionOnFailure.t option ; - status: StepStatus.t option } - let make ?id ?name ?config ?action_on_failure ?status () = - { id; name; config; action_on_failure; status } - let parse xml = - Some - { - id = (Util.option_bind (Xml.member "Id" xml) String.parse); - name = (Util.option_bind (Xml.member "Name" xml) String.parse); - config = - (Util.option_bind (Xml.member "Config" xml) - HadoopStepConfig.parse); - action_on_failure = - (Util.option_bind (Xml.member "ActionOnFailure" xml) - ActionOnFailure.parse); - status = - (Util.option_bind (Xml.member "Status" xml) StepStatus.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> Query.Pair ("Status", (StepStatus.to_query f))); - Util.option_map v.action_on_failure - (fun f -> - Query.Pair ("ActionOnFailure", (ActionOnFailure.to_query f))); - Util.option_map v.config - (fun f -> Query.Pair ("Config", (HadoopStepConfig.to_query f))); - Util.option_map v.name - (fun f -> Query.Pair ("Name", (String.to_query f))); - Util.option_map v.id - (fun f -> Query.Pair ("Id", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.status - (fun f -> ("status", (StepStatus.to_json f))); - Util.option_map v.action_on_failure - (fun f -> ("action_on_failure", (ActionOnFailure.to_json f))); - Util.option_map v.config - (fun f -> ("config", (HadoopStepConfig.to_json f))); - Util.option_map v.name (fun f -> ("name", (String.to_json f))); - Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) - let of_json j = - { - id = (Util.option_map (Json.lookup j "id") String.of_json); - name = (Util.option_map (Json.lookup j "name") String.of_json); - config = - (Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json); - action_on_failure = - (Util.option_map (Json.lookup j "action_on_failure") - ActionOnFailure.of_json); - status = - (Util.option_map (Json.lookup j "status") StepStatus.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Args.member", XmlStringList.to_query v.args)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("args", XmlStringList.to_json v.args) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; args = XmlStringList.of_json (Util.of_option_exn (Json.lookup j "args")) + } +end + +module SecurityConfigurationSummary = struct + type t = + { name : String.t option + ; creation_date_time : DateTime.t option + } + + let make ?name ?creation_date_time () = { name; creation_date_time } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse } - end -module Cluster = - struct - type t = - { - id: String.t ; - name: String.t ; - status: ClusterStatus.t ; - ec2_instance_attributes: Ec2InstanceAttributes.t option ; - log_uri: String.t option ; - requested_ami_version: String.t option ; - running_ami_version: String.t option ; - release_label: String.t option ; - auto_terminate: Boolean.t option ; - termination_protected: Boolean.t option ; - visible_to_all_users: Boolean.t option ; - applications: ApplicationList.t ; - tags: TagList.t ; - service_role: String.t option ; - normalized_instance_hours: Integer.t option ; - master_public_dns_name: String.t option ; - configurations: ConfigurationList.t } - let make ~id ~name ~status ?ec2_instance_attributes ?log_uri - ?requested_ami_version ?running_ami_version ?release_label - ?auto_terminate ?termination_protected ?visible_to_all_users - ?(applications= []) ?(tags= []) ?service_role - ?normalized_instance_hours ?master_public_dns_name ?(configurations= - []) () = - { - id; - name; - status; - ec2_instance_attributes; - log_uri; - requested_ami_version; - running_ami_version; - release_label; - auto_terminate; - termination_protected; - visible_to_all_users; - applications; - tags; - service_role; - normalized_instance_hours; - master_public_dns_name; - configurations + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + } +end + +module InstanceFleet = struct + type t = + { id : String.t option + ; name : String.t option + ; status : InstanceFleetStatus.t option + ; instance_fleet_type : InstanceFleetType.t option + ; target_on_demand_capacity : Integer.t option + ; target_spot_capacity : Integer.t option + ; provisioned_on_demand_capacity : Integer.t option + ; provisioned_spot_capacity : Integer.t option + ; instance_type_specifications : InstanceTypeSpecificationList.t + ; launch_specifications : InstanceFleetProvisioningSpecifications.t option + } + + let make + ?id + ?name + ?status + ?instance_fleet_type + ?target_on_demand_capacity + ?target_spot_capacity + ?provisioned_on_demand_capacity + ?provisioned_spot_capacity + ?(instance_type_specifications = []) + ?launch_specifications + () = + { id + ; name + ; status + ; instance_fleet_type + ; target_on_demand_capacity + ; target_spot_capacity + ; provisioned_on_demand_capacity + ; provisioned_spot_capacity + ; instance_type_specifications + ; launch_specifications + } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) InstanceFleetStatus.parse + ; instance_fleet_type = + Util.option_bind (Xml.member "InstanceFleetType" xml) InstanceFleetType.parse + ; target_on_demand_capacity = + Util.option_bind (Xml.member "TargetOnDemandCapacity" xml) Integer.parse + ; target_spot_capacity = + Util.option_bind (Xml.member "TargetSpotCapacity" xml) Integer.parse + ; provisioned_on_demand_capacity = + Util.option_bind (Xml.member "ProvisionedOnDemandCapacity" xml) Integer.parse + ; provisioned_spot_capacity = + Util.option_bind (Xml.member "ProvisionedSpotCapacity" xml) Integer.parse + ; instance_type_specifications = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceTypeSpecifications" xml) + InstanceTypeSpecificationList.parse) + ; launch_specifications = + Util.option_bind + (Xml.member "LaunchSpecifications" xml) + InstanceFleetProvisioningSpecifications.parse } - let parse xml = - Some - { - id = - (Xml.required "Id" - (Util.option_bind (Xml.member "Id" xml) String.parse)); - name = - (Xml.required "Name" - (Util.option_bind (Xml.member "Name" xml) String.parse)); - status = - (Xml.required "Status" - (Util.option_bind (Xml.member "Status" xml) - ClusterStatus.parse)); - ec2_instance_attributes = - (Util.option_bind (Xml.member "Ec2InstanceAttributes" xml) - Ec2InstanceAttributes.parse); - log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); - requested_ami_version = - (Util.option_bind (Xml.member "RequestedAmiVersion" xml) - String.parse); - running_ami_version = - (Util.option_bind (Xml.member "RunningAmiVersion" xml) - String.parse); - release_label = - (Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse); - auto_terminate = - (Util.option_bind (Xml.member "AutoTerminate" xml) Boolean.parse); - termination_protected = - (Util.option_bind (Xml.member "TerminationProtected" xml) - Boolean.parse); - visible_to_all_users = - (Util.option_bind (Xml.member "VisibleToAllUsers" xml) - Boolean.parse); - applications = - (Util.of_option [] - (Util.option_bind (Xml.member "Applications" xml) - ApplicationList.parse)); - tags = - (Util.of_option [] - (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); - service_role = - (Util.option_bind (Xml.member "ServiceRole" xml) String.parse); - normalized_instance_hours = - (Util.option_bind (Xml.member "NormalizedInstanceHours" xml) - Integer.parse); - master_public_dns_name = - (Util.option_bind (Xml.member "MasterPublicDnsName" xml) - String.parse); - configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "Configurations" xml) - ConfigurationList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("Configurations.member", - (ConfigurationList.to_query v.configurations))); - Util.option_map v.master_public_dns_name - (fun f -> - Query.Pair ("MasterPublicDnsName", (String.to_query f))); - Util.option_map v.normalized_instance_hours - (fun f -> - Query.Pair ("NormalizedInstanceHours", (Integer.to_query f))); - Util.option_map v.service_role - (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); - Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.launch_specifications (fun f -> + Query.Pair + ( "LaunchSpecifications" + , InstanceFleetProvisioningSpecifications.to_query f )) + ; Some (Query.Pair - ("Applications.member", - (ApplicationList.to_query v.applications))); - Util.option_map v.visible_to_all_users - (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); - Util.option_map v.termination_protected - (fun f -> - Query.Pair ("TerminationProtected", (Boolean.to_query f))); - Util.option_map v.auto_terminate - (fun f -> Query.Pair ("AutoTerminate", (Boolean.to_query f))); - Util.option_map v.release_label - (fun f -> Query.Pair ("ReleaseLabel", (String.to_query f))); - Util.option_map v.running_ami_version - (fun f -> Query.Pair ("RunningAmiVersion", (String.to_query f))); - Util.option_map v.requested_ami_version - (fun f -> - Query.Pair ("RequestedAmiVersion", (String.to_query f))); - Util.option_map v.log_uri - (fun f -> Query.Pair ("LogUri", (String.to_query f))); - Util.option_map v.ec2_instance_attributes - (fun f -> - Query.Pair - ("Ec2InstanceAttributes", - (Ec2InstanceAttributes.to_query f))); - Some (Query.Pair ("Status", (ClusterStatus.to_query v.status))); - Some (Query.Pair ("Name", (String.to_query v.name))); - Some (Query.Pair ("Id", (String.to_query v.id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("configurations", - (ConfigurationList.to_json v.configurations)); - Util.option_map v.master_public_dns_name - (fun f -> ("master_public_dns_name", (String.to_json f))); - Util.option_map v.normalized_instance_hours - (fun f -> ("normalized_instance_hours", (Integer.to_json f))); - Util.option_map v.service_role - (fun f -> ("service_role", (String.to_json f))); - Some ("tags", (TagList.to_json v.tags)); - Some ("applications", (ApplicationList.to_json v.applications)); - Util.option_map v.visible_to_all_users - (fun f -> ("visible_to_all_users", (Boolean.to_json f))); - Util.option_map v.termination_protected - (fun f -> ("termination_protected", (Boolean.to_json f))); - Util.option_map v.auto_terminate - (fun f -> ("auto_terminate", (Boolean.to_json f))); - Util.option_map v.release_label - (fun f -> ("release_label", (String.to_json f))); - Util.option_map v.running_ami_version - (fun f -> ("running_ami_version", (String.to_json f))); - Util.option_map v.requested_ami_version - (fun f -> ("requested_ami_version", (String.to_json f))); - Util.option_map v.log_uri - (fun f -> ("log_uri", (String.to_json f))); - Util.option_map v.ec2_instance_attributes - (fun f -> - ("ec2_instance_attributes", - (Ec2InstanceAttributes.to_json f))); - Some ("status", (ClusterStatus.to_json v.status)); - Some ("name", (String.to_json v.name)); - Some ("id", (String.to_json v.id))]) - let of_json j = - { - id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); - name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); - status = - (ClusterStatus.of_json - (Util.of_option_exn (Json.lookup j "status"))); - ec2_instance_attributes = - (Util.option_map (Json.lookup j "ec2_instance_attributes") - Ec2InstanceAttributes.of_json); - log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); - requested_ami_version = - (Util.option_map (Json.lookup j "requested_ami_version") - String.of_json); - running_ami_version = - (Util.option_map (Json.lookup j "running_ami_version") - String.of_json); - release_label = - (Util.option_map (Json.lookup j "release_label") String.of_json); - auto_terminate = - (Util.option_map (Json.lookup j "auto_terminate") Boolean.of_json); - termination_protected = - (Util.option_map (Json.lookup j "termination_protected") - Boolean.of_json); - visible_to_all_users = - (Util.option_map (Json.lookup j "visible_to_all_users") - Boolean.of_json); - applications = - (ApplicationList.of_json - (Util.of_option_exn (Json.lookup j "applications"))); - tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); - service_role = - (Util.option_map (Json.lookup j "service_role") String.of_json); - normalized_instance_hours = - (Util.option_map (Json.lookup j "normalized_instance_hours") - Integer.of_json); - master_public_dns_name = - (Util.option_map (Json.lookup j "master_public_dns_name") - String.of_json); - configurations = - (ConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "configurations"))) + ( "InstanceTypeSpecifications.member" + , InstanceTypeSpecificationList.to_query v.instance_type_specifications )) + ; Util.option_map v.provisioned_spot_capacity (fun f -> + Query.Pair ("ProvisionedSpotCapacity", Integer.to_query f)) + ; Util.option_map v.provisioned_on_demand_capacity (fun f -> + Query.Pair ("ProvisionedOnDemandCapacity", Integer.to_query f)) + ; Util.option_map v.target_spot_capacity (fun f -> + Query.Pair ("TargetSpotCapacity", Integer.to_query f)) + ; Util.option_map v.target_on_demand_capacity (fun f -> + Query.Pair ("TargetOnDemandCapacity", Integer.to_query f)) + ; Util.option_map v.instance_fleet_type (fun f -> + Query.Pair ("InstanceFleetType", InstanceFleetType.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", InstanceFleetStatus.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.launch_specifications (fun f -> + "launch_specifications", InstanceFleetProvisioningSpecifications.to_json f) + ; Some + ( "instance_type_specifications" + , InstanceTypeSpecificationList.to_json v.instance_type_specifications ) + ; Util.option_map v.provisioned_spot_capacity (fun f -> + "provisioned_spot_capacity", Integer.to_json f) + ; Util.option_map v.provisioned_on_demand_capacity (fun f -> + "provisioned_on_demand_capacity", Integer.to_json f) + ; Util.option_map v.target_spot_capacity (fun f -> + "target_spot_capacity", Integer.to_json f) + ; Util.option_map v.target_on_demand_capacity (fun f -> + "target_on_demand_capacity", Integer.to_json f) + ; Util.option_map v.instance_fleet_type (fun f -> + "instance_fleet_type", InstanceFleetType.to_json f) + ; Util.option_map v.status (fun f -> "status", InstanceFleetStatus.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; status = Util.option_map (Json.lookup j "status") InstanceFleetStatus.of_json + ; instance_fleet_type = + Util.option_map (Json.lookup j "instance_fleet_type") InstanceFleetType.of_json + ; target_on_demand_capacity = + Util.option_map (Json.lookup j "target_on_demand_capacity") Integer.of_json + ; target_spot_capacity = + Util.option_map (Json.lookup j "target_spot_capacity") Integer.of_json + ; provisioned_on_demand_capacity = + Util.option_map (Json.lookup j "provisioned_on_demand_capacity") Integer.of_json + ; provisioned_spot_capacity = + Util.option_map (Json.lookup j "provisioned_spot_capacity") Integer.of_json + ; instance_type_specifications = + InstanceTypeSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "instance_type_specifications")) + ; launch_specifications = + Util.option_map + (Json.lookup j "launch_specifications") + InstanceFleetProvisioningSpecifications.of_json + } +end + +module StepSummary = struct + type t = + { id : String.t option + ; name : String.t option + ; config : HadoopStepConfig.t option + ; action_on_failure : ActionOnFailure.t option + ; status : StepStatus.t option + } + + let make ?id ?name ?config ?action_on_failure ?status () = + { id; name; config; action_on_failure; status } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; config = Util.option_bind (Xml.member "Config" xml) HadoopStepConfig.parse + ; action_on_failure = + Util.option_bind (Xml.member "ActionOnFailure" xml) ActionOnFailure.parse + ; status = Util.option_bind (Xml.member "Status" xml) StepStatus.parse } - end -module BootstrapActionConfigList = - struct - type t = BootstrapActionConfig.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map BootstrapActionConfig.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list BootstrapActionConfig.to_query v - let to_json v = `List (List.map BootstrapActionConfig.to_json v) - let of_json j = Json.to_list BootstrapActionConfig.of_json j - end -module JobFlowInstancesConfig = - struct - type t = - { - master_instance_type: String.t option ; - slave_instance_type: String.t option ; - instance_count: Integer.t option ; - instance_groups: InstanceGroupConfigList.t ; - ec2_key_name: String.t option ; - placement: PlacementType.t option ; - keep_job_flow_alive_when_no_steps: Boolean.t option ; - termination_protected: Boolean.t option ; - hadoop_version: String.t option ; - ec2_subnet_id: String.t option ; - emr_managed_master_security_group: String.t option ; - emr_managed_slave_security_group: String.t option ; - additional_master_security_groups: SecurityGroupsList.t ; - additional_slave_security_groups: SecurityGroupsList.t } - let make ?master_instance_type ?slave_instance_type ?instance_count - ?(instance_groups= []) ?ec2_key_name ?placement - ?keep_job_flow_alive_when_no_steps ?termination_protected - ?hadoop_version ?ec2_subnet_id ?emr_managed_master_security_group - ?emr_managed_slave_security_group ?(additional_master_security_groups= - []) ?(additional_slave_security_groups= []) () = - { - master_instance_type; - slave_instance_type; - instance_count; - instance_groups; - ec2_key_name; - placement; - keep_job_flow_alive_when_no_steps; - termination_protected; - hadoop_version; - ec2_subnet_id; - emr_managed_master_security_group; - emr_managed_slave_security_group; - additional_master_security_groups; - additional_slave_security_groups - } - let parse xml = - Some - { - master_instance_type = - (Util.option_bind (Xml.member "MasterInstanceType" xml) - String.parse); - slave_instance_type = - (Util.option_bind (Xml.member "SlaveInstanceType" xml) - String.parse); - instance_count = - (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse); - instance_groups = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroups" xml) - InstanceGroupConfigList.parse)); - ec2_key_name = - (Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse); - placement = - (Util.option_bind (Xml.member "Placement" xml) - PlacementType.parse); - keep_job_flow_alive_when_no_steps = - (Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) - Boolean.parse); - termination_protected = - (Util.option_bind (Xml.member "TerminationProtected" xml) - Boolean.parse); - hadoop_version = - (Util.option_bind (Xml.member "HadoopVersion" xml) String.parse); - ec2_subnet_id = - (Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse); - emr_managed_master_security_group = + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.status (fun f -> + Query.Pair ("Status", StepStatus.to_query f)) + ; Util.option_map v.action_on_failure (fun f -> + Query.Pair ("ActionOnFailure", ActionOnFailure.to_query f)) + ; Util.option_map v.config (fun f -> + Query.Pair ("Config", HadoopStepConfig.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.status (fun f -> "status", StepStatus.to_json f) + ; Util.option_map v.action_on_failure (fun f -> + "action_on_failure", ActionOnFailure.to_json f) + ; Util.option_map v.config (fun f -> "config", HadoopStepConfig.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; config = Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json + ; action_on_failure = + Util.option_map (Json.lookup j "action_on_failure") ActionOnFailure.of_json + ; status = Util.option_map (Json.lookup j "status") StepStatus.of_json + } +end + +module InstanceGroupModifyConfig = struct + type t = + { instance_group_id : String.t + ; instance_count : Integer.t option + ; e_c2_instance_ids_to_terminate : EC2InstanceIdsToTerminateList.t + ; shrink_policy : ShrinkPolicy.t option + } + + let make + ~instance_group_id + ?instance_count + ?(e_c2_instance_ids_to_terminate = []) + ?shrink_policy + () = + { instance_group_id; instance_count; e_c2_instance_ids_to_terminate; shrink_policy } + + let parse xml = + Some + { instance_group_id = + Xml.required + "InstanceGroupId" + (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse) + ; instance_count = Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse + ; e_c2_instance_ids_to_terminate = + Util.of_option + [] (Util.option_bind - (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse); - emr_managed_slave_security_group = - (Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) - String.parse); - additional_master_security_groups = - (Util.of_option [] - (Util.option_bind - (Xml.member "AdditionalMasterSecurityGroups" xml) - SecurityGroupsList.parse)); - additional_slave_security_groups = - (Util.of_option [] - (Util.option_bind - (Xml.member "AdditionalSlaveSecurityGroups" xml) - SecurityGroupsList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("AdditionalSlaveSecurityGroups.member", - (SecurityGroupsList.to_query - v.additional_slave_security_groups))); - Some + (Xml.member "EC2InstanceIdsToTerminate" xml) + EC2InstanceIdsToTerminateList.parse) + ; shrink_policy = + Util.option_bind (Xml.member "ShrinkPolicy" xml) ShrinkPolicy.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.shrink_policy (fun f -> + Query.Pair ("ShrinkPolicy", ShrinkPolicy.to_query f)) + ; Some (Query.Pair - ("AdditionalMasterSecurityGroups.member", - (SecurityGroupsList.to_query - v.additional_master_security_groups))); - Util.option_map v.emr_managed_slave_security_group - (fun f -> - Query.Pair - ("EmrManagedSlaveSecurityGroup", (String.to_query f))); - Util.option_map v.emr_managed_master_security_group - (fun f -> - Query.Pair - ("EmrManagedMasterSecurityGroup", (String.to_query f))); - Util.option_map v.ec2_subnet_id - (fun f -> Query.Pair ("Ec2SubnetId", (String.to_query f))); - Util.option_map v.hadoop_version - (fun f -> Query.Pair ("HadoopVersion", (String.to_query f))); - Util.option_map v.termination_protected - (fun f -> - Query.Pair ("TerminationProtected", (Boolean.to_query f))); - Util.option_map v.keep_job_flow_alive_when_no_steps - (fun f -> - Query.Pair - ("KeepJobFlowAliveWhenNoSteps", (Boolean.to_query f))); - Util.option_map v.placement - (fun f -> Query.Pair ("Placement", (PlacementType.to_query f))); - Util.option_map v.ec2_key_name - (fun f -> Query.Pair ("Ec2KeyName", (String.to_query f))); - Some + ( "EC2InstanceIdsToTerminate.member" + , EC2InstanceIdsToTerminateList.to_query v.e_c2_instance_ids_to_terminate + )) + ; Util.option_map v.instance_count (fun f -> + Query.Pair ("InstanceCount", Integer.to_query f)) + ; Some (Query.Pair ("InstanceGroupId", String.to_query v.instance_group_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.shrink_policy (fun f -> + "shrink_policy", ShrinkPolicy.to_json f) + ; Some + ( "e_c2_instance_ids_to_terminate" + , EC2InstanceIdsToTerminateList.to_json v.e_c2_instance_ids_to_terminate ) + ; Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) + ; Some ("instance_group_id", String.to_json v.instance_group_id) + ]) + + let of_json j = + { instance_group_id = + String.of_json (Util.of_option_exn (Json.lookup j "instance_group_id")) + ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json + ; e_c2_instance_ids_to_terminate = + EC2InstanceIdsToTerminateList.of_json + (Util.of_option_exn (Json.lookup j "e_c2_instance_ids_to_terminate")) + ; shrink_policy = Util.option_map (Json.lookup j "shrink_policy") ShrinkPolicy.of_json + } +end + +module InstanceGroup = struct + type t = + { id : String.t option + ; name : String.t option + ; market : MarketType.t option + ; instance_group_type : InstanceGroupType.t option + ; bid_price : String.t option + ; instance_type : String.t option + ; requested_instance_count : Integer.t option + ; running_instance_count : Integer.t option + ; status : InstanceGroupStatus.t option + ; configurations : ConfigurationList.t + ; ebs_block_devices : EbsBlockDeviceList.t + ; ebs_optimized : Boolean.t option + ; shrink_policy : ShrinkPolicy.t option + ; auto_scaling_policy : AutoScalingPolicyDescription.t option + } + + let make + ?id + ?name + ?market + ?instance_group_type + ?bid_price + ?instance_type + ?requested_instance_count + ?running_instance_count + ?status + ?(configurations = []) + ?(ebs_block_devices = []) + ?ebs_optimized + ?shrink_policy + ?auto_scaling_policy + () = + { id + ; name + ; market + ; instance_group_type + ; bid_price + ; instance_type + ; requested_instance_count + ; running_instance_count + ; status + ; configurations + ; ebs_block_devices + ; ebs_optimized + ; shrink_policy + ; auto_scaling_policy + } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; market = Util.option_bind (Xml.member "Market" xml) MarketType.parse + ; instance_group_type = + Util.option_bind (Xml.member "InstanceGroupType" xml) InstanceGroupType.parse + ; bid_price = Util.option_bind (Xml.member "BidPrice" xml) String.parse + ; instance_type = Util.option_bind (Xml.member "InstanceType" xml) String.parse + ; requested_instance_count = + Util.option_bind (Xml.member "RequestedInstanceCount" xml) Integer.parse + ; running_instance_count = + Util.option_bind (Xml.member "RunningInstanceCount" xml) Integer.parse + ; status = Util.option_bind (Xml.member "Status" xml) InstanceGroupStatus.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; ebs_block_devices = + Util.of_option + [] + (Util.option_bind (Xml.member "EbsBlockDevices" xml) EbsBlockDeviceList.parse) + ; ebs_optimized = Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse + ; shrink_policy = + Util.option_bind (Xml.member "ShrinkPolicy" xml) ShrinkPolicy.parse + ; auto_scaling_policy = + Util.option_bind + (Xml.member "AutoScalingPolicy" xml) + AutoScalingPolicyDescription.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + Query.Pair ("AutoScalingPolicy", AutoScalingPolicyDescription.to_query f)) + ; Util.option_map v.shrink_policy (fun f -> + Query.Pair ("ShrinkPolicy", ShrinkPolicy.to_query f)) + ; Util.option_map v.ebs_optimized (fun f -> + Query.Pair ("EbsOptimized", Boolean.to_query f)) + ; Some (Query.Pair - ("InstanceGroups.member", - (InstanceGroupConfigList.to_query v.instance_groups))); - Util.option_map v.instance_count - (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); - Util.option_map v.slave_instance_type - (fun f -> Query.Pair ("SlaveInstanceType", (String.to_query f))); - Util.option_map v.master_instance_type - (fun f -> Query.Pair ("MasterInstanceType", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("additional_slave_security_groups", - (SecurityGroupsList.to_json - v.additional_slave_security_groups)); - Some - ("additional_master_security_groups", - (SecurityGroupsList.to_json - v.additional_master_security_groups)); - Util.option_map v.emr_managed_slave_security_group - (fun f -> - ("emr_managed_slave_security_group", (String.to_json f))); - Util.option_map v.emr_managed_master_security_group - (fun f -> - ("emr_managed_master_security_group", (String.to_json f))); - Util.option_map v.ec2_subnet_id - (fun f -> ("ec2_subnet_id", (String.to_json f))); - Util.option_map v.hadoop_version - (fun f -> ("hadoop_version", (String.to_json f))); - Util.option_map v.termination_protected - (fun f -> ("termination_protected", (Boolean.to_json f))); - Util.option_map v.keep_job_flow_alive_when_no_steps - (fun f -> - ("keep_job_flow_alive_when_no_steps", (Boolean.to_json f))); - Util.option_map v.placement - (fun f -> ("placement", (PlacementType.to_json f))); - Util.option_map v.ec2_key_name - (fun f -> ("ec2_key_name", (String.to_json f))); - Some - ("instance_groups", - (InstanceGroupConfigList.to_json v.instance_groups)); - Util.option_map v.instance_count - (fun f -> ("instance_count", (Integer.to_json f))); - Util.option_map v.slave_instance_type - (fun f -> ("slave_instance_type", (String.to_json f))); - Util.option_map v.master_instance_type - (fun f -> ("master_instance_type", (String.to_json f)))]) - let of_json j = - { - master_instance_type = - (Util.option_map (Json.lookup j "master_instance_type") - String.of_json); - slave_instance_type = - (Util.option_map (Json.lookup j "slave_instance_type") - String.of_json); - instance_count = - (Util.option_map (Json.lookup j "instance_count") Integer.of_json); - instance_groups = - (InstanceGroupConfigList.of_json - (Util.of_option_exn (Json.lookup j "instance_groups"))); - ec2_key_name = - (Util.option_map (Json.lookup j "ec2_key_name") String.of_json); - placement = - (Util.option_map (Json.lookup j "placement") PlacementType.of_json); - keep_job_flow_alive_when_no_steps = - (Util.option_map - (Json.lookup j "keep_job_flow_alive_when_no_steps") - Boolean.of_json); - termination_protected = - (Util.option_map (Json.lookup j "termination_protected") - Boolean.of_json); - hadoop_version = - (Util.option_map (Json.lookup j "hadoop_version") String.of_json); - ec2_subnet_id = - (Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json); - emr_managed_master_security_group = - (Util.option_map - (Json.lookup j "emr_managed_master_security_group") - String.of_json); - emr_managed_slave_security_group = - (Util.option_map (Json.lookup j "emr_managed_slave_security_group") - String.of_json); - additional_master_security_groups = - (SecurityGroupsList.of_json - (Util.of_option_exn - (Json.lookup j "additional_master_security_groups"))); - additional_slave_security_groups = - (SecurityGroupsList.of_json - (Util.of_option_exn - (Json.lookup j "additional_slave_security_groups"))) + ("EbsBlockDevices.member", EbsBlockDeviceList.to_query v.ebs_block_devices)) + ; Some + (Query.Pair + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", InstanceGroupStatus.to_query f)) + ; Util.option_map v.running_instance_count (fun f -> + Query.Pair ("RunningInstanceCount", Integer.to_query f)) + ; Util.option_map v.requested_instance_count (fun f -> + Query.Pair ("RequestedInstanceCount", Integer.to_query f)) + ; Util.option_map v.instance_type (fun f -> + Query.Pair ("InstanceType", String.to_query f)) + ; Util.option_map v.bid_price (fun f -> + Query.Pair ("BidPrice", String.to_query f)) + ; Util.option_map v.instance_group_type (fun f -> + Query.Pair ("InstanceGroupType", InstanceGroupType.to_query f)) + ; Util.option_map v.market (fun f -> + Query.Pair ("Market", MarketType.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + "auto_scaling_policy", AutoScalingPolicyDescription.to_json f) + ; Util.option_map v.shrink_policy (fun f -> + "shrink_policy", ShrinkPolicy.to_json f) + ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) + ; Some ("ebs_block_devices", EbsBlockDeviceList.to_json v.ebs_block_devices) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.status (fun f -> "status", InstanceGroupStatus.to_json f) + ; Util.option_map v.running_instance_count (fun f -> + "running_instance_count", Integer.to_json f) + ; Util.option_map v.requested_instance_count (fun f -> + "requested_instance_count", Integer.to_json f) + ; Util.option_map v.instance_type (fun f -> "instance_type", String.to_json f) + ; Util.option_map v.bid_price (fun f -> "bid_price", String.to_json f) + ; Util.option_map v.instance_group_type (fun f -> + "instance_group_type", InstanceGroupType.to_json f) + ; Util.option_map v.market (fun f -> "market", MarketType.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; market = Util.option_map (Json.lookup j "market") MarketType.of_json + ; instance_group_type = + Util.option_map (Json.lookup j "instance_group_type") InstanceGroupType.of_json + ; bid_price = Util.option_map (Json.lookup j "bid_price") String.of_json + ; instance_type = Util.option_map (Json.lookup j "instance_type") String.of_json + ; requested_instance_count = + Util.option_map (Json.lookup j "requested_instance_count") Integer.of_json + ; running_instance_count = + Util.option_map (Json.lookup j "running_instance_count") Integer.of_json + ; status = Util.option_map (Json.lookup j "status") InstanceGroupStatus.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; ebs_block_devices = + EbsBlockDeviceList.of_json + (Util.of_option_exn (Json.lookup j "ebs_block_devices")) + ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json + ; shrink_policy = Util.option_map (Json.lookup j "shrink_policy") ShrinkPolicy.of_json + ; auto_scaling_policy = + Util.option_map + (Json.lookup j "auto_scaling_policy") + AutoScalingPolicyDescription.of_json + } +end + +module Instance = struct + type t = + { id : String.t option + ; ec2_instance_id : String.t option + ; public_dns_name : String.t option + ; public_ip_address : String.t option + ; private_dns_name : String.t option + ; private_ip_address : String.t option + ; status : InstanceStatus.t option + ; instance_group_id : String.t option + ; instance_fleet_id : String.t option + ; market : MarketType.t option + ; instance_type : String.t option + ; ebs_volumes : EbsVolumeList.t + } + + let make + ?id + ?ec2_instance_id + ?public_dns_name + ?public_ip_address + ?private_dns_name + ?private_ip_address + ?status + ?instance_group_id + ?instance_fleet_id + ?market + ?instance_type + ?(ebs_volumes = []) + () = + { id + ; ec2_instance_id + ; public_dns_name + ; public_ip_address + ; private_dns_name + ; private_ip_address + ; status + ; instance_group_id + ; instance_fleet_id + ; market + ; instance_type + ; ebs_volumes + } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; ec2_instance_id = Util.option_bind (Xml.member "Ec2InstanceId" xml) String.parse + ; public_dns_name = Util.option_bind (Xml.member "PublicDnsName" xml) String.parse + ; public_ip_address = + Util.option_bind (Xml.member "PublicIpAddress" xml) String.parse + ; private_dns_name = Util.option_bind (Xml.member "PrivateDnsName" xml) String.parse + ; private_ip_address = + Util.option_bind (Xml.member "PrivateIpAddress" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) InstanceStatus.parse + ; instance_group_id = + Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse + ; instance_fleet_id = + Util.option_bind (Xml.member "InstanceFleetId" xml) String.parse + ; market = Util.option_bind (Xml.member "Market" xml) MarketType.parse + ; instance_type = Util.option_bind (Xml.member "InstanceType" xml) String.parse + ; ebs_volumes = + Util.of_option + [] + (Util.option_bind (Xml.member "EbsVolumes" xml) EbsVolumeList.parse) } - end -module NewSupportedProductsList = - struct - type t = SupportedProductConfig.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map SupportedProductConfig.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list SupportedProductConfig.to_query v - let to_json v = `List (List.map SupportedProductConfig.to_json v) - let of_json j = Json.to_list SupportedProductConfig.of_json j - end -module StepConfigList = - struct - type t = StepConfig.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map StepConfig.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list StepConfig.to_query v - let to_json v = `List (List.map StepConfig.to_json v) - let of_json j = Json.to_list StepConfig.of_json j - end -module StepSummaryList = - struct - type t = StepSummary.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map StepSummary.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list StepSummary.to_query v - let to_json v = `List (List.map StepSummary.to_json v) - let of_json j = Json.to_list StepSummary.of_json j - end -module InstanceGroupModifyConfigList = - struct - type t = InstanceGroupModifyConfig.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map InstanceGroupModifyConfig.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list InstanceGroupModifyConfig.to_query v - let to_json v = `List (List.map InstanceGroupModifyConfig.to_json v) - let of_json j = Json.to_list InstanceGroupModifyConfig.of_json j - end -module InstanceGroupList = - struct - type t = InstanceGroup.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map InstanceGroup.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list InstanceGroup.to_query v - let to_json v = `List (List.map InstanceGroup.to_json v) - let of_json j = Json.to_list InstanceGroup.of_json j - end -module StepIdsList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module InstanceList = - struct - type t = Instance.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map Instance.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list Instance.to_query v - let to_json v = `List (List.map Instance.to_json v) - let of_json j = Json.to_list Instance.of_json j - end -module ClusterSummaryList = - struct - type t = ClusterSummary.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map ClusterSummary.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list ClusterSummary.to_query v - let to_json v = `List (List.map ClusterSummary.to_json v) - let of_json j = Json.to_list ClusterSummary.of_json j - end -module StepStateList = - struct - type t = StepState.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map StepState.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list StepState.to_query v - let to_json v = `List (List.map StepState.to_json v) - let of_json j = Json.to_list StepState.of_json j - end -module JobFlowExecutionStateList = - struct - type t = JobFlowExecutionState.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map JobFlowExecutionState.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list JobFlowExecutionState.to_query v - let to_json v = `List (List.map JobFlowExecutionState.to_json v) - let of_json j = Json.to_list JobFlowExecutionState.of_json j - end -module JobFlowDetailList = - struct - type t = JobFlowDetail.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map JobFlowDetail.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list JobFlowDetail.to_query v - let to_json v = `List (List.map JobFlowDetail.to_json v) - let of_json j = Json.to_list JobFlowDetail.of_json j - end -module CommandList = - struct - type t = Command.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map Command.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list Command.to_query v - let to_json v = `List (List.map Command.to_json v) - let of_json j = Json.to_list Command.of_json j - end -module InstanceGroupIdsList = - struct - type t = String.t list - let make elems () = elems - let parse xml = - Util.option_all (List.map String.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list String.to_query v - let to_json v = `List (List.map String.to_json v) - let of_json j = Json.to_list String.of_json j - end -module InstanceGroupTypeList = - struct - type t = InstanceGroupType.t list - let make elems () = elems - let parse xml = - Util.option_all - (List.map InstanceGroupType.parse (Xml.members "member" xml)) - let to_query v = Query.to_query_list InstanceGroupType.to_query v - let to_json v = `List (List.map InstanceGroupType.to_json v) - let of_json j = Json.to_list InstanceGroupType.of_json j - end -module ListInstanceGroupsInput = - struct - type t = { - cluster_id: String.t ; - marker: String.t option } - let make ~cluster_id ?marker () = { cluster_id; marker } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("EbsVolumes.member", EbsVolumeList.to_query v.ebs_volumes)) + ; Util.option_map v.instance_type (fun f -> + Query.Pair ("InstanceType", String.to_query f)) + ; Util.option_map v.market (fun f -> + Query.Pair ("Market", MarketType.to_query f)) + ; Util.option_map v.instance_fleet_id (fun f -> + Query.Pair ("InstanceFleetId", String.to_query f)) + ; Util.option_map v.instance_group_id (fun f -> + Query.Pair ("InstanceGroupId", String.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", InstanceStatus.to_query f)) + ; Util.option_map v.private_ip_address (fun f -> + Query.Pair ("PrivateIpAddress", String.to_query f)) + ; Util.option_map v.private_dns_name (fun f -> + Query.Pair ("PrivateDnsName", String.to_query f)) + ; Util.option_map v.public_ip_address (fun f -> + Query.Pair ("PublicIpAddress", String.to_query f)) + ; Util.option_map v.public_dns_name (fun f -> + Query.Pair ("PublicDnsName", String.to_query f)) + ; Util.option_map v.ec2_instance_id (fun f -> + Query.Pair ("Ec2InstanceId", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("ebs_volumes", EbsVolumeList.to_json v.ebs_volumes) + ; Util.option_map v.instance_type (fun f -> "instance_type", String.to_json f) + ; Util.option_map v.market (fun f -> "market", MarketType.to_json f) + ; Util.option_map v.instance_fleet_id (fun f -> + "instance_fleet_id", String.to_json f) + ; Util.option_map v.instance_group_id (fun f -> + "instance_group_id", String.to_json f) + ; Util.option_map v.status (fun f -> "status", InstanceStatus.to_json f) + ; Util.option_map v.private_ip_address (fun f -> + "private_ip_address", String.to_json f) + ; Util.option_map v.private_dns_name (fun f -> + "private_dns_name", String.to_json f) + ; Util.option_map v.public_ip_address (fun f -> + "public_ip_address", String.to_json f) + ; Util.option_map v.public_dns_name (fun f -> + "public_dns_name", String.to_json f) + ; Util.option_map v.ec2_instance_id (fun f -> + "ec2_instance_id", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; ec2_instance_id = Util.option_map (Json.lookup j "ec2_instance_id") String.of_json + ; public_dns_name = Util.option_map (Json.lookup j "public_dns_name") String.of_json + ; public_ip_address = + Util.option_map (Json.lookup j "public_ip_address") String.of_json + ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json + ; private_ip_address = + Util.option_map (Json.lookup j "private_ip_address") String.of_json + ; status = Util.option_map (Json.lookup j "status") InstanceStatus.of_json + ; instance_group_id = + Util.option_map (Json.lookup j "instance_group_id") String.of_json + ; instance_fleet_id = + Util.option_map (Json.lookup j "instance_fleet_id") String.of_json + ; market = Util.option_map (Json.lookup j "market") MarketType.of_json + ; instance_type = Util.option_map (Json.lookup j "instance_type") String.of_json + ; ebs_volumes = + EbsVolumeList.of_json (Util.of_option_exn (Json.lookup j "ebs_volumes")) + } +end + +module ClusterSummary = struct + type t = + { id : String.t option + ; name : String.t option + ; status : ClusterStatus.t option + ; normalized_instance_hours : Integer.t option + } + + let make ?id ?name ?status ?normalized_instance_hours () = + { id; name; status; normalized_instance_hours } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) ClusterStatus.parse + ; normalized_instance_hours = + Util.option_bind (Xml.member "NormalizedInstanceHours" xml) Integer.parse } - end -module AddTagsInput = - struct - type t = { - resource_id: String.t ; - tags: TagList.t } - let make ~resource_id ~tags () = { resource_id; tags } - let parse xml = - Some - { - resource_id = - (Xml.required "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); - tags = - (Xml.required "Tags" - (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); - Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("tags", (TagList.to_json v.tags)); - Some ("resource_id", (String.to_json v.resource_id))]) - let of_json j = - { - resource_id = - (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); - tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.normalized_instance_hours (fun f -> + Query.Pair ("NormalizedInstanceHours", Integer.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", ClusterStatus.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.normalized_instance_hours (fun f -> + "normalized_instance_hours", Integer.to_json f) + ; Util.option_map v.status (fun f -> "status", ClusterStatus.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; status = Util.option_map (Json.lookup j "status") ClusterStatus.of_json + ; normalized_instance_hours = + Util.option_map (Json.lookup j "normalized_instance_hours") Integer.of_json + } +end + +module JobFlowDetail = struct + type t = + { job_flow_id : String.t + ; name : String.t + ; log_uri : String.t option + ; ami_version : String.t option + ; execution_status_detail : JobFlowExecutionStatusDetail.t + ; instances : JobFlowInstancesDetail.t + ; steps : StepDetailList.t + ; bootstrap_actions : BootstrapActionDetailList.t + ; supported_products : SupportedProductsList.t + ; visible_to_all_users : Boolean.t option + ; job_flow_role : String.t option + ; service_role : String.t option + ; auto_scaling_role : String.t option + ; scale_down_behavior : ScaleDownBehavior.t option + } + + let make + ~job_flow_id + ~name + ?log_uri + ?ami_version + ~execution_status_detail + ~instances + ?(steps = []) + ?(bootstrap_actions = []) + ?(supported_products = []) + ?visible_to_all_users + ?job_flow_role + ?service_role + ?auto_scaling_role + ?scale_down_behavior + () = + { job_flow_id + ; name + ; log_uri + ; ami_version + ; execution_status_detail + ; instances + ; steps + ; bootstrap_actions + ; supported_products + ; visible_to_all_users + ; job_flow_role + ; service_role + ; auto_scaling_role + ; scale_down_behavior + } + + let parse xml = + Some + { job_flow_id = + Xml.required + "JobFlowId" + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse) + ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; ami_version = Util.option_bind (Xml.member "AmiVersion" xml) String.parse + ; execution_status_detail = + Xml.required + "ExecutionStatusDetail" + (Util.option_bind + (Xml.member "ExecutionStatusDetail" xml) + JobFlowExecutionStatusDetail.parse) + ; instances = + Xml.required + "Instances" + (Util.option_bind (Xml.member "Instances" xml) JobFlowInstancesDetail.parse) + ; steps = + Util.of_option + [] + (Util.option_bind (Xml.member "Steps" xml) StepDetailList.parse) + ; bootstrap_actions = + Util.of_option + [] + (Util.option_bind + (Xml.member "BootstrapActions" xml) + BootstrapActionDetailList.parse) + ; supported_products = + Util.of_option + [] + (Util.option_bind + (Xml.member "SupportedProducts" xml) + SupportedProductsList.parse) + ; visible_to_all_users = + Util.option_bind (Xml.member "VisibleToAllUsers" xml) Boolean.parse + ; job_flow_role = Util.option_bind (Xml.member "JobFlowRole" xml) String.parse + ; service_role = Util.option_bind (Xml.member "ServiceRole" xml) String.parse + ; auto_scaling_role = + Util.option_bind (Xml.member "AutoScalingRole" xml) String.parse + ; scale_down_behavior = + Util.option_bind (Xml.member "ScaleDownBehavior" xml) ScaleDownBehavior.parse } - end -module ListClustersInput = - struct - type t = - { - created_after: DateTime.t option ; - created_before: DateTime.t option ; - cluster_states: ClusterStateList.t ; - marker: String.t option } - let make ?created_after ?created_before ?(cluster_states= []) ?marker - () = { created_after; created_before; cluster_states; marker } - let parse xml = - Some - { - created_after = - (Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse); - created_before = - (Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse); - cluster_states = - (Util.of_option [] - (Util.option_bind (Xml.member "ClusterStates" xml) - ClusterStateList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.scale_down_behavior (fun f -> + Query.Pair ("ScaleDownBehavior", ScaleDownBehavior.to_query f)) + ; Util.option_map v.auto_scaling_role (fun f -> + Query.Pair ("AutoScalingRole", String.to_query f)) + ; Util.option_map v.service_role (fun f -> + Query.Pair ("ServiceRole", String.to_query f)) + ; Util.option_map v.job_flow_role (fun f -> + Query.Pair ("JobFlowRole", String.to_query f)) + ; Util.option_map v.visible_to_all_users (fun f -> + Query.Pair ("VisibleToAllUsers", Boolean.to_query f)) + ; Some (Query.Pair - ("ClusterStates.member", - (ClusterStateList.to_query v.cluster_states))); - Util.option_map v.created_before - (fun f -> Query.Pair ("CreatedBefore", (DateTime.to_query f))); - Util.option_map v.created_after - (fun f -> Query.Pair ("CreatedAfter", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some - ("cluster_states", (ClusterStateList.to_json v.cluster_states)); - Util.option_map v.created_before - (fun f -> ("created_before", (DateTime.to_json f))); - Util.option_map v.created_after - (fun f -> ("created_after", (DateTime.to_json f)))]) - let of_json j = - { - created_after = - (Util.option_map (Json.lookup j "created_after") DateTime.of_json); - created_before = - (Util.option_map (Json.lookup j "created_before") DateTime.of_json); - cluster_states = - (ClusterStateList.of_json - (Util.of_option_exn (Json.lookup j "cluster_states"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) - } - end -module DescribeStepOutput = - struct - type t = { - step: Step.t option } - let make ?step () = { step } - let parse xml = - Some { step = (Util.option_bind (Xml.member "Step" xml) Step.parse) } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.step - (fun f -> Query.Pair ("Step", (Step.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.step (fun f -> ("step", (Step.to_json f)))]) - let of_json j = - { step = (Util.option_map (Json.lookup j "step") Step.of_json) } - end -module AddInstanceGroupsInput = - struct - type t = - { - instance_groups: InstanceGroupConfigList.t ; - job_flow_id: String.t } - let make ~instance_groups ~job_flow_id () = - { instance_groups; job_flow_id } - let parse xml = - Some - { - instance_groups = - (Xml.required "InstanceGroups" - (Util.option_bind (Xml.member "InstanceGroups" xml) - InstanceGroupConfigList.parse)); - job_flow_id = - (Xml.required "JobFlowId" - (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id))); - Some + ( "SupportedProducts.member" + , SupportedProductsList.to_query v.supported_products )) + ; Some (Query.Pair - ("InstanceGroups.member", - (InstanceGroupConfigList.to_query v.instance_groups)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("job_flow_id", (String.to_json v.job_flow_id)); - Some - ("instance_groups", - (InstanceGroupConfigList.to_json v.instance_groups))]) - let of_json j = - { - instance_groups = - (InstanceGroupConfigList.of_json - (Util.of_option_exn (Json.lookup j "instance_groups"))); - job_flow_id = - (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))) - } - end -module SetVisibleToAllUsersInput = - struct - type t = - { - job_flow_ids: XmlStringList.t ; - visible_to_all_users: Boolean.t } - let make ~job_flow_ids ~visible_to_all_users () = - { job_flow_ids; visible_to_all_users } - let parse xml = - Some - { - job_flow_ids = - (Xml.required "JobFlowIds" - (Util.option_bind (Xml.member "JobFlowIds" xml) - XmlStringList.parse)); - visible_to_all_users = - (Xml.required "VisibleToAllUsers" - (Util.option_bind (Xml.member "VisibleToAllUsers" xml) - Boolean.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("VisibleToAllUsers", - (Boolean.to_query v.visible_to_all_users))); - Some + ( "BootstrapActions.member" + , BootstrapActionDetailList.to_query v.bootstrap_actions )) + ; Some (Query.Pair ("Steps.member", StepDetailList.to_query v.steps)) + ; Some (Query.Pair ("Instances", JobFlowInstancesDetail.to_query v.instances)) + ; Some (Query.Pair - ("JobFlowIds.member", - (XmlStringList.to_query v.job_flow_ids)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("visible_to_all_users", - (Boolean.to_json v.visible_to_all_users)); - Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) - let of_json j = - { - job_flow_ids = - (XmlStringList.of_json - (Util.of_option_exn (Json.lookup j "job_flow_ids"))); - visible_to_all_users = - (Boolean.of_json - (Util.of_option_exn (Json.lookup j "visible_to_all_users"))) + ( "ExecutionStatusDetail" + , JobFlowExecutionStatusDetail.to_query v.execution_status_detail )) + ; Util.option_map v.ami_version (fun f -> + Query.Pair ("AmiVersion", String.to_query f)) + ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ; Some (Query.Pair ("JobFlowId", String.to_query v.job_flow_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.scale_down_behavior (fun f -> + "scale_down_behavior", ScaleDownBehavior.to_json f) + ; Util.option_map v.auto_scaling_role (fun f -> + "auto_scaling_role", String.to_json f) + ; Util.option_map v.service_role (fun f -> "service_role", String.to_json f) + ; Util.option_map v.job_flow_role (fun f -> "job_flow_role", String.to_json f) + ; Util.option_map v.visible_to_all_users (fun f -> + "visible_to_all_users", Boolean.to_json f) + ; Some ("supported_products", SupportedProductsList.to_json v.supported_products) + ; Some + ("bootstrap_actions", BootstrapActionDetailList.to_json v.bootstrap_actions) + ; Some ("steps", StepDetailList.to_json v.steps) + ; Some ("instances", JobFlowInstancesDetail.to_json v.instances) + ; Some + ( "execution_status_detail" + , JobFlowExecutionStatusDetail.to_json v.execution_status_detail ) + ; Util.option_map v.ami_version (fun f -> "ami_version", String.to_json f) + ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) + ; Some ("name", String.to_json v.name) + ; Some ("job_flow_id", String.to_json v.job_flow_id) + ]) + + let of_json j = + { job_flow_id = String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id")) + ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; ami_version = Util.option_map (Json.lookup j "ami_version") String.of_json + ; execution_status_detail = + JobFlowExecutionStatusDetail.of_json + (Util.of_option_exn (Json.lookup j "execution_status_detail")) + ; instances = + JobFlowInstancesDetail.of_json (Util.of_option_exn (Json.lookup j "instances")) + ; steps = StepDetailList.of_json (Util.of_option_exn (Json.lookup j "steps")) + ; bootstrap_actions = + BootstrapActionDetailList.of_json + (Util.of_option_exn (Json.lookup j "bootstrap_actions")) + ; supported_products = + SupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "supported_products")) + ; visible_to_all_users = + Util.option_map (Json.lookup j "visible_to_all_users") Boolean.of_json + ; job_flow_role = Util.option_map (Json.lookup j "job_flow_role") String.of_json + ; service_role = Util.option_map (Json.lookup j "service_role") String.of_json + ; auto_scaling_role = + Util.option_map (Json.lookup j "auto_scaling_role") String.of_json + ; scale_down_behavior = + Util.option_map (Json.lookup j "scale_down_behavior") ScaleDownBehavior.of_json + } +end + +module Command = struct + type t = + { name : String.t option + ; script_path : String.t option + ; args : StringList.t + } + + let make ?name ?script_path ?(args = []) () = { name; script_path; args } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; script_path = Util.option_bind (Xml.member "ScriptPath" xml) String.parse + ; args = + Util.of_option [] (Util.option_bind (Xml.member "Args" xml) StringList.parse) } - end -module ListBootstrapActionsInput = - struct - type t = { - cluster_id: String.t ; - marker: String.t option } - let make ~cluster_id ?marker () = { cluster_id; marker } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Args.member", StringList.to_query v.args)) + ; Util.option_map v.script_path (fun f -> + Query.Pair ("ScriptPath", String.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("args", StringList.to_json v.args) + ; Util.option_map v.script_path (fun f -> "script_path", String.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; script_path = Util.option_map (Json.lookup j "script_path") String.of_json + ; args = StringList.of_json (Util.of_option_exn (Json.lookup j "args")) + } +end + +module CancelStepsInfo = struct + type t = + { step_id : String.t option + ; status : CancelStepsRequestStatus.t option + ; reason : String.t option + } + + let make ?step_id ?status ?reason () = { step_id; status; reason } + + let parse xml = + Some + { step_id = Util.option_bind (Xml.member "StepId" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) CancelStepsRequestStatus.parse + ; reason = Util.option_bind (Xml.member "Reason" xml) String.parse } - end -module DescribeClusterOutput = - struct - type t = { - cluster: Cluster.t } - let make ~cluster () = { cluster } - let parse xml = - Some - { - cluster = - (Xml.required "Cluster" - (Util.option_bind (Xml.member "Cluster" xml) Cluster.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("Cluster", (Cluster.to_query v.cluster)))]) - let to_json v = - `Assoc - (Util.list_filter_opt [Some ("cluster", (Cluster.to_json v.cluster))]) - let of_json j = - { - cluster = - (Cluster.of_json (Util.of_option_exn (Json.lookup j "cluster"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.reason (fun f -> Query.Pair ("Reason", String.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", CancelStepsRequestStatus.to_query f)) + ; Util.option_map v.step_id (fun f -> Query.Pair ("StepId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.reason (fun f -> "reason", String.to_json f) + ; Util.option_map v.status (fun f -> + "status", CancelStepsRequestStatus.to_json f) + ; Util.option_map v.step_id (fun f -> "step_id", String.to_json f) + ]) + + let of_json j = + { step_id = Util.option_map (Json.lookup j "step_id") String.of_json + ; status = Util.option_map (Json.lookup j "status") CancelStepsRequestStatus.of_json + ; reason = Util.option_map (Json.lookup j "reason") String.of_json + } +end + +module ClusterStateList = struct + type t = ClusterState.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map ClusterState.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list ClusterState.to_query v + + let to_json v = `List (List.map ClusterState.to_json v) + + let of_json j = Json.to_list ClusterState.of_json j +end + +module InstanceFleetModifyConfig = struct + type t = + { instance_fleet_id : String.t + ; target_on_demand_capacity : Integer.t option + ; target_spot_capacity : Integer.t option + } + + let make ~instance_fleet_id ?target_on_demand_capacity ?target_spot_capacity () = + { instance_fleet_id; target_on_demand_capacity; target_spot_capacity } + + let parse xml = + Some + { instance_fleet_id = + Xml.required + "InstanceFleetId" + (Util.option_bind (Xml.member "InstanceFleetId" xml) String.parse) + ; target_on_demand_capacity = + Util.option_bind (Xml.member "TargetOnDemandCapacity" xml) Integer.parse + ; target_spot_capacity = + Util.option_bind (Xml.member "TargetSpotCapacity" xml) Integer.parse } - end -module DescribeStepInput = - struct - type t = { - cluster_id: String.t ; - step_id: String.t } - let make ~cluster_id ~step_id () = { cluster_id; step_id } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); - step_id = - (Xml.required "StepId" - (Util.option_bind (Xml.member "StepId" xml) String.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("StepId", (String.to_query v.step_id))); - Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("step_id", (String.to_json v.step_id)); - Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); - step_id = - (String.of_json (Util.of_option_exn (Json.lookup j "step_id"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.target_spot_capacity (fun f -> + Query.Pair ("TargetSpotCapacity", Integer.to_query f)) + ; Util.option_map v.target_on_demand_capacity (fun f -> + Query.Pair ("TargetOnDemandCapacity", Integer.to_query f)) + ; Some (Query.Pair ("InstanceFleetId", String.to_query v.instance_fleet_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.target_spot_capacity (fun f -> + "target_spot_capacity", Integer.to_json f) + ; Util.option_map v.target_on_demand_capacity (fun f -> + "target_on_demand_capacity", Integer.to_json f) + ; Some ("instance_fleet_id", String.to_json v.instance_fleet_id) + ]) + + let of_json j = + { instance_fleet_id = + String.of_json (Util.of_option_exn (Json.lookup j "instance_fleet_id")) + ; target_on_demand_capacity = + Util.option_map (Json.lookup j "target_on_demand_capacity") Integer.of_json + ; target_spot_capacity = + Util.option_map (Json.lookup j "target_spot_capacity") Integer.of_json + } +end + +module Step = struct + type t = + { id : String.t option + ; name : String.t option + ; config : HadoopStepConfig.t option + ; action_on_failure : ActionOnFailure.t option + ; status : StepStatus.t option + } + + let make ?id ?name ?config ?action_on_failure ?status () = + { id; name; config; action_on_failure; status } + + let parse xml = + Some + { id = Util.option_bind (Xml.member "Id" xml) String.parse + ; name = Util.option_bind (Xml.member "Name" xml) String.parse + ; config = Util.option_bind (Xml.member "Config" xml) HadoopStepConfig.parse + ; action_on_failure = + Util.option_bind (Xml.member "ActionOnFailure" xml) ActionOnFailure.parse + ; status = Util.option_bind (Xml.member "Status" xml) StepStatus.parse } - end -module RunJobFlowInput = - struct - type t = - { - name: String.t ; - log_uri: String.t option ; - additional_info: String.t option ; - ami_version: String.t option ; - release_label: String.t option ; - instances: JobFlowInstancesConfig.t ; - steps: StepConfigList.t ; - bootstrap_actions: BootstrapActionConfigList.t ; - supported_products: SupportedProductsList.t ; - new_supported_products: NewSupportedProductsList.t ; - applications: ApplicationList.t ; - configurations: ConfigurationList.t ; - visible_to_all_users: Boolean.t option ; - job_flow_role: String.t option ; - service_role: String.t option ; - tags: TagList.t } - let make ~name ?log_uri ?additional_info ?ami_version ?release_label - ~instances ?(steps= []) ?(bootstrap_actions= []) - ?(supported_products= []) ?(new_supported_products= []) - ?(applications= []) ?(configurations= []) ?visible_to_all_users - ?job_flow_role ?service_role ?(tags= []) () = - { - name; - log_uri; - additional_info; - ami_version; - release_label; - instances; - steps; - bootstrap_actions; - supported_products; - new_supported_products; - applications; - configurations; - visible_to_all_users; - job_flow_role; - service_role; - tags + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.status (fun f -> + Query.Pair ("Status", StepStatus.to_query f)) + ; Util.option_map v.action_on_failure (fun f -> + Query.Pair ("ActionOnFailure", ActionOnFailure.to_query f)) + ; Util.option_map v.config (fun f -> + Query.Pair ("Config", HadoopStepConfig.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.status (fun f -> "status", StepStatus.to_json f) + ; Util.option_map v.action_on_failure (fun f -> + "action_on_failure", ActionOnFailure.to_json f) + ; Util.option_map v.config (fun f -> "config", HadoopStepConfig.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ; Util.option_map v.id (fun f -> "id", String.to_json f) + ]) + + let of_json j = + { id = Util.option_map (Json.lookup j "id") String.of_json + ; name = Util.option_map (Json.lookup j "name") String.of_json + ; config = Util.option_map (Json.lookup j "config") HadoopStepConfig.of_json + ; action_on_failure = + Util.option_map (Json.lookup j "action_on_failure") ActionOnFailure.of_json + ; status = Util.option_map (Json.lookup j "status") StepStatus.of_json + } +end + +module StepIdsList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module Cluster = struct + type t = + { id : String.t + ; name : String.t + ; status : ClusterStatus.t + ; ec2_instance_attributes : Ec2InstanceAttributes.t option + ; instance_collection_type : InstanceCollectionType.t option + ; log_uri : String.t option + ; requested_ami_version : String.t option + ; running_ami_version : String.t option + ; release_label : String.t option + ; auto_terminate : Boolean.t option + ; termination_protected : Boolean.t option + ; visible_to_all_users : Boolean.t option + ; applications : ApplicationList.t + ; tags : TagList.t + ; service_role : String.t option + ; normalized_instance_hours : Integer.t option + ; master_public_dns_name : String.t option + ; configurations : ConfigurationList.t + ; security_configuration : String.t option + ; auto_scaling_role : String.t option + ; scale_down_behavior : ScaleDownBehavior.t option + ; custom_ami_id : String.t option + ; ebs_root_volume_size : Integer.t option + ; repo_upgrade_on_boot : RepoUpgradeOnBoot.t option + ; kerberos_attributes : KerberosAttributes.t option + } + + let make + ~id + ~name + ~status + ?ec2_instance_attributes + ?instance_collection_type + ?log_uri + ?requested_ami_version + ?running_ami_version + ?release_label + ?auto_terminate + ?termination_protected + ?visible_to_all_users + ?(applications = []) + ?(tags = []) + ?service_role + ?normalized_instance_hours + ?master_public_dns_name + ?(configurations = []) + ?security_configuration + ?auto_scaling_role + ?scale_down_behavior + ?custom_ami_id + ?ebs_root_volume_size + ?repo_upgrade_on_boot + ?kerberos_attributes + () = + { id + ; name + ; status + ; ec2_instance_attributes + ; instance_collection_type + ; log_uri + ; requested_ami_version + ; running_ami_version + ; release_label + ; auto_terminate + ; termination_protected + ; visible_to_all_users + ; applications + ; tags + ; service_role + ; normalized_instance_hours + ; master_public_dns_name + ; configurations + ; security_configuration + ; auto_scaling_role + ; scale_down_behavior + ; custom_ami_id + ; ebs_root_volume_size + ; repo_upgrade_on_boot + ; kerberos_attributes + } + + let parse xml = + Some + { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) + ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; status = + Xml.required + "Status" + (Util.option_bind (Xml.member "Status" xml) ClusterStatus.parse) + ; ec2_instance_attributes = + Util.option_bind + (Xml.member "Ec2InstanceAttributes" xml) + Ec2InstanceAttributes.parse + ; instance_collection_type = + Util.option_bind + (Xml.member "InstanceCollectionType" xml) + InstanceCollectionType.parse + ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; requested_ami_version = + Util.option_bind (Xml.member "RequestedAmiVersion" xml) String.parse + ; running_ami_version = + Util.option_bind (Xml.member "RunningAmiVersion" xml) String.parse + ; release_label = Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse + ; auto_terminate = Util.option_bind (Xml.member "AutoTerminate" xml) Boolean.parse + ; termination_protected = + Util.option_bind (Xml.member "TerminationProtected" xml) Boolean.parse + ; visible_to_all_users = + Util.option_bind (Xml.member "VisibleToAllUsers" xml) Boolean.parse + ; applications = + Util.of_option + [] + (Util.option_bind (Xml.member "Applications" xml) ApplicationList.parse) + ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) + ; service_role = Util.option_bind (Xml.member "ServiceRole" xml) String.parse + ; normalized_instance_hours = + Util.option_bind (Xml.member "NormalizedInstanceHours" xml) Integer.parse + ; master_public_dns_name = + Util.option_bind (Xml.member "MasterPublicDnsName" xml) String.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; security_configuration = + Util.option_bind (Xml.member "SecurityConfiguration" xml) String.parse + ; auto_scaling_role = + Util.option_bind (Xml.member "AutoScalingRole" xml) String.parse + ; scale_down_behavior = + Util.option_bind (Xml.member "ScaleDownBehavior" xml) ScaleDownBehavior.parse + ; custom_ami_id = Util.option_bind (Xml.member "CustomAmiId" xml) String.parse + ; ebs_root_volume_size = + Util.option_bind (Xml.member "EbsRootVolumeSize" xml) Integer.parse + ; repo_upgrade_on_boot = + Util.option_bind (Xml.member "RepoUpgradeOnBoot" xml) RepoUpgradeOnBoot.parse + ; kerberos_attributes = + Util.option_bind (Xml.member "KerberosAttributes" xml) KerberosAttributes.parse } - let parse xml = - Some - { - name = - (Xml.required "Name" - (Util.option_bind (Xml.member "Name" xml) String.parse)); - log_uri = (Util.option_bind (Xml.member "LogUri" xml) String.parse); - additional_info = - (Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse); - ami_version = - (Util.option_bind (Xml.member "AmiVersion" xml) String.parse); - release_label = - (Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse); - instances = - (Xml.required "Instances" - (Util.option_bind (Xml.member "Instances" xml) - JobFlowInstancesConfig.parse)); - steps = - (Util.of_option [] - (Util.option_bind (Xml.member "Steps" xml) - StepConfigList.parse)); - bootstrap_actions = - (Util.of_option [] - (Util.option_bind (Xml.member "BootstrapActions" xml) - BootstrapActionConfigList.parse)); - supported_products = - (Util.of_option [] - (Util.option_bind (Xml.member "SupportedProducts" xml) - SupportedProductsList.parse)); - new_supported_products = - (Util.of_option [] - (Util.option_bind (Xml.member "NewSupportedProducts" xml) - NewSupportedProductsList.parse)); - applications = - (Util.of_option [] - (Util.option_bind (Xml.member "Applications" xml) - ApplicationList.parse)); - configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "Configurations" xml) - ConfigurationList.parse)); - visible_to_all_users = - (Util.option_bind (Xml.member "VisibleToAllUsers" xml) - Boolean.parse); - job_flow_role = - (Util.option_bind (Xml.member "JobFlowRole" xml) String.parse); - service_role = - (Util.option_bind (Xml.member "ServiceRole" xml) String.parse); - tags = - (Util.of_option [] - (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); - Util.option_map v.service_role - (fun f -> Query.Pair ("ServiceRole", (String.to_query f))); - Util.option_map v.job_flow_role - (fun f -> Query.Pair ("JobFlowRole", (String.to_query f))); - Util.option_map v.visible_to_all_users - (fun f -> Query.Pair ("VisibleToAllUsers", (Boolean.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.kerberos_attributes (fun f -> + Query.Pair ("KerberosAttributes", KerberosAttributes.to_query f)) + ; Util.option_map v.repo_upgrade_on_boot (fun f -> + Query.Pair ("RepoUpgradeOnBoot", RepoUpgradeOnBoot.to_query f)) + ; Util.option_map v.ebs_root_volume_size (fun f -> + Query.Pair ("EbsRootVolumeSize", Integer.to_query f)) + ; Util.option_map v.custom_ami_id (fun f -> + Query.Pair ("CustomAmiId", String.to_query f)) + ; Util.option_map v.scale_down_behavior (fun f -> + Query.Pair ("ScaleDownBehavior", ScaleDownBehavior.to_query f)) + ; Util.option_map v.auto_scaling_role (fun f -> + Query.Pair ("AutoScalingRole", String.to_query f)) + ; Util.option_map v.security_configuration (fun f -> + Query.Pair ("SecurityConfiguration", String.to_query f)) + ; Some (Query.Pair - ("Configurations.member", - (ConfigurationList.to_query v.configurations))); - Some + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.master_public_dns_name (fun f -> + Query.Pair ("MasterPublicDnsName", String.to_query f)) + ; Util.option_map v.normalized_instance_hours (fun f -> + Query.Pair ("NormalizedInstanceHours", Integer.to_query f)) + ; Util.option_map v.service_role (fun f -> + Query.Pair ("ServiceRole", String.to_query f)) + ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) + ; Some + (Query.Pair ("Applications.member", ApplicationList.to_query v.applications)) + ; Util.option_map v.visible_to_all_users (fun f -> + Query.Pair ("VisibleToAllUsers", Boolean.to_query f)) + ; Util.option_map v.termination_protected (fun f -> + Query.Pair ("TerminationProtected", Boolean.to_query f)) + ; Util.option_map v.auto_terminate (fun f -> + Query.Pair ("AutoTerminate", Boolean.to_query f)) + ; Util.option_map v.release_label (fun f -> + Query.Pair ("ReleaseLabel", String.to_query f)) + ; Util.option_map v.running_ami_version (fun f -> + Query.Pair ("RunningAmiVersion", String.to_query f)) + ; Util.option_map v.requested_ami_version (fun f -> + Query.Pair ("RequestedAmiVersion", String.to_query f)) + ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) + ; Util.option_map v.instance_collection_type (fun f -> + Query.Pair ("InstanceCollectionType", InstanceCollectionType.to_query f)) + ; Util.option_map v.ec2_instance_attributes (fun f -> + Query.Pair ("Ec2InstanceAttributes", Ec2InstanceAttributes.to_query f)) + ; Some (Query.Pair ("Status", ClusterStatus.to_query v.status)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ; Some (Query.Pair ("Id", String.to_query v.id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.kerberos_attributes (fun f -> + "kerberos_attributes", KerberosAttributes.to_json f) + ; Util.option_map v.repo_upgrade_on_boot (fun f -> + "repo_upgrade_on_boot", RepoUpgradeOnBoot.to_json f) + ; Util.option_map v.ebs_root_volume_size (fun f -> + "ebs_root_volume_size", Integer.to_json f) + ; Util.option_map v.custom_ami_id (fun f -> "custom_ami_id", String.to_json f) + ; Util.option_map v.scale_down_behavior (fun f -> + "scale_down_behavior", ScaleDownBehavior.to_json f) + ; Util.option_map v.auto_scaling_role (fun f -> + "auto_scaling_role", String.to_json f) + ; Util.option_map v.security_configuration (fun f -> + "security_configuration", String.to_json f) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.master_public_dns_name (fun f -> + "master_public_dns_name", String.to_json f) + ; Util.option_map v.normalized_instance_hours (fun f -> + "normalized_instance_hours", Integer.to_json f) + ; Util.option_map v.service_role (fun f -> "service_role", String.to_json f) + ; Some ("tags", TagList.to_json v.tags) + ; Some ("applications", ApplicationList.to_json v.applications) + ; Util.option_map v.visible_to_all_users (fun f -> + "visible_to_all_users", Boolean.to_json f) + ; Util.option_map v.termination_protected (fun f -> + "termination_protected", Boolean.to_json f) + ; Util.option_map v.auto_terminate (fun f -> "auto_terminate", Boolean.to_json f) + ; Util.option_map v.release_label (fun f -> "release_label", String.to_json f) + ; Util.option_map v.running_ami_version (fun f -> + "running_ami_version", String.to_json f) + ; Util.option_map v.requested_ami_version (fun f -> + "requested_ami_version", String.to_json f) + ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) + ; Util.option_map v.instance_collection_type (fun f -> + "instance_collection_type", InstanceCollectionType.to_json f) + ; Util.option_map v.ec2_instance_attributes (fun f -> + "ec2_instance_attributes", Ec2InstanceAttributes.to_json f) + ; Some ("status", ClusterStatus.to_json v.status) + ; Some ("name", String.to_json v.name) + ; Some ("id", String.to_json v.id) + ]) + + let of_json j = + { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) + ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; status = ClusterStatus.of_json (Util.of_option_exn (Json.lookup j "status")) + ; ec2_instance_attributes = + Util.option_map + (Json.lookup j "ec2_instance_attributes") + Ec2InstanceAttributes.of_json + ; instance_collection_type = + Util.option_map + (Json.lookup j "instance_collection_type") + InstanceCollectionType.of_json + ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; requested_ami_version = + Util.option_map (Json.lookup j "requested_ami_version") String.of_json + ; running_ami_version = + Util.option_map (Json.lookup j "running_ami_version") String.of_json + ; release_label = Util.option_map (Json.lookup j "release_label") String.of_json + ; auto_terminate = Util.option_map (Json.lookup j "auto_terminate") Boolean.of_json + ; termination_protected = + Util.option_map (Json.lookup j "termination_protected") Boolean.of_json + ; visible_to_all_users = + Util.option_map (Json.lookup j "visible_to_all_users") Boolean.of_json + ; applications = + ApplicationList.of_json (Util.of_option_exn (Json.lookup j "applications")) + ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) + ; service_role = Util.option_map (Json.lookup j "service_role") String.of_json + ; normalized_instance_hours = + Util.option_map (Json.lookup j "normalized_instance_hours") Integer.of_json + ; master_public_dns_name = + Util.option_map (Json.lookup j "master_public_dns_name") String.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; security_configuration = + Util.option_map (Json.lookup j "security_configuration") String.of_json + ; auto_scaling_role = + Util.option_map (Json.lookup j "auto_scaling_role") String.of_json + ; scale_down_behavior = + Util.option_map (Json.lookup j "scale_down_behavior") ScaleDownBehavior.of_json + ; custom_ami_id = Util.option_map (Json.lookup j "custom_ami_id") String.of_json + ; ebs_root_volume_size = + Util.option_map (Json.lookup j "ebs_root_volume_size") Integer.of_json + ; repo_upgrade_on_boot = + Util.option_map (Json.lookup j "repo_upgrade_on_boot") RepoUpgradeOnBoot.of_json + ; kerberos_attributes = + Util.option_map (Json.lookup j "kerberos_attributes") KerberosAttributes.of_json + } +end + +module BootstrapActionConfigList = struct + type t = BootstrapActionConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map BootstrapActionConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list BootstrapActionConfig.to_query v + + let to_json v = `List (List.map BootstrapActionConfig.to_json v) + + let of_json j = Json.to_list BootstrapActionConfig.of_json j +end + +module JobFlowInstancesConfig = struct + type t = + { master_instance_type : String.t option + ; slave_instance_type : String.t option + ; instance_count : Integer.t option + ; instance_groups : InstanceGroupConfigList.t + ; instance_fleets : InstanceFleetConfigList.t + ; ec2_key_name : String.t option + ; placement : PlacementType.t option + ; keep_job_flow_alive_when_no_steps : Boolean.t option + ; termination_protected : Boolean.t option + ; hadoop_version : String.t option + ; ec2_subnet_id : String.t option + ; ec2_subnet_ids : XmlStringMaxLen256List.t + ; emr_managed_master_security_group : String.t option + ; emr_managed_slave_security_group : String.t option + ; service_access_security_group : String.t option + ; additional_master_security_groups : SecurityGroupsList.t + ; additional_slave_security_groups : SecurityGroupsList.t + } + + let make + ?master_instance_type + ?slave_instance_type + ?instance_count + ?(instance_groups = []) + ?(instance_fleets = []) + ?ec2_key_name + ?placement + ?keep_job_flow_alive_when_no_steps + ?termination_protected + ?hadoop_version + ?ec2_subnet_id + ?(ec2_subnet_ids = []) + ?emr_managed_master_security_group + ?emr_managed_slave_security_group + ?service_access_security_group + ?(additional_master_security_groups = []) + ?(additional_slave_security_groups = []) + () = + { master_instance_type + ; slave_instance_type + ; instance_count + ; instance_groups + ; instance_fleets + ; ec2_key_name + ; placement + ; keep_job_flow_alive_when_no_steps + ; termination_protected + ; hadoop_version + ; ec2_subnet_id + ; ec2_subnet_ids + ; emr_managed_master_security_group + ; emr_managed_slave_security_group + ; service_access_security_group + ; additional_master_security_groups + ; additional_slave_security_groups + } + + let parse xml = + Some + { master_instance_type = + Util.option_bind (Xml.member "MasterInstanceType" xml) String.parse + ; slave_instance_type = + Util.option_bind (Xml.member "SlaveInstanceType" xml) String.parse + ; instance_count = Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse + ; instance_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceGroups" xml) + InstanceGroupConfigList.parse) + ; instance_fleets = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceFleets" xml) + InstanceFleetConfigList.parse) + ; ec2_key_name = Util.option_bind (Xml.member "Ec2KeyName" xml) String.parse + ; placement = Util.option_bind (Xml.member "Placement" xml) PlacementType.parse + ; keep_job_flow_alive_when_no_steps = + Util.option_bind (Xml.member "KeepJobFlowAliveWhenNoSteps" xml) Boolean.parse + ; termination_protected = + Util.option_bind (Xml.member "TerminationProtected" xml) Boolean.parse + ; hadoop_version = Util.option_bind (Xml.member "HadoopVersion" xml) String.parse + ; ec2_subnet_id = Util.option_bind (Xml.member "Ec2SubnetId" xml) String.parse + ; ec2_subnet_ids = + Util.of_option + [] + (Util.option_bind + (Xml.member "Ec2SubnetIds" xml) + XmlStringMaxLen256List.parse) + ; emr_managed_master_security_group = + Util.option_bind (Xml.member "EmrManagedMasterSecurityGroup" xml) String.parse + ; emr_managed_slave_security_group = + Util.option_bind (Xml.member "EmrManagedSlaveSecurityGroup" xml) String.parse + ; service_access_security_group = + Util.option_bind (Xml.member "ServiceAccessSecurityGroup" xml) String.parse + ; additional_master_security_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "AdditionalMasterSecurityGroups" xml) + SecurityGroupsList.parse) + ; additional_slave_security_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "AdditionalSlaveSecurityGroups" xml) + SecurityGroupsList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("Applications.member", - (ApplicationList.to_query v.applications))); - Some + ( "AdditionalSlaveSecurityGroups.member" + , SecurityGroupsList.to_query v.additional_slave_security_groups )) + ; Some (Query.Pair - ("NewSupportedProducts.member", - (NewSupportedProductsList.to_query v.new_supported_products))); - Some + ( "AdditionalMasterSecurityGroups.member" + , SecurityGroupsList.to_query v.additional_master_security_groups )) + ; Util.option_map v.service_access_security_group (fun f -> + Query.Pair ("ServiceAccessSecurityGroup", String.to_query f)) + ; Util.option_map v.emr_managed_slave_security_group (fun f -> + Query.Pair ("EmrManagedSlaveSecurityGroup", String.to_query f)) + ; Util.option_map v.emr_managed_master_security_group (fun f -> + Query.Pair ("EmrManagedMasterSecurityGroup", String.to_query f)) + ; Some (Query.Pair - ("SupportedProducts.member", - (SupportedProductsList.to_query v.supported_products))); - Some + ("Ec2SubnetIds.member", XmlStringMaxLen256List.to_query v.ec2_subnet_ids)) + ; Util.option_map v.ec2_subnet_id (fun f -> + Query.Pair ("Ec2SubnetId", String.to_query f)) + ; Util.option_map v.hadoop_version (fun f -> + Query.Pair ("HadoopVersion", String.to_query f)) + ; Util.option_map v.termination_protected (fun f -> + Query.Pair ("TerminationProtected", Boolean.to_query f)) + ; Util.option_map v.keep_job_flow_alive_when_no_steps (fun f -> + Query.Pair ("KeepJobFlowAliveWhenNoSteps", Boolean.to_query f)) + ; Util.option_map v.placement (fun f -> + Query.Pair ("Placement", PlacementType.to_query f)) + ; Util.option_map v.ec2_key_name (fun f -> + Query.Pair ("Ec2KeyName", String.to_query f)) + ; Some (Query.Pair - ("BootstrapActions.member", - (BootstrapActionConfigList.to_query v.bootstrap_actions))); - Some - (Query.Pair ("Steps.member", (StepConfigList.to_query v.steps))); - Some + ( "InstanceFleets.member" + , InstanceFleetConfigList.to_query v.instance_fleets )) + ; Some (Query.Pair - ("Instances", (JobFlowInstancesConfig.to_query v.instances))); - Util.option_map v.release_label - (fun f -> Query.Pair ("ReleaseLabel", (String.to_query f))); - Util.option_map v.ami_version - (fun f -> Query.Pair ("AmiVersion", (String.to_query f))); - Util.option_map v.additional_info - (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); - Util.option_map v.log_uri - (fun f -> Query.Pair ("LogUri", (String.to_query f))); - Some (Query.Pair ("Name", (String.to_query v.name)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("tags", (TagList.to_json v.tags)); - Util.option_map v.service_role - (fun f -> ("service_role", (String.to_json f))); - Util.option_map v.job_flow_role - (fun f -> ("job_flow_role", (String.to_json f))); - Util.option_map v.visible_to_all_users - (fun f -> ("visible_to_all_users", (Boolean.to_json f))); - Some - ("configurations", (ConfigurationList.to_json v.configurations)); - Some ("applications", (ApplicationList.to_json v.applications)); - Some - ("new_supported_products", - (NewSupportedProductsList.to_json v.new_supported_products)); - Some - ("supported_products", - (SupportedProductsList.to_json v.supported_products)); - Some - ("bootstrap_actions", - (BootstrapActionConfigList.to_json v.bootstrap_actions)); - Some ("steps", (StepConfigList.to_json v.steps)); - Some ("instances", (JobFlowInstancesConfig.to_json v.instances)); - Util.option_map v.release_label - (fun f -> ("release_label", (String.to_json f))); - Util.option_map v.ami_version - (fun f -> ("ami_version", (String.to_json f))); - Util.option_map v.additional_info - (fun f -> ("additional_info", (String.to_json f))); - Util.option_map v.log_uri - (fun f -> ("log_uri", (String.to_json f))); - Some ("name", (String.to_json v.name))]) - let of_json j = - { - name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); - log_uri = (Util.option_map (Json.lookup j "log_uri") String.of_json); - additional_info = - (Util.option_map (Json.lookup j "additional_info") String.of_json); - ami_version = - (Util.option_map (Json.lookup j "ami_version") String.of_json); - release_label = - (Util.option_map (Json.lookup j "release_label") String.of_json); - instances = - (JobFlowInstancesConfig.of_json - (Util.of_option_exn (Json.lookup j "instances"))); - steps = - (StepConfigList.of_json - (Util.of_option_exn (Json.lookup j "steps"))); - bootstrap_actions = - (BootstrapActionConfigList.of_json - (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); - supported_products = - (SupportedProductsList.of_json - (Util.of_option_exn (Json.lookup j "supported_products"))); - new_supported_products = - (NewSupportedProductsList.of_json - (Util.of_option_exn (Json.lookup j "new_supported_products"))); - applications = - (ApplicationList.of_json - (Util.of_option_exn (Json.lookup j "applications"))); - configurations = - (ConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "configurations"))); - visible_to_all_users = - (Util.option_map (Json.lookup j "visible_to_all_users") - Boolean.of_json); - job_flow_role = - (Util.option_map (Json.lookup j "job_flow_role") String.of_json); - service_role = - (Util.option_map (Json.lookup j "service_role") String.of_json); - tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + ( "InstanceGroups.member" + , InstanceGroupConfigList.to_query v.instance_groups )) + ; Util.option_map v.instance_count (fun f -> + Query.Pair ("InstanceCount", Integer.to_query f)) + ; Util.option_map v.slave_instance_type (fun f -> + Query.Pair ("SlaveInstanceType", String.to_query f)) + ; Util.option_map v.master_instance_type (fun f -> + Query.Pair ("MasterInstanceType", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "additional_slave_security_groups" + , SecurityGroupsList.to_json v.additional_slave_security_groups ) + ; Some + ( "additional_master_security_groups" + , SecurityGroupsList.to_json v.additional_master_security_groups ) + ; Util.option_map v.service_access_security_group (fun f -> + "service_access_security_group", String.to_json f) + ; Util.option_map v.emr_managed_slave_security_group (fun f -> + "emr_managed_slave_security_group", String.to_json f) + ; Util.option_map v.emr_managed_master_security_group (fun f -> + "emr_managed_master_security_group", String.to_json f) + ; Some ("ec2_subnet_ids", XmlStringMaxLen256List.to_json v.ec2_subnet_ids) + ; Util.option_map v.ec2_subnet_id (fun f -> "ec2_subnet_id", String.to_json f) + ; Util.option_map v.hadoop_version (fun f -> "hadoop_version", String.to_json f) + ; Util.option_map v.termination_protected (fun f -> + "termination_protected", Boolean.to_json f) + ; Util.option_map v.keep_job_flow_alive_when_no_steps (fun f -> + "keep_job_flow_alive_when_no_steps", Boolean.to_json f) + ; Util.option_map v.placement (fun f -> "placement", PlacementType.to_json f) + ; Util.option_map v.ec2_key_name (fun f -> "ec2_key_name", String.to_json f) + ; Some ("instance_fleets", InstanceFleetConfigList.to_json v.instance_fleets) + ; Some ("instance_groups", InstanceGroupConfigList.to_json v.instance_groups) + ; Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) + ; Util.option_map v.slave_instance_type (fun f -> + "slave_instance_type", String.to_json f) + ; Util.option_map v.master_instance_type (fun f -> + "master_instance_type", String.to_json f) + ]) + + let of_json j = + { master_instance_type = + Util.option_map (Json.lookup j "master_instance_type") String.of_json + ; slave_instance_type = + Util.option_map (Json.lookup j "slave_instance_type") String.of_json + ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json + ; instance_groups = + InstanceGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups")) + ; instance_fleets = + InstanceFleetConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_fleets")) + ; ec2_key_name = Util.option_map (Json.lookup j "ec2_key_name") String.of_json + ; placement = Util.option_map (Json.lookup j "placement") PlacementType.of_json + ; keep_job_flow_alive_when_no_steps = + Util.option_map + (Json.lookup j "keep_job_flow_alive_when_no_steps") + Boolean.of_json + ; termination_protected = + Util.option_map (Json.lookup j "termination_protected") Boolean.of_json + ; hadoop_version = Util.option_map (Json.lookup j "hadoop_version") String.of_json + ; ec2_subnet_id = Util.option_map (Json.lookup j "ec2_subnet_id") String.of_json + ; ec2_subnet_ids = + XmlStringMaxLen256List.of_json + (Util.of_option_exn (Json.lookup j "ec2_subnet_ids")) + ; emr_managed_master_security_group = + Util.option_map (Json.lookup j "emr_managed_master_security_group") String.of_json + ; emr_managed_slave_security_group = + Util.option_map (Json.lookup j "emr_managed_slave_security_group") String.of_json + ; service_access_security_group = + Util.option_map (Json.lookup j "service_access_security_group") String.of_json + ; additional_master_security_groups = + SecurityGroupsList.of_json + (Util.of_option_exn (Json.lookup j "additional_master_security_groups")) + ; additional_slave_security_groups = + SecurityGroupsList.of_json + (Util.of_option_exn (Json.lookup j "additional_slave_security_groups")) + } +end + +module NewSupportedProductsList = struct + type t = SupportedProductConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map SupportedProductConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list SupportedProductConfig.to_query v + + let to_json v = `List (List.map SupportedProductConfig.to_json v) + + let of_json j = Json.to_list SupportedProductConfig.of_json j +end + +module StepConfigList = struct + type t = StepConfig.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map StepConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list StepConfig.to_query v + + let to_json v = `List (List.map StepConfig.to_json v) + + let of_json j = Json.to_list StepConfig.of_json j +end + +module SecurityConfigurationList = struct + type t = SecurityConfigurationSummary.t list + + let make elems () = elems + + let parse xml = + Util.option_all + (List.map SecurityConfigurationSummary.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list SecurityConfigurationSummary.to_query v + + let to_json v = `List (List.map SecurityConfigurationSummary.to_json v) + + let of_json j = Json.to_list SecurityConfigurationSummary.of_json j +end + +module InstanceFleetList = struct + type t = InstanceFleet.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceFleet.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceFleet.to_query v + + let to_json v = `List (List.map InstanceFleet.to_json v) + + let of_json j = Json.to_list InstanceFleet.of_json j +end + +module StepSummaryList = struct + type t = StepSummary.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map StepSummary.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list StepSummary.to_query v + + let to_json v = `List (List.map StepSummary.to_json v) + + let of_json j = Json.to_list StepSummary.of_json j +end + +module InstanceGroupModifyConfigList = struct + type t = InstanceGroupModifyConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceGroupModifyConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceGroupModifyConfig.to_query v + + let to_json v = `List (List.map InstanceGroupModifyConfig.to_json v) + + let of_json j = Json.to_list InstanceGroupModifyConfig.of_json j +end + +module InstanceGroupList = struct + type t = InstanceGroup.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceGroup.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceGroup.to_query v + + let to_json v = `List (List.map InstanceGroup.to_json v) + + let of_json j = Json.to_list InstanceGroup.of_json j +end + +module InstanceList = struct + type t = Instance.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map Instance.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list Instance.to_query v + + let to_json v = `List (List.map Instance.to_json v) + + let of_json j = Json.to_list Instance.of_json j +end + +module ClusterSummaryList = struct + type t = ClusterSummary.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map ClusterSummary.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list ClusterSummary.to_query v + + let to_json v = `List (List.map ClusterSummary.to_json v) + + let of_json j = Json.to_list ClusterSummary.of_json j +end + +module StepStateList = struct + type t = StepState.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map StepState.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list StepState.to_query v + + let to_json v = `List (List.map StepState.to_json v) + + let of_json j = Json.to_list StepState.of_json j +end + +module JobFlowExecutionStateList = struct + type t = JobFlowExecutionState.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map JobFlowExecutionState.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list JobFlowExecutionState.to_query v + + let to_json v = `List (List.map JobFlowExecutionState.to_json v) + + let of_json j = Json.to_list JobFlowExecutionState.of_json j +end + +module JobFlowDetailList = struct + type t = JobFlowDetail.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map JobFlowDetail.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list JobFlowDetail.to_query v + + let to_json v = `List (List.map JobFlowDetail.to_json v) + + let of_json j = Json.to_list JobFlowDetail.of_json j +end + +module CommandList = struct + type t = Command.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map Command.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list Command.to_query v + + let to_json v = `List (List.map Command.to_json v) + + let of_json j = Json.to_list Command.of_json j +end + +module InstanceGroupIdsList = struct + type t = String.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list String.to_query v + + let to_json v = `List (List.map String.to_json v) + + let of_json j = Json.to_list String.of_json j +end + +module CancelStepsInfoList = struct + type t = CancelStepsInfo.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map CancelStepsInfo.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list CancelStepsInfo.to_query v + + let to_json v = `List (List.map CancelStepsInfo.to_json v) + + let of_json j = Json.to_list CancelStepsInfo.of_json j +end + +module InstanceGroupTypeList = struct + type t = InstanceGroupType.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceGroupType.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceGroupType.to_query v + + let to_json v = `List (List.map InstanceGroupType.to_json v) + + let of_json j = Json.to_list InstanceGroupType.of_json j +end + +module InstanceStateList = struct + type t = InstanceState.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map InstanceState.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list InstanceState.to_query v + + let to_json v = `List (List.map InstanceState.to_json v) + + let of_json j = Json.to_list InstanceState.of_json j +end + +module ListInstanceGroupsInput = struct + type t = + { cluster_id : String.t + ; marker : String.t option + } + + let make ~cluster_id ?marker () = { cluster_id; marker } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module RemoveTagsInput = - struct - type t = { - resource_id: String.t ; - tag_keys: StringList.t } - let make ~resource_id ~tag_keys () = { resource_id; tag_keys } - let parse xml = - Some - { - resource_id = - (Xml.required "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); - tag_keys = - (Xml.required "TagKeys" - (Util.option_bind (Xml.member "TagKeys" xml) StringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("TagKeys.member", (StringList.to_query v.tag_keys))); - Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("tag_keys", (StringList.to_json v.tag_keys)); - Some ("resource_id", (String.to_json v.resource_id))]) - let of_json j = - { - resource_id = - (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); - tag_keys = - (StringList.of_json (Util.of_option_exn (Json.lookup j "tag_keys"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module AddTagsInput = struct + type t = + { resource_id : String.t + ; tags : TagList.t + } + + let make ~resource_id ~tags () = { resource_id; tags } + + let parse xml = + Some + { resource_id = + Xml.required + "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse) + ; tags = + Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) TagList.parse) } - end -module ListStepsOutput = - struct - type t = { - steps: StepSummaryList.t ; - marker: String.t option } - let make ?(steps= []) ?marker () = { steps; marker } - let parse xml = - Some - { - steps = - (Util.of_option [] - (Util.option_bind (Xml.member "Steps" xml) - StepSummaryList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some - (Query.Pair ("Steps.member", (StepSummaryList.to_query v.steps)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("steps", (StepSummaryList.to_json v.steps))]) - let of_json j = - { - steps = - (StepSummaryList.of_json - (Util.of_option_exn (Json.lookup j "steps"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) + ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("tags", TagList.to_json v.tags) + ; Some ("resource_id", String.to_json v.resource_id) + ]) + + let of_json j = + { resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) + ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) + } +end + +module ListClustersInput = struct + type t = + { created_after : DateTime.t option + ; created_before : DateTime.t option + ; cluster_states : ClusterStateList.t + ; marker : String.t option + } + + let make ?created_after ?created_before ?(cluster_states = []) ?marker () = + { created_after; created_before; cluster_states; marker } + + let parse xml = + Some + { created_after = Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse + ; created_before = Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse + ; cluster_states = + Util.of_option + [] + (Util.option_bind (Xml.member "ClusterStates" xml) ClusterStateList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module ModifyInstanceGroupsInput = - struct - type t = { - instance_groups: InstanceGroupModifyConfigList.t } - let make ?(instance_groups= []) () = { instance_groups } - let parse xml = - Some - { - instance_groups = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroups" xml) - InstanceGroupModifyConfigList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("InstanceGroups.member", - (InstanceGroupModifyConfigList.to_query v.instance_groups)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("instance_groups", - (InstanceGroupModifyConfigList.to_json v.instance_groups))]) - let of_json j = - { - instance_groups = - (InstanceGroupModifyConfigList.of_json - (Util.of_option_exn (Json.lookup j "instance_groups"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some + (Query.Pair + ("ClusterStates.member", ClusterStateList.to_query v.cluster_states)) + ; Util.option_map v.created_before (fun f -> + Query.Pair ("CreatedBefore", DateTime.to_query f)) + ; Util.option_map v.created_after (fun f -> + Query.Pair ("CreatedAfter", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("cluster_states", ClusterStateList.to_json v.cluster_states) + ; Util.option_map v.created_before (fun f -> + "created_before", DateTime.to_json f) + ; Util.option_map v.created_after (fun f -> "created_after", DateTime.to_json f) + ]) + + let of_json j = + { created_after = Util.option_map (Json.lookup j "created_after") DateTime.of_json + ; created_before = Util.option_map (Json.lookup j "created_before") DateTime.of_json + ; cluster_states = + ClusterStateList.of_json (Util.of_option_exn (Json.lookup j "cluster_states")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module DeleteSecurityConfigurationInput = struct + type t = { name : String.t } + + let make ~name () = { name } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) } - end -module AddJobFlowStepsInput = - struct - type t = { - job_flow_id: String.t ; - steps: StepConfigList.t } - let make ~job_flow_id ~steps () = { job_flow_id; steps } - let parse xml = - Some - { - job_flow_id = - (Xml.required "JobFlowId" - (Util.option_bind (Xml.member "JobFlowId" xml) String.parse)); - steps = - (Xml.required "Steps" - (Util.option_bind (Xml.member "Steps" xml) - StepConfigList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair ("Steps.member", (StepConfigList.to_query v.steps))); - Some (Query.Pair ("JobFlowId", (String.to_query v.job_flow_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("steps", (StepConfigList.to_json v.steps)); - Some ("job_flow_id", (String.to_json v.job_flow_id))]) - let of_json j = - { - job_flow_id = - (String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id"))); - steps = - (StepConfigList.of_json - (Util.of_option_exn (Json.lookup j "steps"))) + + let to_query v = + Query.List + (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) + + let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) + + let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } +end + +module ModifyInstanceFleetInput = struct + type t = + { cluster_id : String.t + ; instance_fleet : InstanceFleetModifyConfig.t + } + + let make ~cluster_id ~instance_fleet () = { cluster_id; instance_fleet } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; instance_fleet = + Xml.required + "InstanceFleet" + (Util.option_bind + (Xml.member "InstanceFleet" xml) + InstanceFleetModifyConfig.parse) } - end -module ListInstanceGroupsOutput = - struct - type t = { - instance_groups: InstanceGroupList.t ; - marker: String.t option } - let make ?(instance_groups= []) ?marker () = - { instance_groups; marker } - let parse xml = - Some - { - instance_groups = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroups" xml) - InstanceGroupList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("InstanceGroups.member", - (InstanceGroupList.to_query v.instance_groups)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some - ("instance_groups", - (InstanceGroupList.to_json v.instance_groups))]) - let of_json j = - { - instance_groups = - (InstanceGroupList.of_json - (Util.of_option_exn (Json.lookup j "instance_groups"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + ("InstanceFleet", InstanceFleetModifyConfig.to_query v.instance_fleet)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("instance_fleet", InstanceFleetModifyConfig.to_json v.instance_fleet) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; instance_fleet = + InstanceFleetModifyConfig.of_json + (Util.of_option_exn (Json.lookup j "instance_fleet")) + } +end + +module DescribeStepOutput = struct + type t = { step : Step.t option } + + let make ?step () = { step } + + let parse xml = Some { step = Util.option_bind (Xml.member "Step" xml) Step.parse } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.step (fun f -> Query.Pair ("Step", Step.to_query f)) ]) + + let to_json v = + `Assoc + (Util.list_filter_opt [ Util.option_map v.step (fun f -> "step", Step.to_json f) ]) + + let of_json j = { step = Util.option_map (Json.lookup j "step") Step.of_json } +end + +module AddInstanceGroupsInput = struct + type t = + { instance_groups : InstanceGroupConfigList.t + ; job_flow_id : String.t + } + + let make ~instance_groups ~job_flow_id () = { instance_groups; job_flow_id } + + let parse xml = + Some + { instance_groups = + Xml.required + "InstanceGroups" + (Util.option_bind + (Xml.member "InstanceGroups" xml) + InstanceGroupConfigList.parse) + ; job_flow_id = + Xml.required + "JobFlowId" + (Util.option_bind (Xml.member "JobFlowId" xml) String.parse) } - end -module SetTerminationProtectionInput = - struct - type t = - { - job_flow_ids: XmlStringList.t ; - termination_protected: Boolean.t } - let make ~job_flow_ids ~termination_protected () = - { job_flow_ids; termination_protected } - let parse xml = - Some - { - job_flow_ids = - (Xml.required "JobFlowIds" - (Util.option_bind (Xml.member "JobFlowIds" xml) - XmlStringList.parse)); - termination_protected = - (Xml.required "TerminationProtected" - (Util.option_bind (Xml.member "TerminationProtected" xml) - Boolean.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("TerminationProtected", - (Boolean.to_query v.termination_protected))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("JobFlowId", String.to_query v.job_flow_id)) + ; Some (Query.Pair - ("JobFlowIds.member", - (XmlStringList.to_query v.job_flow_ids)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("termination_protected", - (Boolean.to_json v.termination_protected)); - Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) - let of_json j = - { - job_flow_ids = - (XmlStringList.of_json - (Util.of_option_exn (Json.lookup j "job_flow_ids"))); - termination_protected = - (Boolean.of_json - (Util.of_option_exn (Json.lookup j "termination_protected"))) + ( "InstanceGroups.member" + , InstanceGroupConfigList.to_query v.instance_groups )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("job_flow_id", String.to_json v.job_flow_id) + ; Some ("instance_groups", InstanceGroupConfigList.to_json v.instance_groups) + ]) + + let of_json j = + { instance_groups = + InstanceGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups")) + ; job_flow_id = String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id")) + } +end + +module DescribeSecurityConfigurationInput = struct + type t = { name : String.t } + + let make ~name () = { name } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) } - end -module AddJobFlowStepsOutput = - struct - type t = { - step_ids: StepIdsList.t } - let make ?(step_ids= []) () = { step_ids } - let parse xml = - Some - { - step_ids = - (Util.of_option [] - (Util.option_bind (Xml.member "StepIds" xml) StepIdsList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("StepIds.member", (StepIdsList.to_query v.step_ids)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("step_ids", (StepIdsList.to_json v.step_ids))]) - let of_json j = - { - step_ids = - (StepIdsList.of_json - (Util.of_option_exn (Json.lookup j "step_ids"))) + + let to_query v = + Query.List + (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) + + let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) + + let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } +end + +module ListInstanceFleetsInput = struct + type t = + { cluster_id : String.t + ; marker : String.t option + } + + let make ~cluster_id ?marker () = { cluster_id; marker } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module ListInstancesOutput = - struct - type t = { - instances: InstanceList.t ; - marker: String.t option } - let make ?(instances= []) ?marker () = { instances; marker } - let parse xml = - Some - { - instances = - (Util.of_option [] - (Util.option_bind (Xml.member "Instances" xml) - InstanceList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some - (Query.Pair - ("Instances.member", (InstanceList.to_query v.instances)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("instances", (InstanceList.to_json v.instances))]) - let of_json j = - { - instances = - (InstanceList.of_json - (Util.of_option_exn (Json.lookup j "instances"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module CancelStepsInput = struct + type t = + { cluster_id : String.t option + ; step_ids : StepIdsList.t + } + + let make ?cluster_id ?(step_ids = []) () = { cluster_id; step_ids } + + let parse xml = + Some + { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse + ; step_ids = + Util.of_option + [] + (Util.option_bind (Xml.member "StepIds" xml) StepIdsList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("StepIds.member", StepIdsList.to_query v.step_ids)) + ; Util.option_map v.cluster_id (fun f -> + Query.Pair ("ClusterId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("step_ids", StepIdsList.to_json v.step_ids) + ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) + ]) + + let of_json j = + { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json + ; step_ids = StepIdsList.of_json (Util.of_option_exn (Json.lookup j "step_ids")) + } +end + +module SetVisibleToAllUsersInput = struct + type t = + { job_flow_ids : XmlStringList.t + ; visible_to_all_users : Boolean.t + } + + let make ~job_flow_ids ~visible_to_all_users () = { job_flow_ids; visible_to_all_users } + + let parse xml = + Some + { job_flow_ids = + Xml.required + "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) XmlStringList.parse) + ; visible_to_all_users = + Xml.required + "VisibleToAllUsers" + (Util.option_bind (Xml.member "VisibleToAllUsers" xml) Boolean.parse) } - end -module InternalServerException = - struct - type t = { - message: String.t option } - let make ?message () = { message } - let parse xml = - Some - { - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f)))]) - let of_json j = - { message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("VisibleToAllUsers", Boolean.to_query v.visible_to_all_users)) + ; Some (Query.Pair ("JobFlowIds.member", XmlStringList.to_query v.job_flow_ids)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("visible_to_all_users", Boolean.to_json v.visible_to_all_users) + ; Some ("job_flow_ids", XmlStringList.to_json v.job_flow_ids) + ]) + + let of_json j = + { job_flow_ids = + XmlStringList.of_json (Util.of_option_exn (Json.lookup j "job_flow_ids")) + ; visible_to_all_users = + Boolean.of_json (Util.of_option_exn (Json.lookup j "visible_to_all_users")) + } +end + +module CreateSecurityConfigurationInput = struct + type t = + { name : String.t + ; security_configuration : String.t + } + + let make ~name ~security_configuration () = { name; security_configuration } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; security_configuration = + Xml.required + "SecurityConfiguration" + (Util.option_bind (Xml.member "SecurityConfiguration" xml) String.parse) } - end -module ListClustersOutput = - struct - type t = { - clusters: ClusterSummaryList.t ; - marker: String.t option } - let make ?(clusters= []) ?marker () = { clusters; marker } - let parse xml = - Some - { - clusters = - (Util.of_option [] - (Util.option_bind (Xml.member "Clusters" xml) - ClusterSummaryList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair - ("Clusters.member", (ClusterSummaryList.to_query v.clusters)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("clusters", (ClusterSummaryList.to_json v.clusters))]) - let of_json j = - { - clusters = - (ClusterSummaryList.of_json - (Util.of_option_exn (Json.lookup j "clusters"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + ("SecurityConfiguration", String.to_query v.security_configuration)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("security_configuration", String.to_json v.security_configuration) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; security_configuration = + String.of_json (Util.of_option_exn (Json.lookup j "security_configuration")) + } +end + +module ListBootstrapActionsInput = struct + type t = + { cluster_id : String.t + ; marker : String.t option + } + + let make ~cluster_id ?marker () = { cluster_id; marker } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module DescribeClusterOutput = struct + type t = { cluster : Cluster.t } + + let make ~cluster () = { cluster } + + let parse xml = + Some + { cluster = + Xml.required + "Cluster" + (Util.option_bind (Xml.member "Cluster" xml) Cluster.parse) } - end -module InvalidRequestException = - struct - type t = { - error_code: String.t option ; - message: String.t option } - let make ?error_code ?message () = { error_code; message } - let parse xml = - Some - { - error_code = - (Util.option_bind (Xml.member "ErrorCode" xml) String.parse); - message = - (Util.option_bind (Xml.member "Message" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> Query.Pair ("Message", (String.to_query f))); - Util.option_map v.error_code - (fun f -> Query.Pair ("ErrorCode", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.message - (fun f -> ("message", (String.to_json f))); - Util.option_map v.error_code - (fun f -> ("error_code", (String.to_json f)))]) - let of_json j = - { - error_code = - (Util.option_map (Json.lookup j "error_code") String.of_json); - message = (Util.option_map (Json.lookup j "message") String.of_json) + + let to_query v = + Query.List + (Util.list_filter_opt [ Some (Query.Pair ("Cluster", Cluster.to_query v.cluster)) ]) + + let to_json v = + `Assoc (Util.list_filter_opt [ Some ("cluster", Cluster.to_json v.cluster) ]) + + let of_json j = + { cluster = Cluster.of_json (Util.of_option_exn (Json.lookup j "cluster")) } +end + +module DescribeStepInput = struct + type t = + { cluster_id : String.t + ; step_id : String.t + } + + let make ~cluster_id ~step_id () = { cluster_id; step_id } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; step_id = + Xml.required "StepId" (Util.option_bind (Xml.member "StepId" xml) String.parse) } - end -module ListStepsInput = - struct - type t = - { - cluster_id: String.t ; - step_states: StepStateList.t ; - step_ids: XmlStringList.t ; - marker: String.t option } - let make ~cluster_id ?(step_states= []) ?(step_ids= []) ?marker () = - { cluster_id; step_states; step_ids; marker } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); - step_states = - (Util.of_option [] - (Util.option_bind (Xml.member "StepStates" xml) - StepStateList.parse)); - step_ids = - (Util.of_option [] - (Util.option_bind (Xml.member "StepIds" xml) - XmlStringList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("StepId", String.to_query v.step_id)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("step_id", String.to_json v.step_id) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; step_id = String.of_json (Util.of_option_exn (Json.lookup j "step_id")) + } +end + +module RunJobFlowInput = struct + type t = + { name : String.t + ; log_uri : String.t option + ; additional_info : String.t option + ; ami_version : String.t option + ; release_label : String.t option + ; instances : JobFlowInstancesConfig.t + ; steps : StepConfigList.t + ; bootstrap_actions : BootstrapActionConfigList.t + ; supported_products : SupportedProductsList.t + ; new_supported_products : NewSupportedProductsList.t + ; applications : ApplicationList.t + ; configurations : ConfigurationList.t + ; visible_to_all_users : Boolean.t option + ; job_flow_role : String.t option + ; service_role : String.t option + ; tags : TagList.t + ; security_configuration : String.t option + ; auto_scaling_role : String.t option + ; scale_down_behavior : ScaleDownBehavior.t option + ; custom_ami_id : String.t option + ; ebs_root_volume_size : Integer.t option + ; repo_upgrade_on_boot : RepoUpgradeOnBoot.t option + ; kerberos_attributes : KerberosAttributes.t option + } + + let make + ~name + ?log_uri + ?additional_info + ?ami_version + ?release_label + ~instances + ?(steps = []) + ?(bootstrap_actions = []) + ?(supported_products = []) + ?(new_supported_products = []) + ?(applications = []) + ?(configurations = []) + ?visible_to_all_users + ?job_flow_role + ?service_role + ?(tags = []) + ?security_configuration + ?auto_scaling_role + ?scale_down_behavior + ?custom_ami_id + ?ebs_root_volume_size + ?repo_upgrade_on_boot + ?kerberos_attributes + () = + { name + ; log_uri + ; additional_info + ; ami_version + ; release_label + ; instances + ; steps + ; bootstrap_actions + ; supported_products + ; new_supported_products + ; applications + ; configurations + ; visible_to_all_users + ; job_flow_role + ; service_role + ; tags + ; security_configuration + ; auto_scaling_role + ; scale_down_behavior + ; custom_ami_id + ; ebs_root_volume_size + ; repo_upgrade_on_boot + ; kerberos_attributes + } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; additional_info = Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse + ; ami_version = Util.option_bind (Xml.member "AmiVersion" xml) String.parse + ; release_label = Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse + ; instances = + Xml.required + "Instances" + (Util.option_bind (Xml.member "Instances" xml) JobFlowInstancesConfig.parse) + ; steps = + Util.of_option + [] + (Util.option_bind (Xml.member "Steps" xml) StepConfigList.parse) + ; bootstrap_actions = + Util.of_option + [] + (Util.option_bind + (Xml.member "BootstrapActions" xml) + BootstrapActionConfigList.parse) + ; supported_products = + Util.of_option + [] + (Util.option_bind + (Xml.member "SupportedProducts" xml) + SupportedProductsList.parse) + ; new_supported_products = + Util.of_option + [] + (Util.option_bind + (Xml.member "NewSupportedProducts" xml) + NewSupportedProductsList.parse) + ; applications = + Util.of_option + [] + (Util.option_bind (Xml.member "Applications" xml) ApplicationList.parse) + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; visible_to_all_users = + Util.option_bind (Xml.member "VisibleToAllUsers" xml) Boolean.parse + ; job_flow_role = Util.option_bind (Xml.member "JobFlowRole" xml) String.parse + ; service_role = Util.option_bind (Xml.member "ServiceRole" xml) String.parse + ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) + ; security_configuration = + Util.option_bind (Xml.member "SecurityConfiguration" xml) String.parse + ; auto_scaling_role = + Util.option_bind (Xml.member "AutoScalingRole" xml) String.parse + ; scale_down_behavior = + Util.option_bind (Xml.member "ScaleDownBehavior" xml) ScaleDownBehavior.parse + ; custom_ami_id = Util.option_bind (Xml.member "CustomAmiId" xml) String.parse + ; ebs_root_volume_size = + Util.option_bind (Xml.member "EbsRootVolumeSize" xml) Integer.parse + ; repo_upgrade_on_boot = + Util.option_bind (Xml.member "RepoUpgradeOnBoot" xml) RepoUpgradeOnBoot.parse + ; kerberos_attributes = + Util.option_bind (Xml.member "KerberosAttributes" xml) KerberosAttributes.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.kerberos_attributes (fun f -> + Query.Pair ("KerberosAttributes", KerberosAttributes.to_query f)) + ; Util.option_map v.repo_upgrade_on_boot (fun f -> + Query.Pair ("RepoUpgradeOnBoot", RepoUpgradeOnBoot.to_query f)) + ; Util.option_map v.ebs_root_volume_size (fun f -> + Query.Pair ("EbsRootVolumeSize", Integer.to_query f)) + ; Util.option_map v.custom_ami_id (fun f -> + Query.Pair ("CustomAmiId", String.to_query f)) + ; Util.option_map v.scale_down_behavior (fun f -> + Query.Pair ("ScaleDownBehavior", ScaleDownBehavior.to_query f)) + ; Util.option_map v.auto_scaling_role (fun f -> + Query.Pair ("AutoScalingRole", String.to_query f)) + ; Util.option_map v.security_configuration (fun f -> + Query.Pair ("SecurityConfiguration", String.to_query f)) + ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) + ; Util.option_map v.service_role (fun f -> + Query.Pair ("ServiceRole", String.to_query f)) + ; Util.option_map v.job_flow_role (fun f -> + Query.Pair ("JobFlowRole", String.to_query f)) + ; Util.option_map v.visible_to_all_users (fun f -> + Query.Pair ("VisibleToAllUsers", Boolean.to_query f)) + ; Some (Query.Pair - ("StepIds.member", (XmlStringList.to_query v.step_ids))); - Some + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Some + (Query.Pair ("Applications.member", ApplicationList.to_query v.applications)) + ; Some (Query.Pair - ("StepStates.member", (StepStateList.to_query v.step_states))); - Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some ("step_ids", (XmlStringList.to_json v.step_ids)); - Some ("step_states", (StepStateList.to_json v.step_states)); - Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); - step_states = - (StepStateList.of_json - (Util.of_option_exn (Json.lookup j "step_states"))); - step_ids = - (XmlStringList.of_json - (Util.of_option_exn (Json.lookup j "step_ids"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + ( "NewSupportedProducts.member" + , NewSupportedProductsList.to_query v.new_supported_products )) + ; Some + (Query.Pair + ( "SupportedProducts.member" + , SupportedProductsList.to_query v.supported_products )) + ; Some + (Query.Pair + ( "BootstrapActions.member" + , BootstrapActionConfigList.to_query v.bootstrap_actions )) + ; Some (Query.Pair ("Steps.member", StepConfigList.to_query v.steps)) + ; Some (Query.Pair ("Instances", JobFlowInstancesConfig.to_query v.instances)) + ; Util.option_map v.release_label (fun f -> + Query.Pair ("ReleaseLabel", String.to_query f)) + ; Util.option_map v.ami_version (fun f -> + Query.Pair ("AmiVersion", String.to_query f)) + ; Util.option_map v.additional_info (fun f -> + Query.Pair ("AdditionalInfo", String.to_query f)) + ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.kerberos_attributes (fun f -> + "kerberos_attributes", KerberosAttributes.to_json f) + ; Util.option_map v.repo_upgrade_on_boot (fun f -> + "repo_upgrade_on_boot", RepoUpgradeOnBoot.to_json f) + ; Util.option_map v.ebs_root_volume_size (fun f -> + "ebs_root_volume_size", Integer.to_json f) + ; Util.option_map v.custom_ami_id (fun f -> "custom_ami_id", String.to_json f) + ; Util.option_map v.scale_down_behavior (fun f -> + "scale_down_behavior", ScaleDownBehavior.to_json f) + ; Util.option_map v.auto_scaling_role (fun f -> + "auto_scaling_role", String.to_json f) + ; Util.option_map v.security_configuration (fun f -> + "security_configuration", String.to_json f) + ; Some ("tags", TagList.to_json v.tags) + ; Util.option_map v.service_role (fun f -> "service_role", String.to_json f) + ; Util.option_map v.job_flow_role (fun f -> "job_flow_role", String.to_json f) + ; Util.option_map v.visible_to_all_users (fun f -> + "visible_to_all_users", Boolean.to_json f) + ; Some ("configurations", ConfigurationList.to_json v.configurations) + ; Some ("applications", ApplicationList.to_json v.applications) + ; Some + ( "new_supported_products" + , NewSupportedProductsList.to_json v.new_supported_products ) + ; Some ("supported_products", SupportedProductsList.to_json v.supported_products) + ; Some + ("bootstrap_actions", BootstrapActionConfigList.to_json v.bootstrap_actions) + ; Some ("steps", StepConfigList.to_json v.steps) + ; Some ("instances", JobFlowInstancesConfig.to_json v.instances) + ; Util.option_map v.release_label (fun f -> "release_label", String.to_json f) + ; Util.option_map v.ami_version (fun f -> "ami_version", String.to_json f) + ; Util.option_map v.additional_info (fun f -> + "additional_info", String.to_json f) + ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json + ; ami_version = Util.option_map (Json.lookup j "ami_version") String.of_json + ; release_label = Util.option_map (Json.lookup j "release_label") String.of_json + ; instances = + JobFlowInstancesConfig.of_json (Util.of_option_exn (Json.lookup j "instances")) + ; steps = StepConfigList.of_json (Util.of_option_exn (Json.lookup j "steps")) + ; bootstrap_actions = + BootstrapActionConfigList.of_json + (Util.of_option_exn (Json.lookup j "bootstrap_actions")) + ; supported_products = + SupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "supported_products")) + ; new_supported_products = + NewSupportedProductsList.of_json + (Util.of_option_exn (Json.lookup j "new_supported_products")) + ; applications = + ApplicationList.of_json (Util.of_option_exn (Json.lookup j "applications")) + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; visible_to_all_users = + Util.option_map (Json.lookup j "visible_to_all_users") Boolean.of_json + ; job_flow_role = Util.option_map (Json.lookup j "job_flow_role") String.of_json + ; service_role = Util.option_map (Json.lookup j "service_role") String.of_json + ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) + ; security_configuration = + Util.option_map (Json.lookup j "security_configuration") String.of_json + ; auto_scaling_role = + Util.option_map (Json.lookup j "auto_scaling_role") String.of_json + ; scale_down_behavior = + Util.option_map (Json.lookup j "scale_down_behavior") ScaleDownBehavior.of_json + ; custom_ami_id = Util.option_map (Json.lookup j "custom_ami_id") String.of_json + ; ebs_root_volume_size = + Util.option_map (Json.lookup j "ebs_root_volume_size") Integer.of_json + ; repo_upgrade_on_boot = + Util.option_map (Json.lookup j "repo_upgrade_on_boot") RepoUpgradeOnBoot.of_json + ; kerberos_attributes = + Util.option_map (Json.lookup j "kerberos_attributes") KerberosAttributes.of_json + } +end + +module ListSecurityConfigurationsOutput = struct + type t = + { security_configurations : SecurityConfigurationList.t + ; marker : String.t option + } + + let make ?(security_configurations = []) ?marker () = + { security_configurations; marker } + + let parse xml = + Some + { security_configurations = + Util.of_option + [] + (Util.option_bind + (Xml.member "SecurityConfigurations" xml) + SecurityConfigurationList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module InternalServerError = - struct - type t = unit - let make () = () - let parse xml = Some () - let to_query v = Query.List (Util.list_filter_opt []) - let to_json v = `Assoc (Util.list_filter_opt []) - let of_json j = () - end -module DescribeJobFlowsInput = - struct - type t = - { - created_after: DateTime.t option ; - created_before: DateTime.t option ; - job_flow_ids: XmlStringList.t ; - job_flow_states: JobFlowExecutionStateList.t } - let make ?created_after ?created_before ?(job_flow_ids= []) - ?(job_flow_states= []) () = - { created_after; created_before; job_flow_ids; job_flow_states } - let parse xml = - Some - { - created_after = - (Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse); - created_before = - (Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse); - job_flow_ids = - (Util.of_option [] - (Util.option_bind (Xml.member "JobFlowIds" xml) - XmlStringList.parse)); - job_flow_states = - (Util.of_option [] - (Util.option_bind (Xml.member "JobFlowStates" xml) - JobFlowExecutionStateList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("JobFlowStates.member", - (JobFlowExecutionStateList.to_query v.job_flow_states))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair - ("JobFlowIds.member", - (XmlStringList.to_query v.job_flow_ids))); - Util.option_map v.created_before - (fun f -> Query.Pair ("CreatedBefore", (DateTime.to_query f))); - Util.option_map v.created_after - (fun f -> Query.Pair ("CreatedAfter", (DateTime.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("job_flow_states", - (JobFlowExecutionStateList.to_json v.job_flow_states)); - Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids)); - Util.option_map v.created_before - (fun f -> ("created_before", (DateTime.to_json f))); - Util.option_map v.created_after - (fun f -> ("created_after", (DateTime.to_json f)))]) - let of_json j = - { - created_after = - (Util.option_map (Json.lookup j "created_after") DateTime.of_json); - created_before = - (Util.option_map (Json.lookup j "created_before") DateTime.of_json); - job_flow_ids = - (XmlStringList.of_json - (Util.of_option_exn (Json.lookup j "job_flow_ids"))); - job_flow_states = - (JobFlowExecutionStateList.of_json - (Util.of_option_exn (Json.lookup j "job_flow_states"))) + ( "SecurityConfigurations.member" + , SecurityConfigurationList.to_query v.security_configurations )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some + ( "security_configurations" + , SecurityConfigurationList.to_json v.security_configurations ) + ]) + + let of_json j = + { security_configurations = + SecurityConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "security_configurations")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module RemoveTagsInput = struct + type t = + { resource_id : String.t + ; tag_keys : StringList.t + } + + let make ~resource_id ~tag_keys () = { resource_id; tag_keys } + + let parse xml = + Some + { resource_id = + Xml.required + "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse) + ; tag_keys = + Xml.required + "TagKeys" + (Util.option_bind (Xml.member "TagKeys" xml) StringList.parse) } - end -module AddTagsOutput = - struct - type t = unit - let make () = () - let parse xml = Some () - let to_query v = Query.List (Util.list_filter_opt []) - let to_json v = `Assoc (Util.list_filter_opt []) - let of_json j = () - end -module RemoveTagsOutput = - struct - type t = unit - let make () = () - let parse xml = Some () - let to_query v = Query.List (Util.list_filter_opt []) - let to_json v = `Assoc (Util.list_filter_opt []) - let of_json j = () - end -module DescribeJobFlowsOutput = - struct - type t = { - job_flows: JobFlowDetailList.t } - let make ?(job_flows= []) () = { job_flows } - let parse xml = - Some - { - job_flows = - (Util.of_option [] - (Util.option_bind (Xml.member "JobFlows" xml) - JobFlowDetailList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("JobFlows.member", - (JobFlowDetailList.to_query v.job_flows)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("job_flows", (JobFlowDetailList.to_json v.job_flows))]) - let of_json j = - { - job_flows = - (JobFlowDetailList.of_json - (Util.of_option_exn (Json.lookup j "job_flows"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("TagKeys.member", StringList.to_query v.tag_keys)) + ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("tag_keys", StringList.to_json v.tag_keys) + ; Some ("resource_id", String.to_json v.resource_id) + ]) + + let of_json j = + { resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) + ; tag_keys = StringList.of_json (Util.of_option_exn (Json.lookup j "tag_keys")) + } +end + +module ListInstanceFleetsOutput = struct + type t = + { instance_fleets : InstanceFleetList.t + ; marker : String.t option + } + + let make ?(instance_fleets = []) ?marker () = { instance_fleets; marker } + + let parse xml = + Some + { instance_fleets = + Util.of_option + [] + (Util.option_bind (Xml.member "InstanceFleets" xml) InstanceFleetList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module ListBootstrapActionsOutput = - struct - type t = { - bootstrap_actions: CommandList.t ; - marker: String.t option } - let make ?(bootstrap_actions= []) ?marker () = - { bootstrap_actions; marker } - let parse xml = - Some - { - bootstrap_actions = - (Util.of_option [] - (Util.option_bind (Xml.member "BootstrapActions" xml) - CommandList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair - ("BootstrapActions.member", - (CommandList.to_query v.bootstrap_actions)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some - ("bootstrap_actions", (CommandList.to_json v.bootstrap_actions))]) - let of_json j = - { - bootstrap_actions = - (CommandList.of_json - (Util.of_option_exn (Json.lookup j "bootstrap_actions"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + ("InstanceFleets.member", InstanceFleetList.to_query v.instance_fleets)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("instance_fleets", InstanceFleetList.to_json v.instance_fleets) + ]) + + let of_json j = + { instance_fleets = + InstanceFleetList.of_json (Util.of_option_exn (Json.lookup j "instance_fleets")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module DeleteSecurityConfigurationOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module ListStepsOutput = struct + type t = + { steps : StepSummaryList.t + ; marker : String.t option + } + + let make ?(steps = []) ?marker () = { steps; marker } + + let parse xml = + Some + { steps = + Util.of_option + [] + (Util.option_bind (Xml.member "Steps" xml) StepSummaryList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module RunJobFlowOutput = - struct - type t = { - job_flow_id: String.t option } - let make ?job_flow_id () = { job_flow_id } - let parse xml = - Some - { - job_flow_id = + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("Steps.member", StepSummaryList.to_query v.steps)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("steps", StepSummaryList.to_json v.steps) + ]) + + let of_json j = + { steps = StepSummaryList.of_json (Util.of_option_exn (Json.lookup j "steps")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module ModifyInstanceGroupsInput = struct + type t = + { cluster_id : String.t option + ; instance_groups : InstanceGroupModifyConfigList.t + } + + let make ?cluster_id ?(instance_groups = []) () = { cluster_id; instance_groups } + + let parse xml = + Some + { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse + ; instance_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceGroups" xml) + InstanceGroupModifyConfigList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "InstanceGroups.member" + , InstanceGroupModifyConfigList.to_query v.instance_groups )) + ; Util.option_map v.cluster_id (fun f -> + Query.Pair ("ClusterId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ("instance_groups", InstanceGroupModifyConfigList.to_json v.instance_groups) + ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) + ]) + + let of_json j = + { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json + ; instance_groups = + InstanceGroupModifyConfigList.of_json + (Util.of_option_exn (Json.lookup j "instance_groups")) + } +end + +module AddJobFlowStepsInput = struct + type t = + { job_flow_id : String.t + ; steps : StepConfigList.t + } + + let make ~job_flow_id ~steps () = { job_flow_id; steps } + + let parse xml = + Some + { job_flow_id = + Xml.required + "JobFlowId" (Util.option_bind (Xml.member "JobFlowId" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.job_flow_id - (fun f -> Query.Pair ("JobFlowId", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.job_flow_id - (fun f -> ("job_flow_id", (String.to_json f)))]) - let of_json j = - { - job_flow_id = - (Util.option_map (Json.lookup j "job_flow_id") String.of_json) + ; steps = + Xml.required + "Steps" + (Util.option_bind (Xml.member "Steps" xml) StepConfigList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Steps.member", StepConfigList.to_query v.steps)) + ; Some (Query.Pair ("JobFlowId", String.to_query v.job_flow_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("steps", StepConfigList.to_json v.steps) + ; Some ("job_flow_id", String.to_json v.job_flow_id) + ]) + + let of_json j = + { job_flow_id = String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id")) + ; steps = StepConfigList.of_json (Util.of_option_exn (Json.lookup j "steps")) + } +end + +module ListInstanceGroupsOutput = struct + type t = + { instance_groups : InstanceGroupList.t + ; marker : String.t option + } + + let make ?(instance_groups = []) ?marker () = { instance_groups; marker } + + let parse xml = + Some + { instance_groups = + Util.of_option + [] + (Util.option_bind (Xml.member "InstanceGroups" xml) InstanceGroupList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some + (Query.Pair + ("InstanceGroups.member", InstanceGroupList.to_query v.instance_groups)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("instance_groups", InstanceGroupList.to_json v.instance_groups) + ]) + + let of_json j = + { instance_groups = + InstanceGroupList.of_json (Util.of_option_exn (Json.lookup j "instance_groups")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module SetTerminationProtectionInput = struct + type t = + { job_flow_ids : XmlStringList.t + ; termination_protected : Boolean.t + } + + let make ~job_flow_ids ~termination_protected () = + { job_flow_ids; termination_protected } + + let parse xml = + Some + { job_flow_ids = + Xml.required + "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) XmlStringList.parse) + ; termination_protected = + Xml.required + "TerminationProtected" + (Util.option_bind (Xml.member "TerminationProtected" xml) Boolean.parse) } - end -module AddInstanceGroupsOutput = - struct - type t = - { - job_flow_id: String.t option ; - instance_group_ids: InstanceGroupIdsList.t } - let make ?job_flow_id ?(instance_group_ids= []) () = - { job_flow_id; instance_group_ids } - let parse xml = - Some - { - job_flow_id = - (Util.option_bind (Xml.member "JobFlowId" xml) String.parse); - instance_group_ids = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroupIds" xml) - InstanceGroupIdsList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("InstanceGroupIds.member", - (InstanceGroupIdsList.to_query v.instance_group_ids))); - Util.option_map v.job_flow_id - (fun f -> Query.Pair ("JobFlowId", (String.to_query f)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some - ("instance_group_ids", - (InstanceGroupIdsList.to_json v.instance_group_ids)); - Util.option_map v.job_flow_id - (fun f -> ("job_flow_id", (String.to_json f)))]) - let of_json j = - { - job_flow_id = - (Util.option_map (Json.lookup j "job_flow_id") String.of_json); - instance_group_ids = - (InstanceGroupIdsList.of_json - (Util.of_option_exn (Json.lookup j "instance_group_ids"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("TerminationProtected", Boolean.to_query v.termination_protected)) + ; Some (Query.Pair ("JobFlowIds.member", XmlStringList.to_query v.job_flow_ids)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("termination_protected", Boolean.to_json v.termination_protected) + ; Some ("job_flow_ids", XmlStringList.to_json v.job_flow_ids) + ]) + + let of_json j = + { job_flow_ids = + XmlStringList.of_json (Util.of_option_exn (Json.lookup j "job_flow_ids")) + ; termination_protected = + Boolean.of_json (Util.of_option_exn (Json.lookup j "termination_protected")) + } +end + +module AddJobFlowStepsOutput = struct + type t = { step_ids : StepIdsList.t } + + let make ?(step_ids = []) () = { step_ids } + + let parse xml = + Some + { step_ids = + Util.of_option + [] + (Util.option_bind (Xml.member "StepIds" xml) StepIdsList.parse) } - end -module TerminateJobFlowsInput = - struct - type t = { - job_flow_ids: XmlStringList.t } - let make ~job_flow_ids () = { job_flow_ids } - let parse xml = - Some - { - job_flow_ids = - (Xml.required "JobFlowIds" - (Util.option_bind (Xml.member "JobFlowIds" xml) - XmlStringList.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some - (Query.Pair - ("JobFlowIds.member", - (XmlStringList.to_query v.job_flow_ids)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("job_flow_ids", (XmlStringList.to_json v.job_flow_ids))]) - let of_json j = - { - job_flow_ids = - (XmlStringList.of_json - (Util.of_option_exn (Json.lookup j "job_flow_ids"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("StepIds.member", StepIdsList.to_query v.step_ids)) ]) + + let to_json v = + `Assoc (Util.list_filter_opt [ Some ("step_ids", StepIdsList.to_json v.step_ids) ]) + + let of_json j = + { step_ids = StepIdsList.of_json (Util.of_option_exn (Json.lookup j "step_ids")) } +end + +module ListInstancesOutput = struct + type t = + { instances : InstanceList.t + ; marker : String.t option + } + + let make ?(instances = []) ?marker () = { instances; marker } + + let parse xml = + Some + { instances = + Util.of_option + [] + (Util.option_bind (Xml.member "Instances" xml) InstanceList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module DescribeClusterInput = - struct - type t = { - cluster_id: String.t } - let make ~cluster_id () = { cluster_id } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))) + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("Instances.member", InstanceList.to_query v.instances)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("instances", InstanceList.to_json v.instances) + ]) + + let of_json j = + { instances = InstanceList.of_json (Util.of_option_exn (Json.lookup j "instances")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module InternalServerException = struct + type t = { message : String.t option } + + let make ?message () = { message } + + let parse xml = + Some { message = Util.option_bind (Xml.member "Message" xml) String.parse } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) + + let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } +end + +module ListClustersOutput = struct + type t = + { clusters : ClusterSummaryList.t + ; marker : String.t option + } + + let make ?(clusters = []) ?marker () = { clusters; marker } + + let parse xml = + Some + { clusters = + Util.of_option + [] + (Util.option_bind (Xml.member "Clusters" xml) ClusterSummaryList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse } - end -module ListInstancesInput = - struct - type t = - { - cluster_id: String.t ; - instance_group_id: String.t option ; - instance_group_types: InstanceGroupTypeList.t ; - marker: String.t option } - let make ~cluster_id ?instance_group_id ?(instance_group_types= []) - ?marker () = - { cluster_id; instance_group_id; instance_group_types; marker } - let parse xml = - Some - { - cluster_id = - (Xml.required "ClusterId" - (Util.option_bind (Xml.member "ClusterId" xml) String.parse)); - instance_group_id = - (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse); - instance_group_types = - (Util.of_option [] - (Util.option_bind (Xml.member "InstanceGroupTypes" xml) - InstanceGroupTypeList.parse)); - marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) - } - let to_query v = - Query.List - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> Query.Pair ("Marker", (String.to_query f))); - Some + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("Clusters.member", ClusterSummaryList.to_query v.clusters)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("clusters", ClusterSummaryList.to_json v.clusters) + ]) + + let of_json j = + { clusters = + ClusterSummaryList.of_json (Util.of_option_exn (Json.lookup j "clusters")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module InvalidRequestException = struct + type t = + { error_code : String.t option + ; message : String.t option + } + + let make ?error_code ?message () = { error_code; message } + + let parse xml = + Some + { error_code = Util.option_bind (Xml.member "ErrorCode" xml) String.parse + ; message = Util.option_bind (Xml.member "Message" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) + ; Util.option_map v.error_code (fun f -> + Query.Pair ("ErrorCode", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.message (fun f -> "message", String.to_json f) + ; Util.option_map v.error_code (fun f -> "error_code", String.to_json f) + ]) + + let of_json j = + { error_code = Util.option_map (Json.lookup j "error_code") String.of_json + ; message = Util.option_map (Json.lookup j "message") String.of_json + } +end + +module ListStepsInput = struct + type t = + { cluster_id : String.t + ; step_states : StepStateList.t + ; step_ids : XmlStringList.t + ; marker : String.t option + } + + let make ~cluster_id ?(step_states = []) ?(step_ids = []) ?marker () = + { cluster_id; step_states; step_ids; marker } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; step_states = + Util.of_option + [] + (Util.option_bind (Xml.member "StepStates" xml) StepStateList.parse) + ; step_ids = + Util.of_option + [] + (Util.option_bind (Xml.member "StepIds" xml) XmlStringList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some (Query.Pair ("StepIds.member", XmlStringList.to_query v.step_ids)) + ; Some (Query.Pair ("StepStates.member", StepStateList.to_query v.step_states)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("step_ids", XmlStringList.to_json v.step_ids) + ; Some ("step_states", StepStateList.to_json v.step_states) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; step_states = + StepStateList.of_json (Util.of_option_exn (Json.lookup j "step_states")) + ; step_ids = XmlStringList.of_json (Util.of_option_exn (Json.lookup j "step_ids")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module RemoveAutoScalingPolicyOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module AddInstanceFleetOutput = struct + type t = + { cluster_id : String.t option + ; instance_fleet_id : String.t option + } + + let make ?cluster_id ?instance_fleet_id () = { cluster_id; instance_fleet_id } + + let parse xml = + Some + { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse + ; instance_fleet_id = + Util.option_bind (Xml.member "InstanceFleetId" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.instance_fleet_id (fun f -> + Query.Pair ("InstanceFleetId", String.to_query f)) + ; Util.option_map v.cluster_id (fun f -> + Query.Pair ("ClusterId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.instance_fleet_id (fun f -> + "instance_fleet_id", String.to_json f) + ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) + ]) + + let of_json j = + { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json + ; instance_fleet_id = + Util.option_map (Json.lookup j "instance_fleet_id") String.of_json + } +end + +module InternalServerError = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module PutAutoScalingPolicyOutput = struct + type t = + { cluster_id : String.t option + ; instance_group_id : String.t option + ; auto_scaling_policy : AutoScalingPolicyDescription.t option + } + + let make ?cluster_id ?instance_group_id ?auto_scaling_policy () = + { cluster_id; instance_group_id; auto_scaling_policy } + + let parse xml = + Some + { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse + ; instance_group_id = + Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse + ; auto_scaling_policy = + Util.option_bind + (Xml.member "AutoScalingPolicy" xml) + AutoScalingPolicyDescription.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + Query.Pair ("AutoScalingPolicy", AutoScalingPolicyDescription.to_query f)) + ; Util.option_map v.instance_group_id (fun f -> + Query.Pair ("InstanceGroupId", String.to_query f)) + ; Util.option_map v.cluster_id (fun f -> + Query.Pair ("ClusterId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.auto_scaling_policy (fun f -> + "auto_scaling_policy", AutoScalingPolicyDescription.to_json f) + ; Util.option_map v.instance_group_id (fun f -> + "instance_group_id", String.to_json f) + ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) + ]) + + let of_json j = + { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json + ; instance_group_id = + Util.option_map (Json.lookup j "instance_group_id") String.of_json + ; auto_scaling_policy = + Util.option_map + (Json.lookup j "auto_scaling_policy") + AutoScalingPolicyDescription.of_json + } +end + +module DescribeJobFlowsInput = struct + type t = + { created_after : DateTime.t option + ; created_before : DateTime.t option + ; job_flow_ids : XmlStringList.t + ; job_flow_states : JobFlowExecutionStateList.t + } + + let make ?created_after ?created_before ?(job_flow_ids = []) ?(job_flow_states = []) () + = + { created_after; created_before; job_flow_ids; job_flow_states } + + let parse xml = + Some + { created_after = Util.option_bind (Xml.member "CreatedAfter" xml) DateTime.parse + ; created_before = Util.option_bind (Xml.member "CreatedBefore" xml) DateTime.parse + ; job_flow_ids = + Util.of_option + [] + (Util.option_bind (Xml.member "JobFlowIds" xml) XmlStringList.parse) + ; job_flow_states = + Util.of_option + [] + (Util.option_bind + (Xml.member "JobFlowStates" xml) + JobFlowExecutionStateList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "JobFlowStates.member" + , JobFlowExecutionStateList.to_query v.job_flow_states )) + ; Some (Query.Pair ("JobFlowIds.member", XmlStringList.to_query v.job_flow_ids)) + ; Util.option_map v.created_before (fun f -> + Query.Pair ("CreatedBefore", DateTime.to_query f)) + ; Util.option_map v.created_after (fun f -> + Query.Pair ("CreatedAfter", DateTime.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("job_flow_states", JobFlowExecutionStateList.to_json v.job_flow_states) + ; Some ("job_flow_ids", XmlStringList.to_json v.job_flow_ids) + ; Util.option_map v.created_before (fun f -> + "created_before", DateTime.to_json f) + ; Util.option_map v.created_after (fun f -> "created_after", DateTime.to_json f) + ]) + + let of_json j = + { created_after = Util.option_map (Json.lookup j "created_after") DateTime.of_json + ; created_before = Util.option_map (Json.lookup j "created_before") DateTime.of_json + ; job_flow_ids = + XmlStringList.of_json (Util.of_option_exn (Json.lookup j "job_flow_ids")) + ; job_flow_states = + JobFlowExecutionStateList.of_json + (Util.of_option_exn (Json.lookup j "job_flow_states")) + } +end + +module AddTagsOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module CreateSecurityConfigurationOutput = struct + type t = + { name : String.t + ; creation_date_time : DateTime.t + } + + let make ~name ~creation_date_time () = { name; creation_date_time } + + let parse xml = + Some + { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + ; creation_date_time = + Xml.required + "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("CreationDateTime", DateTime.to_query v.creation_date_time)) + ; Some (Query.Pair ("Name", String.to_query v.name)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("creation_date_time", DateTime.to_json v.creation_date_time) + ; Some ("name", String.to_json v.name) + ]) + + let of_json j = + { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) + ; creation_date_time = + DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date_time")) + } +end + +module ListSecurityConfigurationsInput = struct + type t = { marker : String.t option } + + let make ?marker () = { marker } + + let parse xml = + Some { marker = Util.option_bind (Xml.member "Marker" xml) String.parse } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) ]) + + let of_json j = { marker = Util.option_map (Json.lookup j "marker") String.of_json } +end + +module RemoveTagsOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module DescribeJobFlowsOutput = struct + type t = { job_flows : JobFlowDetailList.t } + + let make ?(job_flows = []) () = { job_flows } + + let parse xml = + Some + { job_flows = + Util.of_option + [] + (Util.option_bind (Xml.member "JobFlows" xml) JobFlowDetailList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("JobFlows.member", JobFlowDetailList.to_query v.job_flows)) ]) + + let to_json v = + `Assoc + (Util.list_filter_opt [ Some ("job_flows", JobFlowDetailList.to_json v.job_flows) ]) + + let of_json j = + { job_flows = + JobFlowDetailList.of_json (Util.of_option_exn (Json.lookup j "job_flows")) + } +end + +module ListBootstrapActionsOutput = struct + type t = + { bootstrap_actions : CommandList.t + ; marker : String.t option + } + + let make ?(bootstrap_actions = []) ?marker () = { bootstrap_actions; marker } + + let parse xml = + Some + { bootstrap_actions = + Util.of_option + [] + (Util.option_bind (Xml.member "BootstrapActions" xml) CommandList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some + (Query.Pair + ("BootstrapActions.member", CommandList.to_query v.bootstrap_actions)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("bootstrap_actions", CommandList.to_json v.bootstrap_actions) + ]) + + let of_json j = + { bootstrap_actions = + CommandList.of_json (Util.of_option_exn (Json.lookup j "bootstrap_actions")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module RunJobFlowOutput = struct + type t = { job_flow_id : String.t option } + + let make ?job_flow_id () = { job_flow_id } + + let parse xml = + Some { job_flow_id = Util.option_bind (Xml.member "JobFlowId" xml) String.parse } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.job_flow_id (fun f -> + Query.Pair ("JobFlowId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.job_flow_id (fun f -> "job_flow_id", String.to_json f) ]) + + let of_json j = + { job_flow_id = Util.option_map (Json.lookup j "job_flow_id") String.of_json } +end + +module AddInstanceGroupsOutput = struct + type t = + { job_flow_id : String.t option + ; instance_group_ids : InstanceGroupIdsList.t + } + + let make ?job_flow_id ?(instance_group_ids = []) () = + { job_flow_id; instance_group_ids } + + let parse xml = + Some + { job_flow_id = Util.option_bind (Xml.member "JobFlowId" xml) String.parse + ; instance_group_ids = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceGroupIds" xml) + InstanceGroupIdsList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "InstanceGroupIds.member" + , InstanceGroupIdsList.to_query v.instance_group_ids )) + ; Util.option_map v.job_flow_id (fun f -> + Query.Pair ("JobFlowId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("instance_group_ids", InstanceGroupIdsList.to_json v.instance_group_ids) + ; Util.option_map v.job_flow_id (fun f -> "job_flow_id", String.to_json f) + ]) + + let of_json j = + { job_flow_id = Util.option_map (Json.lookup j "job_flow_id") String.of_json + ; instance_group_ids = + InstanceGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "instance_group_ids")) + } +end + +module RemoveAutoScalingPolicyInput = struct + type t = + { cluster_id : String.t + ; instance_group_id : String.t + } + + let make ~cluster_id ~instance_group_id () = { cluster_id; instance_group_id } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; instance_group_id = + Xml.required + "InstanceGroupId" + (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("InstanceGroupId", String.to_query v.instance_group_id)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("instance_group_id", String.to_json v.instance_group_id) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; instance_group_id = + String.of_json (Util.of_option_exn (Json.lookup j "instance_group_id")) + } +end + +module DescribeSecurityConfigurationOutput = struct + type t = + { name : String.t option + ; security_configuration : String.t option + ; creation_date_time : DateTime.t option + } + + let make ?name ?security_configuration ?creation_date_time () = + { name; security_configuration; creation_date_time } + + let parse xml = + Some + { name = Util.option_bind (Xml.member "Name" xml) String.parse + ; security_configuration = + Util.option_bind (Xml.member "SecurityConfiguration" xml) String.parse + ; creation_date_time = + Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.creation_date_time (fun f -> + Query.Pair ("CreationDateTime", DateTime.to_query f)) + ; Util.option_map v.security_configuration (fun f -> + Query.Pair ("SecurityConfiguration", String.to_query f)) + ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.creation_date_time (fun f -> + "creation_date_time", DateTime.to_json f) + ; Util.option_map v.security_configuration (fun f -> + "security_configuration", String.to_json f) + ; Util.option_map v.name (fun f -> "name", String.to_json f) + ]) + + let of_json j = + { name = Util.option_map (Json.lookup j "name") String.of_json + ; security_configuration = + Util.option_map (Json.lookup j "security_configuration") String.of_json + ; creation_date_time = + Util.option_map (Json.lookup j "creation_date_time") DateTime.of_json + } +end + +module TerminateJobFlowsInput = struct + type t = { job_flow_ids : XmlStringList.t } + + let make ~job_flow_ids () = { job_flow_ids } + + let parse xml = + Some + { job_flow_ids = + Xml.required + "JobFlowIds" + (Util.option_bind (Xml.member "JobFlowIds" xml) XmlStringList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("JobFlowIds.member", XmlStringList.to_query v.job_flow_ids)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("job_flow_ids", XmlStringList.to_json v.job_flow_ids) ]) + + let of_json j = + { job_flow_ids = + XmlStringList.of_json (Util.of_option_exn (Json.lookup j "job_flow_ids")) + } +end + +module CancelStepsOutput = struct + type t = { cancel_steps_info_list : CancelStepsInfoList.t } + + let make ?(cancel_steps_info_list = []) () = { cancel_steps_info_list } + + let parse xml = + Some + { cancel_steps_info_list = + Util.of_option + [] + (Util.option_bind + (Xml.member "CancelStepsInfoList" xml) + CancelStepsInfoList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "CancelStepsInfoList.member" + , CancelStepsInfoList.to_query v.cancel_steps_info_list )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "cancel_steps_info_list" + , CancelStepsInfoList.to_json v.cancel_steps_info_list ) + ]) + + let of_json j = + { cancel_steps_info_list = + CancelStepsInfoList.of_json + (Util.of_option_exn (Json.lookup j "cancel_steps_info_list")) + } +end + +module DescribeClusterInput = struct + type t = { cluster_id : String.t } + + let make ~cluster_id () = { cluster_id } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) ]) + + let to_json v = + `Assoc (Util.list_filter_opt [ Some ("cluster_id", String.to_json v.cluster_id) ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) } +end + +module PutAutoScalingPolicyInput = struct + type t = + { cluster_id : String.t + ; instance_group_id : String.t + ; auto_scaling_policy : AutoScalingPolicy.t + } + + let make ~cluster_id ~instance_group_id ~auto_scaling_policy () = + { cluster_id; instance_group_id; auto_scaling_policy } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; instance_group_id = + Xml.required + "InstanceGroupId" + (Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse) + ; auto_scaling_policy = + Xml.required + "AutoScalingPolicy" + (Util.option_bind + (Xml.member "AutoScalingPolicy" xml) + AutoScalingPolicy.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ("AutoScalingPolicy", AutoScalingPolicy.to_query v.auto_scaling_policy)) + ; Some (Query.Pair ("InstanceGroupId", String.to_query v.instance_group_id)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("auto_scaling_policy", AutoScalingPolicy.to_json v.auto_scaling_policy) + ; Some ("instance_group_id", String.to_json v.instance_group_id) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; instance_group_id = + String.of_json (Util.of_option_exn (Json.lookup j "instance_group_id")) + ; auto_scaling_policy = + AutoScalingPolicy.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_policy")) + } +end + +module ListInstancesInput = struct + type t = + { cluster_id : String.t + ; instance_group_id : String.t option + ; instance_group_types : InstanceGroupTypeList.t + ; instance_fleet_id : String.t option + ; instance_fleet_type : InstanceFleetType.t option + ; instance_states : InstanceStateList.t + ; marker : String.t option + } + + let make + ~cluster_id + ?instance_group_id + ?(instance_group_types = []) + ?instance_fleet_id + ?instance_fleet_type + ?(instance_states = []) + ?marker + () = + { cluster_id + ; instance_group_id + ; instance_group_types + ; instance_fleet_id + ; instance_fleet_type + ; instance_states + ; marker + } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; instance_group_id = + Util.option_bind (Xml.member "InstanceGroupId" xml) String.parse + ; instance_group_types = + Util.of_option + [] + (Util.option_bind + (Xml.member "InstanceGroupTypes" xml) + InstanceGroupTypeList.parse) + ; instance_fleet_id = + Util.option_bind (Xml.member "InstanceFleetId" xml) String.parse + ; instance_fleet_type = + Util.option_bind (Xml.member "InstanceFleetType" xml) InstanceFleetType.parse + ; instance_states = + Util.of_option + [] + (Util.option_bind (Xml.member "InstanceStates" xml) InstanceStateList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some + (Query.Pair + ("InstanceStates.member", InstanceStateList.to_query v.instance_states)) + ; Util.option_map v.instance_fleet_type (fun f -> + Query.Pair ("InstanceFleetType", InstanceFleetType.to_query f)) + ; Util.option_map v.instance_fleet_id (fun f -> + Query.Pair ("InstanceFleetId", String.to_query f)) + ; Some (Query.Pair - ("InstanceGroupTypes.member", - (InstanceGroupTypeList.to_query v.instance_group_types))); - Util.option_map v.instance_group_id - (fun f -> Query.Pair ("InstanceGroupId", (String.to_query f))); - Some (Query.Pair ("ClusterId", (String.to_query v.cluster_id)))]) - let to_json v = - `Assoc - (Util.list_filter_opt - [Util.option_map v.marker - (fun f -> ("marker", (String.to_json f))); - Some - ("instance_group_types", - (InstanceGroupTypeList.to_json v.instance_group_types)); - Util.option_map v.instance_group_id - (fun f -> ("instance_group_id", (String.to_json f))); - Some ("cluster_id", (String.to_json v.cluster_id))]) - let of_json j = - { - cluster_id = - (String.of_json (Util.of_option_exn (Json.lookup j "cluster_id"))); - instance_group_id = - (Util.option_map (Json.lookup j "instance_group_id") String.of_json); - instance_group_types = - (InstanceGroupTypeList.of_json - (Util.of_option_exn (Json.lookup j "instance_group_types"))); - marker = (Util.option_map (Json.lookup j "marker") String.of_json) + ( "InstanceGroupTypes.member" + , InstanceGroupTypeList.to_query v.instance_group_types )) + ; Util.option_map v.instance_group_id (fun f -> + Query.Pair ("InstanceGroupId", String.to_query f)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some ("instance_states", InstanceStateList.to_json v.instance_states) + ; Util.option_map v.instance_fleet_type (fun f -> + "instance_fleet_type", InstanceFleetType.to_json f) + ; Util.option_map v.instance_fleet_id (fun f -> + "instance_fleet_id", String.to_json f) + ; Some + ("instance_group_types", InstanceGroupTypeList.to_json v.instance_group_types) + ; Util.option_map v.instance_group_id (fun f -> + "instance_group_id", String.to_json f) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; instance_group_id = + Util.option_map (Json.lookup j "instance_group_id") String.of_json + ; instance_group_types = + InstanceGroupTypeList.of_json + (Util.of_option_exn (Json.lookup j "instance_group_types")) + ; instance_fleet_id = + Util.option_map (Json.lookup j "instance_fleet_id") String.of_json + ; instance_fleet_type = + Util.option_map (Json.lookup j "instance_fleet_type") InstanceFleetType.of_json + ; instance_states = + InstanceStateList.of_json (Util.of_option_exn (Json.lookup j "instance_states")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module AddInstanceFleetInput = struct + type t = + { cluster_id : String.t + ; instance_fleet : InstanceFleetConfig.t + } + + let make ~cluster_id ~instance_fleet () = { cluster_id; instance_fleet } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; instance_fleet = + Xml.required + "InstanceFleet" + (Util.option_bind (Xml.member "InstanceFleet" xml) InstanceFleetConfig.parse) } - end + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("InstanceFleet", InstanceFleetConfig.to_query v.instance_fleet)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("instance_fleet", InstanceFleetConfig.to_json v.instance_fleet) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; instance_fleet = + InstanceFleetConfig.of_json (Util.of_option_exn (Json.lookup j "instance_fleet")) + } +end diff --git a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml index 61aa1aae3..555c2638b 100644 --- a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml +++ b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml @@ -1,89 +1,103 @@ open OUnit open Aws_elasticmapreduce -module TestSuite(Runtime : sig - type 'a m - val run_request : - region:string - -> (module Aws.Call with type input = 'input - and type output = 'output - and type error = 'error) - -> 'input - -> [`Ok of 'output | `Error of 'error Aws.Error.t] m - val un_m : 'a m -> 'a - end) = struct +module TestSuite (Runtime : sig + type 'a m + val run_request : + region:string + -> (module Aws.Call + with type input = 'input + and type output = 'output + and type error = 'error) + -> 'input + -> [ `Ok of 'output | `Error of 'error Aws.Error.t ] m + + val un_m : 'a m -> 'a +end) = +struct (* Tag for test EMR instances *) let test_tag = Types.Tag.make ~key:"client" ~value:"ocaml-aws" () let create_describe_shutdown_test () = - let res = Runtime.(un_m (run_request - ~region:"us-east-1" - (module RunJobFlow) - (Types.RunJobFlowInput.make - ~name:"ocaml-aws test EMR" - ~release_label:"emr-5.20.0" - ~applications:([Types.Application.make ()]) - ~tags:(Types.TagList.make [test_tag] ()) - ~service_role:"EMR_DefaultRole" - ~job_flow_role:"EMR_EC2_DefaultRole" - (* TODO Invalid instance profile? What should this be? *) - ~instances:(Types.JobFlowInstancesConfig.make - ~instance_count:1 - ~master_instance_type:"t1.micro" - ~slave_instance_type:"t1.micro" - ()) - ()) - )) in - "Create EMR" - @? begin match res with - | `Ok resp -> - Printf.printf "%s\n" (Yojson.Basic.to_string (Types.RunJobFlowOutput.(to_json (of_json (to_json resp))))); - true - | `Error err -> begin Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false end - end; + let res = + Runtime.( + un_m + (run_request + ~region:"us-east-1" + (module RunJobFlow) + (Types.RunJobFlowInput.make + ~name:"ocaml-aws test EMR" + ~release_label:"emr-5.20.0" + ~applications:[ Types.Application.make () ] + ~tags:(Types.TagList.make [ test_tag ] ()) + ~service_role:"EMR_DefaultRole" + ~job_flow_role: + "EMR_EC2_DefaultRole" + (* TODO Invalid instance profile? What should this be? *) + ~instances: + (Types.JobFlowInstancesConfig.make + ~instance_count:1 + ~master_instance_type:"t1.micro" + ~slave_instance_type:"t1.micro" + ()) + ()))) + in + ("Create EMR" + @? + match res with + | `Ok resp -> + Printf.printf + "%s\n" + (Yojson.Basic.to_string + Types.RunJobFlowOutput.(to_json (of_json (to_json resp)))); + true + | `Error err -> + Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); + false); - let instance_id = match res with - | `Ok instance -> (match instance.job_flow_id with - | Some job_id -> job_id - | None -> assert false) - | `Error err -> assert false in + let instance_id = + match res with + | `Ok instance -> ( + match instance.job_flow_id with + | Some job_id -> job_id + | None -> assert false) + | `Error err -> assert false + in - let terminate = Runtime.(un_m (run_request - ~region:"us-east-1" - (module TerminateJobFlows) - (Types.TerminateJobFlowsInput.make ~job_flow_ids:[instance_id] ())) - ) in + let terminate = + Runtime.( + un_m + (run_request + ~region:"us-east-1" + (module TerminateJobFlows) + (Types.TerminateJobFlowsInput.make ~job_flow_ids:[ instance_id ] ()))) + in "Shutdown EMR" - @? begin match terminate with - | `Ok resp -> - Printf.printf "Terminating EMR instance %s \n" instance_id; - true - | `Error err -> begin Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false end - end + @? + match terminate with + | `Ok resp -> + Printf.printf "Terminating EMR instance %s \n" instance_id; + true + | `Error err -> + Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); + false - let test_cases = - [ "Create EMR" >:: create_describe_shutdown_test ] + let test_cases = [ "Create EMR" >:: create_describe_shutdown_test ] - let rec was_successful = - function + let rec was_successful = function | [] -> true - | RSuccess _::t - | RSkip _::t -> - was_successful t - | RFailure _::_ - | RError _::_ - | RTodo _::_ -> - false + | RSuccess _ :: t | RSkip _ :: t -> was_successful t + | RFailure _ :: _ | RError _ :: _ | RTodo _ :: _ -> false + let _ = let suite = "Tests" >::: test_cases in let verbose = ref false in let set_verbose _ = verbose := true in Arg.parse - [("-verbose", Arg.Unit set_verbose, "Run the test in verbose mode.");] + [ "-verbose", Arg.Unit set_verbose, "Run the test in verbose mode." ] (fun x -> raise (Arg.Bad ("Bad argument : " ^ x))) ("Usage: " ^ Sys.argv.(0) ^ " [-verbose]"); - if not (was_successful (run_test_tt ~verbose:!verbose suite)) then - exit 1 + if not (was_successful (run_test_tt ~verbose:!verbose suite)) then exit 1 end diff --git a/libraries/elasticmapreduce/lib_test/dune b/libraries/elasticmapreduce/lib_test/dune index 98a5b900b..4d3f2c822 100644 --- a/libraries/elasticmapreduce/lib_test/dune +++ b/libraries/elasticmapreduce/lib_test/dune @@ -1,20 +1,19 @@ (executables (names test_async test_lwt) - (flags (:standard -w -27 -w -33)) + (flags + (:standard -w -27 -w -33)) (modules test_async test_lwt aws_elasticmapreduce_test) - (libraries aws aws_elasticmapreduce aws-async aws-lwt - oUnit yojson - async cohttp-async - lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_elasticmapreduce aws-async aws-lwt oUnit yojson async + cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) -(alias - (name runtest) +(rule + (alias runtest) (deps test_async.exe) - (locks m) - (action (run %{deps}))) + (action + (run %{deps}))) -(alias - (name runtest) +(rule + (alias runtest) (deps test_lwt.exe) - (locks m) - (action (run %{deps}))) + (action + (run %{deps}))) diff --git a/libraries/elasticmapreduce/lib_test/test_async.ml b/libraries/elasticmapreduce/lib_test/test_async.ml index 6ddda6cd5..6bd4e6ad0 100644 --- a/libraries/elasticmapreduce/lib_test/test_async.ml +++ b/libraries/elasticmapreduce/lib_test/test_async.ml @@ -1,11 +1,13 @@ open Aws_elasticmapreduce_test -module T = TestSuite(struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite (struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) - end) + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) +end) diff --git a/libraries/elasticmapreduce/lib_test/test_lwt.ml b/libraries/elasticmapreduce/lib_test/test_lwt.ml index 5364d5f98..685831779 100644 --- a/libraries/elasticmapreduce/lib_test/test_lwt.ml +++ b/libraries/elasticmapreduce/lib_test/test_lwt.ml @@ -1,11 +1,13 @@ open Aws_elasticmapreduce_test -module T = TestSuite(struct - type 'a m = 'a Lwt.t +module T = TestSuite (struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - let un_m = Lwt_main.run - end) + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + + let un_m = Lwt_main.run +end) diff --git a/libraries/sts/lib_test/test_async.ml b/libraries/sts/lib_test/test_async.ml index 1f499d9f0..a9d3c38ea 100644 --- a/libraries/sts/lib_test/test_async.ml +++ b/libraries/sts/lib_test/test_async.ml @@ -1,6 +1,6 @@ open Aws_sts_test -module T = struct +module T = TestSuite (struct type 'a m = 'a Async.Deferred.t let access_key = Unix.getenv "AWS_ACCESS_KEY" @@ -10,4 +10,4 @@ module T = struct let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end +end) From 18f66109b6e802c27625dba95ce3dd8ce39a400c Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Wed, 18 Nov 2020 21:11:29 +1100 Subject: [PATCH 7/8] fixup! Run EMR code gen. --- input/emr/2009-03-31/paginators-1.json | 10 + input/emr/2009-03-31/service-2.json | 871 +- libraries/autoscaling/lib/attachInstances.ml | 32 +- libraries/autoscaling/lib/attachInstances.mli | 7 +- .../autoscaling/lib/attachLoadBalancers.ml | 32 +- .../autoscaling/lib/attachLoadBalancers.mli | 7 +- .../lib/completeLifecycleAction.ml | 32 +- .../lib/completeLifecycleAction.mli | 7 +- .../autoscaling/lib/createAutoScalingGroup.ml | 39 +- .../lib/createAutoScalingGroup.mli | 7 +- .../lib/createLaunchConfiguration.ml | 39 +- .../lib/createLaunchConfiguration.mli | 7 +- .../autoscaling/lib/createOrUpdateTags.ml | 39 +- .../autoscaling/lib/createOrUpdateTags.mli | 7 +- .../autoscaling/lib/deleteAutoScalingGroup.ml | 39 +- .../lib/deleteAutoScalingGroup.mli | 7 +- .../lib/deleteLaunchConfiguration.ml | 35 +- .../lib/deleteLaunchConfiguration.mli | 7 +- .../autoscaling/lib/deleteLifecycleHook.ml | 32 +- .../autoscaling/lib/deleteLifecycleHook.mli | 7 +- .../lib/deleteNotificationConfiguration.ml | 33 +- .../lib/deleteNotificationConfiguration.mli | 7 +- libraries/autoscaling/lib/deletePolicy.ml | 32 +- libraries/autoscaling/lib/deletePolicy.mli | 7 +- .../autoscaling/lib/deleteScheduledAction.ml | 32 +- .../autoscaling/lib/deleteScheduledAction.mli | 7 +- libraries/autoscaling/lib/deleteTags.ml | 33 +- libraries/autoscaling/lib/deleteTags.mli | 7 +- .../autoscaling/lib/describeAccountLimits.ml | 77 +- .../autoscaling/lib/describeAccountLimits.mli | 7 +- .../lib/describeAdjustmentTypes.ml | 72 +- .../lib/describeAdjustmentTypes.mli | 7 +- .../lib/describeAutoScalingGroups.ml | 76 +- .../lib/describeAutoScalingGroups.mli | 7 +- .../lib/describeAutoScalingInstances.ml | 77 +- .../lib/describeAutoScalingInstances.mli | 7 +- .../describeAutoScalingNotificationTypes.ml | 80 +- .../describeAutoScalingNotificationTypes.mli | 7 +- .../lib/describeLaunchConfigurations.ml | 77 +- .../lib/describeLaunchConfigurations.mli | 7 +- .../lib/describeLifecycleHookTypes.ml | 74 +- .../lib/describeLifecycleHookTypes.mli | 7 +- .../autoscaling/lib/describeLifecycleHooks.ml | 71 +- .../lib/describeLifecycleHooks.mli | 7 +- .../autoscaling/lib/describeLoadBalancers.ml | 73 +- .../autoscaling/lib/describeLoadBalancers.mli | 7 +- .../lib/describeMetricCollectionTypes.ml | 74 +- .../lib/describeMetricCollectionTypes.mli | 7 +- .../lib/describeNotificationConfigurations.ml | 80 +- .../describeNotificationConfigurations.mli | 7 +- libraries/autoscaling/lib/describePolicies.ml | 73 +- .../autoscaling/lib/describePolicies.mli | 7 +- .../lib/describeScalingActivities.ml | 70 +- .../lib/describeScalingActivities.mli | 7 +- .../lib/describeScalingProcessTypes.ml | 68 +- .../lib/describeScalingProcessTypes.mli | 7 +- .../lib/describeScheduledActions.ml | 74 +- .../lib/describeScheduledActions.mli | 7 +- libraries/autoscaling/lib/describeTags.ml | 73 +- libraries/autoscaling/lib/describeTags.mli | 7 +- .../lib/describeTerminationPolicyTypes.ml | 74 +- .../lib/describeTerminationPolicyTypes.mli | 7 +- libraries/autoscaling/lib/detachInstances.ml | 75 +- libraries/autoscaling/lib/detachInstances.mli | 7 +- .../autoscaling/lib/detachLoadBalancers.ml | 32 +- .../autoscaling/lib/detachLoadBalancers.mli | 7 +- .../lib/disableMetricsCollection.ml | 32 +- .../lib/disableMetricsCollection.mli | 7 +- libraries/autoscaling/lib/dune | 5 +- .../lib/enableMetricsCollection.ml | 32 +- .../lib/enableMetricsCollection.mli | 7 +- libraries/autoscaling/lib/enterStandby.ml | 74 +- libraries/autoscaling/lib/enterStandby.mli | 7 +- libraries/autoscaling/lib/errors_internal.ml | 125 +- libraries/autoscaling/lib/executePolicy.ml | 35 +- libraries/autoscaling/lib/executePolicy.mli | 7 +- libraries/autoscaling/lib/exitStandby.ml | 75 +- libraries/autoscaling/lib/exitStandby.mli | 7 +- libraries/autoscaling/lib/putLifecycleHook.ml | 35 +- .../autoscaling/lib/putLifecycleHook.mli | 7 +- .../lib/putNotificationConfiguration.ml | 35 +- .../lib/putNotificationConfiguration.mli | 7 +- libraries/autoscaling/lib/putScalingPolicy.ml | 73 +- .../autoscaling/lib/putScalingPolicy.mli | 7 +- .../lib/putScheduledUpdateGroupAction.ml | 39 +- .../lib/putScheduledUpdateGroupAction.mli | 7 +- .../lib/recordLifecycleActionHeartbeat.ml | 33 +- .../lib/recordLifecycleActionHeartbeat.mli | 7 +- libraries/autoscaling/lib/resumeProcesses.ml | 35 +- libraries/autoscaling/lib/resumeProcesses.mli | 7 +- .../autoscaling/lib/setDesiredCapacity.ml | 35 +- .../autoscaling/lib/setDesiredCapacity.mli | 7 +- .../autoscaling/lib/setInstanceHealth.ml | 32 +- .../autoscaling/lib/setInstanceHealth.mli | 7 +- libraries/autoscaling/lib/suspendProcesses.ml | 35 +- .../autoscaling/lib/suspendProcesses.mli | 7 +- .../terminateInstanceInAutoScalingGroup.ml | 73 +- .../terminateInstanceInAutoScalingGroup.mli | 7 +- libraries/autoscaling/lib/types.ml | 12273 ++-- .../autoscaling/lib/updateAutoScalingGroup.ml | 35 +- .../lib/updateAutoScalingGroup.mli | 7 +- libraries/autoscaling/lib_test/dune | 15 +- libraries/autoscaling/lib_test/test_async.ml | 16 +- libraries/autoscaling/lib_test/test_lwt.ml | 16 +- .../cloudformation/lib/cancelUpdateStack.ml | 30 +- .../cloudformation/lib/cancelUpdateStack.mli | 7 +- libraries/cloudformation/lib/createStack.ml | 82 +- libraries/cloudformation/lib/createStack.mli | 7 +- libraries/cloudformation/lib/deleteStack.ml | 31 +- libraries/cloudformation/lib/deleteStack.mli | 7 +- .../cloudformation/lib/describeStackEvents.ml | 75 +- .../lib/describeStackEvents.mli | 7 +- .../lib/describeStackResource.ml | 74 +- .../lib/describeStackResource.mli | 7 +- .../lib/describeStackResources.ml | 69 +- .../lib/describeStackResources.mli | 7 +- .../cloudformation/lib/describeStacks.ml | 72 +- .../cloudformation/lib/describeStacks.mli | 7 +- libraries/cloudformation/lib/dune | 5 +- .../cloudformation/lib/errors_internal.ml | 122 +- .../lib/estimateTemplateCost.ml | 75 +- .../lib/estimateTemplateCost.mli | 7 +- .../cloudformation/lib/getStackPolicy.ml | 72 +- .../cloudformation/lib/getStackPolicy.mli | 7 +- libraries/cloudformation/lib/getTemplate.ml | 73 +- libraries/cloudformation/lib/getTemplate.mli | 7 +- .../cloudformation/lib/getTemplateSummary.ml | 75 +- .../cloudformation/lib/getTemplateSummary.mli | 7 +- .../cloudformation/lib/listStackResources.ml | 75 +- .../cloudformation/lib/listStackResources.mli | 7 +- libraries/cloudformation/lib/listStacks.ml | 71 +- libraries/cloudformation/lib/listStacks.mli | 7 +- .../cloudformation/lib/setStackPolicy.ml | 30 +- .../cloudformation/lib/setStackPolicy.mli | 7 +- .../cloudformation/lib/signalResource.ml | 30 +- .../cloudformation/lib/signalResource.mli | 7 +- libraries/cloudformation/lib/types.ml | 5610 +- libraries/cloudformation/lib/updateStack.ml | 77 +- libraries/cloudformation/lib/updateStack.mli | 7 +- .../cloudformation/lib/validateTemplate.ml | 74 +- .../cloudformation/lib/validateTemplate.mli | 7 +- libraries/cloudformation/lib_test/dune | 15 +- .../cloudformation/lib_test/test_async.ml | 16 +- libraries/cloudformation/lib_test/test_lwt.ml | 16 +- libraries/cloudtrail/lib/createTrail.ml | 94 +- libraries/cloudtrail/lib/createTrail.mli | 7 +- libraries/cloudtrail/lib/deleteTrail.ml | 36 +- libraries/cloudtrail/lib/deleteTrail.mli | 7 +- libraries/cloudtrail/lib/describeTrails.ml | 68 +- libraries/cloudtrail/lib/describeTrails.mli | 7 +- libraries/cloudtrail/lib/dune | 5 +- libraries/cloudtrail/lib/errors_internal.ml | 153 +- libraries/cloudtrail/lib/getTrailStatus.ml | 73 +- libraries/cloudtrail/lib/getTrailStatus.mli | 7 +- libraries/cloudtrail/lib/lookupEvents.ml | 77 +- libraries/cloudtrail/lib/lookupEvents.mli | 7 +- libraries/cloudtrail/lib/startLogging.ml | 35 +- libraries/cloudtrail/lib/startLogging.mli | 7 +- libraries/cloudtrail/lib/stopLogging.ml | 36 +- libraries/cloudtrail/lib/stopLogging.mli | 7 +- libraries/cloudtrail/lib/types.ml | 2656 +- libraries/cloudtrail/lib/updateTrail.ml | 92 +- libraries/cloudtrail/lib/updateTrail.mli | 7 +- libraries/cloudtrail/lib_test/dune | 15 +- libraries/cloudtrail/lib_test/test_async.ml | 16 +- libraries/cloudtrail/lib_test/test_lwt.ml | 16 +- libraries/cloudwatch/lib/deleteAlarms.ml | 32 +- libraries/cloudwatch/lib/deleteAlarms.mli | 7 +- .../cloudwatch/lib/describeAlarmHistory.ml | 77 +- .../cloudwatch/lib/describeAlarmHistory.mli | 7 +- libraries/cloudwatch/lib/describeAlarms.ml | 74 +- libraries/cloudwatch/lib/describeAlarms.mli | 7 +- .../cloudwatch/lib/describeAlarmsForMetric.ml | 69 +- .../lib/describeAlarmsForMetric.mli | 7 +- .../cloudwatch/lib/disableAlarmActions.ml | 30 +- .../cloudwatch/lib/disableAlarmActions.mli | 7 +- libraries/cloudwatch/lib/dune | 5 +- .../cloudwatch/lib/enableAlarmActions.ml | 30 +- .../cloudwatch/lib/enableAlarmActions.mli | 7 +- libraries/cloudwatch/lib/errors_internal.ml | 123 +- .../cloudwatch/lib/getMetricStatistics.ml | 86 +- .../cloudwatch/lib/getMetricStatistics.mli | 7 +- libraries/cloudwatch/lib/listMetrics.ml | 78 +- libraries/cloudwatch/lib/listMetrics.mli | 7 +- libraries/cloudwatch/lib/putMetricAlarm.ml | 32 +- libraries/cloudwatch/lib/putMetricAlarm.mli | 7 +- libraries/cloudwatch/lib/putMetricData.ml | 41 +- libraries/cloudwatch/lib/putMetricData.mli | 7 +- libraries/cloudwatch/lib/setAlarmState.ml | 35 +- libraries/cloudwatch/lib/setAlarmState.mli | 7 +- libraries/cloudwatch/lib/types.ml | 4159 +- libraries/cloudwatch/lib_test/dune | 15 +- libraries/cloudwatch/lib_test/test_async.ml | 16 +- libraries/cloudwatch/lib_test/test_lwt.ml | 16 +- .../ec2/lib/acceptVpcPeeringConnection.ml | 68 +- .../ec2/lib/acceptVpcPeeringConnection.mli | 7 +- libraries/ec2/lib/allocateAddress.ml | 67 +- libraries/ec2/lib/allocateAddress.mli | 7 +- libraries/ec2/lib/assignPrivateIpAddresses.ml | 30 +- .../ec2/lib/assignPrivateIpAddresses.mli | 7 +- libraries/ec2/lib/associateAddress.ml | 68 +- libraries/ec2/lib/associateAddress.mli | 7 +- libraries/ec2/lib/associateDhcpOptions.ml | 29 +- libraries/ec2/lib/associateDhcpOptions.mli | 7 +- libraries/ec2/lib/associateRouteTable.ml | 68 +- libraries/ec2/lib/associateRouteTable.mli | 7 +- libraries/ec2/lib/attachClassicLinkVpc.ml | 68 +- libraries/ec2/lib/attachClassicLinkVpc.mli | 7 +- libraries/ec2/lib/attachInternetGateway.ml | 29 +- libraries/ec2/lib/attachInternetGateway.mli | 7 +- libraries/ec2/lib/attachNetworkInterface.ml | 66 +- libraries/ec2/lib/attachNetworkInterface.mli | 7 +- libraries/ec2/lib/attachVolume.ml | 64 +- libraries/ec2/lib/attachVolume.mli | 7 +- libraries/ec2/lib/attachVpnGateway.ml | 68 +- libraries/ec2/lib/attachVpnGateway.mli | 7 +- .../ec2/lib/authorizeSecurityGroupEgress.ml | 31 +- .../ec2/lib/authorizeSecurityGroupEgress.mli | 7 +- .../ec2/lib/authorizeSecurityGroupIngress.ml | 31 +- .../ec2/lib/authorizeSecurityGroupIngress.mli | 7 +- libraries/ec2/lib/bundleInstance.ml | 66 +- libraries/ec2/lib/bundleInstance.mli | 7 +- libraries/ec2/lib/cancelBundleTask.ml | 68 +- libraries/ec2/lib/cancelBundleTask.mli | 7 +- libraries/ec2/lib/cancelConversionTask.ml | 30 +- libraries/ec2/lib/cancelConversionTask.mli | 7 +- libraries/ec2/lib/cancelExportTask.ml | 30 +- libraries/ec2/lib/cancelExportTask.mli | 7 +- libraries/ec2/lib/cancelImportTask.ml | 68 +- libraries/ec2/lib/cancelImportTask.mli | 7 +- .../ec2/lib/cancelReservedInstancesListing.ml | 69 +- .../lib/cancelReservedInstancesListing.mli | 7 +- libraries/ec2/lib/cancelSpotFleetRequests.ml | 68 +- libraries/ec2/lib/cancelSpotFleetRequests.mli | 7 +- .../ec2/lib/cancelSpotInstanceRequests.ml | 68 +- .../ec2/lib/cancelSpotInstanceRequests.mli | 7 +- libraries/ec2/lib/confirmProductInstance.ml | 66 +- libraries/ec2/lib/confirmProductInstance.mli | 7 +- libraries/ec2/lib/copyImage.ml | 64 +- libraries/ec2/lib/copyImage.mli | 7 +- libraries/ec2/lib/copySnapshot.ml | 66 +- libraries/ec2/lib/copySnapshot.mli | 7 +- libraries/ec2/lib/createCustomerGateway.ml | 68 +- libraries/ec2/lib/createCustomerGateway.mli | 7 +- libraries/ec2/lib/createDhcpOptions.ml | 69 +- libraries/ec2/lib/createDhcpOptions.mli | 7 +- libraries/ec2/lib/createFlowLogs.ml | 66 +- libraries/ec2/lib/createFlowLogs.mli | 7 +- libraries/ec2/lib/createImage.ml | 67 +- libraries/ec2/lib/createImage.mli | 7 +- libraries/ec2/lib/createInstanceExportTask.ml | 66 +- .../ec2/lib/createInstanceExportTask.mli | 7 +- libraries/ec2/lib/createInternetGateway.ml | 68 +- libraries/ec2/lib/createInternetGateway.mli | 7 +- libraries/ec2/lib/createKeyPair.ml | 61 +- libraries/ec2/lib/createKeyPair.mli | 7 +- libraries/ec2/lib/createNetworkAcl.ml | 68 +- libraries/ec2/lib/createNetworkAcl.mli | 7 +- libraries/ec2/lib/createNetworkAclEntry.ml | 29 +- libraries/ec2/lib/createNetworkAclEntry.mli | 7 +- libraries/ec2/lib/createNetworkInterface.ml | 66 +- libraries/ec2/lib/createNetworkInterface.mli | 7 +- libraries/ec2/lib/createPlacementGroup.ml | 29 +- libraries/ec2/lib/createPlacementGroup.mli | 7 +- .../ec2/lib/createReservedInstancesListing.ml | 69 +- .../lib/createReservedInstancesListing.mli | 7 +- libraries/ec2/lib/createRoute.ml | 67 +- libraries/ec2/lib/createRoute.mli | 7 +- libraries/ec2/lib/createRouteTable.ml | 68 +- libraries/ec2/lib/createRouteTable.mli | 7 +- libraries/ec2/lib/createSecurityGroup.ml | 68 +- libraries/ec2/lib/createSecurityGroup.mli | 7 +- libraries/ec2/lib/createSnapshot.ml | 62 +- libraries/ec2/lib/createSnapshot.mli | 7 +- .../ec2/lib/createSpotDatafeedSubscription.ml | 69 +- .../lib/createSpotDatafeedSubscription.mli | 7 +- libraries/ec2/lib/createSubnet.ml | 66 +- libraries/ec2/lib/createSubnet.mli | 7 +- libraries/ec2/lib/createTags.ml | 31 +- libraries/ec2/lib/createTags.mli | 7 +- libraries/ec2/lib/createVolume.ml | 61 +- libraries/ec2/lib/createVolume.mli | 7 +- libraries/ec2/lib/createVpc.ml | 64 +- libraries/ec2/lib/createVpc.mli | 7 +- libraries/ec2/lib/createVpcEndpoint.ml | 69 +- libraries/ec2/lib/createVpcEndpoint.mli | 7 +- .../ec2/lib/createVpcPeeringConnection.ml | 68 +- .../ec2/lib/createVpcPeeringConnection.mli | 7 +- libraries/ec2/lib/createVpnConnection.ml | 68 +- libraries/ec2/lib/createVpnConnection.mli | 7 +- libraries/ec2/lib/createVpnConnectionRoute.ml | 30 +- .../ec2/lib/createVpnConnectionRoute.mli | 7 +- libraries/ec2/lib/createVpnGateway.ml | 68 +- libraries/ec2/lib/createVpnGateway.mli | 7 +- libraries/ec2/lib/deleteCustomerGateway.ml | 29 +- libraries/ec2/lib/deleteCustomerGateway.mli | 7 +- libraries/ec2/lib/deleteDhcpOptions.ml | 30 +- libraries/ec2/lib/deleteDhcpOptions.mli | 7 +- libraries/ec2/lib/deleteFlowLogs.ml | 66 +- libraries/ec2/lib/deleteFlowLogs.mli | 7 +- libraries/ec2/lib/deleteInternetGateway.ml | 29 +- libraries/ec2/lib/deleteInternetGateway.mli | 7 +- libraries/ec2/lib/deleteKeyPair.ml | 30 +- libraries/ec2/lib/deleteKeyPair.mli | 7 +- libraries/ec2/lib/deleteNetworkAcl.ml | 30 +- libraries/ec2/lib/deleteNetworkAcl.mli | 7 +- libraries/ec2/lib/deleteNetworkAclEntry.ml | 29 +- libraries/ec2/lib/deleteNetworkAclEntry.mli | 7 +- libraries/ec2/lib/deleteNetworkInterface.ml | 30 +- libraries/ec2/lib/deleteNetworkInterface.mli | 7 +- libraries/ec2/lib/deletePlacementGroup.ml | 29 +- libraries/ec2/lib/deletePlacementGroup.mli | 7 +- libraries/ec2/lib/deleteRoute.ml | 31 +- libraries/ec2/lib/deleteRoute.mli | 7 +- libraries/ec2/lib/deleteRouteTable.ml | 30 +- libraries/ec2/lib/deleteRouteTable.mli | 7 +- libraries/ec2/lib/deleteSecurityGroup.ml | 29 +- libraries/ec2/lib/deleteSecurityGroup.mli | 7 +- libraries/ec2/lib/deleteSnapshot.ml | 30 +- libraries/ec2/lib/deleteSnapshot.mli | 7 +- .../ec2/lib/deleteSpotDatafeedSubscription.ml | 31 +- .../lib/deleteSpotDatafeedSubscription.mli | 7 +- libraries/ec2/lib/deleteSubnet.ml | 30 +- libraries/ec2/lib/deleteSubnet.mli | 7 +- libraries/ec2/lib/deleteTags.ml | 31 +- libraries/ec2/lib/deleteTags.mli | 7 +- libraries/ec2/lib/deleteVolume.ml | 30 +- libraries/ec2/lib/deleteVolume.mli | 7 +- libraries/ec2/lib/deleteVpc.ml | 31 +- libraries/ec2/lib/deleteVpc.mli | 7 +- libraries/ec2/lib/deleteVpcEndpoints.ml | 69 +- libraries/ec2/lib/deleteVpcEndpoints.mli | 7 +- .../ec2/lib/deleteVpcPeeringConnection.ml | 68 +- .../ec2/lib/deleteVpcPeeringConnection.mli | 7 +- libraries/ec2/lib/deleteVpnConnection.ml | 29 +- libraries/ec2/lib/deleteVpnConnection.mli | 7 +- libraries/ec2/lib/deleteVpnConnectionRoute.ml | 30 +- .../ec2/lib/deleteVpnConnectionRoute.mli | 7 +- libraries/ec2/lib/deleteVpnGateway.ml | 30 +- libraries/ec2/lib/deleteVpnGateway.mli | 7 +- libraries/ec2/lib/deregisterImage.ml | 30 +- libraries/ec2/lib/deregisterImage.mli | 7 +- .../ec2/lib/describeAccountAttributes.ml | 68 +- .../ec2/lib/describeAccountAttributes.mli | 7 +- libraries/ec2/lib/describeAddresses.ml | 69 +- libraries/ec2/lib/describeAddresses.mli | 7 +- .../ec2/lib/describeAvailabilityZones.ml | 68 +- .../ec2/lib/describeAvailabilityZones.mli | 7 +- libraries/ec2/lib/describeBundleTasks.ml | 68 +- libraries/ec2/lib/describeBundleTasks.mli | 7 +- .../ec2/lib/describeClassicLinkInstances.ml | 69 +- .../ec2/lib/describeClassicLinkInstances.mli | 7 +- libraries/ec2/lib/describeConversionTasks.ml | 66 +- libraries/ec2/lib/describeConversionTasks.mli | 7 +- libraries/ec2/lib/describeCustomerGateways.ml | 66 +- .../ec2/lib/describeCustomerGateways.mli | 7 +- libraries/ec2/lib/describeDhcpOptions.ml | 68 +- libraries/ec2/lib/describeDhcpOptions.mli | 7 +- libraries/ec2/lib/describeExportTasks.ml | 68 +- libraries/ec2/lib/describeExportTasks.mli | 7 +- libraries/ec2/lib/describeFlowLogs.ml | 68 +- libraries/ec2/lib/describeFlowLogs.mli | 7 +- libraries/ec2/lib/describeImageAttribute.ml | 62 +- libraries/ec2/lib/describeImageAttribute.mli | 7 +- libraries/ec2/lib/describeImages.ml | 66 +- libraries/ec2/lib/describeImages.mli | 7 +- libraries/ec2/lib/describeImportImageTasks.ml | 66 +- .../ec2/lib/describeImportImageTasks.mli | 7 +- .../ec2/lib/describeImportSnapshotTasks.ml | 69 +- .../ec2/lib/describeImportSnapshotTasks.mli | 7 +- .../ec2/lib/describeInstanceAttribute.ml | 66 +- .../ec2/lib/describeInstanceAttribute.mli | 7 +- libraries/ec2/lib/describeInstanceStatus.ml | 66 +- libraries/ec2/lib/describeInstanceStatus.mli | 7 +- libraries/ec2/lib/describeInstances.ml | 69 +- libraries/ec2/lib/describeInstances.mli | 7 +- libraries/ec2/lib/describeInternetGateways.ml | 66 +- .../ec2/lib/describeInternetGateways.mli | 7 +- libraries/ec2/lib/describeKeyPairs.ml | 68 +- libraries/ec2/lib/describeKeyPairs.mli | 7 +- libraries/ec2/lib/describeMovingAddresses.ml | 66 +- libraries/ec2/lib/describeMovingAddresses.mli | 7 +- libraries/ec2/lib/describeNetworkAcls.ml | 68 +- libraries/ec2/lib/describeNetworkAcls.mli | 7 +- .../lib/describeNetworkInterfaceAttribute.ml | 75 +- .../lib/describeNetworkInterfaceAttribute.mli | 7 +- .../ec2/lib/describeNetworkInterfaces.ml | 68 +- .../ec2/lib/describeNetworkInterfaces.mli | 7 +- libraries/ec2/lib/describePlacementGroups.ml | 66 +- libraries/ec2/lib/describePlacementGroups.mli | 7 +- libraries/ec2/lib/describePrefixLists.ml | 68 +- libraries/ec2/lib/describePrefixLists.mli | 7 +- libraries/ec2/lib/describeRegions.ml | 67 +- libraries/ec2/lib/describeRegions.mli | 7 +- .../ec2/lib/describeReservedInstances.ml | 68 +- .../ec2/lib/describeReservedInstances.mli | 7 +- .../lib/describeReservedInstancesListings.ml | 75 +- .../lib/describeReservedInstancesListings.mli | 7 +- .../describeReservedInstancesModifications.ml | 78 +- ...describeReservedInstancesModifications.mli | 7 +- .../lib/describeReservedInstancesOfferings.ml | 75 +- .../describeReservedInstancesOfferings.mli | 7 +- libraries/ec2/lib/describeRouteTables.ml | 68 +- libraries/ec2/lib/describeRouteTables.mli | 7 +- libraries/ec2/lib/describeSecurityGroups.ml | 66 +- libraries/ec2/lib/describeSecurityGroups.mli | 7 +- .../ec2/lib/describeSnapshotAttribute.ml | 68 +- .../ec2/lib/describeSnapshotAttribute.mli | 7 +- libraries/ec2/lib/describeSnapshots.ml | 69 +- libraries/ec2/lib/describeSnapshots.mli | 7 +- .../lib/describeSpotDatafeedSubscription.ml | 72 +- .../lib/describeSpotDatafeedSubscription.mli | 7 +- .../ec2/lib/describeSpotFleetInstances.ml | 68 +- .../ec2/lib/describeSpotFleetInstances.mli | 7 +- .../lib/describeSpotFleetRequestHistory.ml | 70 +- .../lib/describeSpotFleetRequestHistory.mli | 7 +- .../ec2/lib/describeSpotFleetRequests.ml | 68 +- .../ec2/lib/describeSpotFleetRequests.mli | 7 +- .../ec2/lib/describeSpotInstanceRequests.ml | 69 +- .../ec2/lib/describeSpotInstanceRequests.mli | 7 +- libraries/ec2/lib/describeSpotPriceHistory.ml | 66 +- .../ec2/lib/describeSpotPriceHistory.mli | 7 +- libraries/ec2/lib/describeSubnets.ml | 67 +- libraries/ec2/lib/describeSubnets.mli | 7 +- libraries/ec2/lib/describeTags.ml | 66 +- libraries/ec2/lib/describeTags.mli | 7 +- libraries/ec2/lib/describeVolumeAttribute.ml | 66 +- libraries/ec2/lib/describeVolumeAttribute.mli | 7 +- libraries/ec2/lib/describeVolumeStatus.ml | 68 +- libraries/ec2/lib/describeVolumeStatus.mli | 7 +- libraries/ec2/lib/describeVolumes.ml | 67 +- libraries/ec2/lib/describeVolumes.mli | 7 +- libraries/ec2/lib/describeVpcAttribute.ml | 68 +- libraries/ec2/lib/describeVpcAttribute.mli | 7 +- libraries/ec2/lib/describeVpcClassicLink.ml | 66 +- libraries/ec2/lib/describeVpcClassicLink.mli | 7 +- .../ec2/lib/describeVpcEndpointServices.ml | 69 +- .../ec2/lib/describeVpcEndpointServices.mli | 7 +- libraries/ec2/lib/describeVpcEndpoints.ml | 68 +- libraries/ec2/lib/describeVpcEndpoints.mli | 7 +- .../ec2/lib/describeVpcPeeringConnections.ml | 69 +- .../ec2/lib/describeVpcPeeringConnections.mli | 7 +- libraries/ec2/lib/describeVpcs.ml | 66 +- libraries/ec2/lib/describeVpcs.mli | 7 +- libraries/ec2/lib/describeVpnConnections.ml | 66 +- libraries/ec2/lib/describeVpnConnections.mli | 7 +- libraries/ec2/lib/describeVpnGateways.ml | 68 +- libraries/ec2/lib/describeVpnGateways.mli | 7 +- libraries/ec2/lib/detachClassicLinkVpc.ml | 68 +- libraries/ec2/lib/detachClassicLinkVpc.mli | 7 +- libraries/ec2/lib/detachInternetGateway.ml | 29 +- libraries/ec2/lib/detachInternetGateway.mli | 7 +- libraries/ec2/lib/detachNetworkInterface.ml | 30 +- libraries/ec2/lib/detachNetworkInterface.mli | 7 +- libraries/ec2/lib/detachVolume.ml | 64 +- libraries/ec2/lib/detachVolume.mli | 7 +- libraries/ec2/lib/detachVpnGateway.ml | 30 +- libraries/ec2/lib/detachVpnGateway.mli | 7 +- .../ec2/lib/disableVgwRoutePropagation.ml | 30 +- .../ec2/lib/disableVgwRoutePropagation.mli | 7 +- libraries/ec2/lib/disableVpcClassicLink.ml | 68 +- libraries/ec2/lib/disableVpcClassicLink.mli | 7 +- libraries/ec2/lib/disassociateAddress.ml | 29 +- libraries/ec2/lib/disassociateAddress.mli | 7 +- libraries/ec2/lib/disassociateRouteTable.ml | 30 +- libraries/ec2/lib/disassociateRouteTable.mli | 7 +- libraries/ec2/lib/dune | 5 +- .../ec2/lib/enableVgwRoutePropagation.ml | 30 +- .../ec2/lib/enableVgwRoutePropagation.mli | 7 +- libraries/ec2/lib/enableVolumeIO.ml | 30 +- libraries/ec2/lib/enableVolumeIO.mli | 7 +- libraries/ec2/lib/enableVpcClassicLink.ml | 68 +- libraries/ec2/lib/enableVpcClassicLink.mli | 7 +- libraries/ec2/lib/errors_internal.ml | 833 +- libraries/ec2/lib/getConsoleOutput.ml | 68 +- libraries/ec2/lib/getConsoleOutput.mli | 7 +- libraries/ec2/lib/getPasswordData.ml | 67 +- libraries/ec2/lib/getPasswordData.mli | 7 +- libraries/ec2/lib/importImage.ml | 67 +- libraries/ec2/lib/importImage.mli | 7 +- libraries/ec2/lib/importInstance.ml | 66 +- libraries/ec2/lib/importInstance.mli | 7 +- libraries/ec2/lib/importKeyPair.ml | 66 +- libraries/ec2/lib/importKeyPair.mli | 7 +- libraries/ec2/lib/importSnapshot.ml | 66 +- libraries/ec2/lib/importSnapshot.mli | 7 +- libraries/ec2/lib/importVolume.ml | 66 +- libraries/ec2/lib/importVolume.mli | 7 +- libraries/ec2/lib/modifyImageAttribute.ml | 29 +- libraries/ec2/lib/modifyImageAttribute.mli | 7 +- libraries/ec2/lib/modifyInstanceAttribute.ml | 30 +- libraries/ec2/lib/modifyInstanceAttribute.mli | 7 +- .../lib/modifyNetworkInterfaceAttribute.ml | 31 +- .../lib/modifyNetworkInterfaceAttribute.mli | 7 +- libraries/ec2/lib/modifyReservedInstances.ml | 66 +- libraries/ec2/lib/modifyReservedInstances.mli | 7 +- libraries/ec2/lib/modifySnapshotAttribute.ml | 30 +- libraries/ec2/lib/modifySnapshotAttribute.mli | 7 +- libraries/ec2/lib/modifySubnetAttribute.ml | 29 +- libraries/ec2/lib/modifySubnetAttribute.mli | 7 +- libraries/ec2/lib/modifyVolumeAttribute.ml | 29 +- libraries/ec2/lib/modifyVolumeAttribute.mli | 7 +- libraries/ec2/lib/modifyVpcAttribute.ml | 30 +- libraries/ec2/lib/modifyVpcAttribute.mli | 7 +- libraries/ec2/lib/modifyVpcEndpoint.ml | 69 +- libraries/ec2/lib/modifyVpcEndpoint.mli | 7 +- libraries/ec2/lib/monitorInstances.ml | 68 +- libraries/ec2/lib/monitorInstances.mli | 7 +- libraries/ec2/lib/moveAddressToVpc.ml | 68 +- libraries/ec2/lib/moveAddressToVpc.mli | 7 +- .../lib/purchaseReservedInstancesOffering.ml | 75 +- .../lib/purchaseReservedInstancesOffering.mli | 7 +- libraries/ec2/lib/rebootInstances.ml | 30 +- libraries/ec2/lib/rebootInstances.mli | 7 +- libraries/ec2/lib/registerImage.ml | 66 +- libraries/ec2/lib/registerImage.mli | 7 +- .../ec2/lib/rejectVpcPeeringConnection.ml | 68 +- .../ec2/lib/rejectVpcPeeringConnection.mli | 7 +- libraries/ec2/lib/releaseAddress.ml | 30 +- libraries/ec2/lib/releaseAddress.mli | 7 +- .../ec2/lib/replaceNetworkAclAssociation.ml | 69 +- .../ec2/lib/replaceNetworkAclAssociation.mli | 7 +- libraries/ec2/lib/replaceNetworkAclEntry.ml | 30 +- libraries/ec2/lib/replaceNetworkAclEntry.mli | 7 +- libraries/ec2/lib/replaceRoute.ml | 30 +- libraries/ec2/lib/replaceRoute.mli | 7 +- .../ec2/lib/replaceRouteTableAssociation.ml | 69 +- .../ec2/lib/replaceRouteTableAssociation.mli | 7 +- libraries/ec2/lib/reportInstanceStatus.ml | 29 +- libraries/ec2/lib/reportInstanceStatus.mli | 7 +- libraries/ec2/lib/requestSpotFleet.ml | 69 +- libraries/ec2/lib/requestSpotFleet.mli | 7 +- libraries/ec2/lib/requestSpotInstances.ml | 68 +- libraries/ec2/lib/requestSpotInstances.mli | 7 +- libraries/ec2/lib/resetImageAttribute.ml | 29 +- libraries/ec2/lib/resetImageAttribute.mli | 7 +- libraries/ec2/lib/resetInstanceAttribute.ml | 30 +- libraries/ec2/lib/resetInstanceAttribute.mli | 7 +- .../ec2/lib/resetNetworkInterfaceAttribute.ml | 31 +- .../lib/resetNetworkInterfaceAttribute.mli | 7 +- libraries/ec2/lib/resetSnapshotAttribute.ml | 30 +- libraries/ec2/lib/resetSnapshotAttribute.mli | 7 +- libraries/ec2/lib/restoreAddressToClassic.ml | 66 +- libraries/ec2/lib/restoreAddressToClassic.mli | 7 +- .../ec2/lib/revokeSecurityGroupEgress.ml | 30 +- .../ec2/lib/revokeSecurityGroupEgress.mli | 7 +- .../ec2/lib/revokeSecurityGroupIngress.ml | 30 +- .../ec2/lib/revokeSecurityGroupIngress.mli | 7 +- libraries/ec2/lib/runInstances.ml | 62 +- libraries/ec2/lib/runInstances.mli | 7 +- libraries/ec2/lib/startInstances.ml | 66 +- libraries/ec2/lib/startInstances.mli | 7 +- libraries/ec2/lib/stopInstances.ml | 66 +- libraries/ec2/lib/stopInstances.mli | 7 +- libraries/ec2/lib/terminateInstances.ml | 69 +- libraries/ec2/lib/terminateInstances.mli | 7 +- libraries/ec2/lib/types.ml | 60331 ++++++++-------- .../ec2/lib/unassignPrivateIpAddresses.ml | 30 +- .../ec2/lib/unassignPrivateIpAddresses.mli | 7 +- libraries/ec2/lib/unmonitorInstances.ml | 69 +- libraries/ec2/lib/unmonitorInstances.mli | 7 +- libraries/ec2/lib_test/dune | 15 +- libraries/ec2/lib_test/test_async.ml | 16 +- libraries/ec2/lib_test/test_lwt.ml | 16 +- .../elasticache/lib/addTagsToResource.ml | 79 +- .../elasticache/lib/addTagsToResource.mli | 7 +- .../lib/authorizeCacheSecurityGroupIngress.ml | 88 +- .../authorizeCacheSecurityGroupIngress.mli | 7 +- libraries/elasticache/lib/copySnapshot.ml | 87 +- libraries/elasticache/lib/copySnapshot.mli | 7 +- .../elasticache/lib/createCacheCluster.ml | 106 +- .../elasticache/lib/createCacheCluster.mli | 7 +- .../lib/createCacheParameterGroup.ml | 85 +- .../lib/createCacheParameterGroup.mli | 7 +- .../lib/createCacheSecurityGroup.ml | 80 +- .../lib/createCacheSecurityGroup.mli | 7 +- .../elasticache/lib/createCacheSubnetGroup.ml | 80 +- .../lib/createCacheSubnetGroup.mli | 7 +- .../elasticache/lib/createReplicationGroup.ml | 100 +- .../lib/createReplicationGroup.mli | 7 +- libraries/elasticache/lib/createSnapshot.ml | 89 +- libraries/elasticache/lib/createSnapshot.mli | 7 +- .../elasticache/lib/deleteCacheCluster.ml | 92 +- .../elasticache/lib/deleteCacheCluster.mli | 7 +- .../lib/deleteCacheParameterGroup.ml | 41 +- .../lib/deleteCacheParameterGroup.mli | 7 +- .../lib/deleteCacheSecurityGroup.ml | 41 +- .../lib/deleteCacheSecurityGroup.mli | 7 +- .../elasticache/lib/deleteCacheSubnetGroup.ml | 37 +- .../lib/deleteCacheSubnetGroup.mli | 7 +- .../elasticache/lib/deleteReplicationGroup.ml | 86 +- .../lib/deleteReplicationGroup.mli | 7 +- libraries/elasticache/lib/deleteSnapshot.ml | 83 +- libraries/elasticache/lib/deleteSnapshot.mli | 7 +- .../elasticache/lib/describeCacheClusters.ml | 80 +- .../elasticache/lib/describeCacheClusters.mli | 7 +- .../lib/describeCacheEngineVersions.ml | 73 +- .../lib/describeCacheEngineVersions.mli | 7 +- .../lib/describeCacheParameterGroups.ml | 82 +- .../lib/describeCacheParameterGroups.mli | 7 +- .../lib/describeCacheParameters.ml | 81 +- .../lib/describeCacheParameters.mli | 7 +- .../lib/describeCacheSecurityGroups.ml | 82 +- .../lib/describeCacheSecurityGroups.mli | 7 +- .../lib/describeCacheSubnetGroups.ml | 75 +- .../lib/describeCacheSubnetGroups.mli | 7 +- .../lib/describeEngineDefaultParameters.ml | 77 +- .../lib/describeEngineDefaultParameters.mli | 7 +- libraries/elasticache/lib/describeEvents.ml | 73 +- libraries/elasticache/lib/describeEvents.mli | 7 +- .../lib/describeReplicationGroups.ml | 81 +- .../lib/describeReplicationGroups.mli | 7 +- .../lib/describeReservedCacheNodes.ml | 81 +- .../lib/describeReservedCacheNodes.mli | 7 +- .../describeReservedCacheNodesOfferings.ml | 84 +- .../describeReservedCacheNodesOfferings.mli | 7 +- .../elasticache/lib/describeSnapshots.ml | 83 +- .../elasticache/lib/describeSnapshots.mli | 7 +- libraries/elasticache/lib/dune | 5 +- libraries/elasticache/lib/errors_internal.ml | 214 +- .../elasticache/lib/listTagsForResource.ml | 76 +- .../elasticache/lib/listTagsForResource.mli | 7 +- .../elasticache/lib/modifyCacheCluster.ml | 100 +- .../elasticache/lib/modifyCacheCluster.mli | 7 +- .../lib/modifyCacheParameterGroup.ml | 80 +- .../lib/modifyCacheParameterGroup.mli | 7 +- .../elasticache/lib/modifyCacheSubnetGroup.ml | 80 +- .../lib/modifyCacheSubnetGroup.mli | 7 +- .../elasticache/lib/modifyReplicationGroup.ml | 98 +- .../lib/modifyReplicationGroup.mli | 7 +- .../lib/purchaseReservedCacheNodesOffering.ml | 89 +- .../purchaseReservedCacheNodesOffering.mli | 7 +- .../elasticache/lib/rebootCacheCluster.ml | 80 +- .../elasticache/lib/rebootCacheCluster.mli | 7 +- .../elasticache/lib/removeTagsFromResource.ml | 76 +- .../lib/removeTagsFromResource.mli | 7 +- .../lib/resetCacheParameterGroup.ml | 80 +- .../lib/resetCacheParameterGroup.mli | 7 +- .../lib/revokeCacheSecurityGroupIngress.ml | 85 +- .../lib/revokeCacheSecurityGroupIngress.mli | 7 +- libraries/elasticache/lib/types.ml | 14482 ++-- libraries/elasticache/lib_test/dune | 15 +- libraries/elasticache/lib_test/test_async.ml | 16 +- libraries/elasticache/lib_test/test_lwt.ml | 16 +- libraries/elasticloadbalancing/lib/addTags.ml | 39 +- .../elasticloadbalancing/lib/addTags.mli | 7 +- .../lib/applySecurityGroupsToLoadBalancer.ml | 84 +- .../lib/applySecurityGroupsToLoadBalancer.mli | 7 +- .../lib/attachLoadBalancerToSubnets.ml | 82 +- .../lib/attachLoadBalancerToSubnets.mli | 7 +- .../lib/configureHealthCheck.ml | 78 +- .../lib/configureHealthCheck.mli | 7 +- .../lib/createAppCookieStickinessPolicy.ml | 42 +- .../lib/createAppCookieStickinessPolicy.mli | 7 +- .../lib/createLBCookieStickinessPolicy.ml | 42 +- .../lib/createLBCookieStickinessPolicy.mli | 7 +- .../lib/createLoadBalancer.ml | 98 +- .../lib/createLoadBalancer.mli | 7 +- .../lib/createLoadBalancerListeners.ml | 41 +- .../lib/createLoadBalancerListeners.mli | 7 +- .../lib/createLoadBalancerPolicy.ml | 43 +- .../lib/createLoadBalancerPolicy.mli | 7 +- .../lib/deleteLoadBalancer.ml | 30 +- .../lib/deleteLoadBalancer.mli | 7 +- .../lib/deleteLoadBalancerListeners.ml | 33 +- .../lib/deleteLoadBalancerListeners.mli | 7 +- .../lib/deleteLoadBalancerPolicy.ml | 35 +- .../lib/deleteLoadBalancerPolicy.mli | 7 +- .../deregisterInstancesFromLoadBalancer.ml | 80 +- .../deregisterInstancesFromLoadBalancer.mli | 7 +- .../lib/describeInstanceHealth.ml | 77 +- .../lib/describeInstanceHealth.mli | 7 +- .../lib/describeLoadBalancerAttributes.ml | 79 +- .../lib/describeLoadBalancerAttributes.mli | 7 +- .../lib/describeLoadBalancerPolicies.ml | 76 +- .../lib/describeLoadBalancerPolicies.mli | 7 +- .../lib/describeLoadBalancerPolicyTypes.ml | 74 +- .../lib/describeLoadBalancerPolicyTypes.mli | 7 +- .../lib/describeLoadBalancers.ml | 78 +- .../lib/describeLoadBalancers.mli | 7 +- .../elasticloadbalancing/lib/describeTags.ml | 75 +- .../elasticloadbalancing/lib/describeTags.mli | 7 +- .../lib/detachLoadBalancerFromSubnets.ml | 77 +- .../lib/detachLoadBalancerFromSubnets.mli | 7 +- ...disableAvailabilityZonesForLoadBalancer.ml | 79 +- ...isableAvailabilityZonesForLoadBalancer.mli | 7 +- libraries/elasticloadbalancing/lib/dune | 5 +- .../enableAvailabilityZonesForLoadBalancer.ml | 81 +- ...enableAvailabilityZonesForLoadBalancer.mli | 7 +- .../lib/errors_internal.ml | 151 +- .../lib/modifyLoadBalancerAttributes.ml | 80 +- .../lib/modifyLoadBalancerAttributes.mli | 7 +- .../lib/registerInstancesWithLoadBalancer.ml | 80 +- .../lib/registerInstancesWithLoadBalancer.mli | 7 +- .../elasticloadbalancing/lib/removeTags.ml | 34 +- .../elasticloadbalancing/lib/removeTags.mli | 7 +- .../setLoadBalancerListenerSSLCertificate.ml | 44 +- .../setLoadBalancerListenerSSLCertificate.mli | 7 +- ...setLoadBalancerPoliciesForBackendServer.ml | 42 +- ...etLoadBalancerPoliciesForBackendServer.mli | 7 +- .../lib/setLoadBalancerPoliciesOfListener.ml | 44 +- .../lib/setLoadBalancerPoliciesOfListener.mli | 7 +- libraries/elasticloadbalancing/lib/types.ml | 7546 +- libraries/elasticloadbalancing/lib_test/dune | 15 +- .../lib_test/test_async.ml | 16 +- .../elasticloadbalancing/lib_test/test_lwt.ml | 16 +- .../elasticmapreduce/lib/addInstanceFleet.ml | 68 +- .../elasticmapreduce/lib/addInstanceFleet.mli | 7 +- .../elasticmapreduce/lib/addInstanceGroups.ml | 69 +- .../lib/addInstanceGroups.mli | 7 +- .../elasticmapreduce/lib/addJobFlowSteps.ml | 67 +- .../elasticmapreduce/lib/addJobFlowSteps.mli | 7 +- libraries/elasticmapreduce/lib/addTags.ml | 30 +- libraries/elasticmapreduce/lib/addTags.mli | 7 +- libraries/elasticmapreduce/lib/cancelSteps.ml | 67 +- .../elasticmapreduce/lib/cancelSteps.mli | 7 +- .../lib/createSecurityConfiguration.ml | 68 +- .../lib/createSecurityConfiguration.mli | 7 +- .../lib/deleteSecurityConfiguration.ml | 30 +- .../lib/deleteSecurityConfiguration.mli | 7 +- .../elasticmapreduce/lib/describeCluster.ml | 67 +- .../elasticmapreduce/lib/describeCluster.mli | 7 +- .../elasticmapreduce/lib/describeJobFlows.ml | 68 +- .../elasticmapreduce/lib/describeJobFlows.mli | 7 +- .../lib/describeNotebookExecution.ml | 60 + .../lib/describeNotebookExecution.mli | 7 + .../lib/describeSecurityConfiguration.ml | 69 +- .../lib/describeSecurityConfiguration.mli | 7 +- .../elasticmapreduce/lib/describeStep.ml | 66 +- .../elasticmapreduce/lib/describeStep.mli | 7 +- libraries/elasticmapreduce/lib/dune | 5 +- .../elasticmapreduce/lib/errors_internal.ml | 119 +- .../lib/getBlockPublicAccessConfiguration.ml | 57 + .../lib/getBlockPublicAccessConfiguration.mli | 7 + .../lib/getManagedScalingPolicy.ml | 60 + .../lib/getManagedScalingPolicy.mli | 7 + .../lib/listBootstrapActions.ml | 69 +- .../lib/listBootstrapActions.mli | 7 +- .../elasticmapreduce/lib/listClusters.ml | 66 +- .../elasticmapreduce/lib/listClusters.mli | 7 +- .../lib/listInstanceFleets.ml | 69 +- .../lib/listInstanceFleets.mli | 7 +- .../lib/listInstanceGroups.ml | 69 +- .../lib/listInstanceGroups.mli | 7 +- .../elasticmapreduce/lib/listInstances.ml | 66 +- .../elasticmapreduce/lib/listInstances.mli | 7 +- .../lib/listNotebookExecutions.ml | 60 + .../lib/listNotebookExecutions.mli | 7 + .../lib/listSecurityConfigurations.ml | 68 +- .../lib/listSecurityConfigurations.mli | 7 +- libraries/elasticmapreduce/lib/listSteps.ml | 64 +- libraries/elasticmapreduce/lib/listSteps.mli | 7 +- .../elasticmapreduce/lib/modifyCluster.ml | 57 + .../elasticmapreduce/lib/modifyCluster.mli | 7 + .../lib/modifyInstanceFleet.ml | 30 +- .../lib/modifyInstanceFleet.mli | 7 +- .../lib/modifyInstanceGroups.ml | 30 +- .../lib/modifyInstanceGroups.mli | 7 +- .../lib/putAutoScalingPolicy.ml | 69 +- .../lib/putAutoScalingPolicy.mli | 7 +- .../lib/putBlockPublicAccessConfiguration.ml | 32 + .../lib/putBlockPublicAccessConfiguration.mli | 7 + .../lib/putManagedScalingPolicy.ml | 31 + .../lib/putManagedScalingPolicy.mli | 7 + .../lib/removeAutoScalingPolicy.ml | 30 +- .../lib/removeAutoScalingPolicy.mli | 7 +- .../lib/removeManagedScalingPolicy.ml | 31 + .../lib/removeManagedScalingPolicy.mli | 7 + libraries/elasticmapreduce/lib/removeTags.ml | 31 +- libraries/elasticmapreduce/lib/removeTags.mli | 7 +- libraries/elasticmapreduce/lib/runJobFlow.ml | 65 +- libraries/elasticmapreduce/lib/runJobFlow.mli | 7 +- .../lib/setTerminationProtection.ml | 30 +- .../lib/setTerminationProtection.mli | 7 +- .../lib/setVisibleToAllUsers.ml | 30 +- .../lib/setVisibleToAllUsers.mli | 7 +- .../lib/startNotebookExecution.ml | 60 + .../lib/startNotebookExecution.mli | 7 + .../lib/stopNotebookExecution.ml | 30 + .../lib/stopNotebookExecution.mli | 7 + .../elasticmapreduce/lib/terminateJobFlows.ml | 30 +- .../lib/terminateJobFlows.mli | 7 +- libraries/elasticmapreduce/lib/types.ml | 2036 +- libraries/elasticmapreduce/lib_test/dune | 15 +- .../elasticmapreduce/lib_test/test_async.ml | 16 +- .../elasticmapreduce/lib_test/test_lwt.ml | 16 +- .../lib/addSourceIdentifierToSubscription.ml | 80 +- .../lib/addSourceIdentifierToSubscription.mli | 7 +- libraries/rds/lib/addTagsToResource.ml | 35 +- libraries/rds/lib/addTagsToResource.mli | 7 +- .../rds/lib/applyPendingMaintenanceAction.ml | 75 +- .../rds/lib/applyPendingMaintenanceAction.mli | 7 +- .../lib/authorizeDBSecurityGroupIngress.ml | 83 +- .../lib/authorizeDBSecurityGroupIngress.mli | 7 +- libraries/rds/lib/copyDBClusterSnapshot.ml | 84 +- libraries/rds/lib/copyDBClusterSnapshot.mli | 7 +- libraries/rds/lib/copyDBParameterGroup.ml | 83 +- libraries/rds/lib/copyDBParameterGroup.mli | 7 +- libraries/rds/lib/copyDBSnapshot.ml | 83 +- libraries/rds/lib/copyDBSnapshot.mli | 7 +- libraries/rds/lib/copyOptionGroup.ml | 82 +- libraries/rds/lib/copyOptionGroup.mli | 7 +- libraries/rds/lib/createDBCluster.ml | 96 +- libraries/rds/lib/createDBCluster.mli | 7 +- .../rds/lib/createDBClusterParameterGroup.ml | 79 +- .../rds/lib/createDBClusterParameterGroup.mli | 7 +- libraries/rds/lib/createDBClusterSnapshot.ml | 81 +- libraries/rds/lib/createDBClusterSnapshot.mli | 7 +- libraries/rds/lib/createDBInstance.ml | 115 +- libraries/rds/lib/createDBInstance.mli | 7 +- .../rds/lib/createDBInstanceReadReplica.ml | 111 +- .../rds/lib/createDBInstanceReadReplica.mli | 7 +- libraries/rds/lib/createDBParameterGroup.ml | 76 +- libraries/rds/lib/createDBParameterGroup.mli | 7 +- libraries/rds/lib/createDBSecurityGroup.ml | 83 +- libraries/rds/lib/createDBSecurityGroup.mli | 7 +- libraries/rds/lib/createDBSnapshot.ml | 85 +- libraries/rds/lib/createDBSnapshot.mli | 7 +- libraries/rds/lib/createDBSubnetGroup.ml | 87 +- libraries/rds/lib/createDBSubnetGroup.mli | 7 +- libraries/rds/lib/createEventSubscription.ml | 86 +- libraries/rds/lib/createEventSubscription.mli | 7 +- libraries/rds/lib/createOptionGroup.ml | 82 +- libraries/rds/lib/createOptionGroup.mli | 7 +- libraries/rds/lib/deleteDBCluster.ml | 78 +- libraries/rds/lib/deleteDBCluster.mli | 7 +- .../rds/lib/deleteDBClusterParameterGroup.ml | 38 +- .../rds/lib/deleteDBClusterParameterGroup.mli | 7 +- libraries/rds/lib/deleteDBClusterSnapshot.ml | 77 +- libraries/rds/lib/deleteDBClusterSnapshot.mli | 7 +- libraries/rds/lib/deleteDBInstance.ml | 85 +- libraries/rds/lib/deleteDBInstance.mli | 7 +- libraries/rds/lib/deleteDBParameterGroup.ml | 37 +- libraries/rds/lib/deleteDBParameterGroup.mli | 7 +- libraries/rds/lib/deleteDBSecurityGroup.ml | 36 +- libraries/rds/lib/deleteDBSecurityGroup.mli | 7 +- libraries/rds/lib/deleteDBSnapshot.ml | 79 +- libraries/rds/lib/deleteDBSnapshot.mli | 7 +- libraries/rds/lib/deleteDBSubnetGroup.ml | 38 +- libraries/rds/lib/deleteDBSubnetGroup.mli | 7 +- libraries/rds/lib/deleteEventSubscription.ml | 76 +- libraries/rds/lib/deleteEventSubscription.mli | 7 +- libraries/rds/lib/deleteOptionGroup.ml | 37 +- libraries/rds/lib/deleteOptionGroup.mli | 7 +- .../rds/lib/describeAccountAttributes.ml | 70 +- .../rds/lib/describeAccountAttributes.mli | 7 +- libraries/rds/lib/describeCertificates.ml | 73 +- libraries/rds/lib/describeCertificates.mli | 7 +- .../lib/describeDBClusterParameterGroups.ml | 75 +- .../lib/describeDBClusterParameterGroups.mli | 7 +- .../rds/lib/describeDBClusterParameters.ml | 73 +- .../rds/lib/describeDBClusterParameters.mli | 7 +- .../rds/lib/describeDBClusterSnapshots.ml | 75 +- .../rds/lib/describeDBClusterSnapshots.mli | 7 +- libraries/rds/lib/describeDBClusters.ml | 73 +- libraries/rds/lib/describeDBClusters.mli | 7 +- libraries/rds/lib/describeDBEngineVersions.ml | 71 +- .../rds/lib/describeDBEngineVersions.mli | 7 +- libraries/rds/lib/describeDBInstances.ml | 73 +- libraries/rds/lib/describeDBInstances.mli | 7 +- libraries/rds/lib/describeDBLogFiles.ml | 77 +- libraries/rds/lib/describeDBLogFiles.mli | 7 +- .../rds/lib/describeDBParameterGroups.ml | 75 +- .../rds/lib/describeDBParameterGroups.mli | 7 +- libraries/rds/lib/describeDBParameters.ml | 77 +- libraries/rds/lib/describeDBParameters.mli | 7 +- libraries/rds/lib/describeDBSecurityGroups.ml | 74 +- .../rds/lib/describeDBSecurityGroups.mli | 7 +- libraries/rds/lib/describeDBSnapshots.ml | 73 +- libraries/rds/lib/describeDBSnapshots.mli | 7 +- libraries/rds/lib/describeDBSubnetGroups.ml | 72 +- libraries/rds/lib/describeDBSubnetGroups.mli | 7 +- .../describeEngineDefaultClusterParameters.ml | 81 +- ...describeEngineDefaultClusterParameters.mli | 7 +- .../lib/describeEngineDefaultParameters.ml | 72 +- .../lib/describeEngineDefaultParameters.mli | 7 +- libraries/rds/lib/describeEventCategories.ml | 71 +- libraries/rds/lib/describeEventCategories.mli | 7 +- .../rds/lib/describeEventSubscriptions.ml | 75 +- .../rds/lib/describeEventSubscriptions.mli | 7 +- libraries/rds/lib/describeEvents.ml | 68 +- libraries/rds/lib/describeEvents.mli | 7 +- .../rds/lib/describeOptionGroupOptions.ml | 72 +- .../rds/lib/describeOptionGroupOptions.mli | 7 +- libraries/rds/lib/describeOptionGroups.ml | 70 +- libraries/rds/lib/describeOptionGroups.mli | 7 +- .../lib/describeOrderableDBInstanceOptions.ml | 74 +- .../describeOrderableDBInstanceOptions.mli | 7 +- .../lib/describePendingMaintenanceActions.ml | 77 +- .../lib/describePendingMaintenanceActions.mli | 7 +- .../rds/lib/describeReservedDBInstances.ml | 76 +- .../rds/lib/describeReservedDBInstances.mli | 7 +- .../describeReservedDBInstancesOfferings.ml | 78 +- .../describeReservedDBInstancesOfferings.mli | 7 +- libraries/rds/lib/downloadDBLogFilePortion.ml | 76 +- .../rds/lib/downloadDBLogFilePortion.mli | 7 +- libraries/rds/lib/dune | 5 +- libraries/rds/lib/errors_internal.ml | 299 +- libraries/rds/lib/failoverDBCluster.ml | 80 +- libraries/rds/lib/failoverDBCluster.mli | 7 +- libraries/rds/lib/listTagsForResource.ml | 72 +- libraries/rds/lib/listTagsForResource.mli | 7 +- libraries/rds/lib/modifyDBCluster.ml | 96 +- libraries/rds/lib/modifyDBCluster.mli | 7 +- .../rds/lib/modifyDBClusterParameterGroup.ml | 79 +- .../rds/lib/modifyDBClusterParameterGroup.mli | 7 +- libraries/rds/lib/modifyDBInstance.ml | 111 +- libraries/rds/lib/modifyDBInstance.mli | 7 +- libraries/rds/lib/modifyDBParameterGroup.ml | 79 +- libraries/rds/lib/modifyDBParameterGroup.mli | 7 +- libraries/rds/lib/modifyDBSubnetGroup.ml | 87 +- libraries/rds/lib/modifyDBSubnetGroup.mli | 7 +- libraries/rds/lib/modifyEventSubscription.ml | 84 +- libraries/rds/lib/modifyEventSubscription.mli | 7 +- libraries/rds/lib/modifyOptionGroup.ml | 82 +- libraries/rds/lib/modifyOptionGroup.mli | 7 +- libraries/rds/lib/promoteReadReplica.ml | 80 +- libraries/rds/lib/promoteReadReplica.mli | 7 +- .../purchaseReservedDBInstancesOffering.ml | 88 +- .../purchaseReservedDBInstancesOffering.mli | 7 +- libraries/rds/lib/rebootDBInstance.ml | 79 +- libraries/rds/lib/rebootDBInstance.mli | 7 +- .../removeSourceIdentifierFromSubscription.ml | 86 +- ...removeSourceIdentifierFromSubscription.mli | 7 +- libraries/rds/lib/removeTagsFromResource.ml | 35 +- libraries/rds/lib/removeTagsFromResource.mli | 7 +- .../rds/lib/resetDBClusterParameterGroup.ml | 79 +- .../rds/lib/resetDBClusterParameterGroup.mli | 7 +- libraries/rds/lib/resetDBParameterGroup.ml | 81 +- libraries/rds/lib/resetDBParameterGroup.mli | 7 +- .../rds/lib/restoreDBClusterFromSnapshot.ml | 107 +- .../rds/lib/restoreDBClusterFromSnapshot.mli | 7 +- .../rds/lib/restoreDBClusterToPointInTime.ml | 105 +- .../rds/lib/restoreDBClusterToPointInTime.mli | 7 +- .../lib/restoreDBInstanceFromDBSnapshot.ml | 113 +- .../lib/restoreDBInstanceFromDBSnapshot.mli | 7 +- .../rds/lib/restoreDBInstanceToPointInTime.ml | 115 +- .../lib/restoreDBInstanceToPointInTime.mli | 7 +- .../rds/lib/revokeDBSecurityGroupIngress.ml | 81 +- .../rds/lib/revokeDBSecurityGroupIngress.mli | 7 +- libraries/rds/lib/types.ml | 28255 ++++---- libraries/rds/lib_test/dune | 15 +- libraries/rds/lib_test/test_async.ml | 16 +- libraries/rds/lib_test/test_lwt.ml | 16 +- .../route53/lib/associateVPCWithHostedZone.ml | 68 +- .../lib/associateVPCWithHostedZone.mli | 7 +- .../route53/lib/changeResourceRecordSets.ml | 68 +- .../route53/lib/changeResourceRecordSets.mli | 7 +- .../route53/lib/changeTagsForResource.ml | 29 +- .../route53/lib/changeTagsForResource.mli | 7 +- libraries/route53/lib/createHealthCheck.ml | 69 +- libraries/route53/lib/createHealthCheck.mli | 7 +- libraries/route53/lib/createHostedZone.ml | 69 +- libraries/route53/lib/createHostedZone.mli | 7 +- .../lib/createReusableDelegationSet.ml | 69 +- .../lib/createReusableDelegationSet.mli | 7 +- libraries/route53/lib/deleteHealthCheck.ml | 30 +- libraries/route53/lib/deleteHealthCheck.mli | 7 +- libraries/route53/lib/deleteHostedZone.ml | 69 +- libraries/route53/lib/deleteHostedZone.mli | 7 +- .../lib/deleteReusableDelegationSet.ml | 31 +- .../lib/deleteReusableDelegationSet.mli | 7 +- .../lib/disassociateVPCFromHostedZone.ml | 69 +- .../lib/disassociateVPCFromHostedZone.mli | 7 +- libraries/route53/lib/dune | 5 +- libraries/route53/lib/errors_internal.ml | 175 +- libraries/route53/lib/getChange.ml | 67 +- libraries/route53/lib/getChange.mli | 7 +- libraries/route53/lib/getCheckerIpRanges.ml | 66 +- libraries/route53/lib/getCheckerIpRanges.mli | 7 +- libraries/route53/lib/getGeoLocation.ml | 68 +- libraries/route53/lib/getGeoLocation.mli | 7 +- libraries/route53/lib/getHealthCheck.ml | 68 +- libraries/route53/lib/getHealthCheck.mli | 7 +- libraries/route53/lib/getHealthCheckCount.ml | 66 +- libraries/route53/lib/getHealthCheckCount.mli | 7 +- .../lib/getHealthCheckLastFailureReason.ml | 70 +- .../lib/getHealthCheckLastFailureReason.mli | 7 +- libraries/route53/lib/getHealthCheckStatus.ml | 65 +- .../route53/lib/getHealthCheckStatus.mli | 7 +- libraries/route53/lib/getHostedZone.ml | 67 +- libraries/route53/lib/getHostedZone.mli | 7 +- libraries/route53/lib/getHostedZoneCount.ml | 66 +- libraries/route53/lib/getHostedZoneCount.mli | 7 +- .../route53/lib/getReusableDelegationSet.ml | 68 +- .../route53/lib/getReusableDelegationSet.mli | 7 +- libraries/route53/lib/listGeoLocations.ml | 69 +- libraries/route53/lib/listGeoLocations.mli | 7 +- libraries/route53/lib/listHealthChecks.ml | 69 +- libraries/route53/lib/listHealthChecks.mli | 7 +- libraries/route53/lib/listHostedZones.ml | 69 +- libraries/route53/lib/listHostedZones.mli | 7 +- .../route53/lib/listHostedZonesByName.ml | 65 +- .../route53/lib/listHostedZonesByName.mli | 7 +- .../route53/lib/listResourceRecordSets.ml | 66 +- .../route53/lib/listResourceRecordSets.mli | 7 +- .../route53/lib/listReusableDelegationSets.ml | 68 +- .../lib/listReusableDelegationSets.mli | 7 +- libraries/route53/lib/listTagsForResource.ml | 68 +- libraries/route53/lib/listTagsForResource.mli | 7 +- libraries/route53/lib/listTagsForResources.ml | 65 +- .../route53/lib/listTagsForResources.mli | 7 +- libraries/route53/lib/types.ml | 8947 +-- libraries/route53/lib/updateHealthCheck.ml | 69 +- libraries/route53/lib/updateHealthCheck.mli | 7 +- .../route53/lib/updateHostedZoneComment.ml | 68 +- .../route53/lib/updateHostedZoneComment.mli | 7 +- libraries/route53/lib_test/dune | 15 +- libraries/route53/lib_test/test_async.ml | 16 +- libraries/route53/lib_test/test_lwt.ml | 16 +- libraries/s3/lib/abortMultipartUpload.ml | 68 +- libraries/s3/lib/abortMultipartUpload.mli | 7 +- libraries/s3/lib/completeMultipartUpload.ml | 66 +- libraries/s3/lib/completeMultipartUpload.mli | 7 +- libraries/s3/lib/copyObject.ml | 65 +- libraries/s3/lib/copyObject.mli | 7 +- libraries/s3/lib/createBucket.ml | 66 +- libraries/s3/lib/createBucket.mli | 7 +- libraries/s3/lib/createMultipartUpload.ml | 68 +- libraries/s3/lib/createMultipartUpload.mli | 7 +- libraries/s3/lib/deleteBucket.ml | 30 +- libraries/s3/lib/deleteBucket.mli | 7 +- libraries/s3/lib/deleteBucketCors.ml | 30 +- libraries/s3/lib/deleteBucketCors.mli | 7 +- libraries/s3/lib/deleteBucketLifecycle.ml | 29 +- libraries/s3/lib/deleteBucketLifecycle.mli | 7 +- libraries/s3/lib/deleteBucketPolicy.ml | 30 +- libraries/s3/lib/deleteBucketPolicy.mli | 7 +- libraries/s3/lib/deleteBucketReplication.ml | 30 +- libraries/s3/lib/deleteBucketReplication.mli | 7 +- libraries/s3/lib/deleteBucketTagging.ml | 29 +- libraries/s3/lib/deleteBucketTagging.mli | 7 +- libraries/s3/lib/deleteBucketWebsite.ml | 29 +- libraries/s3/lib/deleteBucketWebsite.mli | 7 +- libraries/s3/lib/deleteObject.ml | 66 +- libraries/s3/lib/deleteObject.mli | 7 +- libraries/s3/lib/deleteObjects.ml | 66 +- libraries/s3/lib/deleteObjects.mli | 7 +- libraries/s3/lib/dune | 5 +- libraries/s3/lib/errors_internal.ml | 125 +- libraries/s3/lib/getBucketAcl.ml | 66 +- libraries/s3/lib/getBucketAcl.mli | 7 +- libraries/s3/lib/getBucketCors.ml | 66 +- libraries/s3/lib/getBucketCors.mli | 7 +- libraries/s3/lib/getBucketLifecycle.ml | 69 +- libraries/s3/lib/getBucketLifecycle.mli | 7 +- libraries/s3/lib/getBucketLocation.ml | 69 +- libraries/s3/lib/getBucketLocation.mli | 7 +- libraries/s3/lib/getBucketLogging.ml | 68 +- libraries/s3/lib/getBucketLogging.mli | 7 +- libraries/s3/lib/getBucketNotification.ml | 68 +- libraries/s3/lib/getBucketNotification.mli | 7 +- .../lib/getBucketNotificationConfiguration.ml | 75 +- .../getBucketNotificationConfiguration.mli | 7 +- libraries/s3/lib/getBucketPolicy.ml | 67 +- libraries/s3/lib/getBucketPolicy.mli | 7 +- libraries/s3/lib/getBucketReplication.ml | 68 +- libraries/s3/lib/getBucketReplication.mli | 7 +- libraries/s3/lib/getBucketRequestPayment.ml | 66 +- libraries/s3/lib/getBucketRequestPayment.mli | 7 +- libraries/s3/lib/getBucketTagging.ml | 68 +- libraries/s3/lib/getBucketTagging.mli | 7 +- libraries/s3/lib/getBucketVersioning.ml | 68 +- libraries/s3/lib/getBucketVersioning.mli | 7 +- libraries/s3/lib/getBucketWebsite.ml | 68 +- libraries/s3/lib/getBucketWebsite.mli | 7 +- libraries/s3/lib/getObject.ml | 64 +- libraries/s3/lib/getObject.mli | 7 +- libraries/s3/lib/getObjectAcl.ml | 66 +- libraries/s3/lib/getObjectAcl.mli | 7 +- libraries/s3/lib/getObjectTorrent.ml | 68 +- libraries/s3/lib/getObjectTorrent.mli | 7 +- libraries/s3/lib/headBucket.ml | 31 +- libraries/s3/lib/headBucket.mli | 7 +- libraries/s3/lib/headObject.ml | 65 +- libraries/s3/lib/headObject.mli | 7 +- libraries/s3/lib/listBuckets.ml | 67 +- libraries/s3/lib/listBuckets.mli | 7 +- libraries/s3/lib/listMultipartUploads.ml | 68 +- libraries/s3/lib/listMultipartUploads.mli | 7 +- libraries/s3/lib/listObjectVersions.ml | 69 +- libraries/s3/lib/listObjectVersions.mli | 7 +- libraries/s3/lib/listObjects.ml | 67 +- libraries/s3/lib/listObjects.mli | 7 +- libraries/s3/lib/listParts.ml | 64 +- libraries/s3/lib/listParts.mli | 7 +- libraries/s3/lib/putBucketAcl.ml | 30 +- libraries/s3/lib/putBucketAcl.mli | 7 +- libraries/s3/lib/putBucketCors.ml | 30 +- libraries/s3/lib/putBucketCors.mli | 7 +- libraries/s3/lib/putBucketLifecycle.ml | 30 +- libraries/s3/lib/putBucketLifecycle.mli | 7 +- libraries/s3/lib/putBucketLogging.ml | 30 +- libraries/s3/lib/putBucketLogging.mli | 7 +- libraries/s3/lib/putBucketNotification.ml | 29 +- libraries/s3/lib/putBucketNotification.mli | 7 +- .../lib/putBucketNotificationConfiguration.ml | 33 +- .../putBucketNotificationConfiguration.mli | 7 +- libraries/s3/lib/putBucketPolicy.ml | 30 +- libraries/s3/lib/putBucketPolicy.mli | 7 +- libraries/s3/lib/putBucketReplication.ml | 29 +- libraries/s3/lib/putBucketReplication.mli | 7 +- libraries/s3/lib/putBucketRequestPayment.ml | 30 +- libraries/s3/lib/putBucketRequestPayment.mli | 7 +- libraries/s3/lib/putBucketTagging.ml | 30 +- libraries/s3/lib/putBucketTagging.mli | 7 +- libraries/s3/lib/putBucketVersioning.ml | 29 +- libraries/s3/lib/putBucketVersioning.mli | 7 +- libraries/s3/lib/putBucketWebsite.ml | 30 +- libraries/s3/lib/putBucketWebsite.mli | 7 +- libraries/s3/lib/putObject.ml | 64 +- libraries/s3/lib/putObject.mli | 7 +- libraries/s3/lib/putObjectAcl.ml | 66 +- libraries/s3/lib/putObjectAcl.mli | 7 +- libraries/s3/lib/restoreObject.ml | 66 +- libraries/s3/lib/restoreObject.mli | 7 +- libraries/s3/lib/types.ml | 19867 ++--- libraries/s3/lib/uploadPart.ml | 65 +- libraries/s3/lib/uploadPart.mli | 7 +- libraries/s3/lib/uploadPartCopy.ml | 66 +- libraries/s3/lib/uploadPartCopy.mli | 7 +- libraries/s3/lib_test/dune | 15 +- libraries/s3/lib_test/test_async.ml | 16 +- libraries/s3/lib_test/test_lwt.ml | 16 +- libraries/sdb/lib/batchDeleteAttributes.ml | 29 +- libraries/sdb/lib/batchDeleteAttributes.mli | 7 +- libraries/sdb/lib/batchPutAttributes.ml | 51 +- libraries/sdb/lib/batchPutAttributes.mli | 7 +- libraries/sdb/lib/createDomain.ml | 39 +- libraries/sdb/lib/createDomain.mli | 7 +- libraries/sdb/lib/deleteAttributes.ml | 41 +- libraries/sdb/lib/deleteAttributes.mli | 7 +- libraries/sdb/lib/deleteDomain.ml | 32 +- libraries/sdb/lib/deleteDomain.mli | 7 +- libraries/sdb/lib/domainMetadata.ml | 77 +- libraries/sdb/lib/domainMetadata.mli | 7 +- libraries/sdb/lib/dune | 5 +- libraries/sdb/lib/errors_internal.ml | 146 +- libraries/sdb/lib/getAttributes.ml | 81 +- libraries/sdb/lib/getAttributes.mli | 7 +- libraries/sdb/lib/listDomains.ml | 78 +- libraries/sdb/lib/listDomains.mli | 7 +- libraries/sdb/lib/putAttributes.ml | 47 +- libraries/sdb/lib/putAttributes.mli | 7 +- libraries/sdb/lib/select.ml | 87 +- libraries/sdb/lib/select.mli | 7 +- libraries/sdb/lib/types.ml | 2711 +- libraries/sdb/lib_test/dune | 15 +- libraries/sdb/lib_test/test_async.ml | 16 +- libraries/sdb/lib_test/test_lwt.ml | 16 +- libraries/sqs/lib/addPermission.ml | 32 +- libraries/sqs/lib/addPermission.mli | 7 +- libraries/sqs/lib/changeMessageVisibility.ml | 34 +- libraries/sqs/lib/changeMessageVisibility.mli | 7 +- .../sqs/lib/changeMessageVisibilityBatch.ml | 84 +- .../sqs/lib/changeMessageVisibilityBatch.mli | 7 +- libraries/sqs/lib/createQueue.ml | 81 +- libraries/sqs/lib/createQueue.mli | 7 +- libraries/sqs/lib/deleteMessage.ml | 30 +- libraries/sqs/lib/deleteMessage.mli | 7 +- libraries/sqs/lib/deleteMessageBatch.ml | 87 +- libraries/sqs/lib/deleteMessageBatch.mli | 7 +- libraries/sqs/lib/deleteQueue.ml | 31 +- libraries/sqs/lib/deleteQueue.mli | 7 +- libraries/sqs/lib/dune | 5 +- libraries/sqs/lib/errors_internal.ml | 151 +- libraries/sqs/lib/getQueueAttributes.ml | 75 +- libraries/sqs/lib/getQueueAttributes.mli | 7 +- libraries/sqs/lib/getQueueUrl.ml | 77 +- libraries/sqs/lib/getQueueUrl.mli | 7 +- .../sqs/lib/listDeadLetterSourceQueues.ml | 75 +- .../sqs/lib/listDeadLetterSourceQueues.mli | 7 +- libraries/sqs/lib/listQueues.ml | 71 +- libraries/sqs/lib/listQueues.mli | 7 +- libraries/sqs/lib/purgeQueue.ml | 39 +- libraries/sqs/lib/purgeQueue.mli | 7 +- libraries/sqs/lib/receiveMessage.ml | 74 +- libraries/sqs/lib/receiveMessage.mli | 7 +- libraries/sqs/lib/removePermission.ml | 30 +- libraries/sqs/lib/removePermission.mli | 7 +- libraries/sqs/lib/sendMessage.ml | 78 +- libraries/sqs/lib/sendMessage.mli | 7 +- libraries/sqs/lib/sendMessageBatch.ml | 90 +- libraries/sqs/lib/sendMessageBatch.mli | 7 +- libraries/sqs/lib/setQueueAttributes.ml | 30 +- libraries/sqs/lib/setQueueAttributes.mli | 7 +- libraries/sqs/lib/types.ml | 3919 +- libraries/sqs/lib_test/dune | 15 +- libraries/sqs/lib_test/test_async.ml | 16 +- libraries/sqs/lib_test/test_lwt.ml | 16 +- libraries/ssm/lib/createAssociation.ml | 82 +- libraries/ssm/lib/createAssociation.mli | 7 +- libraries/ssm/lib/createAssociationBatch.ml | 79 +- libraries/ssm/lib/createAssociationBatch.mli | 7 +- libraries/ssm/lib/createDocument.ml | 79 +- libraries/ssm/lib/createDocument.mli | 7 +- libraries/ssm/lib/deleteAssociation.ml | 43 +- libraries/ssm/lib/deleteAssociation.mli | 7 +- libraries/ssm/lib/deleteDocument.ml | 39 +- libraries/ssm/lib/deleteDocument.mli | 7 +- libraries/ssm/lib/describeAssociation.ml | 79 +- libraries/ssm/lib/describeAssociation.mli | 7 +- libraries/ssm/lib/describeDocument.ml | 73 +- libraries/ssm/lib/describeDocument.mli | 7 +- libraries/ssm/lib/dune | 5 +- libraries/ssm/lib/errors_internal.ml | 143 +- libraries/ssm/lib/getDocument.ml | 72 +- libraries/ssm/lib/getDocument.mli | 7 +- libraries/ssm/lib/listAssociations.ml | 73 +- libraries/ssm/lib/listAssociations.mli | 7 +- libraries/ssm/lib/listDocuments.ml | 71 +- libraries/ssm/lib/listDocuments.mli | 7 +- libraries/ssm/lib/types.ml | 2943 +- libraries/ssm/lib/updateAssociationStatus.ml | 81 +- libraries/ssm/lib/updateAssociationStatus.mli | 7 +- libraries/ssm/lib_test/dune | 15 +- libraries/ssm/lib_test/test_async.ml | 16 +- libraries/ssm/lib_test/test_lwt.ml | 16 +- libraries/sts/lib/assumeRole.ml | 78 +- libraries/sts/lib/assumeRole.mli | 7 +- libraries/sts/lib/assumeRoleWithSAML.ml | 88 +- libraries/sts/lib/assumeRoleWithSAML.mli | 7 +- .../sts/lib/assumeRoleWithWebIdentity.ml | 86 +- .../sts/lib/assumeRoleWithWebIdentity.mli | 7 +- .../sts/lib/decodeAuthorizationMessage.ml | 75 +- .../sts/lib/decodeAuthorizationMessage.mli | 7 +- libraries/sts/lib/dune | 5 +- libraries/sts/lib/errors_internal.ml | 133 +- libraries/sts/lib/getFederationToken.ml | 80 +- libraries/sts/lib/getFederationToken.mli | 7 +- libraries/sts/lib/getSessionToken.ml | 75 +- libraries/sts/lib/getSessionToken.mli | 7 +- libraries/sts/lib/types.ml | 1978 +- libraries/sts/lib_test/dune | 15 +- libraries/sts/lib_test/test_async.ml | 16 +- libraries/sts/lib_test/test_lwt.ml | 16 +- 1236 files changed, 111176 insertions(+), 110199 deletions(-) create mode 100644 libraries/elasticmapreduce/lib/describeNotebookExecution.ml create mode 100644 libraries/elasticmapreduce/lib/describeNotebookExecution.mli create mode 100644 libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.ml create mode 100644 libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.mli create mode 100644 libraries/elasticmapreduce/lib/getManagedScalingPolicy.ml create mode 100644 libraries/elasticmapreduce/lib/getManagedScalingPolicy.mli create mode 100644 libraries/elasticmapreduce/lib/listNotebookExecutions.ml create mode 100644 libraries/elasticmapreduce/lib/listNotebookExecutions.mli create mode 100644 libraries/elasticmapreduce/lib/modifyCluster.ml create mode 100644 libraries/elasticmapreduce/lib/modifyCluster.mli create mode 100644 libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.ml create mode 100644 libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.mli create mode 100644 libraries/elasticmapreduce/lib/putManagedScalingPolicy.ml create mode 100644 libraries/elasticmapreduce/lib/putManagedScalingPolicy.mli create mode 100644 libraries/elasticmapreduce/lib/removeManagedScalingPolicy.ml create mode 100644 libraries/elasticmapreduce/lib/removeManagedScalingPolicy.mli create mode 100644 libraries/elasticmapreduce/lib/startNotebookExecution.ml create mode 100644 libraries/elasticmapreduce/lib/startNotebookExecution.mli create mode 100644 libraries/elasticmapreduce/lib/stopNotebookExecution.ml create mode 100644 libraries/elasticmapreduce/lib/stopNotebookExecution.mli diff --git a/input/emr/2009-03-31/paginators-1.json b/input/emr/2009-03-31/paginators-1.json index 67ccf4480..150d5fd98 100644 --- a/input/emr/2009-03-31/paginators-1.json +++ b/input/emr/2009-03-31/paginators-1.json @@ -29,6 +29,16 @@ "input_token": "Marker", "output_token": "Marker", "result_key": "InstanceFleets" + }, + "ListSecurityConfigurations": { + "input_token": "Marker", + "output_token": "Marker", + "result_key": "SecurityConfigurations" + }, + "ListNotebookExecutions": { + "input_token": "Marker", + "output_token": "Marker", + "result_key": "NotebookExecutions" } } } diff --git a/input/emr/2009-03-31/service-2.json b/input/emr/2009-03-31/service-2.json index e59cfabf7..e29a32891 100644 --- a/input/emr/2009-03-31/service-2.json +++ b/input/emr/2009-03-31/service-2.json @@ -7,9 +7,9 @@ "protocol":"json", "serviceAbbreviation":"Amazon EMR", "serviceFullName":"Amazon Elastic MapReduce", + "serviceId":"EMR", "signatureVersion":"v4", "targetPrefix":"ElasticMapReduce", - "timestampFormat":"unixTimestamp", "uid":"elasticmapreduce-2009-03-31" }, "operations":{ @@ -51,7 +51,7 @@ "errors":[ {"shape":"InternalServerError"} ], - "documentation":"

AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using SSH to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

A step specifies the location of a JAR file stored either on the master node of the cluster or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.

Amazon EMR executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.

You can only add steps to a cluster that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.

" + "documentation":"

AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using SSH to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

A step specifies the location of a JAR file stored either on the master node of the cluster or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.

Amazon EMR executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.

You can only add steps to a cluster that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.

" }, "AddTags":{ "name":"AddTags", @@ -65,7 +65,7 @@ {"shape":"InternalServerException"}, {"shape":"InvalidRequestException"} ], - "documentation":"

Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" + "documentation":"

Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" }, "CancelSteps":{ "name":"CancelSteps", @@ -121,7 +121,7 @@ {"shape":"InternalServerException"}, {"shape":"InvalidRequestException"} ], - "documentation":"

Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on. For information about the cluster steps, see ListSteps.

" + "documentation":"

Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.

" }, "DescribeJobFlows":{ "name":"DescribeJobFlows", @@ -137,6 +137,20 @@ "documentation":"

This API is deprecated and will eventually be removed. We recommend you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.

DescribeJobFlows returns a list of job flows that match all of the supplied parameters. The parameters can include a list of job flow IDs, job flow states, and restrictions on job flow creation date and time.

Regardless of supplied parameters, only job flows created within the last two months are returned.

If no parameters are supplied, then job flows matching either of the following criteria are returned:

  • Job flows created and completed in the last two weeks

  • Job flows created within the last two months that are in one of the following states: RUNNING, WAITING, SHUTTING_DOWN, STARTING

Amazon EMR can return a maximum of 512 job flow descriptions.

", "deprecated":true }, + "DescribeNotebookExecution":{ + "name":"DescribeNotebookExecution", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"DescribeNotebookExecutionInput"}, + "output":{"shape":"DescribeNotebookExecutionOutput"}, + "errors":[ + {"shape":"InternalServerError"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Provides details of a notebook execution.

" + }, "DescribeSecurityConfiguration":{ "name":"DescribeSecurityConfiguration", "http":{ @@ -165,6 +179,30 @@ ], "documentation":"

Provides more detail about the cluster step.

" }, + "GetBlockPublicAccessConfiguration":{ + "name":"GetBlockPublicAccessConfiguration", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"GetBlockPublicAccessConfigurationInput"}, + "output":{"shape":"GetBlockPublicAccessConfigurationOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Returns the Amazon EMR block public access configuration for your AWS account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide.

" + }, + "GetManagedScalingPolicy":{ + "name":"GetManagedScalingPolicy", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"GetManagedScalingPolicyInput"}, + "output":{"shape":"GetManagedScalingPolicyOutput"}, + "documentation":"

Fetches the attached managed scaling policy for an Amazon EMR cluster.

" + }, "ListBootstrapActions":{ "name":"ListBootstrapActions", "http":{ @@ -235,6 +273,20 @@ ], "documentation":"

Provides information for all active EC2 instances and EC2 instances terminated in the last 30 days, up to a maximum of 2,000. EC2 instances in any of the following states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.

" }, + "ListNotebookExecutions":{ + "name":"ListNotebookExecutions", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"ListNotebookExecutionsInput"}, + "output":{"shape":"ListNotebookExecutionsOutput"}, + "errors":[ + {"shape":"InternalServerError"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Provides summaries of all notebook executions. You can filter the list based on multiple criteria such as status, time range, and editor id. Returns a maximum of 50 notebook executions and a marker to track the paging of a longer notebook execution list across multiple ListNotebookExecution calls.

" + }, "ListSecurityConfigurations":{ "name":"ListSecurityConfigurations", "http":{ @@ -261,7 +313,21 @@ {"shape":"InternalServerException"}, {"shape":"InvalidRequestException"} ], - "documentation":"

Provides a list of steps for the cluster in reverse order unless you specify stepIds with the request.

" + "documentation":"

Provides a list of steps for the cluster in reverse order unless you specify stepIds with the request of filter by StepStates. You can specify a maximum of ten stepIDs.

" + }, + "ModifyCluster":{ + "name":"ModifyCluster", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"ModifyClusterInput"}, + "output":{"shape":"ModifyClusterOutput"}, + "errors":[ + {"shape":"InternalServerError"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Modifies the number of steps that can be executed concurrently for the cluster specified using ClusterID.

" }, "ModifyInstanceFleet":{ "name":"ModifyInstanceFleet", @@ -298,6 +364,30 @@ "output":{"shape":"PutAutoScalingPolicyOutput"}, "documentation":"

Creates or updates an automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric.

" }, + "PutBlockPublicAccessConfiguration":{ + "name":"PutBlockPublicAccessConfiguration", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"PutBlockPublicAccessConfigurationInput"}, + "output":{"shape":"PutBlockPublicAccessConfigurationOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Creates or updates an Amazon EMR block public access configuration for your AWS account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide.

" + }, + "PutManagedScalingPolicy":{ + "name":"PutManagedScalingPolicy", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"PutManagedScalingPolicyInput"}, + "output":{"shape":"PutManagedScalingPolicyOutput"}, + "documentation":"

Creates or updates a managed scaling policy for an Amazon EMR cluster. The managed scaling policy defines the limits for resources, such as EC2 instances that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + }, "RemoveAutoScalingPolicy":{ "name":"RemoveAutoScalingPolicy", "http":{ @@ -308,6 +398,16 @@ "output":{"shape":"RemoveAutoScalingPolicyOutput"}, "documentation":"

Removes an automatic scaling policy from a specified instance group within an EMR cluster.

" }, + "RemoveManagedScalingPolicy":{ + "name":"RemoveManagedScalingPolicy", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"RemoveManagedScalingPolicyInput"}, + "output":{"shape":"RemoveManagedScalingPolicyOutput"}, + "documentation":"

Removes a managed scaling policy from a specified EMR cluster.

" + }, "RemoveTags":{ "name":"RemoveTags", "http":{ @@ -320,7 +420,7 @@ {"shape":"InternalServerException"}, {"shape":"InvalidRequestException"} ], - "documentation":"

Removes tags from an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

The following example removes the stack tag with value Prod from a cluster:

" + "documentation":"

Removes tags from an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

The following example removes the stack tag with value Prod from a cluster:

" }, "RunJobFlow":{ "name":"RunJobFlow", @@ -333,7 +433,7 @@ "errors":[ {"shape":"InternalServerError"} ], - "documentation":"

RunJobFlow creates and starts running a new cluster (job flow). The cluster runs the steps specified. After the steps complete, the cluster stops and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the cluster transitions to the WAITING state rather than shutting down after the steps have completed.

For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the cluster and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.

A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

For long running clusters, we recommend that you periodically store your results.

The instance fleets configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow request can contain InstanceFleets parameters or InstanceGroups parameters, but not both.

" + "documentation":"

RunJobFlow creates and starts running a new cluster (job flow). The cluster runs the steps specified. After the steps complete, the cluster stops and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the cluster transitions to the WAITING state rather than shutting down after the steps have completed.

For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the cluster and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.

A maximum of 256 steps are allowed in each job flow.

If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.

For long running clusters, we recommend that you periodically store your results.

The instance fleets configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow request can contain InstanceFleets parameters or InstanceGroups parameters, but not both.

" }, "SetTerminationProtection":{ "name":"SetTerminationProtection", @@ -345,7 +445,7 @@ "errors":[ {"shape":"InternalServerError"} ], - "documentation":"

SetTerminationProtection locks a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 instances in a cluster.

SetTerminationProtection is used to prevent accidental termination of a cluster and to ensure that in the event of an error, the instances persist so that you can recover any data stored in their ephemeral instance storage.

To terminate a cluster that has been locked by setting SetTerminationProtection to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false.

For more information, seeManaging Cluster Termination in the Amazon EMR Management Guide.

" + "documentation":"

SetTerminationProtection locks a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 instances in a cluster.

SetTerminationProtection is used to prevent accidental termination of a cluster and to ensure that in the event of an error, the instances persist so that you can recover any data stored in their ephemeral instance storage.

To terminate a cluster that has been locked by setting SetTerminationProtection to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false.

For more information, seeManaging Cluster Termination in the Amazon EMR Management Guide.

" }, "SetVisibleToAllUsers":{ "name":"SetVisibleToAllUsers", @@ -357,7 +457,34 @@ "errors":[ {"shape":"InternalServerError"} ], - "documentation":"

Sets whether all AWS Identity and Access Management (IAM) users under your account can access the specified clusters (job flows). This action works on running clusters. You can also set the visibility of a cluster when you launch it using the VisibleToAllUsers parameter of RunJobFlow. The SetVisibleToAllUsers action can be called only by an IAM user who created the cluster or the AWS account that owns the cluster.

" + "documentation":"

Sets the Cluster$VisibleToAllUsers value, which determines whether the cluster is visible to all IAM users of the AWS account associated with the cluster. Only the IAM user who created the cluster or the AWS account root user can call this action. The default value, true, indicates that all IAM users in the AWS account can perform cluster actions if they have the proper IAM policy permissions. If set to false, only the IAM user that created the cluster can perform actions. This action works on running clusters. You can override the default true setting when you create a cluster by using the VisibleToAllUsers parameter with RunJobFlow.

" + }, + "StartNotebookExecution":{ + "name":"StartNotebookExecution", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"StartNotebookExecutionInput"}, + "output":{"shape":"StartNotebookExecutionOutput"}, + "errors":[ + {"shape":"InternalServerException"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Starts a notebook execution.

" + }, + "StopNotebookExecution":{ + "name":"StopNotebookExecution", + "http":{ + "method":"POST", + "requestUri":"/" + }, + "input":{"shape":"StopNotebookExecutionInput"}, + "errors":[ + {"shape":"InternalServerError"}, + {"shape":"InvalidRequestException"} + ], + "documentation":"

Stops a notebook execution.

" }, "TerminateJobFlows":{ "name":"TerminateJobFlows", @@ -409,6 +536,10 @@ "InstanceFleetId":{ "shape":"InstanceFleetId", "documentation":"

The unique identifier of the instance fleet.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" } } }, @@ -440,6 +571,10 @@ "InstanceGroupIds":{ "shape":"InstanceGroupIdsList", "documentation":"

Instance group IDs of the newly created instance groups.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" } }, "documentation":"

Output from an AddInstanceGroups call.

" @@ -524,12 +659,17 @@ "documentation":"

This option is for advanced users only. This is meta information about third-party applications that third-party vendors use for testing purposes.

" } }, - "documentation":"

An application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument. For more information, see Using the MapR Distribution for Hadoop. Currently supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.

  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.

  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the cluster using MapR M3 or M5 Edition, respectively.

In Amazon EMR releases 4.x and later, the only accepted parameter is the application name. To pass arguments to applications, you supply a configuration for each application.

" + "documentation":"

With Amazon EMR release version 4.0 and later, the only accepted parameter is the application name. To pass arguments to applications, you use configuration classifications specified using configuration JSON objects. For more information, see Configuring Applications.

With earlier Amazon EMR releases, the application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument.

" }, "ApplicationList":{ "type":"list", "member":{"shape":"Application"} }, + "ArnType":{ + "type":"string", + "max":2048, + "min":20 + }, "AutoScalingPolicy":{ "type":"structure", "required":[ @@ -613,6 +753,39 @@ }, "documentation":"

The status of an automatic scaling policy.

" }, + "BlockPublicAccessConfiguration":{ + "type":"structure", + "required":["BlockPublicSecurityGroupRules"], + "members":{ + "BlockPublicSecurityGroupRules":{ + "shape":"Boolean", + "documentation":"

Indicates whether EMR block public access is enabled (true) or disabled (false). By default, the value is false for accounts that have created EMR clusters before July 2019. For accounts created after this, the default is true.

" + }, + "PermittedPublicSecurityGroupRuleRanges":{ + "shape":"PortRanges", + "documentation":"

Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from all public sources. For example, if Port 23 (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges, Amazon EMR allows cluster creation if a security group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port ::/0 as the source.

By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of PermittedPublicSecurityGroupRuleRanges.

" + } + }, + "documentation":"

A configuration for Amazon EMR block public access. When BlockPublicSecurityGroupRules is set to true, Amazon EMR prevents cluster creation if one of the cluster's security groups has a rule that allows inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges.

" + }, + "BlockPublicAccessConfigurationMetadata":{ + "type":"structure", + "required":[ + "CreationDateTime", + "CreatedByArn" + ], + "members":{ + "CreationDateTime":{ + "shape":"Date", + "documentation":"

The date and time that the configuration was created.

" + }, + "CreatedByArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name that created or last modified the configuration.

" + } + }, + "documentation":"

Properties that describe the AWS principal that created the BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration action as well as the date and time that the configuration was created. Each time a configuration for block public access is updated, Amazon EMR updates this metadata.

" + }, "Boolean":{"type":"boolean"}, "BooleanObject":{"type":"boolean"}, "BootstrapActionConfig":{ @@ -675,6 +848,10 @@ }, "CancelStepsInput":{ "type":"structure", + "required":[ + "ClusterId", + "StepIds" + ], "members":{ "ClusterId":{ "shape":"XmlStringMaxLen256", @@ -683,6 +860,10 @@ "StepIds":{ "shape":"StepIdsList", "documentation":"

The list of StepIDs to cancel. Use ListSteps to get steps and their states for the specified cluster.

" + }, + "StepCancellationOption":{ + "shape":"StepCancellationOption", + "documentation":"

The option to choose for cancelling RUNNING steps. By default, the value is SEND_INTERRUPT.

" } }, "documentation":"

The input argument to the CancelSteps operation.

" @@ -719,7 +900,7 @@ }, "EvaluationPeriods":{ "shape":"Integer", - "documentation":"

The number of periods, expressed in seconds using Period, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.

" + "documentation":"

The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.

" }, "MetricName":{ "shape":"String", @@ -779,6 +960,10 @@ "shape":"String", "documentation":"

The path to the Amazon S3 location where logs for this cluster are stored.

" }, + "LogEncryptionKmsKeyId":{ + "shape":"String", + "documentation":"

The AWS KMS customer master key (CMK) used for encrypting log files. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0.

" + }, "RequestedAmiVersion":{ "shape":"String", "documentation":"

The AMI version requested for this cluster.

" @@ -789,7 +974,7 @@ }, "ReleaseLabel":{ "shape":"String", - "documentation":"

The release label for the Amazon EMR release.

" + "documentation":"

The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster. Release labels are in the form emr-x.x.x, where x.x.x is an Amazon EMR release version such as emr-5.14.0. For more information about Amazon EMR release versions and included application versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/. The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion.

" }, "AutoTerminate":{ "shape":"Boolean", @@ -801,7 +986,7 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and manage the cluster if they have the proper policy permissions set. If this value is false, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" + "documentation":"

Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster. The default value, true, indicates that all IAM users in the AWS account can perform cluster actions if they have the proper IAM policy permissions. If this value is false, only the IAM user that created the cluster can perform actions. This value can be changed on a running cluster by using the SetVisibleToAllUsers action. You can override the default value of true when you create a cluster by using the VisibleToAllUsers parameter of the RunJobFlow action.

" }, "Applications":{ "shape":"ApplicationList", @@ -853,7 +1038,23 @@ }, "KerberosAttributes":{ "shape":"KerberosAttributes", - "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" + }, + "OutpostArn":{ + "shape":"OptionalArnType", + "documentation":"

The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.

" + }, + "StepConcurrencyLevel":{ + "shape":"Integer", + "documentation":"

Specifies the number of steps that can be executed concurrently.

" + }, + "PlacementGroups":{ + "shape":"PlacementGroupConfigList", + "documentation":"

Placement group configured for an Amazon EMR cluster.

" } }, "documentation":"

The detailed description of the cluster.

" @@ -938,6 +1139,14 @@ "NormalizedInstanceHours":{ "shape":"Integer", "documentation":"

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" + }, + "OutpostArn":{ + "shape":"OptionalArnType", + "documentation":"

The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.

" } }, "documentation":"

The summary description of the cluster.

" @@ -995,6 +1204,45 @@ "LESS_THAN_OR_EQUAL" ] }, + "ComputeLimits":{ + "type":"structure", + "required":[ + "UnitType", + "MinimumCapacityUnits", + "MaximumCapacityUnits" + ], + "members":{ + "UnitType":{ + "shape":"ComputeLimitsUnitType", + "documentation":"

The unit type used for specifying a managed scaling policy.

" + }, + "MinimumCapacityUnits":{ + "shape":"Integer", + "documentation":"

The lower boundary of EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + }, + "MaximumCapacityUnits":{ + "shape":"Integer", + "documentation":"

The upper boundary of EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + }, + "MaximumOnDemandCapacityUnits":{ + "shape":"Integer", + "documentation":"

The upper boundary of On-Demand EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot instances.

" + }, + "MaximumCoreCapacityUnits":{ + "shape":"Integer", + "documentation":"

The upper boundary of EC2 units for core node type in a cluster. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.

" + } + }, + "documentation":"

The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster can not be above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + }, + "ComputeLimitsUnitType":{ + "type":"string", + "enum":[ + "InstanceFleetUnits", + "Instances", + "VCPU" + ] + }, "Configuration":{ "type":"structure", "members":{ @@ -1011,7 +1259,7 @@ "documentation":"

A set of properties specified within a configuration classification.

" } }, - "documentation":"

Amazon EMR releases 4.x or later.

An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.

" + "documentation":"

Amazon EMR releases 4.x or later.

An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.

" }, "ConfigurationList":{ "type":"list", @@ -1030,7 +1278,7 @@ }, "SecurityConfiguration":{ "shape":"String", - "documentation":"

The security configuration details in JSON format. For JSON parameters and examples, see Use Security Configurations to Set Up Cluster Security in the Amazon EMR Management Guide.

" + "documentation":"

The security configuration details in JSON format. For JSON parameters and examples, see Use Security Configurations to Set Up Cluster Security in the Amazon EMR Management Guide.

" } } }, @@ -1120,6 +1368,25 @@ }, "documentation":"

The output for the DescribeJobFlows operation.

" }, + "DescribeNotebookExecutionInput":{ + "type":"structure", + "required":["NotebookExecutionId"], + "members":{ + "NotebookExecutionId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the notebook execution.

" + } + } + }, + "DescribeNotebookExecutionOutput":{ + "type":"structure", + "members":{ + "NotebookExecution":{ + "shape":"NotebookExecution", + "documentation":"

Properties of the notebook execution.

" + } + } + }, "DescribeSecurityConfigurationInput":{ "type":"structure", "required":["Name"], @@ -1261,11 +1528,11 @@ }, "Ec2SubnetId":{ "shape":"String", - "documentation":"

To launch the cluster in Amazon VPC, set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, the cluster is launched in the normal AWS cloud, outside of a VPC.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus, you cannot specify the cc1.4xlarge instance type for nodes of a cluster launched in a VPC.

" + "documentation":"

Set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, and your account supports EC2-Classic, the cluster launches in EC2-Classic.

" }, "RequestedEc2SubnetIds":{ "shape":"XmlStringMaxLen256List", - "documentation":"

Applies to clusters configured with the instance fleets option. Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among the list of RequestedEc2SubnetIds, and then launches all cluster instances within that Subnet. If this value is not specified, and the account and region support EC2-Classic networks, the cluster launches instances in the EC2-Classic network and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.

" + "documentation":"

Applies to clusters configured with the instance fleets option. Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among the list of RequestedEc2SubnetIds, and then launches all cluster instances within that Subnet. If this value is not specified, and the account and Region support EC2-Classic networks, the cluster launches instances in the EC2-Classic network and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.

" }, "Ec2AvailabilityZone":{ "shape":"String", @@ -1285,7 +1552,7 @@ }, "EmrManagedSlaveSecurityGroup":{ "shape":"String", - "documentation":"

The identifier of the Amazon EC2 security group for the slave nodes.

" + "documentation":"

The identifier of the Amazon EC2 security group for the core and task nodes.

" }, "ServiceAccessSecurityGroup":{ "shape":"String", @@ -1297,7 +1564,7 @@ }, "AdditionalSlaveSecurityGroups":{ "shape":"StringList", - "documentation":"

A list of additional Amazon EC2 security group IDs for the slave nodes.

" + "documentation":"

A list of additional Amazon EC2 security group IDs for the core and task nodes.

" } }, "documentation":"

Provides information about the EC2 instances in a cluster grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.

" @@ -1308,6 +1575,29 @@ "min":1 }, "ErrorMessage":{"type":"string"}, + "ExecutionEngineConfig":{ + "type":"structure", + "required":["Id"], + "members":{ + "Id":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the execution engine. For an EMR cluster, this is the cluster ID.

" + }, + "Type":{ + "shape":"ExecutionEngineType", + "documentation":"

The type of execution engine. A value of EMR specifies an EMR cluster.

" + }, + "MasterInstanceSecurityGroupId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

An optional unique ID of an EC2 security group to associate with the master instance of the EMR cluster for this notebook execution. For more information see Specifying EC2 Security Groups for EMR Notebooks in the EMR Management Guide.

" + } + }, + "documentation":"

Specifies the execution engine (cluster) to run the notebook and perform the notebook execution, for example, an EMR cluster.

" + }, + "ExecutionEngineType":{ + "type":"string", + "enum":["EMR"] + }, "FailureDetails":{ "type":"structure", "members":{ @@ -1326,6 +1616,47 @@ }, "documentation":"

The details of the step failure. The service attempts to detect the root cause for many common failures.

" }, + "GetBlockPublicAccessConfigurationInput":{ + "type":"structure", + "members":{ + } + }, + "GetBlockPublicAccessConfigurationOutput":{ + "type":"structure", + "required":[ + "BlockPublicAccessConfiguration", + "BlockPublicAccessConfigurationMetadata" + ], + "members":{ + "BlockPublicAccessConfiguration":{ + "shape":"BlockPublicAccessConfiguration", + "documentation":"

A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration. By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating the block public access configuration to remove the exception.

For accounts that created clusters in a Region before November 25, 2019, block public access is disabled by default in that Region. To use this feature, you must manually enable and configure it. For accounts that did not create an EMR cluster in a Region before this date, block public access is enabled by default in that Region.

" + }, + "BlockPublicAccessConfigurationMetadata":{ + "shape":"BlockPublicAccessConfigurationMetadata", + "documentation":"

Properties that describe the AWS principal that created the BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration action as well as the date and time that the configuration was created. Each time a configuration for block public access is updated, Amazon EMR updates this metadata.

" + } + } + }, + "GetManagedScalingPolicyInput":{ + "type":"structure", + "required":["ClusterId"], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of the cluster for which the managed scaling policy will be fetched.

" + } + } + }, + "GetManagedScalingPolicyOutput":{ + "type":"structure", + "members":{ + "ManagedScalingPolicy":{ + "shape":"ManagedScalingPolicy", + "documentation":"

Specifies the managed scaling policy that is attached to an Amazon EMR cluster.

" + } + } + }, "HadoopJarStepConfig":{ "type":"structure", "required":["Jar"], @@ -1539,14 +1870,17 @@ }, "InstanceFleetProvisioningSpecifications":{ "type":"structure", - "required":["SpotSpecification"], "members":{ "SpotSpecification":{ "shape":"SpotProvisioningSpecification", - "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.

" + "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.

" + }, + "OnDemandSpecification":{ + "shape":"OnDemandProvisioningSpecification", + "documentation":"

The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand instances allocation strategy is available in Amazon EMR version 5.12.1 and later.

" } }, - "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + "documentation":"

The launch specification for Spot instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand and Spot instance allocation strategies are available in Amazon EMR version 5.12.1 and later.

" }, "InstanceFleetState":{ "type":"string", @@ -1648,7 +1982,7 @@ }, "BidPrice":{ "shape":"String", - "documentation":"

The bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

" + "documentation":"

The bid price for each EC2 Spot instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.

" }, "InstanceType":{ "shape":"InstanceType", @@ -1670,6 +2004,18 @@ "shape":"ConfigurationList", "documentation":"

Amazon EMR releases 4.x or later.

The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).

" }, + "ConfigurationsVersion":{ + "shape":"Long", + "documentation":"

The version number of the requested configuration specification for this instance group.

" + }, + "LastSuccessfullyAppliedConfigurations":{ + "shape":"ConfigurationList", + "documentation":"

A list of configurations that were successfully applied for an instance group last time.

" + }, + "LastSuccessfullyAppliedConfigurationsVersion":{ + "shape":"Long", + "documentation":"

The version number of a configuration specification that was successfully applied for an instance group last time.

" + }, "EbsBlockDevices":{ "shape":"EbsBlockDeviceList", "documentation":"

The EBS block devices that are mapped to this instance group.

" @@ -1711,7 +2057,7 @@ }, "BidPrice":{ "shape":"XmlStringMaxLen256", - "documentation":"

Bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

" + "documentation":"

The bid price for each EC2 Spot instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.

" }, "InstanceType":{ "shape":"InstanceType", @@ -1770,7 +2116,7 @@ }, "BidPrice":{ "shape":"XmlStringMaxLen256", - "documentation":"

Bid price for EC2 Instances when launching nodes as Spot Instances, expressed in USD.

" + "documentation":"

The bid price for each EC2 Spot instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.

" }, "InstanceType":{ "shape":"InstanceType", @@ -1843,9 +2189,13 @@ "ShrinkPolicy":{ "shape":"ShrinkPolicy", "documentation":"

Policy for customizing shrink operations.

" + }, + "Configurations":{ + "shape":"ConfigurationList", + "documentation":"

A list of new or modified configurations to apply for an instance group.

" } }, - "documentation":"

Modify an instance group size.

" + "documentation":"

Modify the size or configurations of an instance group.

" }, "InstanceGroupModifyConfigList":{ "type":"list", @@ -1857,6 +2207,7 @@ "PROVISIONING", "BOOTSTRAPPING", "RUNNING", + "RECONFIGURING", "RESIZING", "SUSPENDED", "TERMINATING", @@ -2177,9 +2528,13 @@ "shape":"XmlString", "documentation":"

The location in Amazon S3 where log files for the job are stored.

" }, + "LogEncryptionKmsKeyId":{ + "shape":"XmlString", + "documentation":"

The AWS KMS customer master key (CMK) used for encrypting log files. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0.

" + }, "AmiVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

Used only for version 2.x and 3.x of Amazon EMR. The version of the AMI used to initialize Amazon EC2 instances in the job flow. For a list of AMI versions supported by Amazon EMR, see AMI Versions Supported in EMR in the Amazon EMR Developer Guide.

" + "documentation":"

Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID.

" }, "ExecutionStatusDetail":{ "shape":"JobFlowExecutionStatusDetail", @@ -2203,7 +2558,7 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Specifies whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the cluster. If it is set to false, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

" + "documentation":"

Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster. The default value, true, indicates that all IAM users in the AWS account can perform cluster actions if they have the proper IAM policy permissions. If this value is false, only the IAM user that created the cluster can perform actions. This value can be changed on a running cluster by using the SetVisibleToAllUsers action. You can override the default value of true when you create a cluster by using the VisibleToAllUsers parameter of the RunJobFlow action.

" }, "JobFlowRole":{ "shape":"XmlString", @@ -2289,7 +2644,7 @@ }, "SlaveInstanceType":{ "shape":"InstanceType", - "documentation":"

The EC2 instance type of the slave nodes.

" + "documentation":"

The EC2 instance type of the core and task nodes.

" }, "InstanceCount":{ "shape":"Integer", @@ -2321,11 +2676,11 @@ }, "HadoopVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

The Hadoop version for the cluster. Valid inputs are \"0.18\" (deprecated), \"0.20\" (deprecated), \"0.20.205\" (deprecated), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.

" + "documentation":"

Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid inputs are \"0.18\" (deprecated), \"0.20\" (deprecated), \"0.20.205\" (deprecated), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.

" }, "Ec2SubnetId":{ "shape":"XmlStringMaxLen256", - "documentation":"

Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, the cluster launches in the normal Amazon Web Services cloud, outside of an Amazon VPC, if the account launching the cluster supports EC2 Classic networks in the region where the cluster launches.

Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus you cannot specify the cc1.4xlarge instance type for clusters launched in an Amazon VPC.

" + "documentation":"

Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value and your account supports EC2-Classic, the cluster launches in EC2-Classic.

" }, "Ec2SubnetIds":{ "shape":"XmlStringMaxLen256List", @@ -2337,7 +2692,7 @@ }, "EmrManagedSlaveSecurityGroup":{ "shape":"XmlStringMaxLen256", - "documentation":"

The identifier of the Amazon EC2 security group for the slave nodes.

" + "documentation":"

The identifier of the Amazon EC2 security group for the core and task nodes.

" }, "ServiceAccessSecurityGroup":{ "shape":"XmlStringMaxLen256", @@ -2349,7 +2704,7 @@ }, "AdditionalSlaveSecurityGroups":{ "shape":"SecurityGroupsList", - "documentation":"

A list of additional Amazon EC2 security group IDs for the slave nodes.

" + "documentation":"

A list of additional Amazon EC2 security group IDs for the core and task nodes.

" } }, "documentation":"

A description of the Amazon EC2 instance on which the cluster (job flow) runs. A valid JobFlowInstancesConfig must contain either InstanceGroups or InstanceFleets, which is the recommended configuration. They cannot be used together. You may also have MasterInstanceType, SlaveInstanceType, and InstanceCount (all three must be present), but we don't recommend this configuration.

" @@ -2376,11 +2731,11 @@ }, "SlaveInstanceType":{ "shape":"InstanceType", - "documentation":"

The Amazon EC2 slave node instance type.

" + "documentation":"

The Amazon EC2 core and task node instance type.

" }, "InstanceCount":{ "shape":"Integer", - "documentation":"

The number of Amazon EC2 instances in the cluster. If the value is 1, the same instance serves as both the master and slave node. If the value is greater than 1, one instance is the master node and all others are slave nodes.

" + "documentation":"

The number of Amazon EC2 instances in the cluster. If the value is 1, the same instance serves as both the master and core and task node. If the value is greater than 1, one instance is the master node and all others are core and task nodes.

" }, "InstanceGroups":{ "shape":"InstanceGroupDetailList", @@ -2445,7 +2800,7 @@ "documentation":"

The Active Directory password for ADDomainJoinUser.

" } }, - "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" }, "KeyValue":{ "type":"structure", @@ -2635,6 +2990,44 @@ }, "documentation":"

This output contains the list of instances.

" }, + "ListNotebookExecutionsInput":{ + "type":"structure", + "members":{ + "EditorId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique ID of the editor associated with the notebook execution.

" + }, + "Status":{ + "shape":"NotebookExecutionStatus", + "documentation":"

The status filter for listing notebook executions.

  • START_PENDING indicates that the cluster has received the execution request but execution has not begun.

  • STARTING indicates that the execution is starting on the cluster.

  • RUNNING indicates that the execution is being processed by the cluster.

  • FINISHING indicates that execution processing is in the final stages.

  • FINISHED indicates that the execution has completed without error.

  • FAILING indicates that the execution is failing and will not finish successfully.

  • FAILED indicates that the execution failed.

  • STOP_PENDING indicates that the cluster has received a StopNotebookExecution request and the stop is pending.

  • STOPPING indicates that the cluster is in the process of stopping the execution as a result of a StopNotebookExecution request.

  • STOPPED indicates that the execution stopped because of a StopNotebookExecution request.

" + }, + "From":{ + "shape":"Date", + "documentation":"

The beginning of time range filter for listing notebook executions. The default is the timestamp of 30 days ago.

" + }, + "To":{ + "shape":"Date", + "documentation":"

The end of time range filter for listing notebook executions. The default is the current timestamp.

" + }, + "Marker":{ + "shape":"Marker", + "documentation":"

The pagination token, returned by a previous ListNotebookExecutions call, that indicates the start of the list for this ListNotebookExecutions call.

" + } + } + }, + "ListNotebookExecutionsOutput":{ + "type":"structure", + "members":{ + "NotebookExecutions":{ + "shape":"NotebookExecutionSummaryList", + "documentation":"

A list of notebook executions.

" + }, + "Marker":{ + "shape":"Marker", + "documentation":"

A pagination token that a subsequent ListNotebookExecutions can use to determine the next set of results to retrieve.

" + } + } + }, "ListSecurityConfigurationsInput":{ "type":"structure", "members":{ @@ -2671,7 +3064,7 @@ }, "StepIds":{ "shape":"XmlStringList", - "documentation":"

The filter to limit the step list based on the identifier of the steps.

" + "documentation":"

The filter to limit the step list based on the identifier of the steps. You can specify a maximum of ten Step IDs. The character constraint applies to the overall length of the array.

" }, "Marker":{ "shape":"Marker", @@ -2694,6 +3087,17 @@ }, "documentation":"

This output contains the list of steps returned in reverse order. This means that the last step is the first element in the list.

" }, + "Long":{"type":"long"}, + "ManagedScalingPolicy":{ + "type":"structure", + "members":{ + "ComputeLimits":{ + "shape":"ComputeLimits", + "documentation":"

The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + } + }, + "documentation":"

Managed scaling policy for an Amazon EMR cluster. The policy specifies the limits for resources that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

" + }, "Marker":{"type":"string"}, "MarketType":{ "type":"string", @@ -2720,6 +3124,29 @@ "type":"list", "member":{"shape":"MetricDimension"} }, + "ModifyClusterInput":{ + "type":"structure", + "required":["ClusterId"], + "members":{ + "ClusterId":{ + "shape":"String", + "documentation":"

The unique identifier of the cluster.

" + }, + "StepConcurrencyLevel":{ + "shape":"Integer", + "documentation":"

The number of steps that can be executed concurrently. You can specify a maximum of 256 steps.

" + } + } + }, + "ModifyClusterOutput":{ + "type":"structure", + "members":{ + "StepConcurrencyLevel":{ + "shape":"Integer", + "documentation":"

The number of steps that can be executed concurrently.

" + } + } + }, "ModifyInstanceFleetInput":{ "type":"structure", "required":[ @@ -2759,6 +3186,161 @@ "type":"double", "min":0.0 }, + "NotebookExecution":{ + "type":"structure", + "members":{ + "NotebookExecutionId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of a notebook execution.

" + }, + "EditorId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the EMR Notebook that is used for the notebook execution.

" + }, + "ExecutionEngine":{ + "shape":"ExecutionEngineConfig", + "documentation":"

The execution engine, such as an EMR cluster, used to run the EMR notebook and perform the notebook execution.

" + }, + "NotebookExecutionName":{ + "shape":"XmlStringMaxLen256", + "documentation":"

A name for the notebook execution.

" + }, + "NotebookParams":{ + "shape":"XmlString", + "documentation":"

Input parameters in JSON format passed to the EMR Notebook at runtime for execution.

" + }, + "Status":{ + "shape":"NotebookExecutionStatus", + "documentation":"

The status of the notebook execution.

  • START_PENDING indicates that the cluster has received the execution request but execution has not begun.

  • STARTING indicates that the execution is starting on the cluster.

  • RUNNING indicates that the execution is being processed by the cluster.

  • FINISHING indicates that execution processing is in the final stages.

  • FINISHED indicates that the execution has completed without error.

  • FAILING indicates that the execution is failing and will not finish successfully.

  • FAILED indicates that the execution failed.

  • STOP_PENDING indicates that the cluster has received a StopNotebookExecution request and the stop is pending.

  • STOPPING indicates that the cluster is in the process of stopping the execution as a result of a StopNotebookExecution request.

  • STOPPED indicates that the execution stopped because of a StopNotebookExecution request.

" + }, + "StartTime":{ + "shape":"Date", + "documentation":"

The timestamp when notebook execution started.

" + }, + "EndTime":{ + "shape":"Date", + "documentation":"

The timestamp when notebook execution ended.

" + }, + "Arn":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The Amazon Resource Name (ARN) of the notebook execution.

" + }, + "OutputNotebookURI":{ + "shape":"XmlString", + "documentation":"

The location of the notebook execution's output file in Amazon S3.

" + }, + "LastStateChangeReason":{ + "shape":"XmlString", + "documentation":"

The reason for the latest status change of the notebook execution.

" + }, + "NotebookInstanceSecurityGroupId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the EC2 security group associated with the EMR Notebook instance. For more information see Specifying EC2 Security Groups for EMR Notebooks in the EMR Management Guide.

" + }, + "Tags":{ + "shape":"TagList", + "documentation":"

A list of tags associated with a notebook execution. Tags are user-defined key value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.

" + } + }, + "documentation":"

A notebook execution. An execution is a specific instance that an EMR Notebook is run using the StartNotebookExecution action.

" + }, + "NotebookExecutionStatus":{ + "type":"string", + "enum":[ + "START_PENDING", + "STARTING", + "RUNNING", + "FINISHING", + "FINISHED", + "FAILING", + "FAILED", + "STOP_PENDING", + "STOPPING", + "STOPPED" + ] + }, + "NotebookExecutionSummary":{ + "type":"structure", + "members":{ + "NotebookExecutionId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the notebook execution.

" + }, + "EditorId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the editor associated with the notebook execution.

" + }, + "NotebookExecutionName":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The name of the notebook execution.

" + }, + "Status":{ + "shape":"NotebookExecutionStatus", + "documentation":"

The status of the notebook execution.

  • START_PENDING indicates that the cluster has received the execution request but execution has not begun.

  • STARTING indicates that the execution is starting on the cluster.

  • RUNNING indicates that the execution is being processed by the cluster.

  • FINISHING indicates that execution processing is in the final stages.

  • FINISHED indicates that the execution has completed without error.

  • FAILING indicates that the execution is failing and will not finish successfully.

  • FAILED indicates that the execution failed.

  • STOP_PENDING indicates that the cluster has received a StopNotebookExecution request and the stop is pending.

  • STOPPING indicates that the cluster is in the process of stopping the execution as a result of a StopNotebookExecution request.

  • STOPPED indicates that the execution stopped because of a StopNotebookExecution request.

" + }, + "StartTime":{ + "shape":"Date", + "documentation":"

The timestamp when notebook execution started.

" + }, + "EndTime":{ + "shape":"Date", + "documentation":"

The timestamp when notebook execution started.

" + } + }, + "documentation":"

" + }, + "NotebookExecutionSummaryList":{ + "type":"list", + "member":{"shape":"NotebookExecutionSummary"} + }, + "OnDemandProvisioningAllocationStrategy":{ + "type":"string", + "enum":["lowest-price"] + }, + "OnDemandProvisioningSpecification":{ + "type":"structure", + "required":["AllocationStrategy"], + "members":{ + "AllocationStrategy":{ + "shape":"OnDemandProvisioningAllocationStrategy", + "documentation":"

Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.

" + } + }, + "documentation":"

The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand instances allocation strategy is available in Amazon EMR version 5.12.1 and later.

" + }, + "OptionalArnType":{ + "type":"string", + "max":2048, + "min":0 + }, + "PlacementGroupConfig":{ + "type":"structure", + "required":["InstanceRole"], + "members":{ + "InstanceRole":{ + "shape":"InstanceRoleType", + "documentation":"

Role of the instance in the cluster.

Starting with Amazon EMR version 5.23.0, the only supported instance role is MASTER.

" + }, + "PlacementStrategy":{ + "shape":"PlacementGroupStrategy", + "documentation":"

EC2 Placement Group strategy associated with instance role.

Starting with Amazon EMR version 5.23.0, the only supported placement strategy is SPREAD for the MASTER instance role.

" + } + }, + "documentation":"

Placement group configuration for an Amazon EMR cluster. The configuration specifies the placement strategy that can be applied to instance roles during cluster creation.

To use this configuration, consider attaching managed policy AmazonElasticMapReducePlacementGroupPolicy to the EMR role.

" + }, + "PlacementGroupConfigList":{ + "type":"list", + "member":{"shape":"PlacementGroupConfig"} + }, + "PlacementGroupStrategy":{ + "type":"string", + "enum":[ + "SPREAD", + "PARTITION", + "CLUSTER", + "NONE" + ] + }, "PlacementType":{ "type":"structure", "members":{ @@ -2773,6 +3355,30 @@ }, "documentation":"

The Amazon EC2 Availability Zone configuration of the cluster (job flow).

" }, + "Port":{ + "type":"integer", + "max":65535, + "min":-1 + }, + "PortRange":{ + "type":"structure", + "required":["MinRange"], + "members":{ + "MinRange":{ + "shape":"Port", + "documentation":"

The smallest port number in a specified range of port numbers.

" + }, + "MaxRange":{ + "shape":"Port", + "documentation":"

The smallest port number in a specified range of port numbers.

" + } + }, + "documentation":"

A list of port ranges that are permitted to allow inbound traffic from all public IP addresses. To specify a single port, use the same value for MinRange and MaxRange.

" + }, + "PortRanges":{ + "type":"list", + "member":{"shape":"PortRange"} + }, "PutAutoScalingPolicyInput":{ "type":"structure", "required":[ @@ -2809,9 +3415,50 @@ "AutoScalingPolicy":{ "shape":"AutoScalingPolicyDescription", "documentation":"

The automatic scaling policy definition.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" } } }, + "PutBlockPublicAccessConfigurationInput":{ + "type":"structure", + "required":["BlockPublicAccessConfiguration"], + "members":{ + "BlockPublicAccessConfiguration":{ + "shape":"BlockPublicAccessConfiguration", + "documentation":"

A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration. By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating BlockPublicSecurityGroupRules to remove the exception.

For accounts that created clusters in a Region before November 25, 2019, block public access is disabled by default in that Region. To use this feature, you must manually enable and configure it. For accounts that did not create an EMR cluster in a Region before this date, block public access is enabled by default in that Region.

" + } + } + }, + "PutBlockPublicAccessConfigurationOutput":{ + "type":"structure", + "members":{ + } + }, + "PutManagedScalingPolicyInput":{ + "type":"structure", + "required":[ + "ClusterId", + "ManagedScalingPolicy" + ], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of an EMR cluster where the managed scaling policy is attached.

" + }, + "ManagedScalingPolicy":{ + "shape":"ManagedScalingPolicy", + "documentation":"

Specifies the constraints for the managed scaling policy.

" + } + } + }, + "PutManagedScalingPolicyOutput":{ + "type":"structure", + "members":{ + } + }, "RemoveAutoScalingPolicyInput":{ "type":"structure", "required":[ @@ -2834,6 +3481,21 @@ "members":{ } }, + "RemoveManagedScalingPolicyInput":{ + "type":"structure", + "required":["ClusterId"], + "members":{ + "ClusterId":{ + "shape":"ClusterId", + "documentation":"

Specifies the ID of the cluster from which the managed scaling policy will be removed.

" + } + } + }, + "RemoveManagedScalingPolicyOutput":{ + "type":"structure", + "members":{ + } + }, "RemoveTagsInput":{ "type":"structure", "required":[ @@ -2881,17 +3543,21 @@ "shape":"XmlString", "documentation":"

The location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created.

" }, + "LogEncryptionKmsKeyId":{ + "shape":"XmlString", + "documentation":"

The AWS KMS customer master key (CMK) used for encrypting log files. If a value is not provided, the logs will remain encrypted by AES-256. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0.

" + }, "AdditionalInfo":{ "shape":"XmlString", "documentation":"

A JSON string for selecting additional features.

" }, "AmiVersion":{ "shape":"XmlStringMaxLen256", - "documentation":"

For Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, the Linux AMI is determined by the ReleaseLabel specified or by CustomAmiID. The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. For details about the AMI versions currently supported in EMR version 3.x and 2.x, see AMI Versions Supported in EMR in the Amazon EMR Developer Guide.

If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20), you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above.

Previously, the EMR AMI version API parameter options allowed you to use latest for the latest AMI version rather than specify a numerical value. Some regions no longer support this deprecated option as they only have a newer release label version of EMR, which requires you to specify an EMR release label release (EMR 4.x or later).

" + "documentation":"

Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID.

" }, "ReleaseLabel":{ "shape":"XmlStringMaxLen256", - "documentation":"

The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use AmiVersion instead.

" + "documentation":"

The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster. Release labels are in the form emr-x.x.x, where x.x.x is an Amazon EMR release version such as emr-5.14.0. For more information about Amazon EMR release versions and included application versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/. The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion.

" }, "Instances":{ "shape":"JobFlowInstancesConfig", @@ -2907,15 +3573,15 @@ }, "SupportedProducts":{ "shape":"SupportedProductsList", - "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use. For more information, see the Amazon EMR Developer Guide. Currently supported values are:

  • \"mapr-m3\" - launch the job flow using MapR M3 Edition.

  • \"mapr-m5\" - launch the job flow using MapR M5 Edition.

" + "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use. For more information, see the Amazon EMR Developer Guide. Currently supported values are:

  • \"mapr-m3\" - launch the job flow using MapR M3 Edition.

  • \"mapr-m5\" - launch the job flow using MapR M5 Edition.

" }, "NewSupportedProducts":{ "shape":"NewSupportedProductsList", - "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use with the job flow that accepts a user argument list. EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action arguments. For more information, see \"Launch a Job Flow on the MapR Distribution for Hadoop\" in the Amazon EMR Developer Guide. Supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.

  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.

  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition respectively.

  • \"mapr-m7\" - launch the cluster using MapR M7 Edition.

  • \"hunk\" - launch the cluster with the Hunk Big Data Analtics Platform.

  • \"hue\"- launch the cluster with Hue installed.

  • \"spark\" - launch the cluster with Apache Spark installed.

  • \"ganglia\" - launch the cluster with the Ganglia Monitoring System installed.

" + "documentation":"

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.

A list of strings that indicates third-party software to use with the job flow that accepts a user argument list. EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action arguments. For more information, see \"Launch a Job Flow on the MapR Distribution for Hadoop\" in the Amazon EMR Developer Guide. Supported values are:

  • \"mapr-m3\" - launch the cluster using MapR M3 Edition.

  • \"mapr-m5\" - launch the cluster using MapR M5 Edition.

  • \"mapr\" with the user arguments specifying \"--edition,m3\" or \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition respectively.

  • \"mapr-m7\" - launch the cluster using MapR M7 Edition.

  • \"hunk\" - launch the cluster with the Hunk Big Data Analtics Platform.

  • \"hue\"- launch the cluster with Hue installed.

  • \"spark\" - launch the cluster with Apache Spark installed.

  • \"ganglia\" - launch the cluster with the Ganglia Monitoring System installed.

" }, "Applications":{ "shape":"ApplicationList", - "documentation":"

For Amazon EMR releases 4.0 and later. A list of applications for the cluster. Valid values are: \"Hadoop\", \"Hive\", \"Mahout\", \"Pig\", and \"Spark.\" They are case insensitive.

" + "documentation":"

Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of applications for Amazon EMR to install and configure when launching the cluster. For a list of applications available for each Amazon EMR release version, see the Amazon EMR Release Guide.

" }, "Configurations":{ "shape":"ConfigurationList", @@ -2923,7 +3589,7 @@ }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set to true, all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the cluster. If it is set to false, only the IAM user that created the cluster can view and manage it.

" + "documentation":"

A value of true indicates that all IAM users in the AWS account can perform cluster actions if they have the proper IAM policy permissions. This is the default. A value of false indicates that only the IAM user who created the cluster can perform actions.

" }, "JobFlowRole":{ "shape":"XmlString", @@ -2951,7 +3617,7 @@ }, "CustomAmiId":{ "shape":"XmlStringMaxLen256", - "documentation":"

Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it launches cluster EC2 instances. For more information about custom AMIs in Amazon EMR, see Using a Custom AMI in the Amazon EMR Management Guide. If omitted, the cluster uses the base Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and 3.x, use AmiVersion instead.

For information about creating a custom AMI, see Creating an Amazon EBS-Backed Linux AMI in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For information about finding an AMI ID, see Finding a Linux AMI.

" + "documentation":"

Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it launches cluster EC2 instances. For more information about custom AMIs in Amazon EMR, see Using a Custom AMI in the Amazon EMR Management Guide. If omitted, the cluster uses the base Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and 3.x, use AmiVersion instead.

For information about creating a custom AMI, see Creating an Amazon EBS-Backed Linux AMI in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For information about finding an AMI ID, see Finding a Linux AMI.

" }, "EbsRootVolumeSize":{ "shape":"Integer", @@ -2963,7 +3629,19 @@ }, "KerberosAttributes":{ "shape":"KerberosAttributes", - "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" + "documentation":"

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the EMR Management Guide.

" + }, + "StepConcurrencyLevel":{ + "shape":"Integer", + "documentation":"

Specifies the number of steps that can be executed concurrently. The default value is 1. The maximum value is 256.

" + }, + "ManagedScalingPolicy":{ + "shape":"ManagedScalingPolicy", + "documentation":"

The specified managed scaling policy for an Amazon EMR cluster.

" + }, + "PlacementGroupConfigs":{ + "shape":"PlacementGroupConfigList", + "documentation":"

The specified placement group configuration for an Amazon EMR cluster.

" } }, "documentation":"

Input to the RunJobFlow operation.

" @@ -2974,6 +3652,10 @@ "JobFlowId":{ "shape":"XmlStringMaxLen256", "documentation":"

An unique identifier for the job flow.

" + }, + "ClusterArn":{ + "shape":"ArnType", + "documentation":"

The Amazon Resource Name of the cluster.

" } }, "documentation":"

The result of the RunJobFlow operation.

" @@ -3124,11 +3806,11 @@ "members":{ "JobFlowIds":{ "shape":"XmlStringList", - "documentation":"

Identifiers of the job flows to receive the new visibility setting.

" + "documentation":"

The unique identifier of the job flow (cluster).

" }, "VisibleToAllUsers":{ "shape":"Boolean", - "documentation":"

Whether the specified clusters are visible to all IAM users of the AWS account associated with the cluster. If this value is set to True, all IAM users of that AWS account can view and, if they have the proper IAM policy permissions set, manage the clusters. If it is set to False, only the IAM user that created a cluster can view and manage it.

" + "documentation":"

A value of true indicates that all IAM users in the AWS account can perform cluster actions if they have the proper IAM policy permissions. This is the default. A value of false indicates that only the IAM user who created the cluster can perform actions.

" } }, "documentation":"

The input to the SetVisibleToAllUsers action.

" @@ -3166,6 +3848,10 @@ }, "documentation":"

An automatic scaling configuration, which describes how the policy adds or removes instances, the cooldown period, and the number of EC2 instances that will be added each time the CloudWatch metric alarm condition is satisfied.

" }, + "SpotProvisioningAllocationStrategy":{ + "type":"string", + "enum":["capacity-optimized"] + }, "SpotProvisioningSpecification":{ "type":"structure", "required":[ @@ -3179,14 +3865,18 @@ }, "TimeoutAction":{ "shape":"SpotProvisioningTimeoutAction", - "documentation":"

The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired. Spot instances are not uprovisioned within the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.

" + "documentation":"

The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.

" }, "BlockDurationMinutes":{ "shape":"WholeNumber", "documentation":"

The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.

" + }, + "AllocationStrategy":{ + "shape":"SpotProvisioningAllocationStrategy", + "documentation":"

Specifies the strategy to use in launching Spot instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot instance pools with optimal capacity for the number of instances that are launching.

" } }, - "documentation":"

The launch specification for Spot instances in the instance fleet, which determines the defined duration and provisioning timeout behavior.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.

" + "documentation":"

The launch specification for Spot instances in the instance fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.

The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. Spot instance allocation strategy is available in Amazon EMR version 5.12.1 and later.

" }, "SpotProvisioningTimeoutAction":{ "type":"string", @@ -3195,6 +3885,58 @@ "TERMINATE_CLUSTER" ] }, + "StartNotebookExecutionInput":{ + "type":"structure", + "required":[ + "EditorId", + "RelativePath", + "ExecutionEngine", + "ServiceRole" + ], + "members":{ + "EditorId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the EMR Notebook to use for notebook execution.

" + }, + "RelativePath":{ + "shape":"XmlString", + "documentation":"

The path and file name of the notebook file for this execution, relative to the path specified for the EMR Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when you create an EMR Notebook for a notebook with an ID of e-ABCDEFGHIJK1234567890ABCD (the EditorID of this request), and you specify a RelativePath of my_notebook_executions/notebook_execution.ipynb, the location of the file for the notebook execution is s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb.

" + }, + "NotebookExecutionName":{ + "shape":"XmlStringMaxLen256", + "documentation":"

An optional name for the notebook execution.

" + }, + "NotebookParams":{ + "shape":"XmlString", + "documentation":"

Input parameters in JSON format passed to the EMR Notebook at runtime for execution.

" + }, + "ExecutionEngine":{ + "shape":"ExecutionEngineConfig", + "documentation":"

Specifies the execution engine (cluster) that runs the notebook execution.

" + }, + "ServiceRole":{ + "shape":"XmlString", + "documentation":"

The name or ARN of the IAM role that is used as the service role for Amazon EMR (the EMR role) for the notebook execution.

" + }, + "NotebookInstanceSecurityGroupId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the Amazon EC2 security group to associate with the EMR Notebook for this notebook execution.

" + }, + "Tags":{ + "shape":"TagList", + "documentation":"

A list of tags associated with a notebook execution. Tags are user-defined key value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.

" + } + } + }, + "StartNotebookExecutionOutput":{ + "type":"structure", + "members":{ + "NotebookExecutionId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the notebook execution.

" + } + } + }, "Statistic":{ "type":"string", "enum":[ @@ -3222,7 +3964,7 @@ }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" + "documentation":"

The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is provided for backward compatibility. We recommend using TERMINATE_CLUSTER instead.

" }, "Status":{ "shape":"StepStatus", @@ -3231,6 +3973,13 @@ }, "documentation":"

This represents a step in a cluster.

" }, + "StepCancellationOption":{ + "type":"string", + "enum":[ + "SEND_INTERRUPT", + "TERMINATE_PROCESS" + ] + }, "StepConfig":{ "type":"structure", "required":[ @@ -3244,7 +3993,7 @@ }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

The action to take if the step fails.

" + "documentation":"

The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is provided for backward compatibility. We recommend using TERMINATE_CLUSTER instead.

" }, "HadoopJarStep":{ "shape":"HadoopJarStepConfig", @@ -3399,7 +4148,7 @@ }, "ActionOnFailure":{ "shape":"ActionOnFailure", - "documentation":"

This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

" + "documentation":"

The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is available for backward compatibility. We recommend using TERMINATE_CLUSTER instead.

" }, "Status":{ "shape":"StepStatus", @@ -3430,6 +4179,16 @@ }, "documentation":"

The timeline of the cluster step lifecycle.

" }, + "StopNotebookExecutionInput":{ + "type":"structure", + "required":["NotebookExecutionId"], + "members":{ + "NotebookExecutionId":{ + "shape":"XmlStringMaxLen256", + "documentation":"

The unique identifier of the notebook execution.

" + } + } + }, "String":{"type":"string"}, "StringList":{ "type":"list", @@ -3463,14 +4222,14 @@ "members":{ "Key":{ "shape":"String", - "documentation":"

A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .

" + "documentation":"

A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .

" }, "Value":{ "shape":"String", - "documentation":"

A user-defined value, which is optional in a tag. For more information, see Tag Clusters.

" + "documentation":"

A user-defined value, which is optional in a tag. For more information, see Tag Clusters.

" } }, - "documentation":"

A key/value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" + "documentation":"

A key/value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

" }, "TagList":{ "type":"list", diff --git a/libraries/autoscaling/lib/attachInstances.ml b/libraries/autoscaling/lib/attachInstances.ml index 36d0a3ac2..1cc92672b 100644 --- a/libraries/autoscaling/lib/attachInstances.ml +++ b/libraries/autoscaling/lib/attachInstances.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = AttachInstancesQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "AttachInstances" ] ] + [("Version", ["2011-01-01"]); ("Action", ["AttachInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AttachInstancesQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AttachInstancesQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/attachInstances.mli b/libraries/autoscaling/lib/attachInstances.mli index d47f9ae82..faabdbf31 100644 --- a/libraries/autoscaling/lib/attachInstances.mli +++ b/libraries/autoscaling/lib/attachInstances.mli @@ -1,10 +1,7 @@ open Types - type input = AttachInstancesQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/attachLoadBalancers.ml b/libraries/autoscaling/lib/attachLoadBalancers.ml index 118f8ac61..b0eb691a3 100644 --- a/libraries/autoscaling/lib/attachLoadBalancers.ml +++ b/libraries/autoscaling/lib/attachLoadBalancers.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = AttachLoadBalancersType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "AttachLoadBalancers" ] ] + [("Version", ["2011-01-01"]); ("Action", ["AttachLoadBalancers"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AttachLoadBalancersType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AttachLoadBalancersType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/attachLoadBalancers.mli b/libraries/autoscaling/lib/attachLoadBalancers.mli index ddf98301f..4f6520100 100644 --- a/libraries/autoscaling/lib/attachLoadBalancers.mli +++ b/libraries/autoscaling/lib/attachLoadBalancers.mli @@ -1,10 +1,7 @@ open Types - type input = AttachLoadBalancersType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/completeLifecycleAction.ml b/libraries/autoscaling/lib/completeLifecycleAction.ml index 10fdbcb7f..c7bfecfe9 100644 --- a/libraries/autoscaling/lib/completeLifecycleAction.ml +++ b/libraries/autoscaling/lib/completeLifecycleAction.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = CompleteLifecycleActionType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "CompleteLifecycleAction" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["CompleteLifecycleAction"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CompleteLifecycleActionType.to_query req))))) - in - `POST, uri, [] - + (Query.render (CompleteLifecycleActionType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/completeLifecycleAction.mli b/libraries/autoscaling/lib/completeLifecycleAction.mli index 61aae8ede..b971e1093 100644 --- a/libraries/autoscaling/lib/completeLifecycleAction.mli +++ b/libraries/autoscaling/lib/completeLifecycleAction.mli @@ -1,10 +1,7 @@ open Types - type input = CompleteLifecycleActionType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createAutoScalingGroup.ml b/libraries/autoscaling/lib/createAutoScalingGroup.ml index 3c37a3a76..63ba51ebe 100644 --- a/libraries/autoscaling/lib/createAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/createAutoScalingGroup.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = CreateAutoScalingGroupType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "CreateAutoScalingGroup" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["CreateAutoScalingGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateAutoScalingGroupType.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateAutoScalingGroupType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention - ; Errors_internal.LimitExceeded - ; Errors_internal.AlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.LimitExceeded; + Errors_internal.AlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createAutoScalingGroup.mli b/libraries/autoscaling/lib/createAutoScalingGroup.mli index a3c560283..fc4e1b4f3 100644 --- a/libraries/autoscaling/lib/createAutoScalingGroup.mli +++ b/libraries/autoscaling/lib/createAutoScalingGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateAutoScalingGroupType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createLaunchConfiguration.ml b/libraries/autoscaling/lib/createLaunchConfiguration.ml index 4b0603171..e49b71654 100644 --- a/libraries/autoscaling/lib/createLaunchConfiguration.ml +++ b/libraries/autoscaling/lib/createLaunchConfiguration.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = CreateLaunchConfigurationType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "CreateLaunchConfiguration" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["CreateLaunchConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateLaunchConfigurationType.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateLaunchConfigurationType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention - ; Errors_internal.LimitExceeded - ; Errors_internal.AlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.LimitExceeded; + Errors_internal.AlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createLaunchConfiguration.mli b/libraries/autoscaling/lib/createLaunchConfiguration.mli index 61994ac7e..150acf93d 100644 --- a/libraries/autoscaling/lib/createLaunchConfiguration.mli +++ b/libraries/autoscaling/lib/createLaunchConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = CreateLaunchConfigurationType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createOrUpdateTags.ml b/libraries/autoscaling/lib/createOrUpdateTags.ml index 38b74834a..a0af14969 100644 --- a/libraries/autoscaling/lib/createOrUpdateTags.ml +++ b/libraries/autoscaling/lib/createOrUpdateTags.ml @@ -1,42 +1,33 @@ open Types open Aws - type input = CreateOrUpdateTagsType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "CreateOrUpdateTags" ] ] + [("Version", ["2011-01-01"]); ("Action", ["CreateOrUpdateTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateOrUpdateTagsType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateOrUpdateTagsType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention - ; Errors_internal.AlreadyExists - ; Errors_internal.LimitExceeded - ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.AlreadyExists; + Errors_internal.LimitExceeded] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/createOrUpdateTags.mli b/libraries/autoscaling/lib/createOrUpdateTags.mli index 2aec2e0ef..93b240999 100644 --- a/libraries/autoscaling/lib/createOrUpdateTags.mli +++ b/libraries/autoscaling/lib/createOrUpdateTags.mli @@ -1,10 +1,7 @@ open Types - type input = CreateOrUpdateTagsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteAutoScalingGroup.ml b/libraries/autoscaling/lib/deleteAutoScalingGroup.ml index 0b89d5b90..b49977b4e 100644 --- a/libraries/autoscaling/lib/deleteAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/deleteAutoScalingGroup.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = DeleteAutoScalingGroupType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteAutoScalingGroup" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DeleteAutoScalingGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteAutoScalingGroupType.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteAutoScalingGroupType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention - ; Errors_internal.ResourceInUse - ; Errors_internal.ScalingActivityInProgress - ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.ResourceInUse; + Errors_internal.ScalingActivityInProgress] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteAutoScalingGroup.mli b/libraries/autoscaling/lib/deleteAutoScalingGroup.mli index bac19f3a1..84566c926 100644 --- a/libraries/autoscaling/lib/deleteAutoScalingGroup.mli +++ b/libraries/autoscaling/lib/deleteAutoScalingGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteAutoScalingGroupType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteLaunchConfiguration.ml b/libraries/autoscaling/lib/deleteLaunchConfiguration.ml index 6a5dfd9ac..c26680881 100644 --- a/libraries/autoscaling/lib/deleteLaunchConfiguration.ml +++ b/libraries/autoscaling/lib/deleteLaunchConfiguration.ml @@ -1,40 +1,33 @@ open Types open Aws - type input = LaunchConfigurationNameType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteLaunchConfiguration" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DeleteLaunchConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (LaunchConfigurationNameType.to_query req))))) - in - `POST, uri, [] - + (Query.render (LaunchConfigurationNameType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ResourceInUse ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.ResourceInUse] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteLaunchConfiguration.mli b/libraries/autoscaling/lib/deleteLaunchConfiguration.mli index bf76a4100..a73af9957 100644 --- a/libraries/autoscaling/lib/deleteLaunchConfiguration.mli +++ b/libraries/autoscaling/lib/deleteLaunchConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = LaunchConfigurationNameType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteLifecycleHook.ml b/libraries/autoscaling/lib/deleteLifecycleHook.ml index 8302da0ee..3f0cb48a0 100644 --- a/libraries/autoscaling/lib/deleteLifecycleHook.ml +++ b/libraries/autoscaling/lib/deleteLifecycleHook.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteLifecycleHookType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteLifecycleHook" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DeleteLifecycleHook"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteLifecycleHookType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteLifecycleHookType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteLifecycleHook.mli b/libraries/autoscaling/lib/deleteLifecycleHook.mli index aed23a645..eb6547d50 100644 --- a/libraries/autoscaling/lib/deleteLifecycleHook.mli +++ b/libraries/autoscaling/lib/deleteLifecycleHook.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteLifecycleHookType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteNotificationConfiguration.ml b/libraries/autoscaling/lib/deleteNotificationConfiguration.ml index 05ba94830..70fc52f04 100644 --- a/libraries/autoscaling/lib/deleteNotificationConfiguration.ml +++ b/libraries/autoscaling/lib/deleteNotificationConfiguration.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = DeleteNotificationConfigurationType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteNotificationConfiguration" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DeleteNotificationConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteNotificationConfigurationType.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DeleteNotificationConfigurationType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteNotificationConfiguration.mli b/libraries/autoscaling/lib/deleteNotificationConfiguration.mli index 9b3ccb61f..5f3e4a7ac 100644 --- a/libraries/autoscaling/lib/deleteNotificationConfiguration.mli +++ b/libraries/autoscaling/lib/deleteNotificationConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteNotificationConfigurationType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deletePolicy.ml b/libraries/autoscaling/lib/deletePolicy.ml index 8a59dd5d5..fb529bbd5 100644 --- a/libraries/autoscaling/lib/deletePolicy.ml +++ b/libraries/autoscaling/lib/deletePolicy.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeletePolicyType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeletePolicy" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DeletePolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeletePolicyType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeletePolicyType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deletePolicy.mli b/libraries/autoscaling/lib/deletePolicy.mli index 4eafe69b5..b13a68571 100644 --- a/libraries/autoscaling/lib/deletePolicy.mli +++ b/libraries/autoscaling/lib/deletePolicy.mli @@ -1,10 +1,7 @@ open Types - type input = DeletePolicyType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteScheduledAction.ml b/libraries/autoscaling/lib/deleteScheduledAction.ml index dfc2c842e..e6dd7ca4e 100644 --- a/libraries/autoscaling/lib/deleteScheduledAction.ml +++ b/libraries/autoscaling/lib/deleteScheduledAction.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteScheduledActionType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteScheduledAction" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DeleteScheduledAction"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteScheduledActionType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteScheduledActionType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteScheduledAction.mli b/libraries/autoscaling/lib/deleteScheduledAction.mli index 5c5e26596..668820d07 100644 --- a/libraries/autoscaling/lib/deleteScheduledAction.mli +++ b/libraries/autoscaling/lib/deleteScheduledAction.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteScheduledActionType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteTags.ml b/libraries/autoscaling/lib/deleteTags.ml index 59789fa41..18de49e49 100644 --- a/libraries/autoscaling/lib/deleteTags.ml +++ b/libraries/autoscaling/lib/deleteTags.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteTagsType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DeleteTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteTagsType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteTagsType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/deleteTags.mli b/libraries/autoscaling/lib/deleteTags.mli index 514367c39..87a2c9ee6 100644 --- a/libraries/autoscaling/lib/deleteTags.mli +++ b/libraries/autoscaling/lib/deleteTags.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteTagsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAccountLimits.ml b/libraries/autoscaling/lib/describeAccountLimits.ml index 539b5c985..52dd4909b 100644 --- a/libraries/autoscaling/lib/describeAccountLimits.ml +++ b/libraries/autoscaling/lib/describeAccountLimits.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeAccountLimitsAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeAccountLimits" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DescribeAccountLimits"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeAccountLimitsResponse" (snd xml)) - (Xml.member "DescribeAccountLimitsResult") - in + Util.option_bind (Xml.member "DescribeAccountLimitsResponse" (snd xml)) + (Xml.member "DescribeAccountLimitsResult") in try - Util.or_error - (Util.option_bind resp DescribeAccountLimitsAnswer.parse) + Util.or_error (Util.option_bind resp DescribeAccountLimitsAnswer.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAccountLimitsAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAccountLimitsAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAccountLimitsAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAccountLimitsAnswer - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAccountLimits.mli b/libraries/autoscaling/lib/describeAccountLimits.mli index c69c0d0de..347254aad 100644 --- a/libraries/autoscaling/lib/describeAccountLimits.mli +++ b/libraries/autoscaling/lib/describeAccountLimits.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeAccountLimitsAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAdjustmentTypes.ml b/libraries/autoscaling/lib/describeAdjustmentTypes.ml index f66c753bd..6673c0816 100644 --- a/libraries/autoscaling/lib/describeAdjustmentTypes.ml +++ b/libraries/autoscaling/lib/describeAdjustmentTypes.ml @@ -1,63 +1,63 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeAdjustmentTypesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeAdjustmentTypes" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeAdjustmentTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAdjustmentTypesResponse" (snd xml)) - (Xml.member "DescribeAdjustmentTypesResult") - in + (Xml.member "DescribeAdjustmentTypesResult") in try Util.or_error (Util.option_bind resp DescribeAdjustmentTypesAnswer.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAdjustmentTypesAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAdjustmentTypesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAdjustmentTypesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAdjustmentTypesAnswer - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAdjustmentTypes.mli b/libraries/autoscaling/lib/describeAdjustmentTypes.mli index df6d95780..0d5068408 100644 --- a/libraries/autoscaling/lib/describeAdjustmentTypes.mli +++ b/libraries/autoscaling/lib/describeAdjustmentTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeAdjustmentTypesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingGroups.ml b/libraries/autoscaling/lib/describeAutoScalingGroups.ml index a4fc91716..6a0698214 100644 --- a/libraries/autoscaling/lib/describeAutoScalingGroups.ml +++ b/libraries/autoscaling/lib/describeAutoScalingGroups.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = AutoScalingGroupNamesType.t - type output = AutoScalingGroupsType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeAutoScalingGroups" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeAutoScalingGroups"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AutoScalingGroupNamesType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AutoScalingGroupNamesType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAutoScalingGroupsResponse" (snd xml)) - (Xml.member "DescribeAutoScalingGroupsResult") - in + (Xml.member "DescribeAutoScalingGroupsResult") in try - Util.or_error - (Util.option_bind resp AutoScalingGroupsType.parse) + Util.or_error (Util.option_bind resp AutoScalingGroupsType.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AutoScalingGroupsType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed AutoScalingGroupsType." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AutoScalingGroupsType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AutoScalingGroupsType - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingGroups.mli b/libraries/autoscaling/lib/describeAutoScalingGroups.mli index 57623e392..600be9690 100644 --- a/libraries/autoscaling/lib/describeAutoScalingGroups.mli +++ b/libraries/autoscaling/lib/describeAutoScalingGroups.mli @@ -1,10 +1,7 @@ open Types - type input = AutoScalingGroupNamesType.t - type output = AutoScalingGroupsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingInstances.ml b/libraries/autoscaling/lib/describeAutoScalingInstances.ml index 0671a96a5..6dae2a7d6 100644 --- a/libraries/autoscaling/lib/describeAutoScalingInstances.ml +++ b/libraries/autoscaling/lib/describeAutoScalingInstances.ml @@ -1,67 +1,64 @@ open Types open Aws - type input = DescribeAutoScalingInstancesType.t - type output = AutoScalingInstancesType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeAutoScalingInstances" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeAutoScalingInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeAutoScalingInstancesType.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeAutoScalingInstancesType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAutoScalingInstancesResponse" (snd xml)) - (Xml.member "DescribeAutoScalingInstancesResult") - in + (Xml.member "DescribeAutoScalingInstancesResult") in try - Util.or_error - (Util.option_bind resp AutoScalingInstancesType.parse) + Util.or_error (Util.option_bind resp AutoScalingInstancesType.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AutoScalingInstancesType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AutoScalingInstancesType." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AutoScalingInstancesType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AutoScalingInstancesType - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingInstances.mli b/libraries/autoscaling/lib/describeAutoScalingInstances.mli index b7ef8ad7f..d39073246 100644 --- a/libraries/autoscaling/lib/describeAutoScalingInstances.mli +++ b/libraries/autoscaling/lib/describeAutoScalingInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAutoScalingInstancesType.t - type output = AutoScalingInstancesType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml index 08cfc7fc6..2cffaa4ec 100644 --- a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml +++ b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml @@ -1,68 +1,64 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeAutoScalingNotificationTypesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ] - ; "Action", [ "DescribeAutoScalingNotificationTypes" ] - ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeAutoScalingNotificationTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAutoScalingNotificationTypesResponse" (snd xml)) - (Xml.member "DescribeAutoScalingNotificationTypesResult") - in + (Xml.member "DescribeAutoScalingNotificationTypesResult") in try Util.or_error - (Util.option_bind resp DescribeAutoScalingNotificationTypesAnswer.parse) + (Util.option_bind resp + DescribeAutoScalingNotificationTypesAnswer.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeAutoScalingNotificationTypesAnswer." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAutoScalingNotificationTypesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAutoScalingNotificationTypesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAutoScalingNotificationTypesAnswer - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.mli b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.mli index f2f2b7588..2661e43ff 100644 --- a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.mli +++ b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeAutoScalingNotificationTypesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLaunchConfigurations.ml b/libraries/autoscaling/lib/describeLaunchConfigurations.ml index 567456ea1..3c2e147be 100644 --- a/libraries/autoscaling/lib/describeLaunchConfigurations.ml +++ b/libraries/autoscaling/lib/describeLaunchConfigurations.ml @@ -1,67 +1,64 @@ open Types open Aws - type input = LaunchConfigurationNamesType.t - type output = LaunchConfigurationsType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeLaunchConfigurations" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeLaunchConfigurations"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (LaunchConfigurationNamesType.to_query req))))) - in - `POST, uri, [] - + (Query.render (LaunchConfigurationNamesType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLaunchConfigurationsResponse" (snd xml)) - (Xml.member "DescribeLaunchConfigurationsResult") - in + (Xml.member "DescribeLaunchConfigurationsResult") in try - Util.or_error - (Util.option_bind resp LaunchConfigurationsType.parse) + Util.or_error (Util.option_bind resp LaunchConfigurationsType.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed LaunchConfigurationsType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed LaunchConfigurationsType." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing LaunchConfigurationsType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing LaunchConfigurationsType - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLaunchConfigurations.mli b/libraries/autoscaling/lib/describeLaunchConfigurations.mli index 609eeb975..0446a984e 100644 --- a/libraries/autoscaling/lib/describeLaunchConfigurations.mli +++ b/libraries/autoscaling/lib/describeLaunchConfigurations.mli @@ -1,10 +1,7 @@ open Types - type input = LaunchConfigurationNamesType.t - type output = LaunchConfigurationsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLifecycleHookTypes.ml b/libraries/autoscaling/lib/describeLifecycleHookTypes.ml index faa52598f..22b86f5bf 100644 --- a/libraries/autoscaling/lib/describeLifecycleHookTypes.ml +++ b/libraries/autoscaling/lib/describeLifecycleHookTypes.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeLifecycleHookTypesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeLifecycleHookTypes" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeLifecycleHookTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLifecycleHookTypesResponse" (snd xml)) - (Xml.member "DescribeLifecycleHookTypesResult") - in + (Xml.member "DescribeLifecycleHookTypesResult") in try Util.or_error (Util.option_bind resp DescribeLifecycleHookTypesAnswer.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeLifecycleHookTypesAnswer." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLifecycleHookTypesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLifecycleHookTypesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLifecycleHookTypesAnswer - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLifecycleHookTypes.mli b/libraries/autoscaling/lib/describeLifecycleHookTypes.mli index 409b167f9..56b719ef1 100644 --- a/libraries/autoscaling/lib/describeLifecycleHookTypes.mli +++ b/libraries/autoscaling/lib/describeLifecycleHookTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeLifecycleHookTypesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLifecycleHooks.ml b/libraries/autoscaling/lib/describeLifecycleHooks.ml index a4e5f6a40..ef228adc0 100644 --- a/libraries/autoscaling/lib/describeLifecycleHooks.ml +++ b/libraries/autoscaling/lib/describeLifecycleHooks.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeLifecycleHooksType.t - type output = DescribeLifecycleHooksAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeLifecycleHooks" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeLifecycleHooks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeLifecycleHooksType.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeLifecycleHooksType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLifecycleHooksResponse" (snd xml)) - (Xml.member "DescribeLifecycleHooksResult") - in + (Xml.member "DescribeLifecycleHooksResult") in try Util.or_error (Util.option_bind resp DescribeLifecycleHooksAnswer.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeLifecycleHooksAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLifecycleHooksAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLifecycleHooksAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLifecycleHooksAnswer - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLifecycleHooks.mli b/libraries/autoscaling/lib/describeLifecycleHooks.mli index b1c5d8598..33a47d280 100644 --- a/libraries/autoscaling/lib/describeLifecycleHooks.mli +++ b/libraries/autoscaling/lib/describeLifecycleHooks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeLifecycleHooksType.t - type output = DescribeLifecycleHooksAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLoadBalancers.ml b/libraries/autoscaling/lib/describeLoadBalancers.ml index 1dd408b58..473f4a86b 100644 --- a/libraries/autoscaling/lib/describeLoadBalancers.ml +++ b/libraries/autoscaling/lib/describeLoadBalancers.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = DescribeLoadBalancersRequest.t - type output = DescribeLoadBalancersResponse.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeLoadBalancers" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DescribeLoadBalancers"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeLoadBalancersRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeLoadBalancersRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeLoadBalancersResponse" (snd xml)) - (Xml.member "DescribeLoadBalancersResult") - in + Util.option_bind (Xml.member "DescribeLoadBalancersResponse" (snd xml)) + (Xml.member "DescribeLoadBalancersResult") in try Util.or_error (Util.option_bind resp DescribeLoadBalancersResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeLoadBalancersResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLoadBalancersResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLoadBalancersResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLoadBalancersResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeLoadBalancers.mli b/libraries/autoscaling/lib/describeLoadBalancers.mli index c2c407149..42d3610bb 100644 --- a/libraries/autoscaling/lib/describeLoadBalancers.mli +++ b/libraries/autoscaling/lib/describeLoadBalancers.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeLoadBalancersRequest.t - type output = DescribeLoadBalancersResponse.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeMetricCollectionTypes.ml b/libraries/autoscaling/lib/describeMetricCollectionTypes.ml index 6df6aa93c..cff1b4d60 100644 --- a/libraries/autoscaling/lib/describeMetricCollectionTypes.ml +++ b/libraries/autoscaling/lib/describeMetricCollectionTypes.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeMetricCollectionTypesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeMetricCollectionTypes" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeMetricCollectionTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeMetricCollectionTypesResponse" (snd xml)) - (Xml.member "DescribeMetricCollectionTypesResult") - in + (Xml.member "DescribeMetricCollectionTypesResult") in try Util.or_error (Util.option_bind resp DescribeMetricCollectionTypesAnswer.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeMetricCollectionTypesAnswer." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeMetricCollectionTypesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeMetricCollectionTypesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeMetricCollectionTypesAnswer - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeMetricCollectionTypes.mli b/libraries/autoscaling/lib/describeMetricCollectionTypes.mli index cb1978b5e..2c7480b1a 100644 --- a/libraries/autoscaling/lib/describeMetricCollectionTypes.mli +++ b/libraries/autoscaling/lib/describeMetricCollectionTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeMetricCollectionTypesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeNotificationConfigurations.ml b/libraries/autoscaling/lib/describeNotificationConfigurations.ml index 5ef72a4ca..708db4c01 100644 --- a/libraries/autoscaling/lib/describeNotificationConfigurations.ml +++ b/libraries/autoscaling/lib/describeNotificationConfigurations.ml @@ -1,72 +1,66 @@ open Types open Aws - type input = DescribeNotificationConfigurationsType.t - type output = DescribeNotificationConfigurationsAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ] - ; "Action", [ "DescribeNotificationConfigurations" ] - ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeNotificationConfigurations"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeNotificationConfigurationsType.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeNotificationConfigurationsType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeNotificationConfigurationsResponse" (snd xml)) - (Xml.member "DescribeNotificationConfigurationsResult") - in + (Xml.member "DescribeNotificationConfigurationsResult") in try Util.or_error (Util.option_bind resp DescribeNotificationConfigurationsAnswer.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeNotificationConfigurationsAnswer." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeNotificationConfigurationsAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeNotificationConfigurationsAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeNotificationConfigurationsAnswer - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeNotificationConfigurations.mli b/libraries/autoscaling/lib/describeNotificationConfigurations.mli index ba73b1d36..db9f4a7a8 100644 --- a/libraries/autoscaling/lib/describeNotificationConfigurations.mli +++ b/libraries/autoscaling/lib/describeNotificationConfigurations.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeNotificationConfigurationsType.t - type output = DescribeNotificationConfigurationsAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describePolicies.ml b/libraries/autoscaling/lib/describePolicies.ml index 2104797b5..1c6b225e4 100644 --- a/libraries/autoscaling/lib/describePolicies.ml +++ b/libraries/autoscaling/lib/describePolicies.ml @@ -1,63 +1,58 @@ open Types open Aws - type input = DescribePoliciesType.t - type output = PoliciesType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribePolicies" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DescribePolicies"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribePoliciesType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribePoliciesType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribePoliciesResponse" (snd xml)) - (Xml.member "DescribePoliciesResult") - in + Util.option_bind (Xml.member "DescribePoliciesResponse" (snd xml)) + (Xml.member "DescribePoliciesResult") in try - Util.or_error - (Util.option_bind resp PoliciesType.parse) + Util.or_error (Util.option_bind resp PoliciesType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed PoliciesType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed PoliciesType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PoliciesType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PoliciesType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describePolicies.mli b/libraries/autoscaling/lib/describePolicies.mli index 85d88ed91..0536362d4 100644 --- a/libraries/autoscaling/lib/describePolicies.mli +++ b/libraries/autoscaling/lib/describePolicies.mli @@ -1,10 +1,7 @@ open Types - type input = DescribePoliciesType.t - type output = PoliciesType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScalingActivities.ml b/libraries/autoscaling/lib/describeScalingActivities.ml index a85cdef88..005881bed 100644 --- a/libraries/autoscaling/lib/describeScalingActivities.ml +++ b/libraries/autoscaling/lib/describeScalingActivities.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = DescribeScalingActivitiesType.t - type output = ActivitiesType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeScalingActivities" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeScalingActivities"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeScalingActivitiesType.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeScalingActivitiesType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeScalingActivitiesResponse" (snd xml)) - (Xml.member "DescribeScalingActivitiesResult") - in + (Xml.member "DescribeScalingActivitiesResult") in try - Util.or_error - (Util.option_bind resp ActivitiesType.parse) + Util.or_error (Util.option_bind resp ActivitiesType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ActivitiesType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ActivitiesType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ActivitiesType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ActivitiesType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScalingActivities.mli b/libraries/autoscaling/lib/describeScalingActivities.mli index 356a409c6..b5c73ce18 100644 --- a/libraries/autoscaling/lib/describeScalingActivities.mli +++ b/libraries/autoscaling/lib/describeScalingActivities.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeScalingActivitiesType.t - type output = ActivitiesType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScalingProcessTypes.ml b/libraries/autoscaling/lib/describeScalingProcessTypes.ml index 84a1e44bc..12713b3cd 100644 --- a/libraries/autoscaling/lib/describeScalingProcessTypes.ml +++ b/libraries/autoscaling/lib/describeScalingProcessTypes.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = ProcessesType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeScalingProcessTypes" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeScalingProcessTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeScalingProcessTypesResponse" (snd xml)) - (Xml.member "DescribeScalingProcessTypesResult") - in + (Xml.member "DescribeScalingProcessTypesResult") in try - Util.or_error - (Util.option_bind resp ProcessesType.parse) + Util.or_error (Util.option_bind resp ProcessesType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ProcessesType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ProcessesType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ProcessesType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ProcessesType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScalingProcessTypes.mli b/libraries/autoscaling/lib/describeScalingProcessTypes.mli index dc5c20697..6194dea45 100644 --- a/libraries/autoscaling/lib/describeScalingProcessTypes.mli +++ b/libraries/autoscaling/lib/describeScalingProcessTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = ProcessesType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScheduledActions.ml b/libraries/autoscaling/lib/describeScheduledActions.ml index de145d6e6..60280d769 100644 --- a/libraries/autoscaling/lib/describeScheduledActions.ml +++ b/libraries/autoscaling/lib/describeScheduledActions.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = DescribeScheduledActionsType.t - type output = ScheduledActionsType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeScheduledActions" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeScheduledActions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeScheduledActionsType.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeScheduledActionsType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeScheduledActionsResponse" (snd xml)) - (Xml.member "DescribeScheduledActionsResult") - in + (Xml.member "DescribeScheduledActionsResult") in try - Util.or_error - (Util.option_bind resp ScheduledActionsType.parse) + Util.or_error (Util.option_bind resp ScheduledActionsType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ScheduledActionsType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ScheduledActionsType." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ScheduledActionsType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ScheduledActionsType - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeScheduledActions.mli b/libraries/autoscaling/lib/describeScheduledActions.mli index 33ecde106..877d0dcc4 100644 --- a/libraries/autoscaling/lib/describeScheduledActions.mli +++ b/libraries/autoscaling/lib/describeScheduledActions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeScheduledActionsType.t - type output = ScheduledActionsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeTags.ml b/libraries/autoscaling/lib/describeTags.ml index c1a61bdd6..fd8fc6274 100644 --- a/libraries/autoscaling/lib/describeTags.ml +++ b/libraries/autoscaling/lib/describeTags.ml @@ -1,63 +1,58 @@ open Types open Aws - type input = DescribeTagsType.t - type output = TagsType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeTags" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DescribeTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeTagsType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeTagsType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeTagsResponse" (snd xml)) - (Xml.member "DescribeTagsResult") - in + Util.option_bind (Xml.member "DescribeTagsResponse" (snd xml)) + (Xml.member "DescribeTagsResult") in try - Util.or_error - (Util.option_bind resp TagsType.parse) + Util.or_error (Util.option_bind resp TagsType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed TagsType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed TagsType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TagsType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TagsType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.InvalidNextToken ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.InvalidNextToken] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeTags.mli b/libraries/autoscaling/lib/describeTags.mli index 7fd223dcc..bc97442a8 100644 --- a/libraries/autoscaling/lib/describeTags.mli +++ b/libraries/autoscaling/lib/describeTags.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeTagsType.t - type output = TagsType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml b/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml index 2ff56de64..29efa5024 100644 --- a/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml +++ b/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = DescribeTerminationPolicyTypesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DescribeTerminationPolicyTypes" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DescribeTerminationPolicyTypes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeTerminationPolicyTypesResponse" (snd xml)) - (Xml.member "DescribeTerminationPolicyTypesResult") - in + (Xml.member "DescribeTerminationPolicyTypesResult") in try Util.or_error (Util.option_bind resp DescribeTerminationPolicyTypesAnswer.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeTerminationPolicyTypesAnswer." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeTerminationPolicyTypesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeTerminationPolicyTypesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeTerminationPolicyTypesAnswer - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/describeTerminationPolicyTypes.mli b/libraries/autoscaling/lib/describeTerminationPolicyTypes.mli index ee67c32b6..0ec670fb4 100644 --- a/libraries/autoscaling/lib/describeTerminationPolicyTypes.mli +++ b/libraries/autoscaling/lib/describeTerminationPolicyTypes.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = DescribeTerminationPolicyTypesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/detachInstances.ml b/libraries/autoscaling/lib/detachInstances.ml index 676789540..e28ccd339 100644 --- a/libraries/autoscaling/lib/detachInstances.ml +++ b/libraries/autoscaling/lib/detachInstances.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = DetachInstancesQuery.t - type output = DetachInstancesAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DetachInstances" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DetachInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DetachInstancesQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DetachInstancesQuery.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DetachInstancesResponse" (snd xml)) - (Xml.member "DetachInstancesResult") - in + Util.option_bind (Xml.member "DetachInstancesResponse" (snd xml)) + (Xml.member "DetachInstancesResult") in try - Util.or_error - (Util.option_bind resp DetachInstancesAnswer.parse) + Util.or_error (Util.option_bind resp DetachInstancesAnswer.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DetachInstancesAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DetachInstancesAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DetachInstancesAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DetachInstancesAnswer - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/detachInstances.mli b/libraries/autoscaling/lib/detachInstances.mli index 22006b284..1249ac678 100644 --- a/libraries/autoscaling/lib/detachInstances.mli +++ b/libraries/autoscaling/lib/detachInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DetachInstancesQuery.t - type output = DetachInstancesAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/detachLoadBalancers.ml b/libraries/autoscaling/lib/detachLoadBalancers.ml index ffbaa9980..a51eda97e 100644 --- a/libraries/autoscaling/lib/detachLoadBalancers.ml +++ b/libraries/autoscaling/lib/detachLoadBalancers.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DetachLoadBalancersType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DetachLoadBalancers" ] ] + [("Version", ["2011-01-01"]); ("Action", ["DetachLoadBalancers"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DetachLoadBalancersType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DetachLoadBalancersType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/detachLoadBalancers.mli b/libraries/autoscaling/lib/detachLoadBalancers.mli index ca88f7af8..875d96e8d 100644 --- a/libraries/autoscaling/lib/detachLoadBalancers.mli +++ b/libraries/autoscaling/lib/detachLoadBalancers.mli @@ -1,10 +1,7 @@ open Types - type input = DetachLoadBalancersType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/disableMetricsCollection.ml b/libraries/autoscaling/lib/disableMetricsCollection.ml index f24380bdd..03b25a48b 100644 --- a/libraries/autoscaling/lib/disableMetricsCollection.ml +++ b/libraries/autoscaling/lib/disableMetricsCollection.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DisableMetricsCollectionQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "DisableMetricsCollection" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["DisableMetricsCollection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisableMetricsCollectionQuery.to_query req))))) - in - `POST, uri, [] - + (Query.render (DisableMetricsCollectionQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/disableMetricsCollection.mli b/libraries/autoscaling/lib/disableMetricsCollection.mli index 924c6aab8..68c8085d0 100644 --- a/libraries/autoscaling/lib/disableMetricsCollection.mli +++ b/libraries/autoscaling/lib/disableMetricsCollection.mli @@ -1,10 +1,7 @@ open Types - type input = DisableMetricsCollectionQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/dune b/libraries/autoscaling/lib/dune index da7d73e1c..696ff29fc 100644 --- a/libraries/autoscaling/lib/dune +++ b/libraries/autoscaling/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_autoscaling) + (name aws_autoscaling) (public_name aws-autoscaling) (synopsis "aws-Auto Scaling") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/autoscaling/lib/enableMetricsCollection.ml b/libraries/autoscaling/lib/enableMetricsCollection.ml index a3d2086ab..54b064654 100644 --- a/libraries/autoscaling/lib/enableMetricsCollection.ml +++ b/libraries/autoscaling/lib/enableMetricsCollection.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = EnableMetricsCollectionQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "EnableMetricsCollection" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["EnableMetricsCollection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (EnableMetricsCollectionQuery.to_query req))))) - in - `POST, uri, [] - + (Query.render (EnableMetricsCollectionQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/enableMetricsCollection.mli b/libraries/autoscaling/lib/enableMetricsCollection.mli index 801013673..4ecce90e0 100644 --- a/libraries/autoscaling/lib/enableMetricsCollection.mli +++ b/libraries/autoscaling/lib/enableMetricsCollection.mli @@ -1,10 +1,7 @@ open Types - type input = EnableMetricsCollectionQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/enterStandby.ml b/libraries/autoscaling/lib/enterStandby.ml index 5238e7b54..2abbbe93a 100644 --- a/libraries/autoscaling/lib/enterStandby.ml +++ b/libraries/autoscaling/lib/enterStandby.ml @@ -1,61 +1,59 @@ open Types open Aws - type input = EnterStandbyQuery.t - type output = EnterStandbyAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "EnterStandby" ] ] + [("Version", ["2011-01-01"]); ("Action", ["EnterStandby"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (EnterStandbyQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (EnterStandbyQuery.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "EnterStandbyResponse" (snd xml)) - (Xml.member "EnterStandbyResult") - in + Util.option_bind (Xml.member "EnterStandbyResponse" (snd xml)) + (Xml.member "EnterStandbyResult") in try - Util.or_error - (Util.option_bind resp EnterStandbyAnswer.parse) + Util.or_error (Util.option_bind resp EnterStandbyAnswer.parse) (let open Error in - BadResponse { body; message = "Could not find well formed EnterStandbyAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed EnterStandbyAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EnterStandbyAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EnterStandbyAnswer - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/enterStandby.mli b/libraries/autoscaling/lib/enterStandby.mli index 8a2afbc5b..71d513ad1 100644 --- a/libraries/autoscaling/lib/enterStandby.mli +++ b/libraries/autoscaling/lib/enterStandby.mli @@ -1,10 +1,7 @@ open Types - type input = EnterStandbyQuery.t - type output = EnterStandbyAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/errors_internal.ml b/libraries/autoscaling/lib/errors_internal.ml index 4c12a0264..2a1b86d36 100644 --- a/libraries/autoscaling/lib/errors_internal.ml +++ b/libraries/autoscaling/lib/errors_internal.ml @@ -1,67 +1,64 @@ type t = - | AlreadyExists - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidNextToken - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | LimitExceeded - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ResourceContention - | ResourceInUse - | ScalingActivityInProgress - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AlreadyExists + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidNextToken + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | LimitExceeded + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ResourceContention + | ResourceInUse + | ScalingActivityInProgress + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AlreadyExists -> Some 400 @@ -97,7 +94,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AlreadyExists -> "AlreadyExists" @@ -133,7 +129,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AlreadyExists" -> Some AlreadyExists @@ -169,4 +164,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/autoscaling/lib/executePolicy.ml b/libraries/autoscaling/lib/executePolicy.ml index a491a4954..cfcc2b73c 100644 --- a/libraries/autoscaling/lib/executePolicy.ml +++ b/libraries/autoscaling/lib/executePolicy.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = ExecutePolicyType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "ExecutePolicy" ] ] + [("Version", ["2011-01-01"]); ("Action", ["ExecutePolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ExecutePolicyType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ExecutePolicyType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ScalingActivityInProgress ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.ScalingActivityInProgress] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/executePolicy.mli b/libraries/autoscaling/lib/executePolicy.mli index 20f6cf371..eb3752e6b 100644 --- a/libraries/autoscaling/lib/executePolicy.mli +++ b/libraries/autoscaling/lib/executePolicy.mli @@ -1,10 +1,7 @@ open Types - type input = ExecutePolicyType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/exitStandby.ml b/libraries/autoscaling/lib/exitStandby.ml index 7ccab616d..130d61d4d 100644 --- a/libraries/autoscaling/lib/exitStandby.ml +++ b/libraries/autoscaling/lib/exitStandby.ml @@ -1,61 +1,58 @@ open Types open Aws - type input = ExitStandbyQuery.t - type output = ExitStandbyAnswer.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "ExitStandby" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2011-01-01"]); ("Action", ["ExitStandby"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ExitStandbyQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ExitStandbyQuery.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ExitStandbyResponse" (snd xml)) - (Xml.member "ExitStandbyResult") - in + Util.option_bind (Xml.member "ExitStandbyResponse" (snd xml)) + (Xml.member "ExitStandbyResult") in try - Util.or_error - (Util.option_bind resp ExitStandbyAnswer.parse) + Util.or_error (Util.option_bind resp ExitStandbyAnswer.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ExitStandbyAnswer." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ExitStandbyAnswer." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ExitStandbyAnswer - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ExitStandbyAnswer - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/exitStandby.mli b/libraries/autoscaling/lib/exitStandby.mli index 3345fbc11..17ec1c42e 100644 --- a/libraries/autoscaling/lib/exitStandby.mli +++ b/libraries/autoscaling/lib/exitStandby.mli @@ -1,10 +1,7 @@ open Types - type input = ExitStandbyQuery.t - type output = ExitStandbyAnswer.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putLifecycleHook.ml b/libraries/autoscaling/lib/putLifecycleHook.ml index 5a737e750..8d202543e 100644 --- a/libraries/autoscaling/lib/putLifecycleHook.ml +++ b/libraries/autoscaling/lib/putLifecycleHook.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = PutLifecycleHookType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "PutLifecycleHook" ] ] + [("Version", ["2011-01-01"]); ("Action", ["PutLifecycleHook"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutLifecycleHookType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutLifecycleHookType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.LimitExceeded ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.LimitExceeded] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putLifecycleHook.mli b/libraries/autoscaling/lib/putLifecycleHook.mli index c226bca06..269ca424e 100644 --- a/libraries/autoscaling/lib/putLifecycleHook.mli +++ b/libraries/autoscaling/lib/putLifecycleHook.mli @@ -1,10 +1,7 @@ open Types - type input = PutLifecycleHookType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putNotificationConfiguration.ml b/libraries/autoscaling/lib/putNotificationConfiguration.ml index 403f6cffd..53ea5468b 100644 --- a/libraries/autoscaling/lib/putNotificationConfiguration.ml +++ b/libraries/autoscaling/lib/putNotificationConfiguration.ml @@ -1,40 +1,33 @@ open Types open Aws - type input = PutNotificationConfigurationType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "PutNotificationConfiguration" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["PutNotificationConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutNotificationConfigurationType.to_query req))))) - in - `POST, uri, [] - + (Query.render (PutNotificationConfigurationType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.LimitExceeded ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.LimitExceeded] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putNotificationConfiguration.mli b/libraries/autoscaling/lib/putNotificationConfiguration.mli index 9e5e1d078..4f3b2bf43 100644 --- a/libraries/autoscaling/lib/putNotificationConfiguration.mli +++ b/libraries/autoscaling/lib/putNotificationConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = PutNotificationConfigurationType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putScalingPolicy.ml b/libraries/autoscaling/lib/putScalingPolicy.ml index 64568eb1b..b4002cc6a 100644 --- a/libraries/autoscaling/lib/putScalingPolicy.ml +++ b/libraries/autoscaling/lib/putScalingPolicy.ml @@ -1,63 +1,58 @@ open Types open Aws - type input = PutScalingPolicyType.t - type output = PolicyARNType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "PutScalingPolicy" ] ] + [("Version", ["2011-01-01"]); ("Action", ["PutScalingPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutScalingPolicyType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutScalingPolicyType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "PutScalingPolicyResponse" (snd xml)) - (Xml.member "PutScalingPolicyResult") - in + Util.option_bind (Xml.member "PutScalingPolicyResponse" (snd xml)) + (Xml.member "PutScalingPolicyResult") in try - Util.or_error - (Util.option_bind resp PolicyARNType.parse) + Util.or_error (Util.option_bind resp PolicyARNType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed PolicyARNType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed PolicyARNType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PolicyARNType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PolicyARNType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.LimitExceeded ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.LimitExceeded] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putScalingPolicy.mli b/libraries/autoscaling/lib/putScalingPolicy.mli index e59ea5f15..f1ea0d6f9 100644 --- a/libraries/autoscaling/lib/putScalingPolicy.mli +++ b/libraries/autoscaling/lib/putScalingPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = PutScalingPolicyType.t - type output = PolicyARNType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml index a83b09fbf..de01072a3 100644 --- a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml +++ b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = PutScheduledUpdateGroupActionType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "PutScheduledUpdateGroupAction" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["PutScheduledUpdateGroupAction"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutScheduledUpdateGroupActionType.to_query req))))) - in - `POST, uri, [] - + (Query.render (PutScheduledUpdateGroupActionType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention - ; Errors_internal.LimitExceeded - ; Errors_internal.AlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.LimitExceeded; + Errors_internal.AlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.mli b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.mli index b20f14290..6dad97c58 100644 --- a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.mli +++ b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.mli @@ -1,10 +1,7 @@ open Types - type input = PutScheduledUpdateGroupActionType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml index 1d2f773fb..4cb2e7762 100644 --- a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml +++ b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = RecordLifecycleActionHeartbeatType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "RecordLifecycleActionHeartbeat" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["RecordLifecycleActionHeartbeat"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RecordLifecycleActionHeartbeatType.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RecordLifecycleActionHeartbeatType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.mli b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.mli index 62c60c97c..b9199b2e2 100644 --- a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.mli +++ b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.mli @@ -1,10 +1,7 @@ open Types - type input = RecordLifecycleActionHeartbeatType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/resumeProcesses.ml b/libraries/autoscaling/lib/resumeProcesses.ml index bd5513edd..debb619ce 100644 --- a/libraries/autoscaling/lib/resumeProcesses.ml +++ b/libraries/autoscaling/lib/resumeProcesses.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = ScalingProcessQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "ResumeProcesses" ] ] + [("Version", ["2011-01-01"]); ("Action", ["ResumeProcesses"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ScalingProcessQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ScalingProcessQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ResourceInUse ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.ResourceInUse] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/resumeProcesses.mli b/libraries/autoscaling/lib/resumeProcesses.mli index 7d068f6b6..2e8c01b87 100644 --- a/libraries/autoscaling/lib/resumeProcesses.mli +++ b/libraries/autoscaling/lib/resumeProcesses.mli @@ -1,10 +1,7 @@ open Types - type input = ScalingProcessQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/setDesiredCapacity.ml b/libraries/autoscaling/lib/setDesiredCapacity.ml index fc8c28803..167b4d7f7 100644 --- a/libraries/autoscaling/lib/setDesiredCapacity.ml +++ b/libraries/autoscaling/lib/setDesiredCapacity.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = SetDesiredCapacityType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "SetDesiredCapacity" ] ] + [("Version", ["2011-01-01"]); ("Action", ["SetDesiredCapacity"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetDesiredCapacityType.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetDesiredCapacityType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ScalingActivityInProgress ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.ScalingActivityInProgress] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/setDesiredCapacity.mli b/libraries/autoscaling/lib/setDesiredCapacity.mli index 7797463bd..27f051154 100644 --- a/libraries/autoscaling/lib/setDesiredCapacity.mli +++ b/libraries/autoscaling/lib/setDesiredCapacity.mli @@ -1,10 +1,7 @@ open Types - type input = SetDesiredCapacityType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/setInstanceHealth.ml b/libraries/autoscaling/lib/setInstanceHealth.ml index 81e5f1cf0..d85df9b2e 100644 --- a/libraries/autoscaling/lib/setInstanceHealth.ml +++ b/libraries/autoscaling/lib/setInstanceHealth.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = SetInstanceHealthQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "SetInstanceHealth" ] ] + [("Version", ["2011-01-01"]); ("Action", ["SetInstanceHealth"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetInstanceHealthQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetInstanceHealthQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceContention ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceContention] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/setInstanceHealth.mli b/libraries/autoscaling/lib/setInstanceHealth.mli index 33c05ac94..68a016bfa 100644 --- a/libraries/autoscaling/lib/setInstanceHealth.mli +++ b/libraries/autoscaling/lib/setInstanceHealth.mli @@ -1,10 +1,7 @@ open Types - type input = SetInstanceHealthQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/suspendProcesses.ml b/libraries/autoscaling/lib/suspendProcesses.ml index 906843a6a..4680e2450 100644 --- a/libraries/autoscaling/lib/suspendProcesses.ml +++ b/libraries/autoscaling/lib/suspendProcesses.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = ScalingProcessQuery.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "SuspendProcesses" ] ] + [("Version", ["2011-01-01"]); ("Action", ["SuspendProcesses"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ScalingProcessQuery.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ScalingProcessQuery.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ResourceInUse ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; Errors_internal.ResourceInUse] @ + 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/suspendProcesses.mli b/libraries/autoscaling/lib/suspendProcesses.mli index 7d068f6b6..2e8c01b87 100644 --- a/libraries/autoscaling/lib/suspendProcesses.mli +++ b/libraries/autoscaling/lib/suspendProcesses.mli @@ -1,10 +1,7 @@ open Types - type input = ScalingProcessQuery.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml index f5de6a933..2fd418f2d 100644 --- a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml @@ -1,66 +1,61 @@ open Types open Aws - type input = TerminateInstanceInAutoScalingGroupType.t - type output = ActivityType.t - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ] - ; "Action", [ "TerminateInstanceInAutoScalingGroup" ] - ] + [("Version", ["2011-01-01"]); + ("Action", ["TerminateInstanceInAutoScalingGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (TerminateInstanceInAutoScalingGroupType.to_query req))))) - in - `POST, uri, [] - + (Query.render + (TerminateInstanceInAutoScalingGroupType.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "TerminateInstanceInAutoScalingGroupResponse" (snd xml)) - (Xml.member "TerminateInstanceInAutoScalingGroupResult") - in + (Xml.member "TerminateInstanceInAutoScalingGroupResult") in try - Util.or_error - (Util.option_bind resp ActivityType.parse) + Util.or_error (Util.option_bind resp ActivityType.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ActivityType." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ActivityType." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ActivityType - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ActivityType - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ScalingActivityInProgress ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.ScalingActivityInProgress] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.mli b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.mli index 471fbe893..f25ba6246 100644 --- a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.mli +++ b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.mli @@ -1,10 +1,7 @@ open Types - type input = TerminateInstanceInAutoScalingGroupType.t - type output = ActivityType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/types.ml b/libraries/autoscaling/lib/types.ml index 89cc33548..d9a8a7042 100644 --- a/libraries/autoscaling/lib/types.ml +++ b/libraries/autoscaling/lib/types.ml @@ -1,6208 +1,6357 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module LifecycleState = struct - type t = - | Pending - | Pending_Wait - | Pending_Proceed - | Quarantined - | InService - | Terminating - | Terminating_Wait - | Terminating_Proceed - | Terminated - | Detaching - | Detached - | EnteringStandby - | Standby - - let str_to_t = - [ "Standby", Standby - ; "EnteringStandby", EnteringStandby - ; "Detached", Detached - ; "Detaching", Detaching - ; "Terminated", Terminated - ; "Terminating:Proceed", Terminating_Proceed - ; "Terminating:Wait", Terminating_Wait - ; "Terminating", Terminating - ; "InService", InService - ; "Quarantined", Quarantined - ; "Pending:Proceed", Pending_Proceed - ; "Pending:Wait", Pending_Wait - ; "Pending", Pending - ] - - let t_to_str = - [ Standby, "Standby" - ; EnteringStandby, "EnteringStandby" - ; Detached, "Detached" - ; Detaching, "Detaching" - ; Terminated, "Terminated" - ; Terminating_Proceed, "Terminating:Proceed" - ; Terminating_Wait, "Terminating:Wait" - ; Terminating, "Terminating" - ; InService, "InService" - ; Quarantined, "Quarantined" - ; Pending_Proceed, "Pending:Proceed" - ; Pending_Wait, "Pending:Wait" - ; Pending, "Pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Ebs = struct - type t = - { snapshot_id : String.t option - ; volume_size : Integer.t option - ; volume_type : String.t option - ; delete_on_termination : Boolean.t option - ; iops : Integer.t option - } - - let make ?snapshot_id ?volume_size ?volume_type ?delete_on_termination ?iops () = - { snapshot_id; volume_size; volume_type; delete_on_termination; iops } - - let parse xml = - Some - { snapshot_id = Util.option_bind (Xml.member "SnapshotId" xml) String.parse - ; volume_size = Util.option_bind (Xml.member "VolumeSize" xml) Integer.parse - ; volume_type = Util.option_bind (Xml.member "VolumeType" xml) String.parse - ; delete_on_termination = - Util.option_bind (Xml.member "DeleteOnTermination" xml) Boolean.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse +module LifecycleState = + struct + type t = + | Pending + | Pending_Wait + | Pending_Proceed + | Quarantined + | InService + | Terminating + | Terminating_Wait + | Terminating_Proceed + | Terminated + | Detaching + | Detached + | EnteringStandby + | Standby + let str_to_t = + [("Standby", Standby); + ("EnteringStandby", EnteringStandby); + ("Detached", Detached); + ("Detaching", Detaching); + ("Terminated", Terminated); + ("Terminating:Proceed", Terminating_Proceed); + ("Terminating:Wait", Terminating_Wait); + ("Terminating", Terminating); + ("InService", InService); + ("Quarantined", Quarantined); + ("Pending:Proceed", Pending_Proceed); + ("Pending:Wait", Pending_Wait); + ("Pending", Pending)] + let t_to_str = + [(Standby, "Standby"); + (EnteringStandby, "EnteringStandby"); + (Detached, "Detached"); + (Detaching, "Detaching"); + (Terminated, "Terminated"); + (Terminating_Proceed, "Terminating:Proceed"); + (Terminating_Wait, "Terminating:Wait"); + (Terminating, "Terminating"); + (InService, "InService"); + (Quarantined, "Quarantined"); + (Pending_Proceed, "Pending:Proceed"); + (Pending_Wait, "Pending:Wait"); + (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Ebs = + struct + type t = + { + snapshot_id: String.t option ; + volume_size: Integer.t option ; + volume_type: String.t option ; + delete_on_termination: Boolean.t option ; + iops: Integer.t option } + let make ?snapshot_id ?volume_size ?volume_type ?delete_on_termination + ?iops () = + { snapshot_id; volume_size; volume_type; delete_on_termination; iops } + let parse xml = + Some + { + snapshot_id = + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse); + volume_size = + (Util.option_bind (Xml.member "VolumeSize" xml) Integer.parse); + volume_type = + (Util.option_bind (Xml.member "VolumeType" xml) String.parse); + delete_on_termination = + (Util.option_bind (Xml.member "DeleteOnTermination" xml) + Boolean.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.volume_type + (fun f -> Query.Pair ("VolumeType", (String.to_query f))); + Util.option_map v.volume_size + (fun f -> Query.Pair ("VolumeSize", (Integer.to_query f))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.volume_type + (fun f -> ("volume_type", (String.to_json f))); + Util.option_map v.volume_size + (fun f -> ("volume_size", (Integer.to_json f))); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f)))]) + let of_json j = + { + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + volume_size = + (Util.option_map (Json.lookup j "volume_size") Integer.of_json); + volume_type = + (Util.option_map (Json.lookup j "volume_type") String.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.volume_type (fun f -> - Query.Pair ("VolumeType", String.to_query f)) - ; Util.option_map v.volume_size (fun f -> - Query.Pair ("VolumeSize", Integer.to_query f)) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.volume_type (fun f -> "volume_type", String.to_json f) - ; Util.option_map v.volume_size (fun f -> "volume_size", Integer.to_json f) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ]) - - let of_json j = - { snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; volume_size = Util.option_map (Json.lookup j "volume_size") Integer.of_json - ; volume_type = Util.option_map (Json.lookup j "volume_type") String.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - } -end - -module Alarm = struct - type t = - { alarm_name : String.t option - ; alarm_a_r_n : String.t option - } - - let make ?alarm_name ?alarm_a_r_n () = { alarm_name; alarm_a_r_n } - - let parse xml = - Some - { alarm_name = Util.option_bind (Xml.member "AlarmName" xml) String.parse - ; alarm_a_r_n = Util.option_bind (Xml.member "AlarmARN" xml) String.parse + end +module Alarm = + struct + type t = { + alarm_name: String.t option ; + alarm_a_r_n: String.t option } + let make ?alarm_name ?alarm_a_r_n () = { alarm_name; alarm_a_r_n } + let parse xml = + Some + { + alarm_name = + (Util.option_bind (Xml.member "AlarmName" xml) String.parse); + alarm_a_r_n = + (Util.option_bind (Xml.member "AlarmARN" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.alarm_a_r_n + (fun f -> Query.Pair ("AlarmARN", (String.to_query f))); + Util.option_map v.alarm_name + (fun f -> Query.Pair ("AlarmName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.alarm_a_r_n + (fun f -> ("alarm_a_r_n", (String.to_json f))); + Util.option_map v.alarm_name + (fun f -> ("alarm_name", (String.to_json f)))]) + let of_json j = + { + alarm_name = + (Util.option_map (Json.lookup j "alarm_name") String.of_json); + alarm_a_r_n = + (Util.option_map (Json.lookup j "alarm_a_r_n") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.alarm_a_r_n (fun f -> - Query.Pair ("AlarmARN", String.to_query f)) - ; Util.option_map v.alarm_name (fun f -> - Query.Pair ("AlarmName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.alarm_a_r_n (fun f -> "alarm_a_r_n", String.to_json f) - ; Util.option_map v.alarm_name (fun f -> "alarm_name", String.to_json f) - ]) - - let of_json j = - { alarm_name = Util.option_map (Json.lookup j "alarm_name") String.of_json - ; alarm_a_r_n = Util.option_map (Json.lookup j "alarm_a_r_n") String.of_json - } -end - -module StepAdjustment = struct - type t = - { metric_interval_lower_bound : Double.t option - ; metric_interval_upper_bound : Double.t option - ; scaling_adjustment : Integer.t - } - - let make - ?metric_interval_lower_bound - ?metric_interval_upper_bound - ~scaling_adjustment - () = - { metric_interval_lower_bound; metric_interval_upper_bound; scaling_adjustment } - - let parse xml = - Some - { metric_interval_lower_bound = - Util.option_bind (Xml.member "MetricIntervalLowerBound" xml) Double.parse - ; metric_interval_upper_bound = - Util.option_bind (Xml.member "MetricIntervalUpperBound" xml) Double.parse - ; scaling_adjustment = - Xml.required - "ScalingAdjustment" - (Util.option_bind (Xml.member "ScalingAdjustment" xml) Integer.parse) + end +module StepAdjustment = + struct + type t = + { + metric_interval_lower_bound: Double.t option ; + metric_interval_upper_bound: Double.t option ; + scaling_adjustment: Integer.t } + let make ?metric_interval_lower_bound ?metric_interval_upper_bound + ~scaling_adjustment () = + { + metric_interval_lower_bound; + metric_interval_upper_bound; + scaling_adjustment } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ScalingAdjustment", Integer.to_query v.scaling_adjustment)) - ; Util.option_map v.metric_interval_upper_bound (fun f -> - Query.Pair ("MetricIntervalUpperBound", Double.to_query f)) - ; Util.option_map v.metric_interval_lower_bound (fun f -> - Query.Pair ("MetricIntervalLowerBound", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("scaling_adjustment", Integer.to_json v.scaling_adjustment) - ; Util.option_map v.metric_interval_upper_bound (fun f -> - "metric_interval_upper_bound", Double.to_json f) - ; Util.option_map v.metric_interval_lower_bound (fun f -> - "metric_interval_lower_bound", Double.to_json f) - ]) - - let of_json j = - { metric_interval_lower_bound = - Util.option_map (Json.lookup j "metric_interval_lower_bound") Double.of_json - ; metric_interval_upper_bound = - Util.option_map (Json.lookup j "metric_interval_upper_bound") Double.of_json - ; scaling_adjustment = - Integer.of_json (Util.of_option_exn (Json.lookup j "scaling_adjustment")) - } -end - -module EnabledMetric = struct - type t = - { metric : String.t option - ; granularity : String.t option - } - - let make ?metric ?granularity () = { metric; granularity } - - let parse xml = - Some - { metric = Util.option_bind (Xml.member "Metric" xml) String.parse - ; granularity = Util.option_bind (Xml.member "Granularity" xml) String.parse + let parse xml = + Some + { + metric_interval_lower_bound = + (Util.option_bind (Xml.member "MetricIntervalLowerBound" xml) + Double.parse); + metric_interval_upper_bound = + (Util.option_bind (Xml.member "MetricIntervalUpperBound" xml) + Double.parse); + scaling_adjustment = + (Xml.required "ScalingAdjustment" + (Util.option_bind (Xml.member "ScalingAdjustment" xml) + Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ScalingAdjustment", + (Integer.to_query v.scaling_adjustment))); + Util.option_map v.metric_interval_upper_bound + (fun f -> + Query.Pair ("MetricIntervalUpperBound", (Double.to_query f))); + Util.option_map v.metric_interval_lower_bound + (fun f -> + Query.Pair ("MetricIntervalLowerBound", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("scaling_adjustment", (Integer.to_json v.scaling_adjustment)); + Util.option_map v.metric_interval_upper_bound + (fun f -> ("metric_interval_upper_bound", (Double.to_json f))); + Util.option_map v.metric_interval_lower_bound + (fun f -> ("metric_interval_lower_bound", (Double.to_json f)))]) + let of_json j = + { + metric_interval_lower_bound = + (Util.option_map (Json.lookup j "metric_interval_lower_bound") + Double.of_json); + metric_interval_upper_bound = + (Util.option_map (Json.lookup j "metric_interval_upper_bound") + Double.of_json); + scaling_adjustment = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "scaling_adjustment"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.granularity (fun f -> - Query.Pair ("Granularity", String.to_query f)) - ; Util.option_map v.metric (fun f -> Query.Pair ("Metric", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.granularity (fun f -> "granularity", String.to_json f) - ; Util.option_map v.metric (fun f -> "metric", String.to_json f) - ]) - - let of_json j = - { metric = Util.option_map (Json.lookup j "metric") String.of_json - ; granularity = Util.option_map (Json.lookup j "granularity") String.of_json - } -end - -module Instance = struct - type t = - { instance_id : String.t - ; availability_zone : String.t - ; lifecycle_state : LifecycleState.t - ; health_status : String.t - ; launch_configuration_name : String.t option - } - - let make - ~instance_id - ~availability_zone - ~lifecycle_state - ~health_status - ?launch_configuration_name - () = - { instance_id - ; availability_zone - ; lifecycle_state - ; health_status - ; launch_configuration_name - } - - let parse xml = - Some - { instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; availability_zone = - Xml.required - "AvailabilityZone" - (Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse) - ; lifecycle_state = - Xml.required - "LifecycleState" - (Util.option_bind (Xml.member "LifecycleState" xml) LifecycleState.parse) - ; health_status = - Xml.required - "HealthStatus" - (Util.option_bind (Xml.member "HealthStatus" xml) String.parse) - ; launch_configuration_name = - Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse + end +module EnabledMetric = + struct + type t = { + metric: String.t option ; + granularity: String.t option } + let make ?metric ?granularity () = { metric; granularity } + let parse xml = + Some + { + metric = (Util.option_bind (Xml.member "Metric" xml) String.parse); + granularity = + (Util.option_bind (Xml.member "Granularity" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.granularity + (fun f -> Query.Pair ("Granularity", (String.to_query f))); + Util.option_map v.metric + (fun f -> Query.Pair ("Metric", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.granularity + (fun f -> ("granularity", (String.to_json f))); + Util.option_map v.metric (fun f -> ("metric", (String.to_json f)))]) + let of_json j = + { + metric = (Util.option_map (Json.lookup j "metric") String.of_json); + granularity = + (Util.option_map (Json.lookup j "granularity") String.of_json) + } + end +module Instance = + struct + type t = + { + instance_id: String.t ; + availability_zone: String.t ; + lifecycle_state: LifecycleState.t ; + health_status: String.t ; + launch_configuration_name: String.t option } + let make ~instance_id ~availability_zone ~lifecycle_state + ~health_status ?launch_configuration_name () = + { + instance_id; + availability_zone; + lifecycle_state; + health_status; + launch_configuration_name } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.launch_configuration_name (fun f -> - Query.Pair ("LaunchConfigurationName", String.to_query f)) - ; Some (Query.Pair ("HealthStatus", String.to_query v.health_status)) - ; Some (Query.Pair ("LifecycleState", LifecycleState.to_query v.lifecycle_state)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.launch_configuration_name (fun f -> - "launch_configuration_name", String.to_json f) - ; Some ("health_status", String.to_json v.health_status) - ; Some ("lifecycle_state", LifecycleState.to_json v.lifecycle_state) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; lifecycle_state = - LifecycleState.of_json (Util.of_option_exn (Json.lookup j "lifecycle_state")) - ; health_status = String.of_json (Util.of_option_exn (Json.lookup j "health_status")) - ; launch_configuration_name = - Util.option_map (Json.lookup j "launch_configuration_name") String.of_json - } -end - -module SuspendedProcess = struct - type t = - { process_name : String.t option - ; suspension_reason : String.t option - } - - let make ?process_name ?suspension_reason () = { process_name; suspension_reason } - - let parse xml = - Some - { process_name = Util.option_bind (Xml.member "ProcessName" xml) String.parse - ; suspension_reason = - Util.option_bind (Xml.member "SuspensionReason" xml) String.parse + let parse xml = + Some + { + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + availability_zone = + (Xml.required "AvailabilityZone" + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse)); + lifecycle_state = + (Xml.required "LifecycleState" + (Util.option_bind (Xml.member "LifecycleState" xml) + LifecycleState.parse)); + health_status = + (Xml.required "HealthStatus" + (Util.option_bind (Xml.member "HealthStatus" xml) String.parse)); + launch_configuration_name = + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.launch_configuration_name + (fun f -> + Query.Pair ("LaunchConfigurationName", (String.to_query f))); + Some + (Query.Pair ("HealthStatus", (String.to_query v.health_status))); + Some + (Query.Pair + ("LifecycleState", + (LifecycleState.to_query v.lifecycle_state))); + Some + (Query.Pair + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.launch_configuration_name + (fun f -> ("launch_configuration_name", (String.to_json f))); + Some ("health_status", (String.to_json v.health_status)); + Some + ("lifecycle_state", (LifecycleState.to_json v.lifecycle_state)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + lifecycle_state = + (LifecycleState.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_state"))); + health_status = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_status"))); + launch_configuration_name = + (Util.option_map (Json.lookup j "launch_configuration_name") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.suspension_reason (fun f -> - Query.Pair ("SuspensionReason", String.to_query f)) - ; Util.option_map v.process_name (fun f -> - Query.Pair ("ProcessName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.suspension_reason (fun f -> - "suspension_reason", String.to_json f) - ; Util.option_map v.process_name (fun f -> "process_name", String.to_json f) - ]) - - let of_json j = - { process_name = Util.option_map (Json.lookup j "process_name") String.of_json - ; suspension_reason = - Util.option_map (Json.lookup j "suspension_reason") String.of_json - } -end - -module TagDescription = struct - type t = - { resource_id : String.t - ; resource_type : String.t - ; key : String.t - ; value : String.t - ; propagate_at_launch : Boolean.t - } - - let make ~resource_id ~resource_type ~key ~value ~propagate_at_launch () = - { resource_id; resource_type; key; value; propagate_at_launch } - - let parse xml = - Some - { resource_id = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse) - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) - ; propagate_at_launch = - Xml.required - "PropagateAtLaunch" - (Util.option_bind (Xml.member "PropagateAtLaunch" xml) Boolean.parse) + end +module SuspendedProcess = + struct + type t = + { + process_name: String.t option ; + suspension_reason: String.t option } + let make ?process_name ?suspension_reason () = + { process_name; suspension_reason } + let parse xml = + Some + { + process_name = + (Util.option_bind (Xml.member "ProcessName" xml) String.parse); + suspension_reason = + (Util.option_bind (Xml.member "SuspensionReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.suspension_reason + (fun f -> Query.Pair ("SuspensionReason", (String.to_query f))); + Util.option_map v.process_name + (fun f -> Query.Pair ("ProcessName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.suspension_reason + (fun f -> ("suspension_reason", (String.to_json f))); + Util.option_map v.process_name + (fun f -> ("process_name", (String.to_json f)))]) + let of_json j = + { + process_name = + (Util.option_map (Json.lookup j "process_name") String.of_json); + suspension_reason = + (Util.option_map (Json.lookup j "suspension_reason") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PropagateAtLaunch", Boolean.to_query v.propagate_at_launch)) - ; Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("ResourceType", String.to_query v.resource_type)) - ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("propagate_at_launch", Boolean.to_json v.propagate_at_launch) - ; Some ("value", String.to_json v.value) - ; Some ("key", String.to_json v.key) - ; Some ("resource_type", String.to_json v.resource_type) - ; Some ("resource_id", String.to_json v.resource_id) - ]) - - let of_json j = - { resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) - ; resource_type = String.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - ; propagate_at_launch = - Boolean.of_json (Util.of_option_exn (Json.lookup j "propagate_at_launch")) - } -end - -module BlockDeviceMapping = struct - type t = - { virtual_name : String.t option - ; device_name : String.t - ; ebs : Ebs.t option - ; no_device : Boolean.t option - } - - let make ?virtual_name ~device_name ?ebs ?no_device () = - { virtual_name; device_name; ebs; no_device } - - let parse xml = - Some - { virtual_name = Util.option_bind (Xml.member "VirtualName" xml) String.parse - ; device_name = - Xml.required - "DeviceName" - (Util.option_bind (Xml.member "DeviceName" xml) String.parse) - ; ebs = Util.option_bind (Xml.member "Ebs" xml) Ebs.parse - ; no_device = Util.option_bind (Xml.member "NoDevice" xml) Boolean.parse + end +module TagDescription = + struct + type t = + { + resource_id: String.t ; + resource_type: String.t ; + key: String.t ; + value: String.t ; + propagate_at_launch: Boolean.t } + let make ~resource_id ~resource_type ~key ~value ~propagate_at_launch + () = { resource_id; resource_type; key; value; propagate_at_launch } + let parse xml = + Some + { + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)); + propagate_at_launch = + (Xml.required "PropagateAtLaunch" + (Util.option_bind (Xml.member "PropagateAtLaunch" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PropagateAtLaunch", + (Boolean.to_query v.propagate_at_launch))); + Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some + (Query.Pair ("ResourceType", (String.to_query v.resource_type))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("propagate_at_launch", + (Boolean.to_json v.propagate_at_launch)); + Some ("value", (String.to_json v.value)); + Some ("key", (String.to_json v.key)); + Some ("resource_type", (String.to_json v.resource_type)); + Some ("resource_id", (String.to_json v.resource_id))]) + let of_json j = + { + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + resource_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))); + propagate_at_launch = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "propagate_at_launch"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> - Query.Pair ("NoDevice", Boolean.to_query f)) - ; Util.option_map v.ebs (fun f -> Query.Pair ("Ebs", Ebs.to_query f)) - ; Some (Query.Pair ("DeviceName", String.to_query v.device_name)) - ; Util.option_map v.virtual_name (fun f -> - Query.Pair ("VirtualName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> "no_device", Boolean.to_json f) - ; Util.option_map v.ebs (fun f -> "ebs", Ebs.to_json f) - ; Some ("device_name", String.to_json v.device_name) - ; Util.option_map v.virtual_name (fun f -> "virtual_name", String.to_json f) - ]) - - let of_json j = - { virtual_name = Util.option_map (Json.lookup j "virtual_name") String.of_json - ; device_name = String.of_json (Util.of_option_exn (Json.lookup j "device_name")) - ; ebs = Util.option_map (Json.lookup j "ebs") Ebs.of_json - ; no_device = Util.option_map (Json.lookup j "no_device") Boolean.of_json - } -end - -module Values = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Alarms = struct - type t = Alarm.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Alarm.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Alarm.to_query v - - let to_json v = `List (List.map Alarm.to_json v) - - let of_json j = Json.to_list Alarm.of_json j -end - -module StepAdjustments = struct - type t = StepAdjustment.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map StepAdjustment.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StepAdjustment.to_query v - - let to_json v = `List (List.map StepAdjustment.to_json v) - - let of_json j = Json.to_list StepAdjustment.of_json j -end - -module ScalingActivityStatusCode = struct - type t = - | WaitingForSpotInstanceRequestId - | WaitingForSpotInstanceId - | WaitingForInstanceId - | PreInService - | InProgress - | WaitingForELBConnectionDraining - | MidLifecycleAction - | WaitingForInstanceWarmup - | Successful - | Failed - | Cancelled - - let str_to_t = - [ "Cancelled", Cancelled - ; "Failed", Failed - ; "Successful", Successful - ; "WaitingForInstanceWarmup", WaitingForInstanceWarmup - ; "MidLifecycleAction", MidLifecycleAction - ; "WaitingForELBConnectionDraining", WaitingForELBConnectionDraining - ; "InProgress", InProgress - ; "PreInService", PreInService - ; "WaitingForInstanceId", WaitingForInstanceId - ; "WaitingForSpotInstanceId", WaitingForSpotInstanceId - ; "WaitingForSpotInstanceRequestId", WaitingForSpotInstanceRequestId - ] - - let t_to_str = - [ Cancelled, "Cancelled" - ; Failed, "Failed" - ; Successful, "Successful" - ; WaitingForInstanceWarmup, "WaitingForInstanceWarmup" - ; MidLifecycleAction, "MidLifecycleAction" - ; WaitingForELBConnectionDraining, "WaitingForELBConnectionDraining" - ; InProgress, "InProgress" - ; PreInService, "PreInService" - ; WaitingForInstanceId, "WaitingForInstanceId" - ; WaitingForSpotInstanceId, "WaitingForSpotInstanceId" - ; WaitingForSpotInstanceRequestId, "WaitingForSpotInstanceRequestId" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AvailabilityZones = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module EnabledMetrics = struct - type t = EnabledMetric.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map EnabledMetric.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list EnabledMetric.to_query v - - let to_json v = `List (List.map EnabledMetric.to_json v) - - let of_json j = Json.to_list EnabledMetric.of_json j -end - -module Instances = struct - type t = Instance.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Instance.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Instance.to_query v - - let to_json v = `List (List.map Instance.to_json v) - - let of_json j = Json.to_list Instance.of_json j -end - -module LoadBalancerNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SuspendedProcesses = struct - type t = SuspendedProcess.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map SuspendedProcess.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list SuspendedProcess.to_query v - - let to_json v = `List (List.map SuspendedProcess.to_json v) - - let of_json j = Json.to_list SuspendedProcess.of_json j -end - -module TagDescriptionList = struct - type t = TagDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map TagDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list TagDescription.to_query v - - let to_json v = `List (List.map TagDescription.to_json v) - - let of_json j = Json.to_list TagDescription.of_json j -end - -module TerminationPolicies = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module BlockDeviceMappings = struct - type t = BlockDeviceMapping.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map BlockDeviceMapping.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list BlockDeviceMapping.to_query v - - let to_json v = `List (List.map BlockDeviceMapping.to_json v) - - let of_json j = Json.to_list BlockDeviceMapping.of_json j -end - -module ClassicLinkVPCSecurityGroups = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module InstanceMonitoring = struct - type t = { enabled : Boolean.t option } - - let make ?enabled () = { enabled } - - let parse xml = - Some { enabled = Util.option_bind (Xml.member "Enabled" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> Query.Pair ("Enabled", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> "enabled", Boolean.to_json f) ]) - - let of_json j = { enabled = Util.option_map (Json.lookup j "enabled") Boolean.of_json } -end - -module SecurityGroups = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Filter = struct - type t = - { name : String.t - ; values : Values.t - } - - let make ~name ?(values = []) () = { name; values } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; values = - Util.of_option [] (Util.option_bind (Xml.member "Values" xml) Values.parse) + end +module BlockDeviceMapping = + struct + type t = + { + virtual_name: String.t option ; + device_name: String.t ; + ebs: Ebs.t option ; + no_device: Boolean.t option } + let make ?virtual_name ~device_name ?ebs ?no_device () = + { virtual_name; device_name; ebs; no_device } + let parse xml = + Some + { + virtual_name = + (Util.option_bind (Xml.member "VirtualName" xml) String.parse); + device_name = + (Xml.required "DeviceName" + (Util.option_bind (Xml.member "DeviceName" xml) String.parse)); + ebs = (Util.option_bind (Xml.member "Ebs" xml) Ebs.parse); + no_device = + (Util.option_bind (Xml.member "NoDevice" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> Query.Pair ("NoDevice", (Boolean.to_query f))); + Util.option_map v.ebs + (fun f -> Query.Pair ("Ebs", (Ebs.to_query f))); + Some (Query.Pair ("DeviceName", (String.to_query v.device_name))); + Util.option_map v.virtual_name + (fun f -> Query.Pair ("VirtualName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> ("no_device", (Boolean.to_json f))); + Util.option_map v.ebs (fun f -> ("ebs", (Ebs.to_json f))); + Some ("device_name", (String.to_json v.device_name)); + Util.option_map v.virtual_name + (fun f -> ("virtual_name", (String.to_json f)))]) + let of_json j = + { + virtual_name = + (Util.option_map (Json.lookup j "virtual_name") String.of_json); + device_name = + (String.of_json (Util.of_option_exn (Json.lookup j "device_name"))); + ebs = (Util.option_map (Json.lookup j "ebs") Ebs.of_json); + no_device = + (Util.option_map (Json.lookup j "no_device") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Values.member", Values.to_query v.values)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("values", Values.to_json v.values) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; values = Values.of_json (Util.of_option_exn (Json.lookup j "values")) - } -end - -module AutoScalingInstanceDetails = struct - type t = - { instance_id : String.t - ; auto_scaling_group_name : String.t - ; availability_zone : String.t - ; lifecycle_state : String.t - ; health_status : String.t - ; launch_configuration_name : String.t - } - - let make - ~instance_id - ~auto_scaling_group_name - ~availability_zone - ~lifecycle_state - ~health_status - ~launch_configuration_name - () = - { instance_id - ; auto_scaling_group_name - ; availability_zone - ; lifecycle_state - ; health_status - ; launch_configuration_name - } - - let parse xml = - Some - { instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; availability_zone = - Xml.required - "AvailabilityZone" - (Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse) - ; lifecycle_state = - Xml.required - "LifecycleState" - (Util.option_bind (Xml.member "LifecycleState" xml) String.parse) - ; health_status = - Xml.required - "HealthStatus" - (Util.option_bind (Xml.member "HealthStatus" xml) String.parse) - ; launch_configuration_name = - Xml.required - "LaunchConfigurationName" - (Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse) + end +module Values = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Alarms = + struct + type t = Alarm.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Alarm.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Alarm.to_query v + let to_json v = `List (List.map Alarm.to_json v) + let of_json j = Json.to_list Alarm.of_json j + end +module StepAdjustments = + struct + type t = StepAdjustment.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map StepAdjustment.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StepAdjustment.to_query v + let to_json v = `List (List.map StepAdjustment.to_json v) + let of_json j = Json.to_list StepAdjustment.of_json j + end +module ScalingActivityStatusCode = + struct + type t = + | WaitingForSpotInstanceRequestId + | WaitingForSpotInstanceId + | WaitingForInstanceId + | PreInService + | InProgress + | WaitingForELBConnectionDraining + | MidLifecycleAction + | WaitingForInstanceWarmup + | Successful + | Failed + | Cancelled + let str_to_t = + [("Cancelled", Cancelled); + ("Failed", Failed); + ("Successful", Successful); + ("WaitingForInstanceWarmup", WaitingForInstanceWarmup); + ("MidLifecycleAction", MidLifecycleAction); + ("WaitingForELBConnectionDraining", WaitingForELBConnectionDraining); + ("InProgress", InProgress); + ("PreInService", PreInService); + ("WaitingForInstanceId", WaitingForInstanceId); + ("WaitingForSpotInstanceId", WaitingForSpotInstanceId); + ("WaitingForSpotInstanceRequestId", WaitingForSpotInstanceRequestId)] + let t_to_str = + [(Cancelled, "Cancelled"); + (Failed, "Failed"); + (Successful, "Successful"); + (WaitingForInstanceWarmup, "WaitingForInstanceWarmup"); + (MidLifecycleAction, "MidLifecycleAction"); + (WaitingForELBConnectionDraining, "WaitingForELBConnectionDraining"); + (InProgress, "InProgress"); + (PreInService, "PreInService"); + (WaitingForInstanceId, "WaitingForInstanceId"); + (WaitingForSpotInstanceId, "WaitingForSpotInstanceId"); + (WaitingForSpotInstanceRequestId, "WaitingForSpotInstanceRequestId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AvailabilityZones = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module EnabledMetrics = + struct + type t = EnabledMetric.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map EnabledMetric.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list EnabledMetric.to_query v + let to_json v = `List (List.map EnabledMetric.to_json v) + let of_json j = Json.to_list EnabledMetric.of_json j + end +module Instances = + struct + type t = Instance.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Instance.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Instance.to_query v + let to_json v = `List (List.map Instance.to_json v) + let of_json j = Json.to_list Instance.of_json j + end +module LoadBalancerNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SuspendedProcesses = + struct + type t = SuspendedProcess.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SuspendedProcess.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list SuspendedProcess.to_query v + let to_json v = `List (List.map SuspendedProcess.to_json v) + let of_json j = Json.to_list SuspendedProcess.of_json j + end +module TagDescriptionList = + struct + type t = TagDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map TagDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list TagDescription.to_query v + let to_json v = `List (List.map TagDescription.to_json v) + let of_json j = Json.to_list TagDescription.of_json j + end +module TerminationPolicies = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module BlockDeviceMappings = + struct + type t = BlockDeviceMapping.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BlockDeviceMapping.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list BlockDeviceMapping.to_query v + let to_json v = `List (List.map BlockDeviceMapping.to_json v) + let of_json j = Json.to_list BlockDeviceMapping.of_json j + end +module ClassicLinkVPCSecurityGroups = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceMonitoring = + struct + type t = { + enabled: Boolean.t option } + let make ?enabled () = { enabled } + let parse xml = + Some + { + enabled = + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> Query.Pair ("Enabled", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> ("enabled", (Boolean.to_json f)))]) + let of_json j = + { enabled = (Util.option_map (Json.lookup j "enabled") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module SecurityGroups = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Filter = + struct + type t = { + name: String.t ; + values: Values.t } + let make ~name ?(values= []) () = { name; values } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + values = + (Util.of_option [] + (Util.option_bind (Xml.member "Values" xml) Values.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Values.member", (Values.to_query v.values))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("values", (Values.to_json v.values)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + values = + (Values.of_json (Util.of_option_exn (Json.lookup j "values"))) + } + end +module AutoScalingInstanceDetails = + struct + type t = + { + instance_id: String.t ; + auto_scaling_group_name: String.t ; + availability_zone: String.t ; + lifecycle_state: String.t ; + health_status: String.t ; + launch_configuration_name: String.t } + let make ~instance_id ~auto_scaling_group_name ~availability_zone + ~lifecycle_state ~health_status ~launch_configuration_name () = + { + instance_id; + auto_scaling_group_name; + availability_zone; + lifecycle_state; + health_status; + launch_configuration_name + } + let parse xml = + Some + { + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + availability_zone = + (Xml.required "AvailabilityZone" + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse)); + lifecycle_state = + (Xml.required "LifecycleState" + (Util.option_bind (Xml.member "LifecycleState" xml) + String.parse)); + health_status = + (Xml.required "HealthStatus" + (Util.option_bind (Xml.member "HealthStatus" xml) String.parse)); + launch_configuration_name = + (Xml.required "LaunchConfigurationName" + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LaunchConfigurationName", + (String.to_query v.launch_configuration_name))); + Some + (Query.Pair ("HealthStatus", (String.to_query v.health_status))); + Some + (Query.Pair + ("LifecycleState", (String.to_query v.lifecycle_state))); + Some (Query.Pair - ("LaunchConfigurationName", String.to_query v.launch_configuration_name)) - ; Some (Query.Pair ("HealthStatus", String.to_query v.health_status)) - ; Some (Query.Pair ("LifecycleState", String.to_query v.lifecycle_state)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("launch_configuration_name", String.to_json v.launch_configuration_name) - ; Some ("health_status", String.to_json v.health_status) - ; Some ("lifecycle_state", String.to_json v.lifecycle_state) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; lifecycle_state = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_state")) - ; health_status = String.of_json (Util.of_option_exn (Json.lookup j "health_status")) - ; launch_configuration_name = - String.of_json (Util.of_option_exn (Json.lookup j "launch_configuration_name")) - } -end - -module ScalingPolicy = struct - type t = - { auto_scaling_group_name : String.t option - ; policy_name : String.t option - ; policy_a_r_n : String.t option - ; policy_type : String.t option - ; adjustment_type : String.t option - ; min_adjustment_step : Integer.t option - ; min_adjustment_magnitude : Integer.t option - ; scaling_adjustment : Integer.t option - ; cooldown : Integer.t option - ; step_adjustments : StepAdjustments.t - ; metric_aggregation_type : String.t option - ; estimated_instance_warmup : Integer.t option - ; alarms : Alarms.t - } - - let make - ?auto_scaling_group_name - ?policy_name - ?policy_a_r_n - ?policy_type - ?adjustment_type - ?min_adjustment_step - ?min_adjustment_magnitude - ?scaling_adjustment - ?cooldown - ?(step_adjustments = []) - ?metric_aggregation_type - ?estimated_instance_warmup - ?(alarms = []) - () = - { auto_scaling_group_name - ; policy_name - ; policy_a_r_n - ; policy_type - ; adjustment_type - ; min_adjustment_step - ; min_adjustment_magnitude - ; scaling_adjustment - ; cooldown - ; step_adjustments - ; metric_aggregation_type - ; estimated_instance_warmup - ; alarms - } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; policy_name = Util.option_bind (Xml.member "PolicyName" xml) String.parse - ; policy_a_r_n = Util.option_bind (Xml.member "PolicyARN" xml) String.parse - ; policy_type = Util.option_bind (Xml.member "PolicyType" xml) String.parse - ; adjustment_type = Util.option_bind (Xml.member "AdjustmentType" xml) String.parse - ; min_adjustment_step = - Util.option_bind (Xml.member "MinAdjustmentStep" xml) Integer.parse - ; min_adjustment_magnitude = - Util.option_bind (Xml.member "MinAdjustmentMagnitude" xml) Integer.parse - ; scaling_adjustment = - Util.option_bind (Xml.member "ScalingAdjustment" xml) Integer.parse - ; cooldown = Util.option_bind (Xml.member "Cooldown" xml) Integer.parse - ; step_adjustments = - Util.of_option - [] - (Util.option_bind (Xml.member "StepAdjustments" xml) StepAdjustments.parse) - ; metric_aggregation_type = - Util.option_bind (Xml.member "MetricAggregationType" xml) String.parse - ; estimated_instance_warmup = - Util.option_bind (Xml.member "EstimatedInstanceWarmup" xml) Integer.parse - ; alarms = - Util.of_option [] (Util.option_bind (Xml.member "Alarms" xml) Alarms.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("launch_configuration_name", + (String.to_json v.launch_configuration_name)); + Some ("health_status", (String.to_json v.health_status)); + Some ("lifecycle_state", (String.to_json v.lifecycle_state)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + lifecycle_state = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_state"))); + health_status = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_status"))); + launch_configuration_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "launch_configuration_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Alarms.member", Alarms.to_query v.alarms)) - ; Util.option_map v.estimated_instance_warmup (fun f -> - Query.Pair ("EstimatedInstanceWarmup", Integer.to_query f)) - ; Util.option_map v.metric_aggregation_type (fun f -> - Query.Pair ("MetricAggregationType", String.to_query f)) - ; Some + end +module ScalingPolicy = + struct + type t = + { + auto_scaling_group_name: String.t option ; + policy_name: String.t option ; + policy_a_r_n: String.t option ; + policy_type: String.t option ; + adjustment_type: String.t option ; + min_adjustment_step: Integer.t option ; + min_adjustment_magnitude: Integer.t option ; + scaling_adjustment: Integer.t option ; + cooldown: Integer.t option ; + step_adjustments: StepAdjustments.t ; + metric_aggregation_type: String.t option ; + estimated_instance_warmup: Integer.t option ; + alarms: Alarms.t } + let make ?auto_scaling_group_name ?policy_name ?policy_a_r_n + ?policy_type ?adjustment_type ?min_adjustment_step + ?min_adjustment_magnitude ?scaling_adjustment ?cooldown + ?(step_adjustments= []) ?metric_aggregation_type + ?estimated_instance_warmup ?(alarms= []) () = + { + auto_scaling_group_name; + policy_name; + policy_a_r_n; + policy_type; + adjustment_type; + min_adjustment_step; + min_adjustment_magnitude; + scaling_adjustment; + cooldown; + step_adjustments; + metric_aggregation_type; + estimated_instance_warmup; + alarms + } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + policy_name = + (Util.option_bind (Xml.member "PolicyName" xml) String.parse); + policy_a_r_n = + (Util.option_bind (Xml.member "PolicyARN" xml) String.parse); + policy_type = + (Util.option_bind (Xml.member "PolicyType" xml) String.parse); + adjustment_type = + (Util.option_bind (Xml.member "AdjustmentType" xml) String.parse); + min_adjustment_step = + (Util.option_bind (Xml.member "MinAdjustmentStep" xml) + Integer.parse); + min_adjustment_magnitude = + (Util.option_bind (Xml.member "MinAdjustmentMagnitude" xml) + Integer.parse); + scaling_adjustment = + (Util.option_bind (Xml.member "ScalingAdjustment" xml) + Integer.parse); + cooldown = + (Util.option_bind (Xml.member "Cooldown" xml) Integer.parse); + step_adjustments = + (Util.of_option [] + (Util.option_bind (Xml.member "StepAdjustments" xml) + StepAdjustments.parse)); + metric_aggregation_type = + (Util.option_bind (Xml.member "MetricAggregationType" xml) + String.parse); + estimated_instance_warmup = + (Util.option_bind (Xml.member "EstimatedInstanceWarmup" xml) + Integer.parse); + alarms = + (Util.of_option [] + (Util.option_bind (Xml.member "Alarms" xml) Alarms.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Alarms.member", (Alarms.to_query v.alarms))); + Util.option_map v.estimated_instance_warmup + (fun f -> + Query.Pair ("EstimatedInstanceWarmup", (Integer.to_query f))); + Util.option_map v.metric_aggregation_type + (fun f -> + Query.Pair ("MetricAggregationType", (String.to_query f))); + Some (Query.Pair - ("StepAdjustments.member", StepAdjustments.to_query v.step_adjustments)) - ; Util.option_map v.cooldown (fun f -> - Query.Pair ("Cooldown", Integer.to_query f)) - ; Util.option_map v.scaling_adjustment (fun f -> - Query.Pair ("ScalingAdjustment", Integer.to_query f)) - ; Util.option_map v.min_adjustment_magnitude (fun f -> - Query.Pair ("MinAdjustmentMagnitude", Integer.to_query f)) - ; Util.option_map v.min_adjustment_step (fun f -> - Query.Pair ("MinAdjustmentStep", Integer.to_query f)) - ; Util.option_map v.adjustment_type (fun f -> - Query.Pair ("AdjustmentType", String.to_query f)) - ; Util.option_map v.policy_type (fun f -> - Query.Pair ("PolicyType", String.to_query f)) - ; Util.option_map v.policy_a_r_n (fun f -> - Query.Pair ("PolicyARN", String.to_query f)) - ; Util.option_map v.policy_name (fun f -> - Query.Pair ("PolicyName", String.to_query f)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("alarms", Alarms.to_json v.alarms) - ; Util.option_map v.estimated_instance_warmup (fun f -> - "estimated_instance_warmup", Integer.to_json f) - ; Util.option_map v.metric_aggregation_type (fun f -> - "metric_aggregation_type", String.to_json f) - ; Some ("step_adjustments", StepAdjustments.to_json v.step_adjustments) - ; Util.option_map v.cooldown (fun f -> "cooldown", Integer.to_json f) - ; Util.option_map v.scaling_adjustment (fun f -> - "scaling_adjustment", Integer.to_json f) - ; Util.option_map v.min_adjustment_magnitude (fun f -> - "min_adjustment_magnitude", Integer.to_json f) - ; Util.option_map v.min_adjustment_step (fun f -> - "min_adjustment_step", Integer.to_json f) - ; Util.option_map v.adjustment_type (fun f -> - "adjustment_type", String.to_json f) - ; Util.option_map v.policy_type (fun f -> "policy_type", String.to_json f) - ; Util.option_map v.policy_a_r_n (fun f -> "policy_a_r_n", String.to_json f) - ; Util.option_map v.policy_name (fun f -> "policy_name", String.to_json f) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; policy_name = Util.option_map (Json.lookup j "policy_name") String.of_json - ; policy_a_r_n = Util.option_map (Json.lookup j "policy_a_r_n") String.of_json - ; policy_type = Util.option_map (Json.lookup j "policy_type") String.of_json - ; adjustment_type = Util.option_map (Json.lookup j "adjustment_type") String.of_json - ; min_adjustment_step = - Util.option_map (Json.lookup j "min_adjustment_step") Integer.of_json - ; min_adjustment_magnitude = - Util.option_map (Json.lookup j "min_adjustment_magnitude") Integer.of_json - ; scaling_adjustment = - Util.option_map (Json.lookup j "scaling_adjustment") Integer.of_json - ; cooldown = Util.option_map (Json.lookup j "cooldown") Integer.of_json - ; step_adjustments = - StepAdjustments.of_json (Util.of_option_exn (Json.lookup j "step_adjustments")) - ; metric_aggregation_type = - Util.option_map (Json.lookup j "metric_aggregation_type") String.of_json - ; estimated_instance_warmup = - Util.option_map (Json.lookup j "estimated_instance_warmup") Integer.of_json - ; alarms = Alarms.of_json (Util.of_option_exn (Json.lookup j "alarms")) - } -end - -module Tag = struct - type t = - { resource_id : String.t - ; resource_type : String.t - ; key : String.t - ; value : String.t - ; propagate_at_launch : Boolean.t - } - - let make ~resource_id ~resource_type ~key ~value ~propagate_at_launch () = - { resource_id; resource_type; key; value; propagate_at_launch } - - let parse xml = - Some - { resource_id = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse) - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) - ; propagate_at_launch = - Xml.required - "PropagateAtLaunch" - (Util.option_bind (Xml.member "PropagateAtLaunch" xml) Boolean.parse) + ("StepAdjustments.member", + (StepAdjustments.to_query v.step_adjustments))); + Util.option_map v.cooldown + (fun f -> Query.Pair ("Cooldown", (Integer.to_query f))); + Util.option_map v.scaling_adjustment + (fun f -> Query.Pair ("ScalingAdjustment", (Integer.to_query f))); + Util.option_map v.min_adjustment_magnitude + (fun f -> + Query.Pair ("MinAdjustmentMagnitude", (Integer.to_query f))); + Util.option_map v.min_adjustment_step + (fun f -> Query.Pair ("MinAdjustmentStep", (Integer.to_query f))); + Util.option_map v.adjustment_type + (fun f -> Query.Pair ("AdjustmentType", (String.to_query f))); + Util.option_map v.policy_type + (fun f -> Query.Pair ("PolicyType", (String.to_query f))); + Util.option_map v.policy_a_r_n + (fun f -> Query.Pair ("PolicyARN", (String.to_query f))); + Util.option_map v.policy_name + (fun f -> Query.Pair ("PolicyName", (String.to_query f))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("alarms", (Alarms.to_json v.alarms)); + Util.option_map v.estimated_instance_warmup + (fun f -> ("estimated_instance_warmup", (Integer.to_json f))); + Util.option_map v.metric_aggregation_type + (fun f -> ("metric_aggregation_type", (String.to_json f))); + Some + ("step_adjustments", + (StepAdjustments.to_json v.step_adjustments)); + Util.option_map v.cooldown + (fun f -> ("cooldown", (Integer.to_json f))); + Util.option_map v.scaling_adjustment + (fun f -> ("scaling_adjustment", (Integer.to_json f))); + Util.option_map v.min_adjustment_magnitude + (fun f -> ("min_adjustment_magnitude", (Integer.to_json f))); + Util.option_map v.min_adjustment_step + (fun f -> ("min_adjustment_step", (Integer.to_json f))); + Util.option_map v.adjustment_type + (fun f -> ("adjustment_type", (String.to_json f))); + Util.option_map v.policy_type + (fun f -> ("policy_type", (String.to_json f))); + Util.option_map v.policy_a_r_n + (fun f -> ("policy_a_r_n", (String.to_json f))); + Util.option_map v.policy_name + (fun f -> ("policy_name", (String.to_json f))); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + policy_name = + (Util.option_map (Json.lookup j "policy_name") String.of_json); + policy_a_r_n = + (Util.option_map (Json.lookup j "policy_a_r_n") String.of_json); + policy_type = + (Util.option_map (Json.lookup j "policy_type") String.of_json); + adjustment_type = + (Util.option_map (Json.lookup j "adjustment_type") String.of_json); + min_adjustment_step = + (Util.option_map (Json.lookup j "min_adjustment_step") + Integer.of_json); + min_adjustment_magnitude = + (Util.option_map (Json.lookup j "min_adjustment_magnitude") + Integer.of_json); + scaling_adjustment = + (Util.option_map (Json.lookup j "scaling_adjustment") + Integer.of_json); + cooldown = + (Util.option_map (Json.lookup j "cooldown") Integer.of_json); + step_adjustments = + (StepAdjustments.of_json + (Util.of_option_exn (Json.lookup j "step_adjustments"))); + metric_aggregation_type = + (Util.option_map (Json.lookup j "metric_aggregation_type") + String.of_json); + estimated_instance_warmup = + (Util.option_map (Json.lookup j "estimated_instance_warmup") + Integer.of_json); + alarms = + (Alarms.of_json (Util.of_option_exn (Json.lookup j "alarms"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PropagateAtLaunch", Boolean.to_query v.propagate_at_launch)) - ; Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("ResourceType", String.to_query v.resource_type)) - ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("propagate_at_launch", Boolean.to_json v.propagate_at_launch) - ; Some ("value", String.to_json v.value) - ; Some ("key", String.to_json v.key) - ; Some ("resource_type", String.to_json v.resource_type) - ; Some ("resource_id", String.to_json v.resource_id) - ]) - - let of_json j = - { resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) - ; resource_type = String.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - ; propagate_at_launch = - Boolean.of_json (Util.of_option_exn (Json.lookup j "propagate_at_launch")) - } -end - -module LifecycleHook = struct - type t = - { lifecycle_hook_name : String.t option - ; auto_scaling_group_name : String.t option - ; lifecycle_transition : String.t option - ; notification_target_a_r_n : String.t option - ; role_a_r_n : String.t option - ; notification_metadata : String.t option - ; heartbeat_timeout : Integer.t option - ; global_timeout : Integer.t option - ; default_result : String.t option - } - - let make - ?lifecycle_hook_name - ?auto_scaling_group_name - ?lifecycle_transition - ?notification_target_a_r_n - ?role_a_r_n - ?notification_metadata - ?heartbeat_timeout - ?global_timeout - ?default_result - () = - { lifecycle_hook_name - ; auto_scaling_group_name - ; lifecycle_transition - ; notification_target_a_r_n - ; role_a_r_n - ; notification_metadata - ; heartbeat_timeout - ; global_timeout - ; default_result - } - - let parse xml = - Some - { lifecycle_hook_name = - Util.option_bind (Xml.member "LifecycleHookName" xml) String.parse - ; auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; lifecycle_transition = - Util.option_bind (Xml.member "LifecycleTransition" xml) String.parse - ; notification_target_a_r_n = - Util.option_bind (Xml.member "NotificationTargetARN" xml) String.parse - ; role_a_r_n = Util.option_bind (Xml.member "RoleARN" xml) String.parse - ; notification_metadata = - Util.option_bind (Xml.member "NotificationMetadata" xml) String.parse - ; heartbeat_timeout = - Util.option_bind (Xml.member "HeartbeatTimeout" xml) Integer.parse - ; global_timeout = Util.option_bind (Xml.member "GlobalTimeout" xml) Integer.parse - ; default_result = Util.option_bind (Xml.member "DefaultResult" xml) String.parse + end +module Tag = + struct + type t = + { + resource_id: String.t ; + resource_type: String.t ; + key: String.t ; + value: String.t ; + propagate_at_launch: Boolean.t } + let make ~resource_id ~resource_type ~key ~value ~propagate_at_launch + () = { resource_id; resource_type; key; value; propagate_at_launch } + let parse xml = + Some + { + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)); + propagate_at_launch = + (Xml.required "PropagateAtLaunch" + (Util.option_bind (Xml.member "PropagateAtLaunch" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PropagateAtLaunch", + (Boolean.to_query v.propagate_at_launch))); + Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some + (Query.Pair ("ResourceType", (String.to_query v.resource_type))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("propagate_at_launch", + (Boolean.to_json v.propagate_at_launch)); + Some ("value", (String.to_json v.value)); + Some ("key", (String.to_json v.key)); + Some ("resource_type", (String.to_json v.resource_type)); + Some ("resource_id", (String.to_json v.resource_id))]) + let of_json j = + { + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + resource_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))); + propagate_at_launch = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "propagate_at_launch"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.default_result (fun f -> - Query.Pair ("DefaultResult", String.to_query f)) - ; Util.option_map v.global_timeout (fun f -> - Query.Pair ("GlobalTimeout", Integer.to_query f)) - ; Util.option_map v.heartbeat_timeout (fun f -> - Query.Pair ("HeartbeatTimeout", Integer.to_query f)) - ; Util.option_map v.notification_metadata (fun f -> - Query.Pair ("NotificationMetadata", String.to_query f)) - ; Util.option_map v.role_a_r_n (fun f -> - Query.Pair ("RoleARN", String.to_query f)) - ; Util.option_map v.notification_target_a_r_n (fun f -> - Query.Pair ("NotificationTargetARN", String.to_query f)) - ; Util.option_map v.lifecycle_transition (fun f -> - Query.Pair ("LifecycleTransition", String.to_query f)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ; Util.option_map v.lifecycle_hook_name (fun f -> - Query.Pair ("LifecycleHookName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.default_result (fun f -> "default_result", String.to_json f) - ; Util.option_map v.global_timeout (fun f -> "global_timeout", Integer.to_json f) - ; Util.option_map v.heartbeat_timeout (fun f -> - "heartbeat_timeout", Integer.to_json f) - ; Util.option_map v.notification_metadata (fun f -> - "notification_metadata", String.to_json f) - ; Util.option_map v.role_a_r_n (fun f -> "role_a_r_n", String.to_json f) - ; Util.option_map v.notification_target_a_r_n (fun f -> - "notification_target_a_r_n", String.to_json f) - ; Util.option_map v.lifecycle_transition (fun f -> - "lifecycle_transition", String.to_json f) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ; Util.option_map v.lifecycle_hook_name (fun f -> - "lifecycle_hook_name", String.to_json f) - ]) - - let of_json j = - { lifecycle_hook_name = - Util.option_map (Json.lookup j "lifecycle_hook_name") String.of_json - ; auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; lifecycle_transition = - Util.option_map (Json.lookup j "lifecycle_transition") String.of_json - ; notification_target_a_r_n = - Util.option_map (Json.lookup j "notification_target_a_r_n") String.of_json - ; role_a_r_n = Util.option_map (Json.lookup j "role_a_r_n") String.of_json - ; notification_metadata = - Util.option_map (Json.lookup j "notification_metadata") String.of_json - ; heartbeat_timeout = - Util.option_map (Json.lookup j "heartbeat_timeout") Integer.of_json - ; global_timeout = Util.option_map (Json.lookup j "global_timeout") Integer.of_json - ; default_result = Util.option_map (Json.lookup j "default_result") String.of_json - } -end - -module Activity = struct - type t = - { activity_id : String.t - ; auto_scaling_group_name : String.t - ; description : String.t option - ; cause : String.t - ; start_time : DateTime.t - ; end_time : DateTime.t option - ; status_code : ScalingActivityStatusCode.t - ; status_message : String.t option - ; progress : Integer.t option - ; details : String.t option - } - - let make - ~activity_id - ~auto_scaling_group_name - ?description - ~cause - ~start_time - ?end_time - ~status_code - ?status_message - ?progress - ?details - () = - { activity_id - ; auto_scaling_group_name - ; description - ; cause - ; start_time - ; end_time - ; status_code - ; status_message - ; progress - ; details - } - - let parse xml = - Some - { activity_id = - Xml.required - "ActivityId" - (Util.option_bind (Xml.member "ActivityId" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; cause = - Xml.required "Cause" (Util.option_bind (Xml.member "Cause" xml) String.parse) - ; start_time = - Xml.required - "StartTime" - (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse) - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; status_code = - Xml.required - "StatusCode" - (Util.option_bind - (Xml.member "StatusCode" xml) - ScalingActivityStatusCode.parse) - ; status_message = Util.option_bind (Xml.member "StatusMessage" xml) String.parse - ; progress = Util.option_bind (Xml.member "Progress" xml) Integer.parse - ; details = Util.option_bind (Xml.member "Details" xml) String.parse + end +module LifecycleHook = + struct + type t = + { + lifecycle_hook_name: String.t option ; + auto_scaling_group_name: String.t option ; + lifecycle_transition: String.t option ; + notification_target_a_r_n: String.t option ; + role_a_r_n: String.t option ; + notification_metadata: String.t option ; + heartbeat_timeout: Integer.t option ; + global_timeout: Integer.t option ; + default_result: String.t option } + let make ?lifecycle_hook_name ?auto_scaling_group_name + ?lifecycle_transition ?notification_target_a_r_n ?role_a_r_n + ?notification_metadata ?heartbeat_timeout ?global_timeout + ?default_result () = + { + lifecycle_hook_name; + auto_scaling_group_name; + lifecycle_transition; + notification_target_a_r_n; + role_a_r_n; + notification_metadata; + heartbeat_timeout; + global_timeout; + default_result + } + let parse xml = + Some + { + lifecycle_hook_name = + (Util.option_bind (Xml.member "LifecycleHookName" xml) + String.parse); + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + lifecycle_transition = + (Util.option_bind (Xml.member "LifecycleTransition" xml) + String.parse); + notification_target_a_r_n = + (Util.option_bind (Xml.member "NotificationTargetARN" xml) + String.parse); + role_a_r_n = + (Util.option_bind (Xml.member "RoleARN" xml) String.parse); + notification_metadata = + (Util.option_bind (Xml.member "NotificationMetadata" xml) + String.parse); + heartbeat_timeout = + (Util.option_bind (Xml.member "HeartbeatTimeout" xml) + Integer.parse); + global_timeout = + (Util.option_bind (Xml.member "GlobalTimeout" xml) Integer.parse); + default_result = + (Util.option_bind (Xml.member "DefaultResult" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.default_result + (fun f -> Query.Pair ("DefaultResult", (String.to_query f))); + Util.option_map v.global_timeout + (fun f -> Query.Pair ("GlobalTimeout", (Integer.to_query f))); + Util.option_map v.heartbeat_timeout + (fun f -> Query.Pair ("HeartbeatTimeout", (Integer.to_query f))); + Util.option_map v.notification_metadata + (fun f -> + Query.Pair ("NotificationMetadata", (String.to_query f))); + Util.option_map v.role_a_r_n + (fun f -> Query.Pair ("RoleARN", (String.to_query f))); + Util.option_map v.notification_target_a_r_n + (fun f -> + Query.Pair ("NotificationTargetARN", (String.to_query f))); + Util.option_map v.lifecycle_transition + (fun f -> + Query.Pair ("LifecycleTransition", (String.to_query f))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f))); + Util.option_map v.lifecycle_hook_name + (fun f -> Query.Pair ("LifecycleHookName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.default_result + (fun f -> ("default_result", (String.to_json f))); + Util.option_map v.global_timeout + (fun f -> ("global_timeout", (Integer.to_json f))); + Util.option_map v.heartbeat_timeout + (fun f -> ("heartbeat_timeout", (Integer.to_json f))); + Util.option_map v.notification_metadata + (fun f -> ("notification_metadata", (String.to_json f))); + Util.option_map v.role_a_r_n + (fun f -> ("role_a_r_n", (String.to_json f))); + Util.option_map v.notification_target_a_r_n + (fun f -> ("notification_target_a_r_n", (String.to_json f))); + Util.option_map v.lifecycle_transition + (fun f -> ("lifecycle_transition", (String.to_json f))); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f))); + Util.option_map v.lifecycle_hook_name + (fun f -> ("lifecycle_hook_name", (String.to_json f)))]) + let of_json j = + { + lifecycle_hook_name = + (Util.option_map (Json.lookup j "lifecycle_hook_name") + String.of_json); + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + lifecycle_transition = + (Util.option_map (Json.lookup j "lifecycle_transition") + String.of_json); + notification_target_a_r_n = + (Util.option_map (Json.lookup j "notification_target_a_r_n") + String.of_json); + role_a_r_n = + (Util.option_map (Json.lookup j "role_a_r_n") String.of_json); + notification_metadata = + (Util.option_map (Json.lookup j "notification_metadata") + String.of_json); + heartbeat_timeout = + (Util.option_map (Json.lookup j "heartbeat_timeout") + Integer.of_json); + global_timeout = + (Util.option_map (Json.lookup j "global_timeout") Integer.of_json); + default_result = + (Util.option_map (Json.lookup j "default_result") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.details (fun f -> Query.Pair ("Details", String.to_query f)) - ; Util.option_map v.progress (fun f -> - Query.Pair ("Progress", Integer.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Some - (Query.Pair ("StatusCode", ScalingActivityStatusCode.to_query v.status_code)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Some (Query.Pair ("Cause", String.to_query v.cause)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some + end +module Activity = + struct + type t = + { + activity_id: String.t ; + auto_scaling_group_name: String.t ; + description: String.t option ; + cause: String.t ; + start_time: DateTime.t ; + end_time: DateTime.t option ; + status_code: ScalingActivityStatusCode.t ; + status_message: String.t option ; + progress: Integer.t option ; + details: String.t option } + let make ~activity_id ~auto_scaling_group_name ?description ~cause + ~start_time ?end_time ~status_code ?status_message ?progress + ?details () = + { + activity_id; + auto_scaling_group_name; + description; + cause; + start_time; + end_time; + status_code; + status_message; + progress; + details + } + let parse xml = + Some + { + activity_id = + (Xml.required "ActivityId" + (Util.option_bind (Xml.member "ActivityId" xml) String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + cause = + (Xml.required "Cause" + (Util.option_bind (Xml.member "Cause" xml) String.parse)); + start_time = + (Xml.required "StartTime" + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse)); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + status_code = + (Xml.required "StatusCode" + (Util.option_bind (Xml.member "StatusCode" xml) + ScalingActivityStatusCode.parse)); + status_message = + (Util.option_bind (Xml.member "StatusMessage" xml) String.parse); + progress = + (Util.option_bind (Xml.member "Progress" xml) Integer.parse); + details = + (Util.option_bind (Xml.member "Details" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.details + (fun f -> Query.Pair ("Details", (String.to_query f))); + Util.option_map v.progress + (fun f -> Query.Pair ("Progress", (Integer.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Some + (Query.Pair + ("StatusCode", + (ScalingActivityStatusCode.to_query v.status_code))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Some (Query.Pair ("Cause", (String.to_query v.cause))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("ActivityId", String.to_query v.activity_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.details (fun f -> "details", String.to_json f) - ; Util.option_map v.progress (fun f -> "progress", Integer.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Some ("status_code", ScalingActivityStatusCode.to_json v.status_code) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Some ("cause", String.to_json v.cause) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("activity_id", String.to_json v.activity_id) - ]) - - let of_json j = - { activity_id = String.of_json (Util.of_option_exn (Json.lookup j "activity_id")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; cause = String.of_json (Util.of_option_exn (Json.lookup j "cause")) - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; status_code = - ScalingActivityStatusCode.of_json - (Util.of_option_exn (Json.lookup j "status_code")) - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; progress = Util.option_map (Json.lookup j "progress") Integer.of_json - ; details = Util.option_map (Json.lookup j "details") String.of_json - } -end - -module AdjustmentType = struct - type t = { adjustment_type : String.t option } - - let make ?adjustment_type () = { adjustment_type } - - let parse xml = - Some - { adjustment_type = Util.option_bind (Xml.member "AdjustmentType" xml) String.parse + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair ("ActivityId", (String.to_query v.activity_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.details + (fun f -> ("details", (String.to_json f))); + Util.option_map v.progress + (fun f -> ("progress", (Integer.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Some + ("status_code", + (ScalingActivityStatusCode.to_json v.status_code)); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Some ("start_time", (DateTime.to_json v.start_time)); + Some ("cause", (String.to_json v.cause)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("activity_id", (String.to_json v.activity_id))]) + let of_json j = + { + activity_id = + (String.of_json (Util.of_option_exn (Json.lookup j "activity_id"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + cause = (String.of_json (Util.of_option_exn (Json.lookup j "cause"))); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + status_code = + (ScalingActivityStatusCode.of_json + (Util.of_option_exn (Json.lookup j "status_code"))); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + progress = + (Util.option_map (Json.lookup j "progress") Integer.of_json); + details = (Util.option_map (Json.lookup j "details") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.adjustment_type (fun f -> - Query.Pair ("AdjustmentType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.adjustment_type (fun f -> - "adjustment_type", String.to_json f) - ]) - - let of_json j = - { adjustment_type = Util.option_map (Json.lookup j "adjustment_type") String.of_json } -end - -module AutoScalingGroup = struct - type t = - { auto_scaling_group_name : String.t - ; auto_scaling_group_a_r_n : String.t option - ; launch_configuration_name : String.t option - ; min_size : Integer.t - ; max_size : Integer.t - ; desired_capacity : Integer.t - ; default_cooldown : Integer.t - ; availability_zones : AvailabilityZones.t - ; load_balancer_names : LoadBalancerNames.t - ; health_check_type : String.t - ; health_check_grace_period : Integer.t option - ; instances : Instances.t - ; created_time : DateTime.t - ; suspended_processes : SuspendedProcesses.t - ; placement_group : String.t option - ; v_p_c_zone_identifier : String.t option - ; enabled_metrics : EnabledMetrics.t - ; status : String.t option - ; tags : TagDescriptionList.t - ; termination_policies : TerminationPolicies.t - } - - let make - ~auto_scaling_group_name - ?auto_scaling_group_a_r_n - ?launch_configuration_name - ~min_size - ~max_size - ~desired_capacity - ~default_cooldown - ~availability_zones - ?(load_balancer_names = []) - ~health_check_type - ?health_check_grace_period - ?(instances = []) - ~created_time - ?(suspended_processes = []) - ?placement_group - ?v_p_c_zone_identifier - ?(enabled_metrics = []) - ?status - ?(tags = []) - ?(termination_policies = []) - () = - { auto_scaling_group_name - ; auto_scaling_group_a_r_n - ; launch_configuration_name - ; min_size - ; max_size - ; desired_capacity - ; default_cooldown - ; availability_zones - ; load_balancer_names - ; health_check_type - ; health_check_grace_period - ; instances - ; created_time - ; suspended_processes - ; placement_group - ; v_p_c_zone_identifier - ; enabled_metrics - ; status - ; tags - ; termination_policies - } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; auto_scaling_group_a_r_n = - Util.option_bind (Xml.member "AutoScalingGroupARN" xml) String.parse - ; launch_configuration_name = - Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse - ; min_size = - Xml.required - "MinSize" - (Util.option_bind (Xml.member "MinSize" xml) Integer.parse) - ; max_size = - Xml.required - "MaxSize" - (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse) - ; desired_capacity = - Xml.required - "DesiredCapacity" - (Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse) - ; default_cooldown = - Xml.required - "DefaultCooldown" - (Util.option_bind (Xml.member "DefaultCooldown" xml) Integer.parse) - ; availability_zones = - Xml.required - "AvailabilityZones" - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; load_balancer_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) - ; health_check_type = - Xml.required - "HealthCheckType" - (Util.option_bind (Xml.member "HealthCheckType" xml) String.parse) - ; health_check_grace_period = - Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) Integer.parse - ; instances = - Util.of_option - [] - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - ; created_time = - Xml.required - "CreatedTime" - (Util.option_bind (Xml.member "CreatedTime" xml) DateTime.parse) - ; suspended_processes = - Util.of_option - [] - (Util.option_bind - (Xml.member "SuspendedProcesses" xml) - SuspendedProcesses.parse) - ; placement_group = Util.option_bind (Xml.member "PlacementGroup" xml) String.parse - ; v_p_c_zone_identifier = - Util.option_bind (Xml.member "VPCZoneIdentifier" xml) String.parse - ; enabled_metrics = - Util.of_option - [] - (Util.option_bind (Xml.member "EnabledMetrics" xml) EnabledMetrics.parse) - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; tags = - Util.of_option - [] - (Util.option_bind (Xml.member "Tags" xml) TagDescriptionList.parse) - ; termination_policies = - Util.of_option - [] - (Util.option_bind - (Xml.member "TerminationPolicies" xml) - TerminationPolicies.parse) + end +module AdjustmentType = + struct + type t = { + adjustment_type: String.t option } + let make ?adjustment_type () = { adjustment_type } + let parse xml = + Some + { + adjustment_type = + (Util.option_bind (Xml.member "AdjustmentType" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.adjustment_type + (fun f -> Query.Pair ("AdjustmentType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.adjustment_type + (fun f -> ("adjustment_type", (String.to_json f)))]) + let of_json j = + { + adjustment_type = + (Util.option_map (Json.lookup j "adjustment_type") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module AutoScalingGroup = + struct + type t = + { + auto_scaling_group_name: String.t ; + auto_scaling_group_a_r_n: String.t option ; + launch_configuration_name: String.t option ; + min_size: Integer.t ; + max_size: Integer.t ; + desired_capacity: Integer.t ; + default_cooldown: Integer.t ; + availability_zones: AvailabilityZones.t ; + load_balancer_names: LoadBalancerNames.t ; + health_check_type: String.t ; + health_check_grace_period: Integer.t option ; + instances: Instances.t ; + created_time: DateTime.t ; + suspended_processes: SuspendedProcesses.t ; + placement_group: String.t option ; + v_p_c_zone_identifier: String.t option ; + enabled_metrics: EnabledMetrics.t ; + status: String.t option ; + tags: TagDescriptionList.t ; + termination_policies: TerminationPolicies.t } + let make ~auto_scaling_group_name ?auto_scaling_group_a_r_n + ?launch_configuration_name ~min_size ~max_size ~desired_capacity + ~default_cooldown ~availability_zones ?(load_balancer_names= []) + ~health_check_type ?health_check_grace_period ?(instances= []) + ~created_time ?(suspended_processes= []) ?placement_group + ?v_p_c_zone_identifier ?(enabled_metrics= []) ?status ?(tags= []) + ?(termination_policies= []) () = + { + auto_scaling_group_name; + auto_scaling_group_a_r_n; + launch_configuration_name; + min_size; + max_size; + desired_capacity; + default_cooldown; + availability_zones; + load_balancer_names; + health_check_type; + health_check_grace_period; + instances; + created_time; + suspended_processes; + placement_group; + v_p_c_zone_identifier; + enabled_metrics; + status; + tags; + termination_policies + } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + auto_scaling_group_a_r_n = + (Util.option_bind (Xml.member "AutoScalingGroupARN" xml) + String.parse); + launch_configuration_name = + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse); + min_size = + (Xml.required "MinSize" + (Util.option_bind (Xml.member "MinSize" xml) Integer.parse)); + max_size = + (Xml.required "MaxSize" + (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse)); + desired_capacity = + (Xml.required "DesiredCapacity" + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse)); + default_cooldown = + (Xml.required "DefaultCooldown" + (Util.option_bind (Xml.member "DefaultCooldown" xml) + Integer.parse)); + availability_zones = + (Xml.required "AvailabilityZones" + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + load_balancer_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)); + health_check_type = + (Xml.required "HealthCheckType" + (Util.option_bind (Xml.member "HealthCheckType" xml) + String.parse)); + health_check_grace_period = + (Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) + Integer.parse); + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)); + created_time = + (Xml.required "CreatedTime" + (Util.option_bind (Xml.member "CreatedTime" xml) + DateTime.parse)); + suspended_processes = + (Util.of_option [] + (Util.option_bind (Xml.member "SuspendedProcesses" xml) + SuspendedProcesses.parse)); + placement_group = + (Util.option_bind (Xml.member "PlacementGroup" xml) String.parse); + v_p_c_zone_identifier = + (Util.option_bind (Xml.member "VPCZoneIdentifier" xml) + String.parse); + enabled_metrics = + (Util.of_option [] + (Util.option_bind (Xml.member "EnabledMetrics" xml) + EnabledMetrics.parse)); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) + TagDescriptionList.parse)); + termination_policies = + (Util.of_option [] + (Util.option_bind (Xml.member "TerminationPolicies" xml) + TerminationPolicies.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TerminationPolicies.member", + (TerminationPolicies.to_query v.termination_policies))); + Some + (Query.Pair + ("Tags.member", (TagDescriptionList.to_query v.tags))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Some + (Query.Pair + ("EnabledMetrics.member", + (EnabledMetrics.to_query v.enabled_metrics))); + Util.option_map v.v_p_c_zone_identifier + (fun f -> Query.Pair ("VPCZoneIdentifier", (String.to_query f))); + Util.option_map v.placement_group + (fun f -> Query.Pair ("PlacementGroup", (String.to_query f))); + Some (Query.Pair - ( "TerminationPolicies.member" - , TerminationPolicies.to_query v.termination_policies )) - ; Some (Query.Pair ("Tags.member", TagDescriptionList.to_query v.tags)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Some + ("SuspendedProcesses.member", + (SuspendedProcesses.to_query v.suspended_processes))); + Some + (Query.Pair ("CreatedTime", (DateTime.to_query v.created_time))); + Some (Query.Pair - ("EnabledMetrics.member", EnabledMetrics.to_query v.enabled_metrics)) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - Query.Pair ("VPCZoneIdentifier", String.to_query f)) - ; Util.option_map v.placement_group (fun f -> - Query.Pair ("PlacementGroup", String.to_query f)) - ; Some + ("Instances.member", (Instances.to_query v.instances))); + Util.option_map v.health_check_grace_period + (fun f -> + Query.Pair ("HealthCheckGracePeriod", (Integer.to_query f))); + Some (Query.Pair - ( "SuspendedProcesses.member" - , SuspendedProcesses.to_query v.suspended_processes )) - ; Some (Query.Pair ("CreatedTime", DateTime.to_query v.created_time)) - ; Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) - ; Util.option_map v.health_check_grace_period (fun f -> - Query.Pair ("HealthCheckGracePeriod", Integer.to_query f)) - ; Some (Query.Pair ("HealthCheckType", String.to_query v.health_check_type)) - ; Some + ("HealthCheckType", (String.to_query v.health_check_type))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ; Some + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Some (Query.Pair ("DefaultCooldown", Integer.to_query v.default_cooldown)) - ; Some (Query.Pair ("DesiredCapacity", Integer.to_query v.desired_capacity)) - ; Some (Query.Pair ("MaxSize", Integer.to_query v.max_size)) - ; Some (Query.Pair ("MinSize", Integer.to_query v.min_size)) - ; Util.option_map v.launch_configuration_name (fun f -> - Query.Pair ("LaunchConfigurationName", String.to_query f)) - ; Util.option_map v.auto_scaling_group_a_r_n (fun f -> - Query.Pair ("AutoScalingGroupARN", String.to_query f)) - ; Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("termination_policies", TerminationPolicies.to_json v.termination_policies) - ; Some ("tags", TagDescriptionList.to_json v.tags) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Some ("enabled_metrics", EnabledMetrics.to_json v.enabled_metrics) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - "v_p_c_zone_identifier", String.to_json f) - ; Util.option_map v.placement_group (fun f -> - "placement_group", String.to_json f) - ; Some ("suspended_processes", SuspendedProcesses.to_json v.suspended_processes) - ; Some ("created_time", DateTime.to_json v.created_time) - ; Some ("instances", Instances.to_json v.instances) - ; Util.option_map v.health_check_grace_period (fun f -> - "health_check_grace_period", Integer.to_json f) - ; Some ("health_check_type", String.to_json v.health_check_type) - ; Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Some ("default_cooldown", Integer.to_json v.default_cooldown) - ; Some ("desired_capacity", Integer.to_json v.desired_capacity) - ; Some ("max_size", Integer.to_json v.max_size) - ; Some ("min_size", Integer.to_json v.min_size) - ; Util.option_map v.launch_configuration_name (fun f -> - "launch_configuration_name", String.to_json f) - ; Util.option_map v.auto_scaling_group_a_r_n (fun f -> - "auto_scaling_group_a_r_n", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; auto_scaling_group_a_r_n = - Util.option_map (Json.lookup j "auto_scaling_group_a_r_n") String.of_json - ; launch_configuration_name = - Util.option_map (Json.lookup j "launch_configuration_name") String.of_json - ; min_size = Integer.of_json (Util.of_option_exn (Json.lookup j "min_size")) - ; max_size = Integer.of_json (Util.of_option_exn (Json.lookup j "max_size")) - ; desired_capacity = - Integer.of_json (Util.of_option_exn (Json.lookup j "desired_capacity")) - ; default_cooldown = - Integer.of_json (Util.of_option_exn (Json.lookup j "default_cooldown")) - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - ; health_check_type = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_type")) - ; health_check_grace_period = - Util.option_map (Json.lookup j "health_check_grace_period") Integer.of_json - ; instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) - ; created_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "created_time")) - ; suspended_processes = - SuspendedProcesses.of_json - (Util.of_option_exn (Json.lookup j "suspended_processes")) - ; placement_group = Util.option_map (Json.lookup j "placement_group") String.of_json - ; v_p_c_zone_identifier = - Util.option_map (Json.lookup j "v_p_c_zone_identifier") String.of_json - ; enabled_metrics = - EnabledMetrics.of_json (Util.of_option_exn (Json.lookup j "enabled_metrics")) - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; tags = TagDescriptionList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; termination_policies = - TerminationPolicies.of_json - (Util.of_option_exn (Json.lookup j "termination_policies")) - } -end - -module NotificationConfiguration = struct - type t = - { auto_scaling_group_name : String.t option - ; topic_a_r_n : String.t option - ; notification_type : String.t option - } - - let make ?auto_scaling_group_name ?topic_a_r_n ?notification_type () = - { auto_scaling_group_name; topic_a_r_n; notification_type } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; topic_a_r_n = Util.option_bind (Xml.member "TopicARN" xml) String.parse - ; notification_type = - Util.option_bind (Xml.member "NotificationType" xml) String.parse + ("DefaultCooldown", (Integer.to_query v.default_cooldown))); + Some + (Query.Pair + ("DesiredCapacity", (Integer.to_query v.desired_capacity))); + Some (Query.Pair ("MaxSize", (Integer.to_query v.max_size))); + Some (Query.Pair ("MinSize", (Integer.to_query v.min_size))); + Util.option_map v.launch_configuration_name + (fun f -> + Query.Pair ("LaunchConfigurationName", (String.to_query f))); + Util.option_map v.auto_scaling_group_a_r_n + (fun f -> + Query.Pair ("AutoScalingGroupARN", (String.to_query f))); + Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("termination_policies", + (TerminationPolicies.to_json v.termination_policies)); + Some ("tags", (TagDescriptionList.to_json v.tags)); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Some + ("enabled_metrics", (EnabledMetrics.to_json v.enabled_metrics)); + Util.option_map v.v_p_c_zone_identifier + (fun f -> ("v_p_c_zone_identifier", (String.to_json f))); + Util.option_map v.placement_group + (fun f -> ("placement_group", (String.to_json f))); + Some + ("suspended_processes", + (SuspendedProcesses.to_json v.suspended_processes)); + Some ("created_time", (DateTime.to_json v.created_time)); + Some ("instances", (Instances.to_json v.instances)); + Util.option_map v.health_check_grace_period + (fun f -> ("health_check_grace_period", (Integer.to_json f))); + Some ("health_check_type", (String.to_json v.health_check_type)); + Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names)); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Some ("default_cooldown", (Integer.to_json v.default_cooldown)); + Some ("desired_capacity", (Integer.to_json v.desired_capacity)); + Some ("max_size", (Integer.to_json v.max_size)); + Some ("min_size", (Integer.to_json v.min_size)); + Util.option_map v.launch_configuration_name + (fun f -> ("launch_configuration_name", (String.to_json f))); + Util.option_map v.auto_scaling_group_a_r_n + (fun f -> ("auto_scaling_group_a_r_n", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + auto_scaling_group_a_r_n = + (Util.option_map (Json.lookup j "auto_scaling_group_a_r_n") + String.of_json); + launch_configuration_name = + (Util.option_map (Json.lookup j "launch_configuration_name") + String.of_json); + min_size = + (Integer.of_json (Util.of_option_exn (Json.lookup j "min_size"))); + max_size = + (Integer.of_json (Util.of_option_exn (Json.lookup j "max_size"))); + desired_capacity = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "desired_capacity"))); + default_cooldown = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "default_cooldown"))); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))); + health_check_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_type"))); + health_check_grace_period = + (Util.option_map (Json.lookup j "health_check_grace_period") + Integer.of_json); + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))); + created_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "created_time"))); + suspended_processes = + (SuspendedProcesses.of_json + (Util.of_option_exn (Json.lookup j "suspended_processes"))); + placement_group = + (Util.option_map (Json.lookup j "placement_group") String.of_json); + v_p_c_zone_identifier = + (Util.option_map (Json.lookup j "v_p_c_zone_identifier") + String.of_json); + enabled_metrics = + (EnabledMetrics.of_json + (Util.of_option_exn (Json.lookup j "enabled_metrics"))); + status = (Util.option_map (Json.lookup j "status") String.of_json); + tags = + (TagDescriptionList.of_json + (Util.of_option_exn (Json.lookup j "tags"))); + termination_policies = + (TerminationPolicies.of_json + (Util.of_option_exn (Json.lookup j "termination_policies"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.notification_type (fun f -> - Query.Pair ("NotificationType", String.to_query f)) - ; Util.option_map v.topic_a_r_n (fun f -> - Query.Pair ("TopicARN", String.to_query f)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.notification_type (fun f -> - "notification_type", String.to_json f) - ; Util.option_map v.topic_a_r_n (fun f -> "topic_a_r_n", String.to_json f) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; topic_a_r_n = Util.option_map (Json.lookup j "topic_a_r_n") String.of_json - ; notification_type = - Util.option_map (Json.lookup j "notification_type") String.of_json - } -end - -module LaunchConfiguration = struct - type t = - { launch_configuration_name : String.t - ; launch_configuration_a_r_n : String.t option - ; image_id : String.t - ; key_name : String.t option - ; security_groups : SecurityGroups.t - ; classic_link_v_p_c_id : String.t option - ; classic_link_v_p_c_security_groups : ClassicLinkVPCSecurityGroups.t - ; user_data : String.t option - ; instance_type : String.t - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappings.t - ; instance_monitoring : InstanceMonitoring.t option - ; spot_price : String.t option - ; iam_instance_profile : String.t option - ; created_time : DateTime.t - ; ebs_optimized : Boolean.t option - ; associate_public_ip_address : Boolean.t option - ; placement_tenancy : String.t option - } - - let make - ~launch_configuration_name - ?launch_configuration_a_r_n - ~image_id - ?key_name - ?(security_groups = []) - ?classic_link_v_p_c_id - ?(classic_link_v_p_c_security_groups = []) - ?user_data - ~instance_type - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?instance_monitoring - ?spot_price - ?iam_instance_profile - ~created_time - ?ebs_optimized - ?associate_public_ip_address - ?placement_tenancy - () = - { launch_configuration_name - ; launch_configuration_a_r_n - ; image_id - ; key_name - ; security_groups - ; classic_link_v_p_c_id - ; classic_link_v_p_c_security_groups - ; user_data - ; instance_type - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; instance_monitoring - ; spot_price - ; iam_instance_profile - ; created_time - ; ebs_optimized - ; associate_public_ip_address - ; placement_tenancy - } - - let parse xml = - Some - { launch_configuration_name = - Xml.required - "LaunchConfigurationName" - (Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse) - ; launch_configuration_a_r_n = - Util.option_bind (Xml.member "LaunchConfigurationARN" xml) String.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - ; key_name = Util.option_bind (Xml.member "KeyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - ; classic_link_v_p_c_id = - Util.option_bind (Xml.member "ClassicLinkVPCId" xml) String.parse - ; classic_link_v_p_c_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "ClassicLinkVPCSecurityGroups" xml) - ClassicLinkVPCSecurityGroups.parse) - ; user_data = Util.option_bind (Xml.member "UserData" xml) String.parse - ; instance_type = - Xml.required - "InstanceType" - (Util.option_bind (Xml.member "InstanceType" xml) String.parse) - ; kernel_id = Util.option_bind (Xml.member "KernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "RamdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "BlockDeviceMappings" xml) - BlockDeviceMappings.parse) - ; instance_monitoring = - Util.option_bind (Xml.member "InstanceMonitoring" xml) InstanceMonitoring.parse - ; spot_price = Util.option_bind (Xml.member "SpotPrice" xml) String.parse - ; iam_instance_profile = - Util.option_bind (Xml.member "IamInstanceProfile" xml) String.parse - ; created_time = - Xml.required - "CreatedTime" - (Util.option_bind (Xml.member "CreatedTime" xml) DateTime.parse) - ; ebs_optimized = Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse - ; associate_public_ip_address = - Util.option_bind (Xml.member "AssociatePublicIpAddress" xml) Boolean.parse - ; placement_tenancy = - Util.option_bind (Xml.member "PlacementTenancy" xml) String.parse + end +module NotificationConfiguration = + struct + type t = + { + auto_scaling_group_name: String.t option ; + topic_a_r_n: String.t option ; + notification_type: String.t option } + let make ?auto_scaling_group_name ?topic_a_r_n ?notification_type () = + { auto_scaling_group_name; topic_a_r_n; notification_type } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + topic_a_r_n = + (Util.option_bind (Xml.member "TopicARN" xml) String.parse); + notification_type = + (Util.option_bind (Xml.member "NotificationType" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.notification_type + (fun f -> Query.Pair ("NotificationType", (String.to_query f))); + Util.option_map v.topic_a_r_n + (fun f -> Query.Pair ("TopicARN", (String.to_query f))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.notification_type + (fun f -> ("notification_type", (String.to_json f))); + Util.option_map v.topic_a_r_n + (fun f -> ("topic_a_r_n", (String.to_json f))); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + topic_a_r_n = + (Util.option_map (Json.lookup j "topic_a_r_n") String.of_json); + notification_type = + (Util.option_map (Json.lookup j "notification_type") String.of_json) + } + end +module LaunchConfiguration = + struct + type t = + { + launch_configuration_name: String.t ; + launch_configuration_a_r_n: String.t option ; + image_id: String.t ; + key_name: String.t option ; + security_groups: SecurityGroups.t ; + classic_link_v_p_c_id: String.t option ; + classic_link_v_p_c_security_groups: ClassicLinkVPCSecurityGroups.t ; + user_data: String.t option ; + instance_type: String.t ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappings.t ; + instance_monitoring: InstanceMonitoring.t option ; + spot_price: String.t option ; + iam_instance_profile: String.t option ; + created_time: DateTime.t ; + ebs_optimized: Boolean.t option ; + associate_public_ip_address: Boolean.t option ; + placement_tenancy: String.t option } + let make ~launch_configuration_name ?launch_configuration_a_r_n + ~image_id ?key_name ?(security_groups= []) ?classic_link_v_p_c_id + ?(classic_link_v_p_c_security_groups= []) ?user_data ~instance_type + ?kernel_id ?ramdisk_id ?(block_device_mappings= []) + ?instance_monitoring ?spot_price ?iam_instance_profile ~created_time + ?ebs_optimized ?associate_public_ip_address ?placement_tenancy () = + { + launch_configuration_name; + launch_configuration_a_r_n; + image_id; + key_name; + security_groups; + classic_link_v_p_c_id; + classic_link_v_p_c_security_groups; + user_data; + instance_type; + kernel_id; + ramdisk_id; + block_device_mappings; + instance_monitoring; + spot_price; + iam_instance_profile; + created_time; + ebs_optimized; + associate_public_ip_address; + placement_tenancy } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.placement_tenancy (fun f -> - Query.Pair ("PlacementTenancy", String.to_query f)) - ; Util.option_map v.associate_public_ip_address (fun f -> - Query.Pair ("AssociatePublicIpAddress", Boolean.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Some (Query.Pair ("CreatedTime", DateTime.to_query v.created_time)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair ("IamInstanceProfile", String.to_query f)) - ; Util.option_map v.spot_price (fun f -> - Query.Pair ("SpotPrice", String.to_query f)) - ; Util.option_map v.instance_monitoring (fun f -> - Query.Pair ("InstanceMonitoring", InstanceMonitoring.to_query f)) - ; Some + let parse xml = + Some + { + launch_configuration_name = + (Xml.required "LaunchConfigurationName" + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse)); + launch_configuration_a_r_n = + (Util.option_bind (Xml.member "LaunchConfigurationARN" xml) + String.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)); + key_name = + (Util.option_bind (Xml.member "KeyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)); + classic_link_v_p_c_id = + (Util.option_bind (Xml.member "ClassicLinkVPCId" xml) + String.parse); + classic_link_v_p_c_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "ClassicLinkVPCSecurityGroups" xml) + ClassicLinkVPCSecurityGroups.parse)); + user_data = + (Util.option_bind (Xml.member "UserData" xml) String.parse); + instance_type = + (Xml.required "InstanceType" + (Util.option_bind (Xml.member "InstanceType" xml) String.parse)); + kernel_id = + (Util.option_bind (Xml.member "KernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "RamdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "BlockDeviceMappings" xml) + BlockDeviceMappings.parse)); + instance_monitoring = + (Util.option_bind (Xml.member "InstanceMonitoring" xml) + InstanceMonitoring.parse); + spot_price = + (Util.option_bind (Xml.member "SpotPrice" xml) String.parse); + iam_instance_profile = + (Util.option_bind (Xml.member "IamInstanceProfile" xml) + String.parse); + created_time = + (Xml.required "CreatedTime" + (Util.option_bind (Xml.member "CreatedTime" xml) + DateTime.parse)); + ebs_optimized = + (Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse); + associate_public_ip_address = + (Util.option_bind (Xml.member "AssociatePublicIpAddress" xml) + Boolean.parse); + placement_tenancy = + (Util.option_bind (Xml.member "PlacementTenancy" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.placement_tenancy + (fun f -> Query.Pair ("PlacementTenancy", (String.to_query f))); + Util.option_map v.associate_public_ip_address + (fun f -> + Query.Pair ("AssociatePublicIpAddress", (Boolean.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Some + (Query.Pair ("CreatedTime", (DateTime.to_query v.created_time))); + Util.option_map v.iam_instance_profile + (fun f -> Query.Pair ("IamInstanceProfile", (String.to_query f))); + Util.option_map v.spot_price + (fun f -> Query.Pair ("SpotPrice", (String.to_query f))); + Util.option_map v.instance_monitoring + (fun f -> + Query.Pair + ("InstanceMonitoring", (InstanceMonitoring.to_query f))); + Some (Query.Pair - ( "BlockDeviceMappings.member" - , BlockDeviceMappings.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Some (Query.Pair ("InstanceType", String.to_query v.instance_type)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some + ("BlockDeviceMappings.member", + (BlockDeviceMappings.to_query v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Some + (Query.Pair ("InstanceType", (String.to_query v.instance_type))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some (Query.Pair - ( "ClassicLinkVPCSecurityGroups.member" - , ClassicLinkVPCSecurityGroups.to_query - v.classic_link_v_p_c_security_groups )) - ; Util.option_map v.classic_link_v_p_c_id (fun f -> - Query.Pair ("ClassicLinkVPCId", String.to_query f)) - ; Some + ("ClassicLinkVPCSecurityGroups.member", + (ClassicLinkVPCSecurityGroups.to_query + v.classic_link_v_p_c_security_groups))); + Util.option_map v.classic_link_v_p_c_id + (fun f -> Query.Pair ("ClassicLinkVPCId", (String.to_query f))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.launch_configuration_a_r_n (fun f -> - Query.Pair ("LaunchConfigurationARN", String.to_query f)) - ; Some + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.launch_configuration_a_r_n + (fun f -> + Query.Pair ("LaunchConfigurationARN", (String.to_query f))); + Some (Query.Pair - ("LaunchConfigurationName", String.to_query v.launch_configuration_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.placement_tenancy (fun f -> - "placement_tenancy", String.to_json f) - ; Util.option_map v.associate_public_ip_address (fun f -> - "associate_public_ip_address", Boolean.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Some ("created_time", DateTime.to_json v.created_time) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", String.to_json f) - ; Util.option_map v.spot_price (fun f -> "spot_price", String.to_json f) - ; Util.option_map v.instance_monitoring (fun f -> - "instance_monitoring", InstanceMonitoring.to_json f) - ; Some - ("block_device_mappings", BlockDeviceMappings.to_json v.block_device_mappings) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Some ("instance_type", String.to_json v.instance_type) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some - ( "classic_link_v_p_c_security_groups" - , ClassicLinkVPCSecurityGroups.to_json v.classic_link_v_p_c_security_groups - ) - ; Util.option_map v.classic_link_v_p_c_id (fun f -> - "classic_link_v_p_c_id", String.to_json f) - ; Some ("security_groups", SecurityGroups.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.launch_configuration_a_r_n (fun f -> - "launch_configuration_a_r_n", String.to_json f) - ; Some ("launch_configuration_name", String.to_json v.launch_configuration_name) - ]) - - let of_json j = - { launch_configuration_name = - String.of_json (Util.of_option_exn (Json.lookup j "launch_configuration_name")) - ; launch_configuration_a_r_n = - Util.option_map (Json.lookup j "launch_configuration_a_r_n") String.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; classic_link_v_p_c_id = - Util.option_map (Json.lookup j "classic_link_v_p_c_id") String.of_json - ; classic_link_v_p_c_security_groups = - ClassicLinkVPCSecurityGroups.of_json - (Util.of_option_exn (Json.lookup j "classic_link_v_p_c_security_groups")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; instance_type = String.of_json (Util.of_option_exn (Json.lookup j "instance_type")) - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappings.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; instance_monitoring = - Util.option_map (Json.lookup j "instance_monitoring") InstanceMonitoring.of_json - ; spot_price = Util.option_map (Json.lookup j "spot_price") String.of_json - ; iam_instance_profile = - Util.option_map (Json.lookup j "iam_instance_profile") String.of_json - ; created_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "created_time")) - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; associate_public_ip_address = - Util.option_map (Json.lookup j "associate_public_ip_address") Boolean.of_json - ; placement_tenancy = - Util.option_map (Json.lookup j "placement_tenancy") String.of_json - } -end - -module ScheduledUpdateGroupAction = struct - type t = - { auto_scaling_group_name : String.t option - ; scheduled_action_name : String.t option - ; scheduled_action_a_r_n : String.t option - ; time : DateTime.t option - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; recurrence : String.t option - ; min_size : Integer.t option - ; max_size : Integer.t option - ; desired_capacity : Integer.t option - } - - let make - ?auto_scaling_group_name - ?scheduled_action_name - ?scheduled_action_a_r_n - ?time - ?start_time - ?end_time - ?recurrence - ?min_size - ?max_size - ?desired_capacity - () = - { auto_scaling_group_name - ; scheduled_action_name - ; scheduled_action_a_r_n - ; time - ; start_time - ; end_time - ; recurrence - ; min_size - ; max_size - ; desired_capacity - } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; scheduled_action_name = - Util.option_bind (Xml.member "ScheduledActionName" xml) String.parse - ; scheduled_action_a_r_n = - Util.option_bind (Xml.member "ScheduledActionARN" xml) String.parse - ; time = Util.option_bind (Xml.member "Time" xml) DateTime.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; recurrence = Util.option_bind (Xml.member "Recurrence" xml) String.parse - ; min_size = Util.option_bind (Xml.member "MinSize" xml) Integer.parse - ; max_size = Util.option_bind (Xml.member "MaxSize" xml) Integer.parse - ; desired_capacity = - Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse + ("LaunchConfigurationName", + (String.to_query v.launch_configuration_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.placement_tenancy + (fun f -> ("placement_tenancy", (String.to_json f))); + Util.option_map v.associate_public_ip_address + (fun f -> ("associate_public_ip_address", (Boolean.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Some ("created_time", (DateTime.to_json v.created_time)); + Util.option_map v.iam_instance_profile + (fun f -> ("iam_instance_profile", (String.to_json f))); + Util.option_map v.spot_price + (fun f -> ("spot_price", (String.to_json f))); + Util.option_map v.instance_monitoring + (fun f -> + ("instance_monitoring", (InstanceMonitoring.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappings.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Some ("instance_type", (String.to_json v.instance_type)); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("classic_link_v_p_c_security_groups", + (ClassicLinkVPCSecurityGroups.to_json + v.classic_link_v_p_c_security_groups)); + Util.option_map v.classic_link_v_p_c_id + (fun f -> ("classic_link_v_p_c_id", (String.to_json f))); + Some + ("security_groups", (SecurityGroups.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.launch_configuration_a_r_n + (fun f -> ("launch_configuration_a_r_n", (String.to_json f))); + Some + ("launch_configuration_name", + (String.to_json v.launch_configuration_name))]) + let of_json j = + { + launch_configuration_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "launch_configuration_name"))); + launch_configuration_a_r_n = + (Util.option_map (Json.lookup j "launch_configuration_a_r_n") + String.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + classic_link_v_p_c_id = + (Util.option_map (Json.lookup j "classic_link_v_p_c_id") + String.of_json); + classic_link_v_p_c_security_groups = + (ClassicLinkVPCSecurityGroups.of_json + (Util.of_option_exn + (Json.lookup j "classic_link_v_p_c_security_groups"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + instance_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "instance_type"))); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappings.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + instance_monitoring = + (Util.option_map (Json.lookup j "instance_monitoring") + InstanceMonitoring.of_json); + spot_price = + (Util.option_map (Json.lookup j "spot_price") String.of_json); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + String.of_json); + created_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "created_time"))); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + associate_public_ip_address = + (Util.option_map (Json.lookup j "associate_public_ip_address") + Boolean.of_json); + placement_tenancy = + (Util.option_map (Json.lookup j "placement_tenancy") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.desired_capacity (fun f -> - Query.Pair ("DesiredCapacity", Integer.to_query f)) - ; Util.option_map v.max_size (fun f -> - Query.Pair ("MaxSize", Integer.to_query f)) - ; Util.option_map v.min_size (fun f -> - Query.Pair ("MinSize", Integer.to_query f)) - ; Util.option_map v.recurrence (fun f -> - Query.Pair ("Recurrence", String.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.time (fun f -> Query.Pair ("Time", DateTime.to_query f)) - ; Util.option_map v.scheduled_action_a_r_n (fun f -> - Query.Pair ("ScheduledActionARN", String.to_query f)) - ; Util.option_map v.scheduled_action_name (fun f -> - Query.Pair ("ScheduledActionName", String.to_query f)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.desired_capacity (fun f -> - "desired_capacity", Integer.to_json f) - ; Util.option_map v.max_size (fun f -> "max_size", Integer.to_json f) - ; Util.option_map v.min_size (fun f -> "min_size", Integer.to_json f) - ; Util.option_map v.recurrence (fun f -> "recurrence", String.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.time (fun f -> "time", DateTime.to_json f) - ; Util.option_map v.scheduled_action_a_r_n (fun f -> - "scheduled_action_a_r_n", String.to_json f) - ; Util.option_map v.scheduled_action_name (fun f -> - "scheduled_action_name", String.to_json f) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; scheduled_action_name = - Util.option_map (Json.lookup j "scheduled_action_name") String.of_json - ; scheduled_action_a_r_n = - Util.option_map (Json.lookup j "scheduled_action_a_r_n") String.of_json - ; time = Util.option_map (Json.lookup j "time") DateTime.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; recurrence = Util.option_map (Json.lookup j "recurrence") String.of_json - ; min_size = Util.option_map (Json.lookup j "min_size") Integer.of_json - ; max_size = Util.option_map (Json.lookup j "max_size") Integer.of_json - ; desired_capacity = - Util.option_map (Json.lookup j "desired_capacity") Integer.of_json - } -end - -module LoadBalancerState = struct - type t = - { load_balancer_name : String.t option - ; state : String.t option - } - - let make ?load_balancer_name ?state () = { load_balancer_name; state } - - let parse xml = - Some - { load_balancer_name = - Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse - ; state = Util.option_bind (Xml.member "State" xml) String.parse + end +module ScheduledUpdateGroupAction = + struct + type t = + { + auto_scaling_group_name: String.t option ; + scheduled_action_name: String.t option ; + scheduled_action_a_r_n: String.t option ; + time: DateTime.t option ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + recurrence: String.t option ; + min_size: Integer.t option ; + max_size: Integer.t option ; + desired_capacity: Integer.t option } + let make ?auto_scaling_group_name ?scheduled_action_name + ?scheduled_action_a_r_n ?time ?start_time ?end_time ?recurrence + ?min_size ?max_size ?desired_capacity () = + { + auto_scaling_group_name; + scheduled_action_name; + scheduled_action_a_r_n; + time; + start_time; + end_time; + recurrence; + min_size; + max_size; + desired_capacity } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> Query.Pair ("State", String.to_query f)) - ; Util.option_map v.load_balancer_name (fun f -> - Query.Pair ("LoadBalancerName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> "state", String.to_json f) - ; Util.option_map v.load_balancer_name (fun f -> - "load_balancer_name", String.to_json f) - ]) - - let of_json j = - { load_balancer_name = - Util.option_map (Json.lookup j "load_balancer_name") String.of_json - ; state = Util.option_map (Json.lookup j "state") String.of_json - } -end - -module MetricCollectionType = struct - type t = { metric : String.t option } - - let make ?metric () = { metric } - - let parse xml = - Some { metric = Util.option_bind (Xml.member "Metric" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.metric (fun f -> Query.Pair ("Metric", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.metric (fun f -> "metric", String.to_json f) ]) - - let of_json j = { metric = Util.option_map (Json.lookup j "metric") String.of_json } -end - -module MetricGranularityType = struct - type t = { granularity : String.t option } - - let make ?granularity () = { granularity } - - let parse xml = - Some { granularity = Util.option_bind (Xml.member "Granularity" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.granularity (fun f -> - Query.Pair ("Granularity", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.granularity (fun f -> "granularity", String.to_json f) ]) - - let of_json j = - { granularity = Util.option_map (Json.lookup j "granularity") String.of_json } -end - -module ProcessType = struct - type t = { process_name : String.t } - - let make ~process_name () = { process_name } - - let parse xml = - Some - { process_name = - Xml.required - "ProcessName" - (Util.option_bind (Xml.member "ProcessName" xml) String.parse) + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + scheduled_action_name = + (Util.option_bind (Xml.member "ScheduledActionName" xml) + String.parse); + scheduled_action_a_r_n = + (Util.option_bind (Xml.member "ScheduledActionARN" xml) + String.parse); + time = (Util.option_bind (Xml.member "Time" xml) DateTime.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + recurrence = + (Util.option_bind (Xml.member "Recurrence" xml) String.parse); + min_size = + (Util.option_bind (Xml.member "MinSize" xml) Integer.parse); + max_size = + (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse); + desired_capacity = + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.desired_capacity + (fun f -> Query.Pair ("DesiredCapacity", (Integer.to_query f))); + Util.option_map v.max_size + (fun f -> Query.Pair ("MaxSize", (Integer.to_query f))); + Util.option_map v.min_size + (fun f -> Query.Pair ("MinSize", (Integer.to_query f))); + Util.option_map v.recurrence + (fun f -> Query.Pair ("Recurrence", (String.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.time + (fun f -> Query.Pair ("Time", (DateTime.to_query f))); + Util.option_map v.scheduled_action_a_r_n + (fun f -> Query.Pair ("ScheduledActionARN", (String.to_query f))); + Util.option_map v.scheduled_action_name + (fun f -> + Query.Pair ("ScheduledActionName", (String.to_query f))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.desired_capacity + (fun f -> ("desired_capacity", (Integer.to_json f))); + Util.option_map v.max_size + (fun f -> ("max_size", (Integer.to_json f))); + Util.option_map v.min_size + (fun f -> ("min_size", (Integer.to_json f))); + Util.option_map v.recurrence + (fun f -> ("recurrence", (String.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.time (fun f -> ("time", (DateTime.to_json f))); + Util.option_map v.scheduled_action_a_r_n + (fun f -> ("scheduled_action_a_r_n", (String.to_json f))); + Util.option_map v.scheduled_action_name + (fun f -> ("scheduled_action_name", (String.to_json f))); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + scheduled_action_name = + (Util.option_map (Json.lookup j "scheduled_action_name") + String.of_json); + scheduled_action_a_r_n = + (Util.option_map (Json.lookup j "scheduled_action_a_r_n") + String.of_json); + time = (Util.option_map (Json.lookup j "time") DateTime.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + recurrence = + (Util.option_map (Json.lookup j "recurrence") String.of_json); + min_size = + (Util.option_map (Json.lookup j "min_size") Integer.of_json); + max_size = + (Util.option_map (Json.lookup j "max_size") Integer.of_json); + desired_capacity = + (Util.option_map (Json.lookup j "desired_capacity") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ProcessName", String.to_query v.process_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("process_name", String.to_json v.process_name) ]) - - let of_json j = - { process_name = String.of_json (Util.of_option_exn (Json.lookup j "process_name")) } -end - -module InstanceIds = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Filters = struct - type t = Filter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Filter.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Filter.to_query v - - let to_json v = `List (List.map Filter.to_json v) - - let of_json j = Json.to_list Filter.of_json j -end - -module ProcessNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AutoScalingInstances = struct - type t = AutoScalingInstanceDetails.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AutoScalingInstanceDetails.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AutoScalingInstanceDetails.to_query v - - let to_json v = `List (List.map AutoScalingInstanceDetails.to_json v) - - let of_json j = Json.to_list AutoScalingInstanceDetails.of_json j -end - -module AutoScalingNotificationTypes = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ScalingPolicies = struct - type t = ScalingPolicy.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ScalingPolicy.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ScalingPolicy.to_query v - - let to_json v = `List (List.map ScalingPolicy.to_json v) - - let of_json j = Json.to_list ScalingPolicy.of_json j -end - -module Tags = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module ActivityIds = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module LifecycleHooks = struct - type t = LifecycleHook.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LifecycleHook.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LifecycleHook.to_query v - - let to_json v = `List (List.map LifecycleHook.to_json v) - - let of_json j = Json.to_list LifecycleHook.of_json j -end - -module Activities = struct - type t = Activity.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Activity.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Activity.to_query v - - let to_json v = `List (List.map Activity.to_json v) - - let of_json j = Json.to_list Activity.of_json j -end - -module LaunchConfigurationNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AdjustmentTypes = struct - type t = AdjustmentType.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AdjustmentType.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AdjustmentType.to_query v - - let to_json v = `List (List.map AdjustmentType.to_json v) - - let of_json j = Json.to_list AdjustmentType.of_json j -end - -module AutoScalingGroups = struct - type t = AutoScalingGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AutoScalingGroup.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AutoScalingGroup.to_query v - - let to_json v = `List (List.map AutoScalingGroup.to_json v) - - let of_json j = Json.to_list AutoScalingGroup.of_json j -end - -module Metrics = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module PolicyNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module PolicyTypes = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module NotificationConfigurations = struct - type t = NotificationConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NotificationConfiguration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list NotificationConfiguration.to_query v - - let to_json v = `List (List.map NotificationConfiguration.to_json v) - - let of_json j = Json.to_list NotificationConfiguration.of_json j -end - -module AutoScalingGroupNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module LaunchConfigurations = struct - type t = LaunchConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LaunchConfiguration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LaunchConfiguration.to_query v - - let to_json v = `List (List.map LaunchConfiguration.to_json v) - - let of_json j = Json.to_list LaunchConfiguration.of_json j -end - -module ScheduledUpdateGroupActions = struct - type t = ScheduledUpdateGroupAction.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ScheduledUpdateGroupAction.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ScheduledUpdateGroupAction.to_query v - - let to_json v = `List (List.map ScheduledUpdateGroupAction.to_json v) - - let of_json j = Json.to_list ScheduledUpdateGroupAction.of_json j -end - -module LoadBalancerStates = struct - type t = LoadBalancerState.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LoadBalancerState.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LoadBalancerState.to_query v - - let to_json v = `List (List.map LoadBalancerState.to_json v) - - let of_json j = Json.to_list LoadBalancerState.of_json j -end - -module MetricCollectionTypes = struct - type t = MetricCollectionType.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map MetricCollectionType.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list MetricCollectionType.to_query v - - let to_json v = `List (List.map MetricCollectionType.to_json v) - - let of_json j = Json.to_list MetricCollectionType.of_json j -end - -module MetricGranularityTypes = struct - type t = MetricGranularityType.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map MetricGranularityType.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list MetricGranularityType.to_query v - - let to_json v = `List (List.map MetricGranularityType.to_json v) - - let of_json j = Json.to_list MetricGranularityType.of_json j -end - -module LifecycleHookNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Processes = struct - type t = ProcessType.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map ProcessType.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ProcessType.to_query v - - let to_json v = `List (List.map ProcessType.to_json v) - - let of_json j = Json.to_list ProcessType.of_json j -end - -module ScheduledActionNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ExitStandbyQuery = struct - type t = - { instance_ids : InstanceIds.t - ; auto_scaling_group_name : String.t - } - - let make ?(instance_ids = []) ~auto_scaling_group_name () = - { instance_ids; auto_scaling_group_name } - - let parse xml = - Some - { instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceIds" xml) InstanceIds.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) + end +module LoadBalancerState = + struct + type t = { + load_balancer_name: String.t option ; + state: String.t option } + let make ?load_balancer_name ?state () = { load_balancer_name; state } + let parse xml = + Some + { + load_balancer_name = + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse); + state = (Util.option_bind (Xml.member "State" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> Query.Pair ("State", (String.to_query f))); + Util.option_map v.load_balancer_name + (fun f -> Query.Pair ("LoadBalancerName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state (fun f -> ("state", (String.to_json f))); + Util.option_map v.load_balancer_name + (fun f -> ("load_balancer_name", (String.to_json f)))]) + let of_json j = + { + load_balancer_name = + (Util.option_map (Json.lookup j "load_balancer_name") + String.of_json); + state = (Util.option_map (Json.lookup j "state") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("InstanceIds.member", InstanceIds.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("instance_ids", InstanceIds.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIds.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - } -end - -module RecordLifecycleActionHeartbeatAnswer = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ActivityType = struct - type t = { activity : Activity.t option } - - let make ?activity () = { activity } - - let parse xml = - Some { activity = Util.option_bind (Xml.member "Activity" xml) Activity.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.activity (fun f -> - Query.Pair ("Activity", Activity.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.activity (fun f -> "activity", Activity.to_json f) ]) - - let of_json j = - { activity = Util.option_map (Json.lookup j "activity") Activity.of_json } -end - -module DeleteAutoScalingGroupType = struct - type t = - { auto_scaling_group_name : String.t - ; force_delete : Boolean.t option - } - - let make ~auto_scaling_group_name ?force_delete () = - { auto_scaling_group_name; force_delete } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; force_delete = Util.option_bind (Xml.member "ForceDelete" xml) Boolean.parse + end +module MetricCollectionType = + struct + type t = { + metric: String.t option } + let make ?metric () = { metric } + let parse xml = + Some + { metric = (Util.option_bind (Xml.member "Metric" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.metric + (fun f -> Query.Pair ("Metric", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.metric + (fun f -> ("metric", (String.to_json f)))]) + let of_json j = + { metric = (Util.option_map (Json.lookup j "metric") String.of_json) } + end +module MetricGranularityType = + struct + type t = { + granularity: String.t option } + let make ?granularity () = { granularity } + let parse xml = + Some + { + granularity = + (Util.option_bind (Xml.member "Granularity" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.granularity + (fun f -> Query.Pair ("Granularity", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.granularity + (fun f -> ("granularity", (String.to_json f)))]) + let of_json j = + { + granularity = + (Util.option_map (Json.lookup j "granularity") String.of_json) + } + end +module ProcessType = + struct + type t = { + process_name: String.t } + let make ~process_name () = { process_name } + let parse xml = + Some + { + process_name = + (Xml.required "ProcessName" + (Util.option_bind (Xml.member "ProcessName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ProcessName", (String.to_query v.process_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("process_name", (String.to_json v.process_name))]) + let of_json j = + { + process_name = + (String.of_json (Util.of_option_exn (Json.lookup j "process_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.force_delete (fun f -> - Query.Pair ("ForceDelete", Boolean.to_query f)) - ; Some + end +module InstanceIds = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Filters = + struct + type t = Filter.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Filter.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Filter.to_query v + let to_json v = `List (List.map Filter.to_json v) + let of_json j = Json.to_list Filter.of_json j + end +module ProcessNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AutoScalingInstances = + struct + type t = AutoScalingInstanceDetails.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AutoScalingInstanceDetails.parse (Xml.members "member" xml)) + let to_query v = + Query.to_query_list AutoScalingInstanceDetails.to_query v + let to_json v = `List (List.map AutoScalingInstanceDetails.to_json v) + let of_json j = Json.to_list AutoScalingInstanceDetails.of_json j + end +module AutoScalingNotificationTypes = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ScalingPolicies = + struct + type t = ScalingPolicy.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ScalingPolicy.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ScalingPolicy.to_query v + let to_json v = `List (List.map ScalingPolicy.to_json v) + let of_json j = Json.to_list ScalingPolicy.of_json j + end +module Tags = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module ActivityIds = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module LifecycleHooks = + struct + type t = LifecycleHook.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LifecycleHook.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LifecycleHook.to_query v + let to_json v = `List (List.map LifecycleHook.to_json v) + let of_json j = Json.to_list LifecycleHook.of_json j + end +module Activities = + struct + type t = Activity.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Activity.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Activity.to_query v + let to_json v = `List (List.map Activity.to_json v) + let of_json j = Json.to_list Activity.of_json j + end +module LaunchConfigurationNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AdjustmentTypes = + struct + type t = AdjustmentType.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AdjustmentType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list AdjustmentType.to_query v + let to_json v = `List (List.map AdjustmentType.to_json v) + let of_json j = Json.to_list AdjustmentType.of_json j + end +module AutoScalingGroups = + struct + type t = AutoScalingGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AutoScalingGroup.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list AutoScalingGroup.to_query v + let to_json v = `List (List.map AutoScalingGroup.to_json v) + let of_json j = Json.to_list AutoScalingGroup.of_json j + end +module Metrics = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module PolicyNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module PolicyTypes = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module NotificationConfigurations = + struct + type t = NotificationConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NotificationConfiguration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list NotificationConfiguration.to_query v + let to_json v = `List (List.map NotificationConfiguration.to_json v) + let of_json j = Json.to_list NotificationConfiguration.of_json j + end +module AutoScalingGroupNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module LaunchConfigurations = + struct + type t = LaunchConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LaunchConfiguration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LaunchConfiguration.to_query v + let to_json v = `List (List.map LaunchConfiguration.to_json v) + let of_json j = Json.to_list LaunchConfiguration.of_json j + end +module ScheduledUpdateGroupActions = + struct + type t = ScheduledUpdateGroupAction.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ScheduledUpdateGroupAction.parse (Xml.members "member" xml)) + let to_query v = + Query.to_query_list ScheduledUpdateGroupAction.to_query v + let to_json v = `List (List.map ScheduledUpdateGroupAction.to_json v) + let of_json j = Json.to_list ScheduledUpdateGroupAction.of_json j + end +module LoadBalancerStates = + struct + type t = LoadBalancerState.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LoadBalancerState.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LoadBalancerState.to_query v + let to_json v = `List (List.map LoadBalancerState.to_json v) + let of_json j = Json.to_list LoadBalancerState.of_json j + end +module MetricCollectionTypes = + struct + type t = MetricCollectionType.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map MetricCollectionType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list MetricCollectionType.to_query v + let to_json v = `List (List.map MetricCollectionType.to_json v) + let of_json j = Json.to_list MetricCollectionType.of_json j + end +module MetricGranularityTypes = + struct + type t = MetricGranularityType.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map MetricGranularityType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list MetricGranularityType.to_query v + let to_json v = `List (List.map MetricGranularityType.to_json v) + let of_json j = Json.to_list MetricGranularityType.of_json j + end +module LifecycleHookNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Processes = + struct + type t = ProcessType.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map ProcessType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ProcessType.to_query v + let to_json v = `List (List.map ProcessType.to_json v) + let of_json j = Json.to_list ProcessType.of_json j + end +module ScheduledActionNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ExitStandbyQuery = + struct + type t = + { + instance_ids: InstanceIds.t ; + auto_scaling_group_name: String.t } + let make ?(instance_ids= []) ~auto_scaling_group_name () = + { instance_ids; auto_scaling_group_name } + let parse xml = + Some + { + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceIds" xml) + InstanceIds.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.force_delete (fun f -> "force_delete", Boolean.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; force_delete = Util.option_map (Json.lookup j "force_delete") Boolean.of_json - } -end - -module DescribeTagsType = struct - type t = - { filters : Filters.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make ?(filters = []) ?next_token ?max_records () = - { filters; next_token; max_records } - - let parse xml = - Some - { filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) Filters.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("InstanceIds.member", (InstanceIds.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("instance_ids", (InstanceIds.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIds.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filters.member", Filters.to_query v.filters)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", Filters.to_json v.filters) - ]) - - let of_json j = - { filters = Filters.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module PutLifecycleHookType = struct - type t = - { lifecycle_hook_name : String.t - ; auto_scaling_group_name : String.t - ; lifecycle_transition : String.t option - ; role_a_r_n : String.t option - ; notification_target_a_r_n : String.t option - ; notification_metadata : String.t option - ; heartbeat_timeout : Integer.t option - ; default_result : String.t option - } - - let make - ~lifecycle_hook_name - ~auto_scaling_group_name - ?lifecycle_transition - ?role_a_r_n - ?notification_target_a_r_n - ?notification_metadata - ?heartbeat_timeout - ?default_result - () = - { lifecycle_hook_name - ; auto_scaling_group_name - ; lifecycle_transition - ; role_a_r_n - ; notification_target_a_r_n - ; notification_metadata - ; heartbeat_timeout - ; default_result - } - - let parse xml = - Some - { lifecycle_hook_name = - Xml.required - "LifecycleHookName" - (Util.option_bind (Xml.member "LifecycleHookName" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; lifecycle_transition = - Util.option_bind (Xml.member "LifecycleTransition" xml) String.parse - ; role_a_r_n = Util.option_bind (Xml.member "RoleARN" xml) String.parse - ; notification_target_a_r_n = - Util.option_bind (Xml.member "NotificationTargetARN" xml) String.parse - ; notification_metadata = - Util.option_bind (Xml.member "NotificationMetadata" xml) String.parse - ; heartbeat_timeout = - Util.option_bind (Xml.member "HeartbeatTimeout" xml) Integer.parse - ; default_result = Util.option_bind (Xml.member "DefaultResult" xml) String.parse + end +module RecordLifecycleActionHeartbeatAnswer = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ActivityType = + struct + type t = { + activity: Activity.t option } + let make ?activity () = { activity } + let parse xml = + Some + { + activity = + (Util.option_bind (Xml.member "Activity" xml) Activity.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.activity + (fun f -> Query.Pair ("Activity", (Activity.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.activity + (fun f -> ("activity", (Activity.to_json f)))]) + let of_json j = + { + activity = + (Util.option_map (Json.lookup j "activity") Activity.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.default_result (fun f -> - Query.Pair ("DefaultResult", String.to_query f)) - ; Util.option_map v.heartbeat_timeout (fun f -> - Query.Pair ("HeartbeatTimeout", Integer.to_query f)) - ; Util.option_map v.notification_metadata (fun f -> - Query.Pair ("NotificationMetadata", String.to_query f)) - ; Util.option_map v.notification_target_a_r_n (fun f -> - Query.Pair ("NotificationTargetARN", String.to_query f)) - ; Util.option_map v.role_a_r_n (fun f -> - Query.Pair ("RoleARN", String.to_query f)) - ; Util.option_map v.lifecycle_transition (fun f -> - Query.Pair ("LifecycleTransition", String.to_query f)) - ; Some + end +module DeleteAutoScalingGroupType = + struct + type t = + { + auto_scaling_group_name: String.t ; + force_delete: Boolean.t option } + let make ~auto_scaling_group_name ?force_delete () = + { auto_scaling_group_name; force_delete } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + force_delete = + (Util.option_bind (Xml.member "ForceDelete" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.force_delete + (fun f -> Query.Pair ("ForceDelete", (Boolean.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("LifecycleHookName", String.to_query v.lifecycle_hook_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.default_result (fun f -> "default_result", String.to_json f) - ; Util.option_map v.heartbeat_timeout (fun f -> - "heartbeat_timeout", Integer.to_json f) - ; Util.option_map v.notification_metadata (fun f -> - "notification_metadata", String.to_json f) - ; Util.option_map v.notification_target_a_r_n (fun f -> - "notification_target_a_r_n", String.to_json f) - ; Util.option_map v.role_a_r_n (fun f -> "role_a_r_n", String.to_json f) - ; Util.option_map v.lifecycle_transition (fun f -> - "lifecycle_transition", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("lifecycle_hook_name", String.to_json v.lifecycle_hook_name) - ]) - - let of_json j = - { lifecycle_hook_name = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_hook_name")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; lifecycle_transition = - Util.option_map (Json.lookup j "lifecycle_transition") String.of_json - ; role_a_r_n = Util.option_map (Json.lookup j "role_a_r_n") String.of_json - ; notification_target_a_r_n = - Util.option_map (Json.lookup j "notification_target_a_r_n") String.of_json - ; notification_metadata = - Util.option_map (Json.lookup j "notification_metadata") String.of_json - ; heartbeat_timeout = - Util.option_map (Json.lookup j "heartbeat_timeout") Integer.of_json - ; default_result = Util.option_map (Json.lookup j "default_result") String.of_json - } -end - -module PutLifecycleHookAnswer = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteLifecycleHookType = struct - type t = - { lifecycle_hook_name : String.t - ; auto_scaling_group_name : String.t - } - - let make ~lifecycle_hook_name ~auto_scaling_group_name () = - { lifecycle_hook_name; auto_scaling_group_name } - - let parse xml = - Some - { lifecycle_hook_name = - Xml.required - "LifecycleHookName" - (Util.option_bind (Xml.member "LifecycleHookName" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.force_delete + (fun f -> ("force_delete", (Boolean.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + force_delete = + (Util.option_map (Json.lookup j "force_delete") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("LifecycleHookName", String.to_query v.lifecycle_hook_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("lifecycle_hook_name", String.to_json v.lifecycle_hook_name) - ]) - - let of_json j = - { lifecycle_hook_name = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_hook_name")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - } -end - -module DetachInstancesQuery = struct - type t = - { instance_ids : InstanceIds.t - ; auto_scaling_group_name : String.t - ; should_decrement_desired_capacity : Boolean.t - } - - let make - ?(instance_ids = []) - ~auto_scaling_group_name - ~should_decrement_desired_capacity - () = - { instance_ids; auto_scaling_group_name; should_decrement_desired_capacity } - - let parse xml = - Some - { instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceIds" xml) InstanceIds.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; should_decrement_desired_capacity = - Xml.required - "ShouldDecrementDesiredCapacity" - (Util.option_bind - (Xml.member "ShouldDecrementDesiredCapacity" xml) - Boolean.parse) + end +module DescribeTagsType = + struct + type t = + { + filters: Filters.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?(filters= []) ?next_token ?max_records () = + { filters; next_token; max_records } + let parse xml = + Some + { + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) Filters.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filters.member", (Filters.to_query v.filters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (Filters.to_json v.filters))]) + let of_json j = + { + filters = + (Filters.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "ShouldDecrementDesiredCapacity" - , Boolean.to_query v.should_decrement_desired_capacity )) - ; Some - (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("InstanceIds.member", InstanceIds.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "should_decrement_desired_capacity" - , Boolean.to_json v.should_decrement_desired_capacity ) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("instance_ids", InstanceIds.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIds.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; should_decrement_desired_capacity = - Boolean.of_json - (Util.of_option_exn (Json.lookup j "should_decrement_desired_capacity")) - } -end - -module ScalingProcessQuery = struct - type t = - { auto_scaling_group_name : String.t - ; scaling_processes : ProcessNames.t - } - - let make ~auto_scaling_group_name ?(scaling_processes = []) () = - { auto_scaling_group_name; scaling_processes } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; scaling_processes = - Util.of_option - [] - (Util.option_bind (Xml.member "ScalingProcesses" xml) ProcessNames.parse) + end +module PutLifecycleHookType = + struct + type t = + { + lifecycle_hook_name: String.t ; + auto_scaling_group_name: String.t ; + lifecycle_transition: String.t option ; + role_a_r_n: String.t option ; + notification_target_a_r_n: String.t option ; + notification_metadata: String.t option ; + heartbeat_timeout: Integer.t option ; + default_result: String.t option } + let make ~lifecycle_hook_name ~auto_scaling_group_name + ?lifecycle_transition ?role_a_r_n ?notification_target_a_r_n + ?notification_metadata ?heartbeat_timeout ?default_result () = + { + lifecycle_hook_name; + auto_scaling_group_name; + lifecycle_transition; + role_a_r_n; + notification_target_a_r_n; + notification_metadata; + heartbeat_timeout; + default_result } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + lifecycle_hook_name = + (Xml.required "LifecycleHookName" + (Util.option_bind (Xml.member "LifecycleHookName" xml) + String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + lifecycle_transition = + (Util.option_bind (Xml.member "LifecycleTransition" xml) + String.parse); + role_a_r_n = + (Util.option_bind (Xml.member "RoleARN" xml) String.parse); + notification_target_a_r_n = + (Util.option_bind (Xml.member "NotificationTargetARN" xml) + String.parse); + notification_metadata = + (Util.option_bind (Xml.member "NotificationMetadata" xml) + String.parse); + heartbeat_timeout = + (Util.option_bind (Xml.member "HeartbeatTimeout" xml) + Integer.parse); + default_result = + (Util.option_bind (Xml.member "DefaultResult" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.default_result + (fun f -> Query.Pair ("DefaultResult", (String.to_query f))); + Util.option_map v.heartbeat_timeout + (fun f -> Query.Pair ("HeartbeatTimeout", (Integer.to_query f))); + Util.option_map v.notification_metadata + (fun f -> + Query.Pair ("NotificationMetadata", (String.to_query f))); + Util.option_map v.notification_target_a_r_n + (fun f -> + Query.Pair ("NotificationTargetARN", (String.to_query f))); + Util.option_map v.role_a_r_n + (fun f -> Query.Pair ("RoleARN", (String.to_query f))); + Util.option_map v.lifecycle_transition + (fun f -> + Query.Pair ("LifecycleTransition", (String.to_query f))); + Some (Query.Pair - ("ScalingProcesses.member", ProcessNames.to_query v.scaling_processes)) - ; Some + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("scaling_processes", ProcessNames.to_json v.scaling_processes) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; scaling_processes = - ProcessNames.of_json (Util.of_option_exn (Json.lookup j "scaling_processes")) - } -end - -module DetachLoadBalancersType = struct - type t = - { auto_scaling_group_name : String.t option - ; load_balancer_names : LoadBalancerNames.t - } - - let make ?auto_scaling_group_name ?(load_balancer_names = []) () = - { auto_scaling_group_name; load_balancer_names } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; load_balancer_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) + ("LifecycleHookName", + (String.to_query v.lifecycle_hook_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.default_result + (fun f -> ("default_result", (String.to_json f))); + Util.option_map v.heartbeat_timeout + (fun f -> ("heartbeat_timeout", (Integer.to_json f))); + Util.option_map v.notification_metadata + (fun f -> ("notification_metadata", (String.to_json f))); + Util.option_map v.notification_target_a_r_n + (fun f -> ("notification_target_a_r_n", (String.to_json f))); + Util.option_map v.role_a_r_n + (fun f -> ("role_a_r_n", (String.to_json f))); + Util.option_map v.lifecycle_transition + (fun f -> ("lifecycle_transition", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some + ("lifecycle_hook_name", (String.to_json v.lifecycle_hook_name))]) + let of_json j = + { + lifecycle_hook_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_name"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + lifecycle_transition = + (Util.option_map (Json.lookup j "lifecycle_transition") + String.of_json); + role_a_r_n = + (Util.option_map (Json.lookup j "role_a_r_n") String.of_json); + notification_target_a_r_n = + (Util.option_map (Json.lookup j "notification_target_a_r_n") + String.of_json); + notification_metadata = + (Util.option_map (Json.lookup j "notification_metadata") + String.of_json); + heartbeat_timeout = + (Util.option_map (Json.lookup j "heartbeat_timeout") + Integer.of_json); + default_result = + (Util.option_map (Json.lookup j "default_result") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module PutLifecycleHookAnswer = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteLifecycleHookType = + struct + type t = + { + lifecycle_hook_name: String.t ; + auto_scaling_group_name: String.t } + let make ~lifecycle_hook_name ~auto_scaling_group_name () = + { lifecycle_hook_name; auto_scaling_group_name } + let parse xml = + Some + { + lifecycle_hook_name = + (Xml.required "LifecycleHookName" + (Util.option_bind (Xml.member "LifecycleHookName" xml) + String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - } -end - -module ResourceInUseFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DescribeLoadBalancersRequest = struct - type t = - { auto_scaling_group_name : String.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make ~auto_scaling_group_name ?next_token ?max_records () = - { auto_scaling_group_name; next_token; max_records } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("LifecycleHookName", + (String.to_query v.lifecycle_hook_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some + ("lifecycle_hook_name", (String.to_json v.lifecycle_hook_name))]) + let of_json j = + { + lifecycle_hook_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_name"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module AttachLoadBalancersType = struct - type t = - { auto_scaling_group_name : String.t option - ; load_balancer_names : LoadBalancerNames.t - } - - let make ?auto_scaling_group_name ?(load_balancer_names = []) () = - { auto_scaling_group_name; load_balancer_names } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; load_balancer_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) + end +module DetachInstancesQuery = + struct + type t = + { + instance_ids: InstanceIds.t ; + auto_scaling_group_name: String.t ; + should_decrement_desired_capacity: Boolean.t } + let make ?(instance_ids= []) ~auto_scaling_group_name + ~should_decrement_desired_capacity () = + { + instance_ids; + auto_scaling_group_name; + should_decrement_desired_capacity } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceIds" xml) + InstanceIds.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + should_decrement_desired_capacity = + (Xml.required "ShouldDecrementDesiredCapacity" + (Util.option_bind + (Xml.member "ShouldDecrementDesiredCapacity" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ShouldDecrementDesiredCapacity", + (Boolean.to_query v.should_decrement_desired_capacity))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - } -end - -module RecordLifecycleActionHeartbeatType = struct - type t = - { lifecycle_hook_name : String.t - ; auto_scaling_group_name : String.t - ; lifecycle_action_token : String.t - } - - let make ~lifecycle_hook_name ~auto_scaling_group_name ~lifecycle_action_token () = - { lifecycle_hook_name; auto_scaling_group_name; lifecycle_action_token } - - let parse xml = - Some - { lifecycle_hook_name = - Xml.required - "LifecycleHookName" - (Util.option_bind (Xml.member "LifecycleHookName" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; lifecycle_action_token = - Xml.required - "LifecycleActionToken" - (Util.option_bind (Xml.member "LifecycleActionToken" xml) String.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some + (Query.Pair + ("InstanceIds.member", (InstanceIds.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("should_decrement_desired_capacity", + (Boolean.to_json v.should_decrement_desired_capacity)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("instance_ids", (InstanceIds.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIds.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + should_decrement_desired_capacity = + (Boolean.of_json + (Util.of_option_exn + (Json.lookup j "should_decrement_desired_capacity"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("LifecycleActionToken", String.to_query v.lifecycle_action_token)) - ; Some + end +module ScalingProcessQuery = + struct + type t = + { + auto_scaling_group_name: String.t ; + scaling_processes: ProcessNames.t } + let make ~auto_scaling_group_name ?(scaling_processes= []) () = + { auto_scaling_group_name; scaling_processes } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + scaling_processes = + (Util.of_option [] + (Util.option_bind (Xml.member "ScalingProcesses" xml) + ProcessNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ScalingProcesses.member", + (ProcessNames.to_query v.scaling_processes))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("LifecycleHookName", String.to_query v.lifecycle_hook_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("lifecycle_action_token", String.to_json v.lifecycle_action_token) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("lifecycle_hook_name", String.to_json v.lifecycle_hook_name) - ]) - - let of_json j = - { lifecycle_hook_name = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_hook_name")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; lifecycle_action_token = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_action_token")) - } -end - -module AutoScalingInstancesType = struct - type t = - { auto_scaling_instances : AutoScalingInstances.t - ; next_token : String.t option - } - - let make ?(auto_scaling_instances = []) ?next_token () = - { auto_scaling_instances; next_token } - - let parse xml = - Some - { auto_scaling_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "AutoScalingInstances" xml) - AutoScalingInstances.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("scaling_processes", + (ProcessNames.to_json v.scaling_processes)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + scaling_processes = + (ProcessNames.of_json + (Util.of_option_exn (Json.lookup j "scaling_processes"))) + } + end +module DetachLoadBalancersType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + load_balancer_names: LoadBalancerNames.t } + let make ?auto_scaling_group_name ?(load_balancer_names= []) () = + { auto_scaling_group_name; load_balancer_names } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + load_balancer_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module ResourceInUseFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module DescribeLoadBalancersRequest = + struct + type t = + { + auto_scaling_group_name: String.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ~auto_scaling_group_name ?next_token ?max_records () = + { auto_scaling_group_name; next_token; max_records } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AutoScalingInstances.member" - , AutoScalingInstances.to_query v.auto_scaling_instances )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "auto_scaling_instances" - , AutoScalingInstances.to_json v.auto_scaling_instances ) - ]) - - let of_json j = - { auto_scaling_instances = - AutoScalingInstances.of_json - (Util.of_option_exn (Json.lookup j "auto_scaling_instances")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module PutNotificationConfigurationType = struct - type t = - { auto_scaling_group_name : String.t - ; topic_a_r_n : String.t - ; notification_types : AutoScalingNotificationTypes.t - } - - let make ~auto_scaling_group_name ~topic_a_r_n ~notification_types () = - { auto_scaling_group_name; topic_a_r_n; notification_types } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; topic_a_r_n = - Xml.required - "TopicARN" - (Util.option_bind (Xml.member "TopicARN" xml) String.parse) - ; notification_types = - Xml.required - "NotificationTypes" - (Util.option_bind - (Xml.member "NotificationTypes" xml) - AutoScalingNotificationTypes.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) + } + end +module AttachLoadBalancersType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + load_balancer_names: LoadBalancerNames.t } + let make ?auto_scaling_group_name ?(load_balancer_names= []) () = + { auto_scaling_group_name; load_balancer_names } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + load_balancer_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module RecordLifecycleActionHeartbeatType = + struct + type t = + { + lifecycle_hook_name: String.t ; + auto_scaling_group_name: String.t ; + lifecycle_action_token: String.t } + let make ~lifecycle_hook_name ~auto_scaling_group_name + ~lifecycle_action_token () = + { lifecycle_hook_name; auto_scaling_group_name; lifecycle_action_token + } + let parse xml = + Some + { + lifecycle_hook_name = + (Xml.required "LifecycleHookName" + (Util.option_bind (Xml.member "LifecycleHookName" xml) + String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + lifecycle_action_token = + (Xml.required "LifecycleActionToken" + (Util.option_bind (Xml.member "LifecycleActionToken" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LifecycleActionToken", + (String.to_query v.lifecycle_action_token))); + Some (Query.Pair - ( "NotificationTypes.member" - , AutoScalingNotificationTypes.to_query v.notification_types )) - ; Some (Query.Pair ("TopicARN", String.to_query v.topic_a_r_n)) - ; Some + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "notification_types" - , AutoScalingNotificationTypes.to_json v.notification_types ) - ; Some ("topic_a_r_n", String.to_json v.topic_a_r_n) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; topic_a_r_n = String.of_json (Util.of_option_exn (Json.lookup j "topic_a_r_n")) - ; notification_types = - AutoScalingNotificationTypes.of_json - (Util.of_option_exn (Json.lookup j "notification_types")) - } -end - -module PoliciesType = struct - type t = - { scaling_policies : ScalingPolicies.t - ; next_token : String.t option - } - - let make ?(scaling_policies = []) ?next_token () = { scaling_policies; next_token } - - let parse xml = - Some - { scaling_policies = - Util.of_option - [] - (Util.option_bind (Xml.member "ScalingPolicies" xml) ScalingPolicies.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("LifecycleHookName", + (String.to_query v.lifecycle_hook_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lifecycle_action_token", + (String.to_json v.lifecycle_action_token)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some + ("lifecycle_hook_name", (String.to_json v.lifecycle_hook_name))]) + let of_json j = + { + lifecycle_hook_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_name"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + lifecycle_action_token = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_action_token"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module AutoScalingInstancesType = + struct + type t = + { + auto_scaling_instances: AutoScalingInstances.t ; + next_token: String.t option } + let make ?(auto_scaling_instances= []) ?next_token () = + { auto_scaling_instances; next_token } + let parse xml = + Some + { + auto_scaling_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "AutoScalingInstances" xml) + AutoScalingInstances.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("ScalingPolicies.member", ScalingPolicies.to_query v.scaling_policies)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("scaling_policies", ScalingPolicies.to_json v.scaling_policies) - ]) - - let of_json j = - { scaling_policies = - ScalingPolicies.of_json (Util.of_option_exn (Json.lookup j "scaling_policies")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module UpdateAutoScalingGroupType = struct - type t = - { auto_scaling_group_name : String.t - ; launch_configuration_name : String.t option - ; min_size : Integer.t option - ; max_size : Integer.t option - ; desired_capacity : Integer.t option - ; default_cooldown : Integer.t option - ; availability_zones : AvailabilityZones.t - ; health_check_type : String.t option - ; health_check_grace_period : Integer.t option - ; placement_group : String.t option - ; v_p_c_zone_identifier : String.t option - ; termination_policies : TerminationPolicies.t - } - - let make - ~auto_scaling_group_name - ?launch_configuration_name - ?min_size - ?max_size - ?desired_capacity - ?default_cooldown - ?(availability_zones = []) - ?health_check_type - ?health_check_grace_period - ?placement_group - ?v_p_c_zone_identifier - ?(termination_policies = []) - () = - { auto_scaling_group_name - ; launch_configuration_name - ; min_size - ; max_size - ; desired_capacity - ; default_cooldown - ; availability_zones - ; health_check_type - ; health_check_grace_period - ; placement_group - ; v_p_c_zone_identifier - ; termination_policies - } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; launch_configuration_name = - Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse - ; min_size = Util.option_bind (Xml.member "MinSize" xml) Integer.parse - ; max_size = Util.option_bind (Xml.member "MaxSize" xml) Integer.parse - ; desired_capacity = - Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse - ; default_cooldown = - Util.option_bind (Xml.member "DefaultCooldown" xml) Integer.parse - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; health_check_type = - Util.option_bind (Xml.member "HealthCheckType" xml) String.parse - ; health_check_grace_period = - Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) Integer.parse - ; placement_group = Util.option_bind (Xml.member "PlacementGroup" xml) String.parse - ; v_p_c_zone_identifier = - Util.option_bind (Xml.member "VPCZoneIdentifier" xml) String.parse - ; termination_policies = - Util.of_option - [] - (Util.option_bind - (Xml.member "TerminationPolicies" xml) - TerminationPolicies.parse) + ("AutoScalingInstances.member", + (AutoScalingInstances.to_query v.auto_scaling_instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("auto_scaling_instances", + (AutoScalingInstances.to_json v.auto_scaling_instances))]) + let of_json j = + { + auto_scaling_instances = + (AutoScalingInstances.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_instances"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module PutNotificationConfigurationType = + struct + type t = + { + auto_scaling_group_name: String.t ; + topic_a_r_n: String.t ; + notification_types: AutoScalingNotificationTypes.t } + let make ~auto_scaling_group_name ~topic_a_r_n ~notification_types () + = { auto_scaling_group_name; topic_a_r_n; notification_types } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + topic_a_r_n = + (Xml.required "TopicARN" + (Util.option_bind (Xml.member "TopicARN" xml) String.parse)); + notification_types = + (Xml.required "NotificationTypes" + (Util.option_bind (Xml.member "NotificationTypes" xml) + AutoScalingNotificationTypes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NotificationTypes.member", + (AutoScalingNotificationTypes.to_query + v.notification_types))); + Some (Query.Pair ("TopicARN", (String.to_query v.topic_a_r_n))); + Some (Query.Pair - ( "TerminationPolicies.member" - , TerminationPolicies.to_query v.termination_policies )) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - Query.Pair ("VPCZoneIdentifier", String.to_query f)) - ; Util.option_map v.placement_group (fun f -> - Query.Pair ("PlacementGroup", String.to_query f)) - ; Util.option_map v.health_check_grace_period (fun f -> - Query.Pair ("HealthCheckGracePeriod", Integer.to_query f)) - ; Util.option_map v.health_check_type (fun f -> - Query.Pair ("HealthCheckType", String.to_query f)) - ; Some + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("notification_types", + (AutoScalingNotificationTypes.to_json v.notification_types)); + Some ("topic_a_r_n", (String.to_json v.topic_a_r_n)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + topic_a_r_n = + (String.of_json (Util.of_option_exn (Json.lookup j "topic_a_r_n"))); + notification_types = + (AutoScalingNotificationTypes.of_json + (Util.of_option_exn (Json.lookup j "notification_types"))) + } + end +module PoliciesType = + struct + type t = + { + scaling_policies: ScalingPolicies.t ; + next_token: String.t option } + let make ?(scaling_policies= []) ?next_token () = + { scaling_policies; next_token } + let parse xml = + Some + { + scaling_policies = + (Util.of_option [] + (Util.option_bind (Xml.member "ScalingPolicies" xml) + ScalingPolicies.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Util.option_map v.default_cooldown (fun f -> - Query.Pair ("DefaultCooldown", Integer.to_query f)) - ; Util.option_map v.desired_capacity (fun f -> - Query.Pair ("DesiredCapacity", Integer.to_query f)) - ; Util.option_map v.max_size (fun f -> - Query.Pair ("MaxSize", Integer.to_query f)) - ; Util.option_map v.min_size (fun f -> - Query.Pair ("MinSize", Integer.to_query f)) - ; Util.option_map v.launch_configuration_name (fun f -> - Query.Pair ("LaunchConfigurationName", String.to_query f)) - ; Some + ("ScalingPolicies.member", + (ScalingPolicies.to_query v.scaling_policies)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("scaling_policies", + (ScalingPolicies.to_json v.scaling_policies))]) + let of_json j = + { + scaling_policies = + (ScalingPolicies.of_json + (Util.of_option_exn (Json.lookup j "scaling_policies"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module UpdateAutoScalingGroupType = + struct + type t = + { + auto_scaling_group_name: String.t ; + launch_configuration_name: String.t option ; + min_size: Integer.t option ; + max_size: Integer.t option ; + desired_capacity: Integer.t option ; + default_cooldown: Integer.t option ; + availability_zones: AvailabilityZones.t ; + health_check_type: String.t option ; + health_check_grace_period: Integer.t option ; + placement_group: String.t option ; + v_p_c_zone_identifier: String.t option ; + termination_policies: TerminationPolicies.t } + let make ~auto_scaling_group_name ?launch_configuration_name ?min_size + ?max_size ?desired_capacity ?default_cooldown ?(availability_zones= + []) ?health_check_type ?health_check_grace_period ?placement_group + ?v_p_c_zone_identifier ?(termination_policies= []) () = + { + auto_scaling_group_name; + launch_configuration_name; + min_size; + max_size; + desired_capacity; + default_cooldown; + availability_zones; + health_check_type; + health_check_grace_period; + placement_group; + v_p_c_zone_identifier; + termination_policies + } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + launch_configuration_name = + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse); + min_size = + (Util.option_bind (Xml.member "MinSize" xml) Integer.parse); + max_size = + (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse); + desired_capacity = + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse); + default_cooldown = + (Util.option_bind (Xml.member "DefaultCooldown" xml) + Integer.parse); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + health_check_type = + (Util.option_bind (Xml.member "HealthCheckType" xml) String.parse); + health_check_grace_period = + (Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) + Integer.parse); + placement_group = + (Util.option_bind (Xml.member "PlacementGroup" xml) String.parse); + v_p_c_zone_identifier = + (Util.option_bind (Xml.member "VPCZoneIdentifier" xml) + String.parse); + termination_policies = + (Util.of_option [] + (Util.option_bind (Xml.member "TerminationPolicies" xml) + TerminationPolicies.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TerminationPolicies.member", + (TerminationPolicies.to_query v.termination_policies))); + Util.option_map v.v_p_c_zone_identifier + (fun f -> Query.Pair ("VPCZoneIdentifier", (String.to_query f))); + Util.option_map v.placement_group + (fun f -> Query.Pair ("PlacementGroup", (String.to_query f))); + Util.option_map v.health_check_grace_period + (fun f -> + Query.Pair ("HealthCheckGracePeriod", (Integer.to_query f))); + Util.option_map v.health_check_type + (fun f -> Query.Pair ("HealthCheckType", (String.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("termination_policies", TerminationPolicies.to_json v.termination_policies) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - "v_p_c_zone_identifier", String.to_json f) - ; Util.option_map v.placement_group (fun f -> - "placement_group", String.to_json f) - ; Util.option_map v.health_check_grace_period (fun f -> - "health_check_grace_period", Integer.to_json f) - ; Util.option_map v.health_check_type (fun f -> - "health_check_type", String.to_json f) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Util.option_map v.default_cooldown (fun f -> - "default_cooldown", Integer.to_json f) - ; Util.option_map v.desired_capacity (fun f -> - "desired_capacity", Integer.to_json f) - ; Util.option_map v.max_size (fun f -> "max_size", Integer.to_json f) - ; Util.option_map v.min_size (fun f -> "min_size", Integer.to_json f) - ; Util.option_map v.launch_configuration_name (fun f -> - "launch_configuration_name", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; launch_configuration_name = - Util.option_map (Json.lookup j "launch_configuration_name") String.of_json - ; min_size = Util.option_map (Json.lookup j "min_size") Integer.of_json - ; max_size = Util.option_map (Json.lookup j "max_size") Integer.of_json - ; desired_capacity = - Util.option_map (Json.lookup j "desired_capacity") Integer.of_json - ; default_cooldown = - Util.option_map (Json.lookup j "default_cooldown") Integer.of_json - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; health_check_type = - Util.option_map (Json.lookup j "health_check_type") String.of_json - ; health_check_grace_period = - Util.option_map (Json.lookup j "health_check_grace_period") Integer.of_json - ; placement_group = Util.option_map (Json.lookup j "placement_group") String.of_json - ; v_p_c_zone_identifier = - Util.option_map (Json.lookup j "v_p_c_zone_identifier") String.of_json - ; termination_policies = - TerminationPolicies.of_json - (Util.of_option_exn (Json.lookup j "termination_policies")) - } -end - -module CreateAutoScalingGroupType = struct - type t = - { auto_scaling_group_name : String.t - ; launch_configuration_name : String.t option - ; instance_id : String.t option - ; min_size : Integer.t - ; max_size : Integer.t - ; desired_capacity : Integer.t option - ; default_cooldown : Integer.t option - ; availability_zones : AvailabilityZones.t - ; load_balancer_names : LoadBalancerNames.t - ; health_check_type : String.t option - ; health_check_grace_period : Integer.t option - ; placement_group : String.t option - ; v_p_c_zone_identifier : String.t option - ; termination_policies : TerminationPolicies.t - ; tags : Tags.t - } - - let make - ~auto_scaling_group_name - ?launch_configuration_name - ?instance_id - ~min_size - ~max_size - ?desired_capacity - ?default_cooldown - ?(availability_zones = []) - ?(load_balancer_names = []) - ?health_check_type - ?health_check_grace_period - ?placement_group - ?v_p_c_zone_identifier - ?(termination_policies = []) - ?(tags = []) - () = - { auto_scaling_group_name - ; launch_configuration_name - ; instance_id - ; min_size - ; max_size - ; desired_capacity - ; default_cooldown - ; availability_zones - ; load_balancer_names - ; health_check_type - ; health_check_grace_period - ; placement_group - ; v_p_c_zone_identifier - ; termination_policies - ; tags - } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; launch_configuration_name = - Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; min_size = - Xml.required - "MinSize" - (Util.option_bind (Xml.member "MinSize" xml) Integer.parse) - ; max_size = - Xml.required - "MaxSize" - (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse) - ; desired_capacity = - Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse - ; default_cooldown = - Util.option_bind (Xml.member "DefaultCooldown" xml) Integer.parse - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; load_balancer_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) - ; health_check_type = - Util.option_bind (Xml.member "HealthCheckType" xml) String.parse - ; health_check_grace_period = - Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) Integer.parse - ; placement_group = Util.option_bind (Xml.member "PlacementGroup" xml) String.parse - ; v_p_c_zone_identifier = - Util.option_bind (Xml.member "VPCZoneIdentifier" xml) String.parse - ; termination_policies = - Util.of_option - [] - (Util.option_bind - (Xml.member "TerminationPolicies" xml) - TerminationPolicies.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) Tags.parse) + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Util.option_map v.default_cooldown + (fun f -> Query.Pair ("DefaultCooldown", (Integer.to_query f))); + Util.option_map v.desired_capacity + (fun f -> Query.Pair ("DesiredCapacity", (Integer.to_query f))); + Util.option_map v.max_size + (fun f -> Query.Pair ("MaxSize", (Integer.to_query f))); + Util.option_map v.min_size + (fun f -> Query.Pair ("MinSize", (Integer.to_query f))); + Util.option_map v.launch_configuration_name + (fun f -> + Query.Pair ("LaunchConfigurationName", (String.to_query f))); + Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("termination_policies", + (TerminationPolicies.to_json v.termination_policies)); + Util.option_map v.v_p_c_zone_identifier + (fun f -> ("v_p_c_zone_identifier", (String.to_json f))); + Util.option_map v.placement_group + (fun f -> ("placement_group", (String.to_json f))); + Util.option_map v.health_check_grace_period + (fun f -> ("health_check_grace_period", (Integer.to_json f))); + Util.option_map v.health_check_type + (fun f -> ("health_check_type", (String.to_json f))); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Util.option_map v.default_cooldown + (fun f -> ("default_cooldown", (Integer.to_json f))); + Util.option_map v.desired_capacity + (fun f -> ("desired_capacity", (Integer.to_json f))); + Util.option_map v.max_size + (fun f -> ("max_size", (Integer.to_json f))); + Util.option_map v.min_size + (fun f -> ("min_size", (Integer.to_json f))); + Util.option_map v.launch_configuration_name + (fun f -> ("launch_configuration_name", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + launch_configuration_name = + (Util.option_map (Json.lookup j "launch_configuration_name") + String.of_json); + min_size = + (Util.option_map (Json.lookup j "min_size") Integer.of_json); + max_size = + (Util.option_map (Json.lookup j "max_size") Integer.of_json); + desired_capacity = + (Util.option_map (Json.lookup j "desired_capacity") Integer.of_json); + default_cooldown = + (Util.option_map (Json.lookup j "default_cooldown") Integer.of_json); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + health_check_type = + (Util.option_map (Json.lookup j "health_check_type") String.of_json); + health_check_grace_period = + (Util.option_map (Json.lookup j "health_check_grace_period") + Integer.of_json); + placement_group = + (Util.option_map (Json.lookup j "placement_group") String.of_json); + v_p_c_zone_identifier = + (Util.option_map (Json.lookup j "v_p_c_zone_identifier") + String.of_json); + termination_policies = + (TerminationPolicies.of_json + (Util.of_option_exn (Json.lookup j "termination_policies"))) + } + end +module CreateAutoScalingGroupType = + struct + type t = + { + auto_scaling_group_name: String.t ; + launch_configuration_name: String.t option ; + instance_id: String.t option ; + min_size: Integer.t ; + max_size: Integer.t ; + desired_capacity: Integer.t option ; + default_cooldown: Integer.t option ; + availability_zones: AvailabilityZones.t ; + load_balancer_names: LoadBalancerNames.t ; + health_check_type: String.t option ; + health_check_grace_period: Integer.t option ; + placement_group: String.t option ; + v_p_c_zone_identifier: String.t option ; + termination_policies: TerminationPolicies.t ; + tags: Tags.t } + let make ~auto_scaling_group_name ?launch_configuration_name + ?instance_id ~min_size ~max_size ?desired_capacity + ?default_cooldown ?(availability_zones= []) ?(load_balancer_names= + []) ?health_check_type ?health_check_grace_period ?placement_group + ?v_p_c_zone_identifier ?(termination_policies= []) ?(tags= []) () = + { + auto_scaling_group_name; + launch_configuration_name; + instance_id; + min_size; + max_size; + desired_capacity; + default_cooldown; + availability_zones; + load_balancer_names; + health_check_type; + health_check_grace_period; + placement_group; + v_p_c_zone_identifier; + termination_policies; + tags } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", Tags.to_query v.tags)) - ; Some + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + launch_configuration_name = + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + min_size = + (Xml.required "MinSize" + (Util.option_bind (Xml.member "MinSize" xml) Integer.parse)); + max_size = + (Xml.required "MaxSize" + (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse)); + desired_capacity = + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse); + default_cooldown = + (Util.option_bind (Xml.member "DefaultCooldown" xml) + Integer.parse); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + load_balancer_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)); + health_check_type = + (Util.option_bind (Xml.member "HealthCheckType" xml) String.parse); + health_check_grace_period = + (Util.option_bind (Xml.member "HealthCheckGracePeriod" xml) + Integer.parse); + placement_group = + (Util.option_bind (Xml.member "PlacementGroup" xml) String.parse); + v_p_c_zone_identifier = + (Util.option_bind (Xml.member "VPCZoneIdentifier" xml) + String.parse); + termination_policies = + (Util.of_option [] + (Util.option_bind (Xml.member "TerminationPolicies" xml) + TerminationPolicies.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) Tags.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (Tags.to_query v.tags))); + Some (Query.Pair - ( "TerminationPolicies.member" - , TerminationPolicies.to_query v.termination_policies )) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - Query.Pair ("VPCZoneIdentifier", String.to_query f)) - ; Util.option_map v.placement_group (fun f -> - Query.Pair ("PlacementGroup", String.to_query f)) - ; Util.option_map v.health_check_grace_period (fun f -> - Query.Pair ("HealthCheckGracePeriod", Integer.to_query f)) - ; Util.option_map v.health_check_type (fun f -> - Query.Pair ("HealthCheckType", String.to_query f)) - ; Some + ("TerminationPolicies.member", + (TerminationPolicies.to_query v.termination_policies))); + Util.option_map v.v_p_c_zone_identifier + (fun f -> Query.Pair ("VPCZoneIdentifier", (String.to_query f))); + Util.option_map v.placement_group + (fun f -> Query.Pair ("PlacementGroup", (String.to_query f))); + Util.option_map v.health_check_grace_period + (fun f -> + Query.Pair ("HealthCheckGracePeriod", (Integer.to_query f))); + Util.option_map v.health_check_type + (fun f -> Query.Pair ("HealthCheckType", (String.to_query f))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ; Some + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Util.option_map v.default_cooldown (fun f -> - Query.Pair ("DefaultCooldown", Integer.to_query f)) - ; Util.option_map v.desired_capacity (fun f -> - Query.Pair ("DesiredCapacity", Integer.to_query f)) - ; Some (Query.Pair ("MaxSize", Integer.to_query v.max_size)) - ; Some (Query.Pair ("MinSize", Integer.to_query v.min_size)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.launch_configuration_name (fun f -> - Query.Pair ("LaunchConfigurationName", String.to_query f)) - ; Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Util.option_map v.default_cooldown + (fun f -> Query.Pair ("DefaultCooldown", (Integer.to_query f))); + Util.option_map v.desired_capacity + (fun f -> Query.Pair ("DesiredCapacity", (Integer.to_query f))); + Some (Query.Pair ("MaxSize", (Integer.to_query v.max_size))); + Some (Query.Pair ("MinSize", (Integer.to_query v.min_size))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.launch_configuration_name + (fun f -> + Query.Pair ("LaunchConfigurationName", (String.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", Tags.to_json v.tags) - ; Some - ("termination_policies", TerminationPolicies.to_json v.termination_policies) - ; Util.option_map v.v_p_c_zone_identifier (fun f -> - "v_p_c_zone_identifier", String.to_json f) - ; Util.option_map v.placement_group (fun f -> - "placement_group", String.to_json f) - ; Util.option_map v.health_check_grace_period (fun f -> - "health_check_grace_period", Integer.to_json f) - ; Util.option_map v.health_check_type (fun f -> - "health_check_type", String.to_json f) - ; Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Util.option_map v.default_cooldown (fun f -> - "default_cooldown", Integer.to_json f) - ; Util.option_map v.desired_capacity (fun f -> - "desired_capacity", Integer.to_json f) - ; Some ("max_size", Integer.to_json v.max_size) - ; Some ("min_size", Integer.to_json v.min_size) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.launch_configuration_name (fun f -> - "launch_configuration_name", String.to_json f) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; launch_configuration_name = - Util.option_map (Json.lookup j "launch_configuration_name") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; min_size = Integer.of_json (Util.of_option_exn (Json.lookup j "min_size")) - ; max_size = Integer.of_json (Util.of_option_exn (Json.lookup j "max_size")) - ; desired_capacity = - Util.option_map (Json.lookup j "desired_capacity") Integer.of_json - ; default_cooldown = - Util.option_map (Json.lookup j "default_cooldown") Integer.of_json - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - ; health_check_type = - Util.option_map (Json.lookup j "health_check_type") String.of_json - ; health_check_grace_period = - Util.option_map (Json.lookup j "health_check_grace_period") Integer.of_json - ; placement_group = Util.option_map (Json.lookup j "placement_group") String.of_json - ; v_p_c_zone_identifier = - Util.option_map (Json.lookup j "v_p_c_zone_identifier") String.of_json - ; termination_policies = - TerminationPolicies.of_json - (Util.of_option_exn (Json.lookup j "termination_policies")) - ; tags = Tags.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module TagsType = struct - type t = - { tags : TagDescriptionList.t - ; next_token : String.t option - } - - let make ?(tags = []) ?next_token () = { tags; next_token } - - let parse xml = - Some - { tags = - Util.of_option - [] - (Util.option_bind (Xml.member "Tags" xml) TagDescriptionList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (Tags.to_json v.tags)); + Some + ("termination_policies", + (TerminationPolicies.to_json v.termination_policies)); + Util.option_map v.v_p_c_zone_identifier + (fun f -> ("v_p_c_zone_identifier", (String.to_json f))); + Util.option_map v.placement_group + (fun f -> ("placement_group", (String.to_json f))); + Util.option_map v.health_check_grace_period + (fun f -> ("health_check_grace_period", (Integer.to_json f))); + Util.option_map v.health_check_type + (fun f -> ("health_check_type", (String.to_json f))); + Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names)); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Util.option_map v.default_cooldown + (fun f -> ("default_cooldown", (Integer.to_json f))); + Util.option_map v.desired_capacity + (fun f -> ("desired_capacity", (Integer.to_json f))); + Some ("max_size", (Integer.to_json v.max_size)); + Some ("min_size", (Integer.to_json v.min_size)); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.launch_configuration_name + (fun f -> ("launch_configuration_name", (String.to_json f))); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + launch_configuration_name = + (Util.option_map (Json.lookup j "launch_configuration_name") + String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + min_size = + (Integer.of_json (Util.of_option_exn (Json.lookup j "min_size"))); + max_size = + (Integer.of_json (Util.of_option_exn (Json.lookup j "max_size"))); + desired_capacity = + (Util.option_map (Json.lookup j "desired_capacity") Integer.of_json); + default_cooldown = + (Util.option_map (Json.lookup j "default_cooldown") Integer.of_json); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))); + health_check_type = + (Util.option_map (Json.lookup j "health_check_type") String.of_json); + health_check_grace_period = + (Util.option_map (Json.lookup j "health_check_grace_period") + Integer.of_json); + placement_group = + (Util.option_map (Json.lookup j "placement_group") String.of_json); + v_p_c_zone_identifier = + (Util.option_map (Json.lookup j "v_p_c_zone_identifier") + String.of_json); + termination_policies = + (TerminationPolicies.of_json + (Util.of_option_exn (Json.lookup j "termination_policies"))); + tags = (Tags.of_json (Util.of_option_exn (Json.lookup j "tags"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Tags.member", TagDescriptionList.to_query v.tags)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("tags", TagDescriptionList.to_json v.tags) - ]) - - let of_json j = - { tags = TagDescriptionList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module AttachLoadBalancersResultType = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeScalingActivitiesType = struct - type t = - { activity_ids : ActivityIds.t - ; auto_scaling_group_name : String.t option - ; max_records : Integer.t option - ; next_token : String.t option - } - - let make ?(activity_ids = []) ?auto_scaling_group_name ?max_records ?next_token () = - { activity_ids; auto_scaling_group_name; max_records; next_token } - - let parse xml = - Some - { activity_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "ActivityIds" xml) ActivityIds.parse) - ; auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module TagsType = + struct + type t = { + tags: TagDescriptionList.t ; + next_token: String.t option } + let make ?(tags= []) ?next_token () = { tags; next_token } + let parse xml = + Some + { + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) + TagDescriptionList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("Tags.member", (TagDescriptionList.to_query v.tags)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("tags", (TagDescriptionList.to_json v.tags))]) + let of_json j = + { + tags = + (TagDescriptionList.of_json + (Util.of_option_exn (Json.lookup j "tags"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ; Some (Query.Pair ("ActivityIds.member", ActivityIds.to_query v.activity_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ; Some ("activity_ids", ActivityIds.to_json v.activity_ids) - ]) - - let of_json j = - { activity_ids = - ActivityIds.of_json (Util.of_option_exn (Json.lookup j "activity_ids")) - ; auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DeleteScheduledActionType = struct - type t = - { auto_scaling_group_name : String.t option - ; scheduled_action_name : String.t - } - - let make ?auto_scaling_group_name ~scheduled_action_name () = - { auto_scaling_group_name; scheduled_action_name } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; scheduled_action_name = - Xml.required - "ScheduledActionName" - (Util.option_bind (Xml.member "ScheduledActionName" xml) String.parse) + end +module AttachLoadBalancersResultType = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeScalingActivitiesType = + struct + type t = + { + activity_ids: ActivityIds.t ; + auto_scaling_group_name: String.t option ; + max_records: Integer.t option ; + next_token: String.t option } + let make ?(activity_ids= []) ?auto_scaling_group_name ?max_records + ?next_token () = + { activity_ids; auto_scaling_group_name; max_records; next_token } + let parse xml = + Some + { + activity_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "ActivityIds" xml) + ActivityIds.parse)); + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f))); + Some + (Query.Pair + ("ActivityIds.member", (ActivityIds.to_query v.activity_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f))); + Some ("activity_ids", (ActivityIds.to_json v.activity_ids))]) + let of_json j = + { + activity_ids = + (ActivityIds.of_json + (Util.of_option_exn (Json.lookup j "activity_ids"))); + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("ScheduledActionName", String.to_query v.scheduled_action_name)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("scheduled_action_name", String.to_json v.scheduled_action_name) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; scheduled_action_name = - String.of_json (Util.of_option_exn (Json.lookup j "scheduled_action_name")) - } -end - -module DescribeLifecycleHooksAnswer = struct - type t = { lifecycle_hooks : LifecycleHooks.t } - - let make ?(lifecycle_hooks = []) () = { lifecycle_hooks } - - let parse xml = - Some - { lifecycle_hooks = - Util.of_option - [] - (Util.option_bind (Xml.member "LifecycleHooks" xml) LifecycleHooks.parse) + end +module DeleteScheduledActionType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + scheduled_action_name: String.t } + let make ?auto_scaling_group_name ~scheduled_action_name () = + { auto_scaling_group_name; scheduled_action_name } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + scheduled_action_name = + (Xml.required "ScheduledActionName" + (Util.option_bind (Xml.member "ScheduledActionName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ScheduledActionName", + (String.to_query v.scheduled_action_name))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("scheduled_action_name", + (String.to_json v.scheduled_action_name)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + scheduled_action_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "scheduled_action_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("LifecycleHooks.member", LifecycleHooks.to_query v.lifecycle_hooks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("lifecycle_hooks", LifecycleHooks.to_json v.lifecycle_hooks) ]) - - let of_json j = - { lifecycle_hooks = - LifecycleHooks.of_json (Util.of_option_exn (Json.lookup j "lifecycle_hooks")) - } -end - -module SetDesiredCapacityType = struct - type t = - { auto_scaling_group_name : String.t - ; desired_capacity : Integer.t - ; honor_cooldown : Boolean.t option - } - - let make ~auto_scaling_group_name ~desired_capacity ?honor_cooldown () = - { auto_scaling_group_name; desired_capacity; honor_cooldown } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; desired_capacity = - Xml.required - "DesiredCapacity" - (Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse) - ; honor_cooldown = Util.option_bind (Xml.member "HonorCooldown" xml) Boolean.parse + end +module DescribeLifecycleHooksAnswer = + struct + type t = { + lifecycle_hooks: LifecycleHooks.t } + let make ?(lifecycle_hooks= []) () = { lifecycle_hooks } + let parse xml = + Some + { + lifecycle_hooks = + (Util.of_option [] + (Util.option_bind (Xml.member "LifecycleHooks" xml) + LifecycleHooks.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LifecycleHooks.member", + (LifecycleHooks.to_query v.lifecycle_hooks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lifecycle_hooks", (LifecycleHooks.to_json v.lifecycle_hooks))]) + let of_json j = + { + lifecycle_hooks = + (LifecycleHooks.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hooks"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.honor_cooldown (fun f -> - Query.Pair ("HonorCooldown", Boolean.to_query f)) - ; Some (Query.Pair ("DesiredCapacity", Integer.to_query v.desired_capacity)) - ; Some + end +module SetDesiredCapacityType = + struct + type t = + { + auto_scaling_group_name: String.t ; + desired_capacity: Integer.t ; + honor_cooldown: Boolean.t option } + let make ~auto_scaling_group_name ~desired_capacity ?honor_cooldown () + = { auto_scaling_group_name; desired_capacity; honor_cooldown } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + desired_capacity = + (Xml.required "DesiredCapacity" + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse)); + honor_cooldown = + (Util.option_bind (Xml.member "HonorCooldown" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.honor_cooldown + (fun f -> Query.Pair ("HonorCooldown", (Boolean.to_query f))); + Some + (Query.Pair + ("DesiredCapacity", (Integer.to_query v.desired_capacity))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.honor_cooldown (fun f -> "honor_cooldown", Boolean.to_json f) - ; Some ("desired_capacity", Integer.to_json v.desired_capacity) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; desired_capacity = - Integer.of_json (Util.of_option_exn (Json.lookup j "desired_capacity")) - ; honor_cooldown = Util.option_map (Json.lookup j "honor_cooldown") Boolean.of_json - } -end - -module DetachInstancesAnswer = struct - type t = { activities : Activities.t } - - let make ?(activities = []) () = { activities } - - let parse xml = - Some - { activities = - Util.of_option - [] - (Util.option_bind (Xml.member "Activities" xml) Activities.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.honor_cooldown + (fun f -> ("honor_cooldown", (Boolean.to_json f))); + Some ("desired_capacity", (Integer.to_json v.desired_capacity)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + desired_capacity = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "desired_capacity"))); + honor_cooldown = + (Util.option_map (Json.lookup j "honor_cooldown") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Activities.member", Activities.to_query v.activities)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("activities", Activities.to_json v.activities) ]) - - let of_json j = - { activities = Activities.of_json (Util.of_option_exn (Json.lookup j "activities")) } -end - -module LaunchConfigurationNamesType = struct - type t = - { launch_configuration_names : LaunchConfigurationNames.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make ?(launch_configuration_names = []) ?next_token ?max_records () = - { launch_configuration_names; next_token; max_records } - - let parse xml = - Some - { launch_configuration_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LaunchConfigurationNames" xml) - LaunchConfigurationNames.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + end +module DetachInstancesAnswer = + struct + type t = { + activities: Activities.t } + let make ?(activities= []) () = { activities } + let parse xml = + Some + { + activities = + (Util.of_option [] + (Util.option_bind (Xml.member "Activities" xml) + Activities.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Activities.member", (Activities.to_query v.activities)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("activities", (Activities.to_json v.activities))]) + let of_json j = + { + activities = + (Activities.of_json + (Util.of_option_exn (Json.lookup j "activities"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module LaunchConfigurationNamesType = + struct + type t = + { + launch_configuration_names: LaunchConfigurationNames.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?(launch_configuration_names= []) ?next_token ?max_records () + = { launch_configuration_names; next_token; max_records } + let parse xml = + Some + { + launch_configuration_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LaunchConfigurationNames" xml) + LaunchConfigurationNames.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "LaunchConfigurationNames.member" - , LaunchConfigurationNames.to_query v.launch_configuration_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "launch_configuration_names" - , LaunchConfigurationNames.to_json v.launch_configuration_names ) - ]) - - let of_json j = - { launch_configuration_names = - LaunchConfigurationNames.of_json - (Util.of_option_exn (Json.lookup j "launch_configuration_names")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module DetachLoadBalancersResultType = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module LimitExceededFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DescribeLifecycleHookTypesAnswer = struct - type t = { lifecycle_hook_types : AutoScalingNotificationTypes.t } - - let make ?(lifecycle_hook_types = []) () = { lifecycle_hook_types } - - let parse xml = - Some - { lifecycle_hook_types = - Util.of_option - [] - (Util.option_bind - (Xml.member "LifecycleHookTypes" xml) - AutoScalingNotificationTypes.parse) + ("LaunchConfigurationNames.member", + (LaunchConfigurationNames.to_query + v.launch_configuration_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("launch_configuration_names", + (LaunchConfigurationNames.to_json v.launch_configuration_names))]) + let of_json j = + { + launch_configuration_names = + (LaunchConfigurationNames.of_json + (Util.of_option_exn (Json.lookup j "launch_configuration_names"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "LifecycleHookTypes.member" - , AutoScalingNotificationTypes.to_query v.lifecycle_hook_types )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "lifecycle_hook_types" - , AutoScalingNotificationTypes.to_json v.lifecycle_hook_types ) - ]) - - let of_json j = - { lifecycle_hook_types = - AutoScalingNotificationTypes.of_json - (Util.of_option_exn (Json.lookup j "lifecycle_hook_types")) - } -end - -module CreateLaunchConfigurationType = struct - type t = - { launch_configuration_name : String.t - ; image_id : String.t option - ; key_name : String.t option - ; security_groups : SecurityGroups.t - ; classic_link_v_p_c_id : String.t option - ; classic_link_v_p_c_security_groups : ClassicLinkVPCSecurityGroups.t - ; user_data : String.t option - ; instance_id : String.t option - ; instance_type : String.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappings.t - ; instance_monitoring : InstanceMonitoring.t option - ; spot_price : String.t option - ; iam_instance_profile : String.t option - ; ebs_optimized : Boolean.t option - ; associate_public_ip_address : Boolean.t option - ; placement_tenancy : String.t option - } - - let make - ~launch_configuration_name - ?image_id - ?key_name - ?(security_groups = []) - ?classic_link_v_p_c_id - ?(classic_link_v_p_c_security_groups = []) - ?user_data - ?instance_id - ?instance_type - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?instance_monitoring - ?spot_price - ?iam_instance_profile - ?ebs_optimized - ?associate_public_ip_address - ?placement_tenancy - () = - { launch_configuration_name - ; image_id - ; key_name - ; security_groups - ; classic_link_v_p_c_id - ; classic_link_v_p_c_security_groups - ; user_data - ; instance_id - ; instance_type - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; instance_monitoring - ; spot_price - ; iam_instance_profile - ; ebs_optimized - ; associate_public_ip_address - ; placement_tenancy - } - - let parse xml = - Some - { launch_configuration_name = - Xml.required - "LaunchConfigurationName" - (Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse) - ; image_id = Util.option_bind (Xml.member "ImageId" xml) String.parse - ; key_name = Util.option_bind (Xml.member "KeyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - ; classic_link_v_p_c_id = - Util.option_bind (Xml.member "ClassicLinkVPCId" xml) String.parse - ; classic_link_v_p_c_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "ClassicLinkVPCSecurityGroups" xml) - ClassicLinkVPCSecurityGroups.parse) - ; user_data = Util.option_bind (Xml.member "UserData" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; instance_type = Util.option_bind (Xml.member "InstanceType" xml) String.parse - ; kernel_id = Util.option_bind (Xml.member "KernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "RamdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "BlockDeviceMappings" xml) - BlockDeviceMappings.parse) - ; instance_monitoring = - Util.option_bind (Xml.member "InstanceMonitoring" xml) InstanceMonitoring.parse - ; spot_price = Util.option_bind (Xml.member "SpotPrice" xml) String.parse - ; iam_instance_profile = - Util.option_bind (Xml.member "IamInstanceProfile" xml) String.parse - ; ebs_optimized = Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse - ; associate_public_ip_address = - Util.option_bind (Xml.member "AssociatePublicIpAddress" xml) Boolean.parse - ; placement_tenancy = - Util.option_bind (Xml.member "PlacementTenancy" xml) String.parse + end +module DetachLoadBalancersResultType = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module LimitExceededFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module DescribeLifecycleHookTypesAnswer = + struct + type t = { + lifecycle_hook_types: AutoScalingNotificationTypes.t } + let make ?(lifecycle_hook_types= []) () = { lifecycle_hook_types } + let parse xml = + Some + { + lifecycle_hook_types = + (Util.of_option [] + (Util.option_bind (Xml.member "LifecycleHookTypes" xml) + AutoScalingNotificationTypes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LifecycleHookTypes.member", + (AutoScalingNotificationTypes.to_query + v.lifecycle_hook_types)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lifecycle_hook_types", + (AutoScalingNotificationTypes.to_json v.lifecycle_hook_types))]) + let of_json j = + { + lifecycle_hook_types = + (AutoScalingNotificationTypes.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_types"))) + } + end +module CreateLaunchConfigurationType = + struct + type t = + { + launch_configuration_name: String.t ; + image_id: String.t option ; + key_name: String.t option ; + security_groups: SecurityGroups.t ; + classic_link_v_p_c_id: String.t option ; + classic_link_v_p_c_security_groups: ClassicLinkVPCSecurityGroups.t ; + user_data: String.t option ; + instance_id: String.t option ; + instance_type: String.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappings.t ; + instance_monitoring: InstanceMonitoring.t option ; + spot_price: String.t option ; + iam_instance_profile: String.t option ; + ebs_optimized: Boolean.t option ; + associate_public_ip_address: Boolean.t option ; + placement_tenancy: String.t option } + let make ~launch_configuration_name ?image_id ?key_name + ?(security_groups= []) ?classic_link_v_p_c_id + ?(classic_link_v_p_c_security_groups= []) ?user_data ?instance_id + ?instance_type ?kernel_id ?ramdisk_id ?(block_device_mappings= []) + ?instance_monitoring ?spot_price ?iam_instance_profile + ?ebs_optimized ?associate_public_ip_address ?placement_tenancy () = + { + launch_configuration_name; + image_id; + key_name; + security_groups; + classic_link_v_p_c_id; + classic_link_v_p_c_security_groups; + user_data; + instance_id; + instance_type; + kernel_id; + ramdisk_id; + block_device_mappings; + instance_monitoring; + spot_price; + iam_instance_profile; + ebs_optimized; + associate_public_ip_address; + placement_tenancy } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.placement_tenancy (fun f -> - Query.Pair ("PlacementTenancy", String.to_query f)) - ; Util.option_map v.associate_public_ip_address (fun f -> - Query.Pair ("AssociatePublicIpAddress", Boolean.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair ("IamInstanceProfile", String.to_query f)) - ; Util.option_map v.spot_price (fun f -> - Query.Pair ("SpotPrice", String.to_query f)) - ; Util.option_map v.instance_monitoring (fun f -> - Query.Pair ("InstanceMonitoring", InstanceMonitoring.to_query f)) - ; Some + let parse xml = + Some + { + launch_configuration_name = + (Xml.required "LaunchConfigurationName" + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse)); + image_id = + (Util.option_bind (Xml.member "ImageId" xml) String.parse); + key_name = + (Util.option_bind (Xml.member "KeyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)); + classic_link_v_p_c_id = + (Util.option_bind (Xml.member "ClassicLinkVPCId" xml) + String.parse); + classic_link_v_p_c_security_groups = + (Util.of_option [] + (Util.option_bind + (Xml.member "ClassicLinkVPCSecurityGroups" xml) + ClassicLinkVPCSecurityGroups.parse)); + user_data = + (Util.option_bind (Xml.member "UserData" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "InstanceType" xml) String.parse); + kernel_id = + (Util.option_bind (Xml.member "KernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "RamdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "BlockDeviceMappings" xml) + BlockDeviceMappings.parse)); + instance_monitoring = + (Util.option_bind (Xml.member "InstanceMonitoring" xml) + InstanceMonitoring.parse); + spot_price = + (Util.option_bind (Xml.member "SpotPrice" xml) String.parse); + iam_instance_profile = + (Util.option_bind (Xml.member "IamInstanceProfile" xml) + String.parse); + ebs_optimized = + (Util.option_bind (Xml.member "EbsOptimized" xml) Boolean.parse); + associate_public_ip_address = + (Util.option_bind (Xml.member "AssociatePublicIpAddress" xml) + Boolean.parse); + placement_tenancy = + (Util.option_bind (Xml.member "PlacementTenancy" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.placement_tenancy + (fun f -> Query.Pair ("PlacementTenancy", (String.to_query f))); + Util.option_map v.associate_public_ip_address + (fun f -> + Query.Pair ("AssociatePublicIpAddress", (Boolean.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> Query.Pair ("IamInstanceProfile", (String.to_query f))); + Util.option_map v.spot_price + (fun f -> Query.Pair ("SpotPrice", (String.to_query f))); + Util.option_map v.instance_monitoring + (fun f -> + Query.Pair + ("InstanceMonitoring", (InstanceMonitoring.to_query f))); + Some (Query.Pair - ( "BlockDeviceMappings.member" - , BlockDeviceMappings.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some + ("BlockDeviceMappings.member", + (BlockDeviceMappings.to_query v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some (Query.Pair - ( "ClassicLinkVPCSecurityGroups.member" - , ClassicLinkVPCSecurityGroups.to_query - v.classic_link_v_p_c_security_groups )) - ; Util.option_map v.classic_link_v_p_c_id (fun f -> - Query.Pair ("ClassicLinkVPCId", String.to_query f)) - ; Some + ("ClassicLinkVPCSecurityGroups.member", + (ClassicLinkVPCSecurityGroups.to_query + v.classic_link_v_p_c_security_groups))); + Util.option_map v.classic_link_v_p_c_id + (fun f -> Query.Pair ("ClassicLinkVPCId", (String.to_query f))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ; Some + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f))); + Some (Query.Pair - ("LaunchConfigurationName", String.to_query v.launch_configuration_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.placement_tenancy (fun f -> - "placement_tenancy", String.to_json f) - ; Util.option_map v.associate_public_ip_address (fun f -> - "associate_public_ip_address", Boolean.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", String.to_json f) - ; Util.option_map v.spot_price (fun f -> "spot_price", String.to_json f) - ; Util.option_map v.instance_monitoring (fun f -> - "instance_monitoring", InstanceMonitoring.to_json f) - ; Some - ("block_device_mappings", BlockDeviceMappings.to_json v.block_device_mappings) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.instance_type (fun f -> "instance_type", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some - ( "classic_link_v_p_c_security_groups" - , ClassicLinkVPCSecurityGroups.to_json v.classic_link_v_p_c_security_groups - ) - ; Util.option_map v.classic_link_v_p_c_id (fun f -> - "classic_link_v_p_c_id", String.to_json f) - ; Some ("security_groups", SecurityGroups.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ; Some ("launch_configuration_name", String.to_json v.launch_configuration_name) - ]) - - let of_json j = - { launch_configuration_name = - String.of_json (Util.of_option_exn (Json.lookup j "launch_configuration_name")) - ; image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; classic_link_v_p_c_id = - Util.option_map (Json.lookup j "classic_link_v_p_c_id") String.of_json - ; classic_link_v_p_c_security_groups = - ClassicLinkVPCSecurityGroups.of_json - (Util.of_option_exn (Json.lookup j "classic_link_v_p_c_security_groups")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") String.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappings.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; instance_monitoring = - Util.option_map (Json.lookup j "instance_monitoring") InstanceMonitoring.of_json - ; spot_price = Util.option_map (Json.lookup j "spot_price") String.of_json - ; iam_instance_profile = - Util.option_map (Json.lookup j "iam_instance_profile") String.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; associate_public_ip_address = - Util.option_map (Json.lookup j "associate_public_ip_address") Boolean.of_json - ; placement_tenancy = - Util.option_map (Json.lookup j "placement_tenancy") String.of_json - } -end - -module PutScheduledUpdateGroupActionType = struct - type t = - { auto_scaling_group_name : String.t - ; scheduled_action_name : String.t - ; time : DateTime.t option - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; recurrence : String.t option - ; min_size : Integer.t option - ; max_size : Integer.t option - ; desired_capacity : Integer.t option - } - - let make - ~auto_scaling_group_name - ~scheduled_action_name - ?time - ?start_time - ?end_time - ?recurrence - ?min_size - ?max_size - ?desired_capacity - () = - { auto_scaling_group_name - ; scheduled_action_name - ; time - ; start_time - ; end_time - ; recurrence - ; min_size - ; max_size - ; desired_capacity - } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; scheduled_action_name = - Xml.required - "ScheduledActionName" - (Util.option_bind (Xml.member "ScheduledActionName" xml) String.parse) - ; time = Util.option_bind (Xml.member "Time" xml) DateTime.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; recurrence = Util.option_bind (Xml.member "Recurrence" xml) String.parse - ; min_size = Util.option_bind (Xml.member "MinSize" xml) Integer.parse - ; max_size = Util.option_bind (Xml.member "MaxSize" xml) Integer.parse - ; desired_capacity = - Util.option_bind (Xml.member "DesiredCapacity" xml) Integer.parse + ("LaunchConfigurationName", + (String.to_query v.launch_configuration_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.placement_tenancy + (fun f -> ("placement_tenancy", (String.to_json f))); + Util.option_map v.associate_public_ip_address + (fun f -> ("associate_public_ip_address", (Boolean.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> ("iam_instance_profile", (String.to_json f))); + Util.option_map v.spot_price + (fun f -> ("spot_price", (String.to_json f))); + Util.option_map v.instance_monitoring + (fun f -> + ("instance_monitoring", (InstanceMonitoring.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappings.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("classic_link_v_p_c_security_groups", + (ClassicLinkVPCSecurityGroups.to_json + v.classic_link_v_p_c_security_groups)); + Util.option_map v.classic_link_v_p_c_id + (fun f -> ("classic_link_v_p_c_id", (String.to_json f))); + Some + ("security_groups", (SecurityGroups.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f))); + Some + ("launch_configuration_name", + (String.to_json v.launch_configuration_name))]) + let of_json j = + { + launch_configuration_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "launch_configuration_name"))); + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + classic_link_v_p_c_id = + (Util.option_map (Json.lookup j "classic_link_v_p_c_id") + String.of_json); + classic_link_v_p_c_security_groups = + (ClassicLinkVPCSecurityGroups.of_json + (Util.of_option_exn + (Json.lookup j "classic_link_v_p_c_security_groups"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") String.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappings.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + instance_monitoring = + (Util.option_map (Json.lookup j "instance_monitoring") + InstanceMonitoring.of_json); + spot_price = + (Util.option_map (Json.lookup j "spot_price") String.of_json); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + String.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + associate_public_ip_address = + (Util.option_map (Json.lookup j "associate_public_ip_address") + Boolean.of_json); + placement_tenancy = + (Util.option_map (Json.lookup j "placement_tenancy") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.desired_capacity (fun f -> - Query.Pair ("DesiredCapacity", Integer.to_query f)) - ; Util.option_map v.max_size (fun f -> - Query.Pair ("MaxSize", Integer.to_query f)) - ; Util.option_map v.min_size (fun f -> - Query.Pair ("MinSize", Integer.to_query f)) - ; Util.option_map v.recurrence (fun f -> - Query.Pair ("Recurrence", String.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.time (fun f -> Query.Pair ("Time", DateTime.to_query f)) - ; Some - (Query.Pair ("ScheduledActionName", String.to_query v.scheduled_action_name)) - ; Some - (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.desired_capacity (fun f -> - "desired_capacity", Integer.to_json f) - ; Util.option_map v.max_size (fun f -> "max_size", Integer.to_json f) - ; Util.option_map v.min_size (fun f -> "min_size", Integer.to_json f) - ; Util.option_map v.recurrence (fun f -> "recurrence", String.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.time (fun f -> "time", DateTime.to_json f) - ; Some ("scheduled_action_name", String.to_json v.scheduled_action_name) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; scheduled_action_name = - String.of_json (Util.of_option_exn (Json.lookup j "scheduled_action_name")) - ; time = Util.option_map (Json.lookup j "time") DateTime.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; recurrence = Util.option_map (Json.lookup j "recurrence") String.of_json - ; min_size = Util.option_map (Json.lookup j "min_size") Integer.of_json - ; max_size = Util.option_map (Json.lookup j "max_size") Integer.of_json - ; desired_capacity = - Util.option_map (Json.lookup j "desired_capacity") Integer.of_json - } -end - -module AlreadyExistsFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeleteNotificationConfigurationType = struct - type t = - { auto_scaling_group_name : String.t - ; topic_a_r_n : String.t - } - - let make ~auto_scaling_group_name ~topic_a_r_n () = - { auto_scaling_group_name; topic_a_r_n } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; topic_a_r_n = - Xml.required - "TopicARN" - (Util.option_bind (Xml.member "TopicARN" xml) String.parse) + end +module PutScheduledUpdateGroupActionType = + struct + type t = + { + auto_scaling_group_name: String.t ; + scheduled_action_name: String.t ; + time: DateTime.t option ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + recurrence: String.t option ; + min_size: Integer.t option ; + max_size: Integer.t option ; + desired_capacity: Integer.t option } + let make ~auto_scaling_group_name ~scheduled_action_name ?time + ?start_time ?end_time ?recurrence ?min_size ?max_size + ?desired_capacity () = + { + auto_scaling_group_name; + scheduled_action_name; + time; + start_time; + end_time; + recurrence; + min_size; + max_size; + desired_capacity } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TopicARN", String.to_query v.topic_a_r_n)) - ; Some + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + scheduled_action_name = + (Xml.required "ScheduledActionName" + (Util.option_bind (Xml.member "ScheduledActionName" xml) + String.parse)); + time = (Util.option_bind (Xml.member "Time" xml) DateTime.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + recurrence = + (Util.option_bind (Xml.member "Recurrence" xml) String.parse); + min_size = + (Util.option_bind (Xml.member "MinSize" xml) Integer.parse); + max_size = + (Util.option_bind (Xml.member "MaxSize" xml) Integer.parse); + desired_capacity = + (Util.option_bind (Xml.member "DesiredCapacity" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.desired_capacity + (fun f -> Query.Pair ("DesiredCapacity", (Integer.to_query f))); + Util.option_map v.max_size + (fun f -> Query.Pair ("MaxSize", (Integer.to_query f))); + Util.option_map v.min_size + (fun f -> Query.Pair ("MinSize", (Integer.to_query f))); + Util.option_map v.recurrence + (fun f -> Query.Pair ("Recurrence", (String.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.time + (fun f -> Query.Pair ("Time", (DateTime.to_query f))); + Some + (Query.Pair + ("ScheduledActionName", + (String.to_query v.scheduled_action_name))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("topic_a_r_n", String.to_json v.topic_a_r_n) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; topic_a_r_n = String.of_json (Util.of_option_exn (Json.lookup j "topic_a_r_n")) - } -end - -module DescribeAccountLimitsAnswer = struct - type t = - { max_number_of_auto_scaling_groups : Integer.t option - ; max_number_of_launch_configurations : Integer.t option - } - - let make ?max_number_of_auto_scaling_groups ?max_number_of_launch_configurations () = - { max_number_of_auto_scaling_groups; max_number_of_launch_configurations } - - let parse xml = - Some - { max_number_of_auto_scaling_groups = - Util.option_bind (Xml.member "MaxNumberOfAutoScalingGroups" xml) Integer.parse - ; max_number_of_launch_configurations = - Util.option_bind - (Xml.member "MaxNumberOfLaunchConfigurations" xml) - Integer.parse + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.desired_capacity + (fun f -> ("desired_capacity", (Integer.to_json f))); + Util.option_map v.max_size + (fun f -> ("max_size", (Integer.to_json f))); + Util.option_map v.min_size + (fun f -> ("min_size", (Integer.to_json f))); + Util.option_map v.recurrence + (fun f -> ("recurrence", (String.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.time (fun f -> ("time", (DateTime.to_json f))); + Some + ("scheduled_action_name", + (String.to_json v.scheduled_action_name)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + scheduled_action_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "scheduled_action_name"))); + time = (Util.option_map (Json.lookup j "time") DateTime.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + recurrence = + (Util.option_map (Json.lookup j "recurrence") String.of_json); + min_size = + (Util.option_map (Json.lookup j "min_size") Integer.of_json); + max_size = + (Util.option_map (Json.lookup j "max_size") Integer.of_json); + desired_capacity = + (Util.option_map (Json.lookup j "desired_capacity") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_number_of_launch_configurations (fun f -> - Query.Pair ("MaxNumberOfLaunchConfigurations", Integer.to_query f)) - ; Util.option_map v.max_number_of_auto_scaling_groups (fun f -> - Query.Pair ("MaxNumberOfAutoScalingGroups", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_number_of_launch_configurations (fun f -> - "max_number_of_launch_configurations", Integer.to_json f) - ; Util.option_map v.max_number_of_auto_scaling_groups (fun f -> - "max_number_of_auto_scaling_groups", Integer.to_json f) - ]) - - let of_json j = - { max_number_of_auto_scaling_groups = - Util.option_map - (Json.lookup j "max_number_of_auto_scaling_groups") - Integer.of_json - ; max_number_of_launch_configurations = - Util.option_map - (Json.lookup j "max_number_of_launch_configurations") - Integer.of_json - } -end - -module DeleteTagsType = struct - type t = { tags : Tags.t } - - let make ~tags () = { tags } - - let parse xml = - Some - { tags = Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) Tags.parse) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Tags.member", Tags.to_query v.tags)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("tags", Tags.to_json v.tags) ]) - - let of_json j = { tags = Tags.of_json (Util.of_option_exn (Json.lookup j "tags")) } -end - -module DescribeTerminationPolicyTypesAnswer = struct - type t = { termination_policy_types : TerminationPolicies.t } - - let make ?(termination_policy_types = []) () = { termination_policy_types } - - let parse xml = - Some - { termination_policy_types = - Util.of_option - [] - (Util.option_bind - (Xml.member "TerminationPolicyTypes" xml) - TerminationPolicies.parse) + end +module AlreadyExistsFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DeleteNotificationConfigurationType = + struct + type t = { + auto_scaling_group_name: String.t ; + topic_a_r_n: String.t } + let make ~auto_scaling_group_name ~topic_a_r_n () = + { auto_scaling_group_name; topic_a_r_n } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + topic_a_r_n = + (Xml.required "TopicARN" + (Util.option_bind (Xml.member "TopicARN" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TopicARN", (String.to_query v.topic_a_r_n))); + Some (Query.Pair - ( "TerminationPolicyTypes.member" - , TerminationPolicies.to_query v.termination_policy_types )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "termination_policy_types" - , TerminationPolicies.to_json v.termination_policy_types ) - ]) - - let of_json j = - { termination_policy_types = - TerminationPolicies.of_json - (Util.of_option_exn (Json.lookup j "termination_policy_types")) - } -end - -module DescribeAdjustmentTypesAnswer = struct - type t = { adjustment_types : AdjustmentTypes.t } - - let make ?(adjustment_types = []) () = { adjustment_types } - - let parse xml = - Some - { adjustment_types = - Util.of_option - [] - (Util.option_bind (Xml.member "AdjustmentTypes" xml) AdjustmentTypes.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("topic_a_r_n", (String.to_json v.topic_a_r_n)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + topic_a_r_n = + (String.of_json (Util.of_option_exn (Json.lookup j "topic_a_r_n"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("AdjustmentTypes.member", AdjustmentTypes.to_query v.adjustment_types)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("adjustment_types", AdjustmentTypes.to_json v.adjustment_types) ]) - - let of_json j = - { adjustment_types = - AdjustmentTypes.of_json (Util.of_option_exn (Json.lookup j "adjustment_types")) - } -end - -module AutoScalingGroupsType = struct - type t = - { auto_scaling_groups : AutoScalingGroups.t - ; next_token : String.t option - } - - let make ~auto_scaling_groups ?next_token () = { auto_scaling_groups; next_token } - - let parse xml = - Some - { auto_scaling_groups = - Xml.required - "AutoScalingGroups" + end +module DescribeAccountLimitsAnswer = + struct + type t = + { + max_number_of_auto_scaling_groups: Integer.t option ; + max_number_of_launch_configurations: Integer.t option } + let make ?max_number_of_auto_scaling_groups + ?max_number_of_launch_configurations () = + { + max_number_of_auto_scaling_groups; + max_number_of_launch_configurations + } + let parse xml = + Some + { + max_number_of_auto_scaling_groups = + (Util.option_bind (Xml.member "MaxNumberOfAutoScalingGroups" xml) + Integer.parse); + max_number_of_launch_configurations = (Util.option_bind - (Xml.member "AutoScalingGroups" xml) - AutoScalingGroups.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + (Xml.member "MaxNumberOfLaunchConfigurations" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_number_of_launch_configurations + (fun f -> + Query.Pair + ("MaxNumberOfLaunchConfigurations", (Integer.to_query f))); + Util.option_map v.max_number_of_auto_scaling_groups + (fun f -> + Query.Pair + ("MaxNumberOfAutoScalingGroups", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_number_of_launch_configurations + (fun f -> + ("max_number_of_launch_configurations", (Integer.to_json f))); + Util.option_map v.max_number_of_auto_scaling_groups + (fun f -> + ("max_number_of_auto_scaling_groups", (Integer.to_json f)))]) + let of_json j = + { + max_number_of_auto_scaling_groups = + (Util.option_map + (Json.lookup j "max_number_of_auto_scaling_groups") + Integer.of_json); + max_number_of_launch_configurations = + (Util.option_map + (Json.lookup j "max_number_of_launch_configurations") + Integer.of_json) + } + end +module DeleteTagsType = + struct + type t = { + tags: Tags.t } + let make ~tags () = { tags } + let parse xml = + Some + { + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) Tags.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (Tags.to_query v.tags)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("tags", (Tags.to_json v.tags))]) + let of_json j = + { tags = (Tags.of_json (Util.of_option_exn (Json.lookup j "tags"))) } + end +module DescribeTerminationPolicyTypesAnswer = + struct + type t = { + termination_policy_types: TerminationPolicies.t } + let make ?(termination_policy_types= []) () = + { termination_policy_types } + let parse xml = + Some + { + termination_policy_types = + (Util.of_option [] + (Util.option_bind (Xml.member "TerminationPolicyTypes" xml) + TerminationPolicies.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TerminationPolicyTypes.member", + (TerminationPolicies.to_query v.termination_policy_types)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("termination_policy_types", + (TerminationPolicies.to_json v.termination_policy_types))]) + let of_json j = + { + termination_policy_types = + (TerminationPolicies.of_json + (Util.of_option_exn (Json.lookup j "termination_policy_types"))) + } + end +module DescribeAdjustmentTypesAnswer = + struct + type t = { + adjustment_types: AdjustmentTypes.t } + let make ?(adjustment_types= []) () = { adjustment_types } + let parse xml = + Some + { + adjustment_types = + (Util.of_option [] + (Util.option_bind (Xml.member "AdjustmentTypes" xml) + AdjustmentTypes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AdjustmentTypes.member", + (AdjustmentTypes.to_query v.adjustment_types)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("adjustment_types", + (AdjustmentTypes.to_json v.adjustment_types))]) + let of_json j = + { + adjustment_types = + (AdjustmentTypes.of_json + (Util.of_option_exn (Json.lookup j "adjustment_types"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module AutoScalingGroupsType = + struct + type t = + { + auto_scaling_groups: AutoScalingGroups.t ; + next_token: String.t option } + let make ~auto_scaling_groups ?next_token () = + { auto_scaling_groups; next_token } + let parse xml = + Some + { + auto_scaling_groups = + (Xml.required "AutoScalingGroups" + (Util.option_bind (Xml.member "AutoScalingGroups" xml) + AutoScalingGroups.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AutoScalingGroups.member" - , AutoScalingGroups.to_query v.auto_scaling_groups )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("auto_scaling_groups", AutoScalingGroups.to_json v.auto_scaling_groups) - ]) - - let of_json j = - { auto_scaling_groups = - AutoScalingGroups.of_json - (Util.of_option_exn (Json.lookup j "auto_scaling_groups")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ExecutePolicyType = struct - type t = - { auto_scaling_group_name : String.t option - ; policy_name : String.t - ; honor_cooldown : Boolean.t option - ; metric_value : Double.t option - ; breach_threshold : Double.t option - } - - let make - ?auto_scaling_group_name - ~policy_name - ?honor_cooldown - ?metric_value - ?breach_threshold - () = - { auto_scaling_group_name - ; policy_name - ; honor_cooldown - ; metric_value - ; breach_threshold - } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - ; honor_cooldown = Util.option_bind (Xml.member "HonorCooldown" xml) Boolean.parse - ; metric_value = Util.option_bind (Xml.member "MetricValue" xml) Double.parse - ; breach_threshold = - Util.option_bind (Xml.member "BreachThreshold" xml) Double.parse + ("AutoScalingGroups.member", + (AutoScalingGroups.to_query v.auto_scaling_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("auto_scaling_groups", + (AutoScalingGroups.to_json v.auto_scaling_groups))]) + let of_json j = + { + auto_scaling_groups = + (AutoScalingGroups.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_groups"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.breach_threshold (fun f -> - Query.Pair ("BreachThreshold", Double.to_query f)) - ; Util.option_map v.metric_value (fun f -> - Query.Pair ("MetricValue", Double.to_query f)) - ; Util.option_map v.honor_cooldown (fun f -> - Query.Pair ("HonorCooldown", Boolean.to_query f)) - ; Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.breach_threshold (fun f -> - "breach_threshold", Double.to_json f) - ; Util.option_map v.metric_value (fun f -> "metric_value", Double.to_json f) - ; Util.option_map v.honor_cooldown (fun f -> "honor_cooldown", Boolean.to_json f) - ; Some ("policy_name", String.to_json v.policy_name) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - ; honor_cooldown = Util.option_map (Json.lookup j "honor_cooldown") Boolean.of_json - ; metric_value = Util.option_map (Json.lookup j "metric_value") Double.of_json - ; breach_threshold = Util.option_map (Json.lookup j "breach_threshold") Double.of_json - } -end - -module SetInstanceHealthQuery = struct - type t = - { instance_id : String.t - ; health_status : String.t - ; should_respect_grace_period : Boolean.t option - } - - let make ~instance_id ~health_status ?should_respect_grace_period () = - { instance_id; health_status; should_respect_grace_period } - - let parse xml = - Some - { instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; health_status = - Xml.required - "HealthStatus" - (Util.option_bind (Xml.member "HealthStatus" xml) String.parse) - ; should_respect_grace_period = - Util.option_bind (Xml.member "ShouldRespectGracePeriod" xml) Boolean.parse + end +module ExecutePolicyType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + policy_name: String.t ; + honor_cooldown: Boolean.t option ; + metric_value: Double.t option ; + breach_threshold: Double.t option } + let make ?auto_scaling_group_name ~policy_name ?honor_cooldown + ?metric_value ?breach_threshold () = + { + auto_scaling_group_name; + policy_name; + honor_cooldown; + metric_value; + breach_threshold } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.should_respect_grace_period (fun f -> - Query.Pair ("ShouldRespectGracePeriod", Boolean.to_query f)) - ; Some (Query.Pair ("HealthStatus", String.to_query v.health_status)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.should_respect_grace_period (fun f -> - "should_respect_grace_period", Boolean.to_json f) - ; Some ("health_status", String.to_json v.health_status) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; health_status = String.of_json (Util.of_option_exn (Json.lookup j "health_status")) - ; should_respect_grace_period = - Util.option_map (Json.lookup j "should_respect_grace_period") Boolean.of_json - } -end - -module PutScalingPolicyType = struct - type t = - { auto_scaling_group_name : String.t - ; policy_name : String.t - ; policy_type : String.t option - ; adjustment_type : String.t - ; min_adjustment_step : Integer.t option - ; min_adjustment_magnitude : Integer.t option - ; scaling_adjustment : Integer.t option - ; cooldown : Integer.t option - ; metric_aggregation_type : String.t option - ; step_adjustments : StepAdjustments.t - ; estimated_instance_warmup : Integer.t option - } - - let make - ~auto_scaling_group_name - ~policy_name - ?policy_type - ~adjustment_type - ?min_adjustment_step - ?min_adjustment_magnitude - ?scaling_adjustment - ?cooldown - ?metric_aggregation_type - ?(step_adjustments = []) - ?estimated_instance_warmup - () = - { auto_scaling_group_name - ; policy_name - ; policy_type - ; adjustment_type - ; min_adjustment_step - ; min_adjustment_magnitude - ; scaling_adjustment - ; cooldown - ; metric_aggregation_type - ; step_adjustments - ; estimated_instance_warmup - } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - ; policy_type = Util.option_bind (Xml.member "PolicyType" xml) String.parse - ; adjustment_type = - Xml.required - "AdjustmentType" - (Util.option_bind (Xml.member "AdjustmentType" xml) String.parse) - ; min_adjustment_step = - Util.option_bind (Xml.member "MinAdjustmentStep" xml) Integer.parse - ; min_adjustment_magnitude = - Util.option_bind (Xml.member "MinAdjustmentMagnitude" xml) Integer.parse - ; scaling_adjustment = - Util.option_bind (Xml.member "ScalingAdjustment" xml) Integer.parse - ; cooldown = Util.option_bind (Xml.member "Cooldown" xml) Integer.parse - ; metric_aggregation_type = - Util.option_bind (Xml.member "MetricAggregationType" xml) String.parse - ; step_adjustments = - Util.of_option - [] - (Util.option_bind (Xml.member "StepAdjustments" xml) StepAdjustments.parse) - ; estimated_instance_warmup = - Util.option_bind (Xml.member "EstimatedInstanceWarmup" xml) Integer.parse + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)); + honor_cooldown = + (Util.option_bind (Xml.member "HonorCooldown" xml) Boolean.parse); + metric_value = + (Util.option_bind (Xml.member "MetricValue" xml) Double.parse); + breach_threshold = + (Util.option_bind (Xml.member "BreachThreshold" xml) Double.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.breach_threshold + (fun f -> Query.Pair ("BreachThreshold", (Double.to_query f))); + Util.option_map v.metric_value + (fun f -> Query.Pair ("MetricValue", (Double.to_query f))); + Util.option_map v.honor_cooldown + (fun f -> Query.Pair ("HonorCooldown", (Boolean.to_query f))); + Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.breach_threshold + (fun f -> ("breach_threshold", (Double.to_json f))); + Util.option_map v.metric_value + (fun f -> ("metric_value", (Double.to_json f))); + Util.option_map v.honor_cooldown + (fun f -> ("honor_cooldown", (Boolean.to_json f))); + Some ("policy_name", (String.to_json v.policy_name)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))); + honor_cooldown = + (Util.option_map (Json.lookup j "honor_cooldown") Boolean.of_json); + metric_value = + (Util.option_map (Json.lookup j "metric_value") Double.of_json); + breach_threshold = + (Util.option_map (Json.lookup j "breach_threshold") Double.of_json) + } + end +module SetInstanceHealthQuery = + struct + type t = + { + instance_id: String.t ; + health_status: String.t ; + should_respect_grace_period: Boolean.t option } + let make ~instance_id ~health_status ?should_respect_grace_period () = + { instance_id; health_status; should_respect_grace_period } + let parse xml = + Some + { + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + health_status = + (Xml.required "HealthStatus" + (Util.option_bind (Xml.member "HealthStatus" xml) String.parse)); + should_respect_grace_period = + (Util.option_bind (Xml.member "ShouldRespectGracePeriod" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.should_respect_grace_period + (fun f -> + Query.Pair + ("ShouldRespectGracePeriod", (Boolean.to_query f))); + Some + (Query.Pair ("HealthStatus", (String.to_query v.health_status))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.should_respect_grace_period + (fun f -> ("should_respect_grace_period", (Boolean.to_json f))); + Some ("health_status", (String.to_json v.health_status)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + health_status = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_status"))); + should_respect_grace_period = + (Util.option_map (Json.lookup j "should_respect_grace_period") + Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.estimated_instance_warmup (fun f -> - Query.Pair ("EstimatedInstanceWarmup", Integer.to_query f)) - ; Some + end +module PutScalingPolicyType = + struct + type t = + { + auto_scaling_group_name: String.t ; + policy_name: String.t ; + policy_type: String.t option ; + adjustment_type: String.t ; + min_adjustment_step: Integer.t option ; + min_adjustment_magnitude: Integer.t option ; + scaling_adjustment: Integer.t option ; + cooldown: Integer.t option ; + metric_aggregation_type: String.t option ; + step_adjustments: StepAdjustments.t ; + estimated_instance_warmup: Integer.t option } + let make ~auto_scaling_group_name ~policy_name ?policy_type + ~adjustment_type ?min_adjustment_step ?min_adjustment_magnitude + ?scaling_adjustment ?cooldown ?metric_aggregation_type + ?(step_adjustments= []) ?estimated_instance_warmup () = + { + auto_scaling_group_name; + policy_name; + policy_type; + adjustment_type; + min_adjustment_step; + min_adjustment_magnitude; + scaling_adjustment; + cooldown; + metric_aggregation_type; + step_adjustments; + estimated_instance_warmup + } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)); + policy_type = + (Util.option_bind (Xml.member "PolicyType" xml) String.parse); + adjustment_type = + (Xml.required "AdjustmentType" + (Util.option_bind (Xml.member "AdjustmentType" xml) + String.parse)); + min_adjustment_step = + (Util.option_bind (Xml.member "MinAdjustmentStep" xml) + Integer.parse); + min_adjustment_magnitude = + (Util.option_bind (Xml.member "MinAdjustmentMagnitude" xml) + Integer.parse); + scaling_adjustment = + (Util.option_bind (Xml.member "ScalingAdjustment" xml) + Integer.parse); + cooldown = + (Util.option_bind (Xml.member "Cooldown" xml) Integer.parse); + metric_aggregation_type = + (Util.option_bind (Xml.member "MetricAggregationType" xml) + String.parse); + step_adjustments = + (Util.of_option [] + (Util.option_bind (Xml.member "StepAdjustments" xml) + StepAdjustments.parse)); + estimated_instance_warmup = + (Util.option_bind (Xml.member "EstimatedInstanceWarmup" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.estimated_instance_warmup + (fun f -> + Query.Pair ("EstimatedInstanceWarmup", (Integer.to_query f))); + Some (Query.Pair - ("StepAdjustments.member", StepAdjustments.to_query v.step_adjustments)) - ; Util.option_map v.metric_aggregation_type (fun f -> - Query.Pair ("MetricAggregationType", String.to_query f)) - ; Util.option_map v.cooldown (fun f -> - Query.Pair ("Cooldown", Integer.to_query f)) - ; Util.option_map v.scaling_adjustment (fun f -> - Query.Pair ("ScalingAdjustment", Integer.to_query f)) - ; Util.option_map v.min_adjustment_magnitude (fun f -> - Query.Pair ("MinAdjustmentMagnitude", Integer.to_query f)) - ; Util.option_map v.min_adjustment_step (fun f -> - Query.Pair ("MinAdjustmentStep", Integer.to_query f)) - ; Some (Query.Pair ("AdjustmentType", String.to_query v.adjustment_type)) - ; Util.option_map v.policy_type (fun f -> - Query.Pair ("PolicyType", String.to_query f)) - ; Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Some + ("StepAdjustments.member", + (StepAdjustments.to_query v.step_adjustments))); + Util.option_map v.metric_aggregation_type + (fun f -> + Query.Pair ("MetricAggregationType", (String.to_query f))); + Util.option_map v.cooldown + (fun f -> Query.Pair ("Cooldown", (Integer.to_query f))); + Util.option_map v.scaling_adjustment + (fun f -> Query.Pair ("ScalingAdjustment", (Integer.to_query f))); + Util.option_map v.min_adjustment_magnitude + (fun f -> + Query.Pair ("MinAdjustmentMagnitude", (Integer.to_query f))); + Util.option_map v.min_adjustment_step + (fun f -> Query.Pair ("MinAdjustmentStep", (Integer.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.estimated_instance_warmup (fun f -> - "estimated_instance_warmup", Integer.to_json f) - ; Some ("step_adjustments", StepAdjustments.to_json v.step_adjustments) - ; Util.option_map v.metric_aggregation_type (fun f -> - "metric_aggregation_type", String.to_json f) - ; Util.option_map v.cooldown (fun f -> "cooldown", Integer.to_json f) - ; Util.option_map v.scaling_adjustment (fun f -> - "scaling_adjustment", Integer.to_json f) - ; Util.option_map v.min_adjustment_magnitude (fun f -> - "min_adjustment_magnitude", Integer.to_json f) - ; Util.option_map v.min_adjustment_step (fun f -> - "min_adjustment_step", Integer.to_json f) - ; Some ("adjustment_type", String.to_json v.adjustment_type) - ; Util.option_map v.policy_type (fun f -> "policy_type", String.to_json f) - ; Some ("policy_name", String.to_json v.policy_name) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - ; policy_type = Util.option_map (Json.lookup j "policy_type") String.of_json - ; adjustment_type = - String.of_json (Util.of_option_exn (Json.lookup j "adjustment_type")) - ; min_adjustment_step = - Util.option_map (Json.lookup j "min_adjustment_step") Integer.of_json - ; min_adjustment_magnitude = - Util.option_map (Json.lookup j "min_adjustment_magnitude") Integer.of_json - ; scaling_adjustment = - Util.option_map (Json.lookup j "scaling_adjustment") Integer.of_json - ; cooldown = Util.option_map (Json.lookup j "cooldown") Integer.of_json - ; metric_aggregation_type = - Util.option_map (Json.lookup j "metric_aggregation_type") String.of_json - ; step_adjustments = - StepAdjustments.of_json (Util.of_option_exn (Json.lookup j "step_adjustments")) - ; estimated_instance_warmup = - Util.option_map (Json.lookup j "estimated_instance_warmup") Integer.of_json - } -end - -module EnableMetricsCollectionQuery = struct - type t = - { auto_scaling_group_name : String.t - ; metrics : Metrics.t - ; granularity : String.t - } - - let make ~auto_scaling_group_name ?(metrics = []) ~granularity () = - { auto_scaling_group_name; metrics; granularity } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; metrics = - Util.of_option [] (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse) - ; granularity = - Xml.required - "Granularity" - (Util.option_bind (Xml.member "Granularity" xml) String.parse) + ("AdjustmentType", (String.to_query v.adjustment_type))); + Util.option_map v.policy_type + (fun f -> Query.Pair ("PolicyType", (String.to_query f))); + Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.estimated_instance_warmup + (fun f -> ("estimated_instance_warmup", (Integer.to_json f))); + Some + ("step_adjustments", + (StepAdjustments.to_json v.step_adjustments)); + Util.option_map v.metric_aggregation_type + (fun f -> ("metric_aggregation_type", (String.to_json f))); + Util.option_map v.cooldown + (fun f -> ("cooldown", (Integer.to_json f))); + Util.option_map v.scaling_adjustment + (fun f -> ("scaling_adjustment", (Integer.to_json f))); + Util.option_map v.min_adjustment_magnitude + (fun f -> ("min_adjustment_magnitude", (Integer.to_json f))); + Util.option_map v.min_adjustment_step + (fun f -> ("min_adjustment_step", (Integer.to_json f))); + Some ("adjustment_type", (String.to_json v.adjustment_type)); + Util.option_map v.policy_type + (fun f -> ("policy_type", (String.to_json f))); + Some ("policy_name", (String.to_json v.policy_name)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))); + policy_type = + (Util.option_map (Json.lookup j "policy_type") String.of_json); + adjustment_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "adjustment_type"))); + min_adjustment_step = + (Util.option_map (Json.lookup j "min_adjustment_step") + Integer.of_json); + min_adjustment_magnitude = + (Util.option_map (Json.lookup j "min_adjustment_magnitude") + Integer.of_json); + scaling_adjustment = + (Util.option_map (Json.lookup j "scaling_adjustment") + Integer.of_json); + cooldown = + (Util.option_map (Json.lookup j "cooldown") Integer.of_json); + metric_aggregation_type = + (Util.option_map (Json.lookup j "metric_aggregation_type") + String.of_json); + step_adjustments = + (StepAdjustments.of_json + (Util.of_option_exn (Json.lookup j "step_adjustments"))); + estimated_instance_warmup = + (Util.option_map (Json.lookup j "estimated_instance_warmup") + Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Granularity", String.to_query v.granularity)) - ; Some (Query.Pair ("Metrics.member", Metrics.to_query v.metrics)) - ; Some + end +module EnableMetricsCollectionQuery = + struct + type t = + { + auto_scaling_group_name: String.t ; + metrics: Metrics.t ; + granularity: String.t } + let make ~auto_scaling_group_name ?(metrics= []) ~granularity () = + { auto_scaling_group_name; metrics; granularity } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + metrics = + (Util.of_option [] + (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse)); + granularity = + (Xml.required "Granularity" + (Util.option_bind (Xml.member "Granularity" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Granularity", (String.to_query v.granularity))); + Some (Query.Pair ("Metrics.member", (Metrics.to_query v.metrics))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("granularity", String.to_json v.granularity) - ; Some ("metrics", Metrics.to_json v.metrics) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; metrics = Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics")) - ; granularity = String.of_json (Util.of_option_exn (Json.lookup j "granularity")) - } -end - -module DescribePoliciesType = struct - type t = - { auto_scaling_group_name : String.t option - ; policy_names : PolicyNames.t - ; policy_types : PolicyTypes.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make - ?auto_scaling_group_name - ?(policy_names = []) - ?(policy_types = []) - ?next_token - ?max_records - () = - { auto_scaling_group_name; policy_names; policy_types; next_token; max_records } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; policy_names = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - ; policy_types = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyTypes" xml) PolicyTypes.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("granularity", (String.to_json v.granularity)); + Some ("metrics", (Metrics.to_json v.metrics)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + metrics = + (Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics"))); + granularity = + (String.of_json (Util.of_option_exn (Json.lookup j "granularity"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("PolicyTypes.member", PolicyTypes.to_query v.policy_types)) - ; Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("policy_types", PolicyTypes.to_json v.policy_types) - ; Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - ; policy_types = - PolicyTypes.of_json (Util.of_option_exn (Json.lookup j "policy_types")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module AttachInstancesQuery = struct - type t = - { instance_ids : InstanceIds.t - ; auto_scaling_group_name : String.t - } - - let make ?(instance_ids = []) ~auto_scaling_group_name () = - { instance_ids; auto_scaling_group_name } - - let parse xml = - Some - { instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceIds" xml) InstanceIds.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) + end +module DescribePoliciesType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + policy_names: PolicyNames.t ; + policy_types: PolicyTypes.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?auto_scaling_group_name ?(policy_names= []) ?(policy_types= + []) ?next_token ?max_records () = + { + auto_scaling_group_name; + policy_names; + policy_types; + next_token; + max_records } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + policy_names = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)); + policy_types = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyTypes" xml) + PolicyTypes.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("InstanceIds.member", InstanceIds.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("instance_ids", InstanceIds.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIds.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - } -end - -module DescribeNotificationConfigurationsAnswer = struct - type t = - { notification_configurations : NotificationConfigurations.t - ; next_token : String.t option - } - - let make ~notification_configurations ?next_token () = - { notification_configurations; next_token } - - let parse xml = - Some - { notification_configurations = - Xml.required - "NotificationConfigurations" - (Util.option_bind - (Xml.member "NotificationConfigurations" xml) - NotificationConfigurations.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("PolicyTypes.member", (PolicyTypes.to_query v.policy_types))); + Some (Query.Pair - ( "NotificationConfigurations.member" - , NotificationConfigurations.to_query v.notification_configurations )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "notification_configurations" - , NotificationConfigurations.to_json v.notification_configurations ) - ]) - - let of_json j = - { notification_configurations = - NotificationConfigurations.of_json - (Util.of_option_exn (Json.lookup j "notification_configurations")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module TerminateInstanceInAutoScalingGroupType = struct - type t = - { instance_id : String.t - ; should_decrement_desired_capacity : Boolean.t - } - - let make ~instance_id ~should_decrement_desired_capacity () = - { instance_id; should_decrement_desired_capacity } - - let parse xml = - Some - { instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; should_decrement_desired_capacity = - Xml.required - "ShouldDecrementDesiredCapacity" - (Util.option_bind - (Xml.member "ShouldDecrementDesiredCapacity" xml) - Boolean.parse) + ("PolicyNames.member", (PolicyNames.to_query v.policy_names))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("policy_types", (PolicyTypes.to_json v.policy_types)); + Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))); + policy_types = + (PolicyTypes.of_json + (Util.of_option_exn (Json.lookup j "policy_types"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module AttachInstancesQuery = + struct + type t = + { + instance_ids: InstanceIds.t ; + auto_scaling_group_name: String.t } + let make ?(instance_ids= []) ~auto_scaling_group_name () = + { instance_ids; auto_scaling_group_name } + let parse xml = + Some + { + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceIds" xml) + InstanceIds.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ( "ShouldDecrementDesiredCapacity" - , Boolean.to_query v.should_decrement_desired_capacity )) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "should_decrement_desired_capacity" - , Boolean.to_json v.should_decrement_desired_capacity ) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; should_decrement_desired_capacity = - Boolean.of_json - (Util.of_option_exn (Json.lookup j "should_decrement_desired_capacity")) - } -end - -module CreateOrUpdateTagsType = struct - type t = { tags : Tags.t } - - let make ~tags () = { tags } - - let parse xml = - Some - { tags = Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) Tags.parse) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Tags.member", Tags.to_query v.tags)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("tags", Tags.to_json v.tags) ]) - - let of_json j = { tags = Tags.of_json (Util.of_option_exn (Json.lookup j "tags")) } -end - -module InvalidNextToken = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeleteLifecycleHookAnswer = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AutoScalingGroupNamesType = struct - type t = - { auto_scaling_group_names : AutoScalingGroupNames.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make ?(auto_scaling_group_names = []) ?next_token ?max_records () = - { auto_scaling_group_names; next_token; max_records } - - let parse xml = - Some - { auto_scaling_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "AutoScalingGroupNames" xml) - AutoScalingGroupNames.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("InstanceIds.member", (InstanceIds.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("instance_ids", (InstanceIds.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIds.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module DescribeNotificationConfigurationsAnswer = + struct + type t = + { + notification_configurations: NotificationConfigurations.t ; + next_token: String.t option } + let make ~notification_configurations ?next_token () = + { notification_configurations; next_token } + let parse xml = + Some + { + notification_configurations = + (Xml.required "NotificationConfigurations" + (Util.option_bind + (Xml.member "NotificationConfigurations" xml) + NotificationConfigurations.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AutoScalingGroupNames.member" - , AutoScalingGroupNames.to_query v.auto_scaling_group_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "auto_scaling_group_names" - , AutoScalingGroupNames.to_json v.auto_scaling_group_names ) - ]) - - let of_json j = - { auto_scaling_group_names = - AutoScalingGroupNames.of_json - (Util.of_option_exn (Json.lookup j "auto_scaling_group_names")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module LaunchConfigurationNameType = struct - type t = { launch_configuration_name : String.t } - - let make ~launch_configuration_name () = { launch_configuration_name } - - let parse xml = - Some - { launch_configuration_name = - Xml.required - "LaunchConfigurationName" - (Util.option_bind (Xml.member "LaunchConfigurationName" xml) String.parse) + ("NotificationConfigurations.member", + (NotificationConfigurations.to_query + v.notification_configurations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("notification_configurations", + (NotificationConfigurations.to_json + v.notification_configurations))]) + let of_json j = + { + notification_configurations = + (NotificationConfigurations.of_json + (Util.of_option_exn + (Json.lookup j "notification_configurations"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module TerminateInstanceInAutoScalingGroupType = + struct + type t = + { + instance_id: String.t ; + should_decrement_desired_capacity: Boolean.t } + let make ~instance_id ~should_decrement_desired_capacity () = + { instance_id; should_decrement_desired_capacity } + let parse xml = + Some + { + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + should_decrement_desired_capacity = + (Xml.required "ShouldDecrementDesiredCapacity" + (Util.option_bind + (Xml.member "ShouldDecrementDesiredCapacity" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ShouldDecrementDesiredCapacity", + (Boolean.to_query v.should_decrement_desired_capacity))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("should_decrement_desired_capacity", + (Boolean.to_json v.should_decrement_desired_capacity)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + should_decrement_desired_capacity = + (Boolean.of_json + (Util.of_option_exn + (Json.lookup j "should_decrement_desired_capacity"))) + } + end +module CreateOrUpdateTagsType = + struct + type t = { + tags: Tags.t } + let make ~tags () = { tags } + let parse xml = + Some + { + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) Tags.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (Tags.to_query v.tags)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("tags", (Tags.to_json v.tags))]) + let of_json j = + { tags = (Tags.of_json (Util.of_option_exn (Json.lookup j "tags"))) } + end +module InvalidNextToken = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DeleteLifecycleHookAnswer = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AutoScalingGroupNamesType = + struct + type t = + { + auto_scaling_group_names: AutoScalingGroupNames.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?(auto_scaling_group_names= []) ?next_token ?max_records () = + { auto_scaling_group_names; next_token; max_records } + let parse xml = + Some + { + auto_scaling_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "AutoScalingGroupNames" xml) + AutoScalingGroupNames.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("LaunchConfigurationName", String.to_query v.launch_configuration_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("launch_configuration_name", String.to_json v.launch_configuration_name) - ]) - - let of_json j = - { launch_configuration_name = - String.of_json (Util.of_option_exn (Json.lookup j "launch_configuration_name")) - } -end - -module DescribeNotificationConfigurationsType = struct - type t = - { auto_scaling_group_names : AutoScalingGroupNames.t - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make ?(auto_scaling_group_names = []) ?next_token ?max_records () = - { auto_scaling_group_names; next_token; max_records } - - let parse xml = - Some - { auto_scaling_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "AutoScalingGroupNames" xml) - AutoScalingGroupNames.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("AutoScalingGroupNames.member", + (AutoScalingGroupNames.to_query v.auto_scaling_group_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("auto_scaling_group_names", + (AutoScalingGroupNames.to_json v.auto_scaling_group_names))]) + let of_json j = + { + auto_scaling_group_names = + (AutoScalingGroupNames.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_names"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) + } + end +module LaunchConfigurationNameType = + struct + type t = { + launch_configuration_name: String.t } + let make ~launch_configuration_name () = { launch_configuration_name } + let parse xml = + Some + { + launch_configuration_name = + (Xml.required "LaunchConfigurationName" + (Util.option_bind (Xml.member "LaunchConfigurationName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LaunchConfigurationName", + (String.to_query v.launch_configuration_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("launch_configuration_name", + (String.to_json v.launch_configuration_name))]) + let of_json j = + { + launch_configuration_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "launch_configuration_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module DescribeNotificationConfigurationsType = + struct + type t = + { + auto_scaling_group_names: AutoScalingGroupNames.t ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?(auto_scaling_group_names= []) ?next_token ?max_records () = + { auto_scaling_group_names; next_token; max_records } + let parse xml = + Some + { + auto_scaling_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "AutoScalingGroupNames" xml) + AutoScalingGroupNames.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AutoScalingGroupNames.member" - , AutoScalingGroupNames.to_query v.auto_scaling_group_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "auto_scaling_group_names" - , AutoScalingGroupNames.to_json v.auto_scaling_group_names ) - ]) - - let of_json j = - { auto_scaling_group_names = - AutoScalingGroupNames.of_json - (Util.of_option_exn (Json.lookup j "auto_scaling_group_names")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module LaunchConfigurationsType = struct - type t = - { launch_configurations : LaunchConfigurations.t - ; next_token : String.t option - } - - let make ~launch_configurations ?next_token () = { launch_configurations; next_token } - - let parse xml = - Some - { launch_configurations = - Xml.required - "LaunchConfigurations" - (Util.option_bind - (Xml.member "LaunchConfigurations" xml) - LaunchConfigurations.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("AutoScalingGroupNames.member", + (AutoScalingGroupNames.to_query v.auto_scaling_group_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("auto_scaling_group_names", + (AutoScalingGroupNames.to_json v.auto_scaling_group_names))]) + let of_json j = + { + auto_scaling_group_names = + (AutoScalingGroupNames.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_names"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module LaunchConfigurationsType = + struct + type t = + { + launch_configurations: LaunchConfigurations.t ; + next_token: String.t option } + let make ~launch_configurations ?next_token () = + { launch_configurations; next_token } + let parse xml = + Some + { + launch_configurations = + (Xml.required "LaunchConfigurations" + (Util.option_bind (Xml.member "LaunchConfigurations" xml) + LaunchConfigurations.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "LaunchConfigurations.member" - , LaunchConfigurations.to_query v.launch_configurations )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "launch_configurations" - , LaunchConfigurations.to_json v.launch_configurations ) - ]) - - let of_json j = - { launch_configurations = - LaunchConfigurations.of_json - (Util.of_option_exn (Json.lookup j "launch_configurations")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ExitStandbyAnswer = struct - type t = { activities : Activities.t } - - let make ?(activities = []) () = { activities } - - let parse xml = - Some - { activities = - Util.of_option - [] - (Util.option_bind (Xml.member "Activities" xml) Activities.parse) + ("LaunchConfigurations.member", + (LaunchConfigurations.to_query v.launch_configurations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("launch_configurations", + (LaunchConfigurations.to_json v.launch_configurations))]) + let of_json j = + { + launch_configurations = + (LaunchConfigurations.of_json + (Util.of_option_exn (Json.lookup j "launch_configurations"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Activities.member", Activities.to_query v.activities)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("activities", Activities.to_json v.activities) ]) - - let of_json j = - { activities = Activities.of_json (Util.of_option_exn (Json.lookup j "activities")) } -end - -module ScheduledActionsType = struct - type t = - { scheduled_update_group_actions : ScheduledUpdateGroupActions.t - ; next_token : String.t option - } - - let make ?(scheduled_update_group_actions = []) ?next_token () = - { scheduled_update_group_actions; next_token } - - let parse xml = - Some - { scheduled_update_group_actions = - Util.of_option - [] - (Util.option_bind - (Xml.member "ScheduledUpdateGroupActions" xml) - ScheduledUpdateGroupActions.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module ExitStandbyAnswer = + struct + type t = { + activities: Activities.t } + let make ?(activities= []) () = { activities } + let parse xml = + Some + { + activities = + (Util.of_option [] + (Util.option_bind (Xml.member "Activities" xml) + Activities.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Activities.member", (Activities.to_query v.activities)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("activities", (Activities.to_json v.activities))]) + let of_json j = + { + activities = + (Activities.of_json + (Util.of_option_exn (Json.lookup j "activities"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module ScheduledActionsType = + struct + type t = + { + scheduled_update_group_actions: ScheduledUpdateGroupActions.t ; + next_token: String.t option } + let make ?(scheduled_update_group_actions= []) ?next_token () = + { scheduled_update_group_actions; next_token } + let parse xml = + Some + { + scheduled_update_group_actions = + (Util.of_option [] + (Util.option_bind + (Xml.member "ScheduledUpdateGroupActions" xml) + ScheduledUpdateGroupActions.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "ScheduledUpdateGroupActions.member" - , ScheduledUpdateGroupActions.to_query v.scheduled_update_group_actions )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "scheduled_update_group_actions" - , ScheduledUpdateGroupActions.to_json v.scheduled_update_group_actions ) - ]) - - let of_json j = - { scheduled_update_group_actions = - ScheduledUpdateGroupActions.of_json - (Util.of_option_exn (Json.lookup j "scheduled_update_group_actions")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeAutoScalingNotificationTypesAnswer = struct - type t = { auto_scaling_notification_types : AutoScalingNotificationTypes.t } - - let make ?(auto_scaling_notification_types = []) () = - { auto_scaling_notification_types } - - let parse xml = - Some - { auto_scaling_notification_types = - Util.of_option - [] - (Util.option_bind - (Xml.member "AutoScalingNotificationTypes" xml) - AutoScalingNotificationTypes.parse) + ("ScheduledUpdateGroupActions.member", + (ScheduledUpdateGroupActions.to_query + v.scheduled_update_group_actions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("scheduled_update_group_actions", + (ScheduledUpdateGroupActions.to_json + v.scheduled_update_group_actions))]) + let of_json j = + { + scheduled_update_group_actions = + (ScheduledUpdateGroupActions.of_json + (Util.of_option_exn + (Json.lookup j "scheduled_update_group_actions"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeAutoScalingNotificationTypesAnswer = + struct + type t = + { + auto_scaling_notification_types: AutoScalingNotificationTypes.t } + let make ?(auto_scaling_notification_types= []) () = + { auto_scaling_notification_types } + let parse xml = + Some + { + auto_scaling_notification_types = + (Util.of_option [] + (Util.option_bind + (Xml.member "AutoScalingNotificationTypes" xml) + AutoScalingNotificationTypes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AutoScalingNotificationTypes.member", + (AutoScalingNotificationTypes.to_query + v.auto_scaling_notification_types)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("auto_scaling_notification_types", + (AutoScalingNotificationTypes.to_json + v.auto_scaling_notification_types))]) + let of_json j = + { + auto_scaling_notification_types = + (AutoScalingNotificationTypes.of_json + (Util.of_option_exn + (Json.lookup j "auto_scaling_notification_types"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DescribeLoadBalancersResponse = + struct + type t = + { + load_balancers: LoadBalancerStates.t ; + next_token: String.t option } + let make ?(load_balancers= []) ?next_token () = + { load_balancers; next_token } + let parse xml = + Some + { + load_balancers = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancers" xml) + LoadBalancerStates.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "AutoScalingNotificationTypes.member" - , AutoScalingNotificationTypes.to_query v.auto_scaling_notification_types - )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "auto_scaling_notification_types" - , AutoScalingNotificationTypes.to_json v.auto_scaling_notification_types ) - ]) - - let of_json j = - { auto_scaling_notification_types = - AutoScalingNotificationTypes.of_json - (Util.of_option_exn (Json.lookup j "auto_scaling_notification_types")) - } -end - -module DescribeLoadBalancersResponse = struct - type t = - { load_balancers : LoadBalancerStates.t - ; next_token : String.t option - } - - let make ?(load_balancers = []) ?next_token () = { load_balancers; next_token } - - let parse xml = - Some - { load_balancers = - Util.of_option - [] - (Util.option_bind (Xml.member "LoadBalancers" xml) LoadBalancerStates.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("LoadBalancers.member", + (LoadBalancerStates.to_query v.load_balancers)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("load_balancers", + (LoadBalancerStates.to_json v.load_balancers))]) + let of_json j = + { + load_balancers = + (LoadBalancerStates.of_json + (Util.of_option_exn (Json.lookup j "load_balancers"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module ActivitiesType = + struct + type t = { + activities: Activities.t ; + next_token: String.t option } + let make ~activities ?next_token () = { activities; next_token } + let parse xml = + Some + { + activities = + (Xml.required "Activities" + (Util.option_bind (Xml.member "Activities" xml) + Activities.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("LoadBalancers.member", LoadBalancerStates.to_query v.load_balancers)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("load_balancers", LoadBalancerStates.to_json v.load_balancers) - ]) - - let of_json j = - { load_balancers = - LoadBalancerStates.of_json (Util.of_option_exn (Json.lookup j "load_balancers")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ActivitiesType = struct - type t = - { activities : Activities.t - ; next_token : String.t option - } - - let make ~activities ?next_token () = { activities; next_token } - - let parse xml = - Some - { activities = - Xml.required - "Activities" - (Util.option_bind (Xml.member "Activities" xml) Activities.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("Activities.member", (Activities.to_query v.activities)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("activities", (Activities.to_json v.activities))]) + let of_json j = + { + activities = + (Activities.of_json + (Util.of_option_exn (Json.lookup j "activities"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Activities.member", Activities.to_query v.activities)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("activities", Activities.to_json v.activities) - ]) - - let of_json j = - { activities = Activities.of_json (Util.of_option_exn (Json.lookup j "activities")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module CompleteLifecycleActionAnswer = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ScalingActivityInProgressFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeletePolicyType = struct - type t = - { auto_scaling_group_name : String.t option - ; policy_name : String.t - } - - let make ?auto_scaling_group_name ~policy_name () = - { auto_scaling_group_name; policy_name } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) + end +module CompleteLifecycleActionAnswer = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ScalingActivityInProgressFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_name", String.to_json v.policy_name) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - } -end - -module PolicyARNType = struct - type t = { policy_a_r_n : String.t option } - - let make ?policy_a_r_n () = { policy_a_r_n } - - let parse xml = - Some { policy_a_r_n = Util.option_bind (Xml.member "PolicyARN" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.policy_a_r_n (fun f -> - Query.Pair ("PolicyARN", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.policy_a_r_n (fun f -> "policy_a_r_n", String.to_json f) ]) - - let of_json j = - { policy_a_r_n = Util.option_map (Json.lookup j "policy_a_r_n") String.of_json } -end - -module DescribeMetricCollectionTypesAnswer = struct - type t = - { metrics : MetricCollectionTypes.t - ; granularities : MetricGranularityTypes.t - } - - let make ?(metrics = []) ?(granularities = []) () = { metrics; granularities } - - let parse xml = - Some - { metrics = - Util.of_option - [] - (Util.option_bind (Xml.member "Metrics" xml) MetricCollectionTypes.parse) - ; granularities = - Util.of_option - [] - (Util.option_bind - (Xml.member "Granularities" xml) - MetricGranularityTypes.parse) + end +module DeletePolicyType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + policy_name: String.t } + let make ?auto_scaling_group_name ~policy_name () = + { auto_scaling_group_name; policy_name } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_name", (String.to_json v.policy_name)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))) + } + end +module PolicyARNType = + struct + type t = { + policy_a_r_n: String.t option } + let make ?policy_a_r_n () = { policy_a_r_n } + let parse xml = + Some + { + policy_a_r_n = + (Util.option_bind (Xml.member "PolicyARN" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.policy_a_r_n + (fun f -> Query.Pair ("PolicyARN", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.policy_a_r_n + (fun f -> ("policy_a_r_n", (String.to_json f)))]) + let of_json j = + { + policy_a_r_n = + (Util.option_map (Json.lookup j "policy_a_r_n") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DescribeMetricCollectionTypesAnswer = + struct + type t = + { + metrics: MetricCollectionTypes.t ; + granularities: MetricGranularityTypes.t } + let make ?(metrics= []) ?(granularities= []) () = + { metrics; granularities } + let parse xml = + Some + { + metrics = + (Util.of_option [] + (Util.option_bind (Xml.member "Metrics" xml) + MetricCollectionTypes.parse)); + granularities = + (Util.of_option [] + (Util.option_bind (Xml.member "Granularities" xml) + MetricGranularityTypes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Granularities.member", + (MetricGranularityTypes.to_query v.granularities))); + Some (Query.Pair - ("Granularities.member", MetricGranularityTypes.to_query v.granularities)) - ; Some (Query.Pair ("Metrics.member", MetricCollectionTypes.to_query v.metrics)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("granularities", MetricGranularityTypes.to_json v.granularities) - ; Some ("metrics", MetricCollectionTypes.to_json v.metrics) - ]) - - let of_json j = - { metrics = - MetricCollectionTypes.of_json (Util.of_option_exn (Json.lookup j "metrics")) - ; granularities = - MetricGranularityTypes.of_json - (Util.of_option_exn (Json.lookup j "granularities")) - } -end - -module EnterStandbyAnswer = struct - type t = { activities : Activities.t } - - let make ?(activities = []) () = { activities } - - let parse xml = - Some - { activities = - Util.of_option - [] - (Util.option_bind (Xml.member "Activities" xml) Activities.parse) + ("Metrics.member", + (MetricCollectionTypes.to_query v.metrics)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("granularities", + (MetricGranularityTypes.to_json v.granularities)); + Some ("metrics", (MetricCollectionTypes.to_json v.metrics))]) + let of_json j = + { + metrics = + (MetricCollectionTypes.of_json + (Util.of_option_exn (Json.lookup j "metrics"))); + granularities = + (MetricGranularityTypes.of_json + (Util.of_option_exn (Json.lookup j "granularities"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Activities.member", Activities.to_query v.activities)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("activities", Activities.to_json v.activities) ]) - - let of_json j = - { activities = Activities.of_json (Util.of_option_exn (Json.lookup j "activities")) } -end - -module DescribeLifecycleHooksType = struct - type t = - { auto_scaling_group_name : String.t - ; lifecycle_hook_names : LifecycleHookNames.t - } - - let make ~auto_scaling_group_name ?(lifecycle_hook_names = []) () = - { auto_scaling_group_name; lifecycle_hook_names } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; lifecycle_hook_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LifecycleHookNames" xml) - LifecycleHookNames.parse) + end +module EnterStandbyAnswer = + struct + type t = { + activities: Activities.t } + let make ?(activities= []) () = { activities } + let parse xml = + Some + { + activities = + (Util.of_option [] + (Util.option_bind (Xml.member "Activities" xml) + Activities.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Activities.member", (Activities.to_query v.activities)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("activities", (Activities.to_json v.activities))]) + let of_json j = + { + activities = + (Activities.of_json + (Util.of_option_exn (Json.lookup j "activities"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DescribeLifecycleHooksType = + struct + type t = + { + auto_scaling_group_name: String.t ; + lifecycle_hook_names: LifecycleHookNames.t } + let make ~auto_scaling_group_name ?(lifecycle_hook_names= []) () = + { auto_scaling_group_name; lifecycle_hook_names } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + lifecycle_hook_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LifecycleHookNames" xml) + LifecycleHookNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LifecycleHookNames.member", + (LifecycleHookNames.to_query v.lifecycle_hook_names))); + Some (Query.Pair - ( "LifecycleHookNames.member" - , LifecycleHookNames.to_query v.lifecycle_hook_names )) - ; Some + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lifecycle_hook_names", + (LifecycleHookNames.to_json v.lifecycle_hook_names)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + lifecycle_hook_names = + (LifecycleHookNames.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_names"))) + } + end +module DisableMetricsCollectionQuery = + struct + type t = { + auto_scaling_group_name: String.t ; + metrics: Metrics.t } + let make ~auto_scaling_group_name ?(metrics= []) () = + { auto_scaling_group_name; metrics } + let parse xml = + Some + { + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + metrics = + (Util.of_option [] + (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Metrics.member", (Metrics.to_query v.metrics))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("lifecycle_hook_names", LifecycleHookNames.to_json v.lifecycle_hook_names) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; lifecycle_hook_names = - LifecycleHookNames.of_json - (Util.of_option_exn (Json.lookup j "lifecycle_hook_names")) - } -end - -module DisableMetricsCollectionQuery = struct - type t = - { auto_scaling_group_name : String.t - ; metrics : Metrics.t - } - - let make ~auto_scaling_group_name ?(metrics = []) () = - { auto_scaling_group_name; metrics } - - let parse xml = - Some - { auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; metrics = - Util.of_option [] (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("metrics", (Metrics.to_json v.metrics)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name))]) + let of_json j = + { + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + metrics = + (Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Metrics.member", Metrics.to_query v.metrics)) - ; Some + end +module DescribeAutoScalingInstancesType = + struct + type t = + { + instance_ids: InstanceIds.t ; + max_records: Integer.t option ; + next_token: String.t option } + let make ?(instance_ids= []) ?max_records ?next_token () = + { instance_ids; max_records; next_token } + let parse xml = + Some + { + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceIds" xml) + InstanceIds.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("metrics", Metrics.to_json v.metrics) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ]) - - let of_json j = - { auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; metrics = Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics")) - } -end - -module DescribeAutoScalingInstancesType = struct - type t = - { instance_ids : InstanceIds.t - ; max_records : Integer.t option - ; next_token : String.t option - } - - let make ?(instance_ids = []) ?max_records ?next_token () = - { instance_ids; max_records; next_token } - - let parse xml = - Some - { instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceIds" xml) InstanceIds.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("InstanceIds.member", (InstanceIds.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("instance_ids", (InstanceIds.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIds.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("InstanceIds.member", InstanceIds.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("instance_ids", InstanceIds.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIds.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ProcessesType = struct - type t = { processes : Processes.t } - - let make ?(processes = []) () = { processes } - - let parse xml = - Some - { processes = - Util.of_option - [] - (Util.option_bind (Xml.member "Processes" xml) Processes.parse) + end +module ProcessesType = + struct + type t = { + processes: Processes.t } + let make ?(processes= []) () = { processes } + let parse xml = + Some + { + processes = + (Util.of_option [] + (Util.option_bind (Xml.member "Processes" xml) Processes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Processes.member", (Processes.to_query v.processes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("processes", (Processes.to_json v.processes))]) + let of_json j = + { + processes = + (Processes.of_json (Util.of_option_exn (Json.lookup j "processes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Processes.member", Processes.to_query v.processes)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("processes", Processes.to_json v.processes) ]) - - let of_json j = - { processes = Processes.of_json (Util.of_option_exn (Json.lookup j "processes")) } -end - -module CompleteLifecycleActionType = struct - type t = - { lifecycle_hook_name : String.t - ; auto_scaling_group_name : String.t - ; lifecycle_action_token : String.t - ; lifecycle_action_result : String.t - } - - let make - ~lifecycle_hook_name - ~auto_scaling_group_name - ~lifecycle_action_token - ~lifecycle_action_result - () = - { lifecycle_hook_name - ; auto_scaling_group_name - ; lifecycle_action_token - ; lifecycle_action_result - } - - let parse xml = - Some - { lifecycle_hook_name = - Xml.required - "LifecycleHookName" - (Util.option_bind (Xml.member "LifecycleHookName" xml) String.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; lifecycle_action_token = - Xml.required - "LifecycleActionToken" - (Util.option_bind (Xml.member "LifecycleActionToken" xml) String.parse) - ; lifecycle_action_result = - Xml.required - "LifecycleActionResult" - (Util.option_bind (Xml.member "LifecycleActionResult" xml) String.parse) + end +module CompleteLifecycleActionType = + struct + type t = + { + lifecycle_hook_name: String.t ; + auto_scaling_group_name: String.t ; + lifecycle_action_token: String.t ; + lifecycle_action_result: String.t } + let make ~lifecycle_hook_name ~auto_scaling_group_name + ~lifecycle_action_token ~lifecycle_action_result () = + { + lifecycle_hook_name; + auto_scaling_group_name; + lifecycle_action_token; + lifecycle_action_result } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + lifecycle_hook_name = + (Xml.required "LifecycleHookName" + (Util.option_bind (Xml.member "LifecycleHookName" xml) + String.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + lifecycle_action_token = + (Xml.required "LifecycleActionToken" + (Util.option_bind (Xml.member "LifecycleActionToken" xml) + String.parse)); + lifecycle_action_result = + (Xml.required "LifecycleActionResult" + (Util.option_bind (Xml.member "LifecycleActionResult" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LifecycleActionResult", + (String.to_query v.lifecycle_action_result))); + Some (Query.Pair - ("LifecycleActionResult", String.to_query v.lifecycle_action_result)) - ; Some - (Query.Pair ("LifecycleActionToken", String.to_query v.lifecycle_action_token)) - ; Some + ("LifecycleActionToken", + (String.to_query v.lifecycle_action_token))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("LifecycleHookName", String.to_query v.lifecycle_hook_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("lifecycle_action_result", String.to_json v.lifecycle_action_result) - ; Some ("lifecycle_action_token", String.to_json v.lifecycle_action_token) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("lifecycle_hook_name", String.to_json v.lifecycle_hook_name) - ]) - - let of_json j = - { lifecycle_hook_name = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_hook_name")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; lifecycle_action_token = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_action_token")) - ; lifecycle_action_result = - String.of_json (Util.of_option_exn (Json.lookup j "lifecycle_action_result")) - } -end - -module EnterStandbyQuery = struct - type t = - { instance_ids : InstanceIds.t - ; auto_scaling_group_name : String.t - ; should_decrement_desired_capacity : Boolean.t - } - - let make - ?(instance_ids = []) - ~auto_scaling_group_name - ~should_decrement_desired_capacity - () = - { instance_ids; auto_scaling_group_name; should_decrement_desired_capacity } - - let parse xml = - Some - { instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceIds" xml) InstanceIds.parse) - ; auto_scaling_group_name = - Xml.required - "AutoScalingGroupName" - (Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse) - ; should_decrement_desired_capacity = - Xml.required - "ShouldDecrementDesiredCapacity" - (Util.option_bind - (Xml.member "ShouldDecrementDesiredCapacity" xml) - Boolean.parse) + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some + (Query.Pair + ("LifecycleHookName", + (String.to_query v.lifecycle_hook_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lifecycle_action_result", + (String.to_json v.lifecycle_action_result)); + Some + ("lifecycle_action_token", + (String.to_json v.lifecycle_action_token)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some + ("lifecycle_hook_name", (String.to_json v.lifecycle_hook_name))]) + let of_json j = + { + lifecycle_hook_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_hook_name"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + lifecycle_action_token = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_action_token"))); + lifecycle_action_result = + (String.of_json + (Util.of_option_exn (Json.lookup j "lifecycle_action_result"))) + } + end +module EnterStandbyQuery = + struct + type t = + { + instance_ids: InstanceIds.t ; + auto_scaling_group_name: String.t ; + should_decrement_desired_capacity: Boolean.t } + let make ?(instance_ids= []) ~auto_scaling_group_name + ~should_decrement_desired_capacity () = + { + instance_ids; + auto_scaling_group_name; + should_decrement_desired_capacity } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceIds" xml) + InstanceIds.parse)); + auto_scaling_group_name = + (Xml.required "AutoScalingGroupName" + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse)); + should_decrement_desired_capacity = + (Xml.required "ShouldDecrementDesiredCapacity" + (Util.option_bind + (Xml.member "ShouldDecrementDesiredCapacity" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ShouldDecrementDesiredCapacity", + (Boolean.to_query v.should_decrement_desired_capacity))); + Some (Query.Pair - ( "ShouldDecrementDesiredCapacity" - , Boolean.to_query v.should_decrement_desired_capacity )) - ; Some + ("AutoScalingGroupName", + (String.to_query v.auto_scaling_group_name))); + Some (Query.Pair - ("AutoScalingGroupName", String.to_query v.auto_scaling_group_name)) - ; Some (Query.Pair ("InstanceIds.member", InstanceIds.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "should_decrement_desired_capacity" - , Boolean.to_json v.should_decrement_desired_capacity ) - ; Some ("auto_scaling_group_name", String.to_json v.auto_scaling_group_name) - ; Some ("instance_ids", InstanceIds.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIds.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; auto_scaling_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "auto_scaling_group_name")) - ; should_decrement_desired_capacity = - Boolean.of_json - (Util.of_option_exn (Json.lookup j "should_decrement_desired_capacity")) - } -end - -module DescribeScheduledActionsType = struct - type t = - { auto_scaling_group_name : String.t option - ; scheduled_action_names : ScheduledActionNames.t - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; next_token : String.t option - ; max_records : Integer.t option - } - - let make - ?auto_scaling_group_name - ?(scheduled_action_names = []) - ?start_time - ?end_time - ?next_token - ?max_records - () = - { auto_scaling_group_name - ; scheduled_action_names - ; start_time - ; end_time - ; next_token - ; max_records - } - - let parse xml = - Some - { auto_scaling_group_name = - Util.option_bind (Xml.member "AutoScalingGroupName" xml) String.parse - ; scheduled_action_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "ScheduledActionNames" xml) - ScheduledActionNames.parse) - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse + ("InstanceIds.member", (InstanceIds.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("should_decrement_desired_capacity", + (Boolean.to_json v.should_decrement_desired_capacity)); + Some + ("auto_scaling_group_name", + (String.to_json v.auto_scaling_group_name)); + Some ("instance_ids", (InstanceIds.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIds.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + auto_scaling_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "auto_scaling_group_name"))); + should_decrement_desired_capacity = + (Boolean.of_json + (Util.of_option_exn + (Json.lookup j "should_decrement_desired_capacity"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Some + end +module DescribeScheduledActionsType = + struct + type t = + { + auto_scaling_group_name: String.t option ; + scheduled_action_names: ScheduledActionNames.t ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + next_token: String.t option ; + max_records: Integer.t option } + let make ?auto_scaling_group_name ?(scheduled_action_names= []) + ?start_time ?end_time ?next_token ?max_records () = + { + auto_scaling_group_name; + scheduled_action_names; + start_time; + end_time; + next_token; + max_records + } + let parse xml = + Some + { + auto_scaling_group_name = + (Util.option_bind (Xml.member "AutoScalingGroupName" xml) + String.parse); + scheduled_action_names = + (Util.of_option [] + (Util.option_bind (Xml.member "ScheduledActionNames" xml) + ScheduledActionNames.parse)); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Some (Query.Pair - ( "ScheduledActionNames.member" - , ScheduledActionNames.to_query v.scheduled_action_names )) - ; Util.option_map v.auto_scaling_group_name (fun f -> - Query.Pair ("AutoScalingGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Some - ( "scheduled_action_names" - , ScheduledActionNames.to_json v.scheduled_action_names ) - ; Util.option_map v.auto_scaling_group_name (fun f -> - "auto_scaling_group_name", String.to_json f) - ]) - - let of_json j = - { auto_scaling_group_name = - Util.option_map (Json.lookup j "auto_scaling_group_name") String.of_json - ; scheduled_action_names = - ScheduledActionNames.of_json - (Util.of_option_exn (Json.lookup j "scheduled_action_names")) - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module ResourceContentionFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end + ("ScheduledActionNames.member", + (ScheduledActionNames.to_query v.scheduled_action_names))); + Util.option_map v.auto_scaling_group_name + (fun f -> + Query.Pair ("AutoScalingGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Some + ("scheduled_action_names", + (ScheduledActionNames.to_json v.scheduled_action_names)); + Util.option_map v.auto_scaling_group_name + (fun f -> ("auto_scaling_group_name", (String.to_json f)))]) + let of_json j = + { + auto_scaling_group_name = + (Util.option_map (Json.lookup j "auto_scaling_group_name") + String.of_json); + scheduled_action_names = + (ScheduledActionNames.of_json + (Util.of_option_exn (Json.lookup j "scheduled_action_names"))); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) + } + end +module ResourceContentionFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end \ No newline at end of file diff --git a/libraries/autoscaling/lib/updateAutoScalingGroup.ml b/libraries/autoscaling/lib/updateAutoScalingGroup.ml index 3cac877ef..59f503909 100644 --- a/libraries/autoscaling/lib/updateAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/updateAutoScalingGroup.ml @@ -1,40 +1,33 @@ open Types open Aws - type input = UpdateAutoScalingGroupType.t - type output = unit - type error = Errors_internal.t - let service = "autoscaling" - 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", [ "2011-01-01" ]; "Action", [ "UpdateAutoScalingGroup" ] ] + [("Version", ["2011-01-01"]); + ("Action", ["UpdateAutoScalingGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (UpdateAutoScalingGroupType.to_query req))))) - in - `POST, uri, [] - + (Query.render (UpdateAutoScalingGroupType.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.ResourceContention; Errors_internal.ScalingActivityInProgress ] - @ Errors_internal.common - in + [Errors_internal.ResourceContention; + Errors_internal.ScalingActivityInProgress] @ 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 \ No newline at end of file diff --git a/libraries/autoscaling/lib/updateAutoScalingGroup.mli b/libraries/autoscaling/lib/updateAutoScalingGroup.mli index 5e7e3d525..3b8b2fdfe 100644 --- a/libraries/autoscaling/lib/updateAutoScalingGroup.mli +++ b/libraries/autoscaling/lib/updateAutoScalingGroup.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateAutoScalingGroupType.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 \ No newline at end of file diff --git a/libraries/autoscaling/lib_test/dune b/libraries/autoscaling/lib_test/dune index 1a93a9953..a80064d00 100644 --- a/libraries/autoscaling/lib_test/dune +++ b/libraries/autoscaling/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_autoscaling_test) - (libraries aws aws_autoscaling aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_autoscaling aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/autoscaling/lib_test/test_async.ml b/libraries/autoscaling/lib_test/test_async.ml index 4d720488b..123309cd3 100644 --- a/libraries/autoscaling/lib_test/test_async.ml +++ b/libraries/autoscaling/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_autoscaling_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/autoscaling/lib_test/test_lwt.ml b/libraries/autoscaling/lib_test/test_lwt.ml index 2fd0fd280..1acddb22f 100644 --- a/libraries/autoscaling/lib_test/test_lwt.ml +++ b/libraries/autoscaling/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_autoscaling_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/cloudformation/lib/cancelUpdateStack.ml b/libraries/cloudformation/lib/cancelUpdateStack.ml index dfc5f4866..ecea8b34c 100644 --- a/libraries/cloudformation/lib/cancelUpdateStack.ml +++ b/libraries/cloudformation/lib/cancelUpdateStack.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = CancelUpdateStackInput.t - type output = unit - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "CancelUpdateStack" ] ] + [("Version", ["2010-05-15"]); ("Action", ["CancelUpdateStack"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelUpdateStackInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelUpdateStackInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/cancelUpdateStack.mli b/libraries/cloudformation/lib/cancelUpdateStack.mli index aad3206a3..61f59fb22 100644 --- a/libraries/cloudformation/lib/cancelUpdateStack.mli +++ b/libraries/cloudformation/lib/cancelUpdateStack.mli @@ -1,10 +1,7 @@ open Types - type input = CancelUpdateStackInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/createStack.ml b/libraries/cloudformation/lib/createStack.ml index 01186c0e8..eeeb6f888 100644 --- a/libraries/cloudformation/lib/createStack.ml +++ b/libraries/cloudformation/lib/createStack.ml @@ -1,67 +1,61 @@ open Types open Aws - type input = CreateStackInput.t - type output = CreateStackOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "CreateStack" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-05-15"]); ("Action", ["CreateStack"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateStackInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateStackInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateStackResponse" (snd xml)) - (Xml.member "CreateStackResult") - in + Util.option_bind (Xml.member "CreateStackResponse" (snd xml)) + (Xml.member "CreateStackResult") in try - Util.or_error - (Util.option_bind resp CreateStackOutput.parse) + Util.or_error (Util.option_bind resp CreateStackOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateStackOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateStackOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateStackOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateStackOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientCapabilitiesException - ; Errors_internal.AlreadyExistsException - ; Errors_internal.LimitExceededException - ] - @ Errors_internal.common - in + [Errors_internal.InsufficientCapabilitiesException; + Errors_internal.AlreadyExistsException; + Errors_internal.LimitExceededException] @ 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/createStack.mli b/libraries/cloudformation/lib/createStack.mli index 2983a4e6a..f043587df 100644 --- a/libraries/cloudformation/lib/createStack.mli +++ b/libraries/cloudformation/lib/createStack.mli @@ -1,10 +1,7 @@ open Types - type input = CreateStackInput.t - type output = CreateStackOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/deleteStack.ml b/libraries/cloudformation/lib/deleteStack.ml index f32d57f1e..95ea1fe29 100644 --- a/libraries/cloudformation/lib/deleteStack.ml +++ b/libraries/cloudformation/lib/deleteStack.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteStackInput.t - type output = unit - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "DeleteStack" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-05-15"]); ("Action", ["DeleteStack"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteStackInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteStackInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/deleteStack.mli b/libraries/cloudformation/lib/deleteStack.mli index a7a555913..a05f7ddef 100644 --- a/libraries/cloudformation/lib/deleteStack.mli +++ b/libraries/cloudformation/lib/deleteStack.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteStackInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackEvents.ml b/libraries/cloudformation/lib/describeStackEvents.ml index ad15a6dff..6c451dc96 100644 --- a/libraries/cloudformation/lib/describeStackEvents.ml +++ b/libraries/cloudformation/lib/describeStackEvents.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = DescribeStackEventsInput.t - type output = DescribeStackEventsOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "DescribeStackEvents" ] ] + [("Version", ["2010-05-15"]); ("Action", ["DescribeStackEvents"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeStackEventsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeStackEventsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeStackEventsResponse" (snd xml)) - (Xml.member "DescribeStackEventsResult") - in + Util.option_bind (Xml.member "DescribeStackEventsResponse" (snd xml)) + (Xml.member "DescribeStackEventsResult") in try - Util.or_error - (Util.option_bind resp DescribeStackEventsOutput.parse) + Util.or_error (Util.option_bind resp DescribeStackEventsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeStackEventsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeStackEventsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStackEventsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeStackEventsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackEvents.mli b/libraries/cloudformation/lib/describeStackEvents.mli index c3a3fdeea..9352c8f82 100644 --- a/libraries/cloudformation/lib/describeStackEvents.mli +++ b/libraries/cloudformation/lib/describeStackEvents.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeStackEventsInput.t - type output = DescribeStackEventsOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackResource.ml b/libraries/cloudformation/lib/describeStackResource.ml index e7a1f8120..d2de062ca 100644 --- a/libraries/cloudformation/lib/describeStackResource.ml +++ b/libraries/cloudformation/lib/describeStackResource.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = DescribeStackResourceInput.t - type output = DescribeStackResourceOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "DescribeStackResource" ] ] + [("Version", ["2010-05-15"]); ("Action", ["DescribeStackResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeStackResourceInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeStackResourceInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeStackResourceResponse" (snd xml)) - (Xml.member "DescribeStackResourceResult") - in + Util.option_bind (Xml.member "DescribeStackResourceResponse" (snd xml)) + (Xml.member "DescribeStackResourceResult") in try - Util.or_error - (Util.option_bind resp DescribeStackResourceOutput.parse) + Util.or_error (Util.option_bind resp DescribeStackResourceOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeStackResourceOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeStackResourceOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStackResourceOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeStackResourceOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackResource.mli b/libraries/cloudformation/lib/describeStackResource.mli index d0e192b1f..e0b90f87d 100644 --- a/libraries/cloudformation/lib/describeStackResource.mli +++ b/libraries/cloudformation/lib/describeStackResource.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeStackResourceInput.t - type output = DescribeStackResourceOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackResources.ml b/libraries/cloudformation/lib/describeStackResources.ml index 229e7c2a1..3d9338267 100644 --- a/libraries/cloudformation/lib/describeStackResources.ml +++ b/libraries/cloudformation/lib/describeStackResources.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeStackResourcesInput.t - type output = DescribeStackResourcesOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "DescribeStackResources" ] ] + [("Version", ["2010-05-15"]); + ("Action", ["DescribeStackResources"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeStackResourcesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeStackResourcesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeStackResourcesResponse" (snd xml)) - (Xml.member "DescribeStackResourcesResult") - in + (Xml.member "DescribeStackResourcesResult") in try Util.or_error (Util.option_bind resp DescribeStackResourcesOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeStackResourcesOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeStackResourcesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStackResourcesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeStackResourcesOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStackResources.mli b/libraries/cloudformation/lib/describeStackResources.mli index 98eb845a1..5a0361ddd 100644 --- a/libraries/cloudformation/lib/describeStackResources.mli +++ b/libraries/cloudformation/lib/describeStackResources.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeStackResourcesInput.t - type output = DescribeStackResourcesOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStacks.ml b/libraries/cloudformation/lib/describeStacks.ml index 0e2756655..9d7b6d906 100644 --- a/libraries/cloudformation/lib/describeStacks.ml +++ b/libraries/cloudformation/lib/describeStacks.ml @@ -1,61 +1,59 @@ open Types open Aws - type input = DescribeStacksInput.t - type output = DescribeStacksOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "DescribeStacks" ] ] + [("Version", ["2010-05-15"]); ("Action", ["DescribeStacks"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeStacksInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeStacksInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeStacksResponse" (snd xml)) - (Xml.member "DescribeStacksResult") - in + Util.option_bind (Xml.member "DescribeStacksResponse" (snd xml)) + (Xml.member "DescribeStacksResult") in try - Util.or_error - (Util.option_bind resp DescribeStacksOutput.parse) + Util.or_error (Util.option_bind resp DescribeStacksOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeStacksOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeStacksOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStacksOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeStacksOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/describeStacks.mli b/libraries/cloudformation/lib/describeStacks.mli index 976d33e13..3bc91b94d 100644 --- a/libraries/cloudformation/lib/describeStacks.mli +++ b/libraries/cloudformation/lib/describeStacks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeStacksInput.t - type output = DescribeStacksOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/dune b/libraries/cloudformation/lib/dune index dc0514418..202c69863 100644 --- a/libraries/cloudformation/lib/dune +++ b/libraries/cloudformation/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_cloudformation) + (name aws_cloudformation) (public_name aws-cloudformation) (synopsis "aws-AWS CloudFormation") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/cloudformation/lib/errors_internal.ml b/libraries/cloudformation/lib/errors_internal.ml index a6f06e343..63062d1c0 100644 --- a/libraries/cloudformation/lib/errors_internal.ml +++ b/libraries/cloudformation/lib/errors_internal.ml @@ -1,64 +1,61 @@ type t = - | AlreadyExistsException - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InsufficientCapabilitiesException - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | LimitExceededException - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AlreadyExistsException + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InsufficientCapabilitiesException + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | LimitExceededException + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AlreadyExistsException -> Some 400 @@ -91,7 +88,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AlreadyExistsException -> "AlreadyExistsException" @@ -124,7 +120,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AlreadyExistsException" -> Some AlreadyExistsException @@ -133,7 +128,8 @@ let of_string e = | "DryRunOperation" -> Some DryRunOperation | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch | "IncompleteSignature" -> Some IncompleteSignature - | "InsufficientCapabilitiesException" -> Some InsufficientCapabilitiesException + | "InsufficientCapabilitiesException" -> + Some InsufficientCapabilitiesException | "InternalFailure" -> Some InternalFailure | "InvalidAction" -> Some InvalidAction | "InvalidClientTokenId" -> Some InvalidClientTokenId @@ -157,4 +153,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/cloudformation/lib/estimateTemplateCost.ml b/libraries/cloudformation/lib/estimateTemplateCost.ml index 1a81722ea..0203b0ccc 100644 --- a/libraries/cloudformation/lib/estimateTemplateCost.ml +++ b/libraries/cloudformation/lib/estimateTemplateCost.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = EstimateTemplateCostInput.t - type output = EstimateTemplateCostOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "EstimateTemplateCost" ] ] + [("Version", ["2010-05-15"]); ("Action", ["EstimateTemplateCost"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (EstimateTemplateCostInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (EstimateTemplateCostInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "EstimateTemplateCostResponse" (snd xml)) - (Xml.member "EstimateTemplateCostResult") - in + Util.option_bind (Xml.member "EstimateTemplateCostResponse" (snd xml)) + (Xml.member "EstimateTemplateCostResult") in try - Util.or_error - (Util.option_bind resp EstimateTemplateCostOutput.parse) + Util.or_error (Util.option_bind resp EstimateTemplateCostOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed EstimateTemplateCostOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed EstimateTemplateCostOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EstimateTemplateCostOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EstimateTemplateCostOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/estimateTemplateCost.mli b/libraries/cloudformation/lib/estimateTemplateCost.mli index 8548fe9ff..2eb0383c5 100644 --- a/libraries/cloudformation/lib/estimateTemplateCost.mli +++ b/libraries/cloudformation/lib/estimateTemplateCost.mli @@ -1,10 +1,7 @@ open Types - type input = EstimateTemplateCostInput.t - type output = EstimateTemplateCostOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getStackPolicy.ml b/libraries/cloudformation/lib/getStackPolicy.ml index d06b1129a..1e2bf77f4 100644 --- a/libraries/cloudformation/lib/getStackPolicy.ml +++ b/libraries/cloudformation/lib/getStackPolicy.ml @@ -1,61 +1,59 @@ open Types open Aws - type input = GetStackPolicyInput.t - type output = GetStackPolicyOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "GetStackPolicy" ] ] + [("Version", ["2010-05-15"]); ("Action", ["GetStackPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetStackPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetStackPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetStackPolicyResponse" (snd xml)) - (Xml.member "GetStackPolicyResult") - in + Util.option_bind (Xml.member "GetStackPolicyResponse" (snd xml)) + (Xml.member "GetStackPolicyResult") in try - Util.or_error - (Util.option_bind resp GetStackPolicyOutput.parse) + Util.or_error (Util.option_bind resp GetStackPolicyOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetStackPolicyOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetStackPolicyOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetStackPolicyOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetStackPolicyOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getStackPolicy.mli b/libraries/cloudformation/lib/getStackPolicy.mli index a15124c99..b7a0f1870 100644 --- a/libraries/cloudformation/lib/getStackPolicy.mli +++ b/libraries/cloudformation/lib/getStackPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = GetStackPolicyInput.t - type output = GetStackPolicyOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getTemplate.ml b/libraries/cloudformation/lib/getTemplate.ml index 188ec6995..e7588740d 100644 --- a/libraries/cloudformation/lib/getTemplate.ml +++ b/libraries/cloudformation/lib/getTemplate.ml @@ -1,61 +1,58 @@ open Types open Aws - type input = GetTemplateInput.t - type output = GetTemplateOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "GetTemplate" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-05-15"]); ("Action", ["GetTemplate"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetTemplateInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetTemplateInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetTemplateResponse" (snd xml)) - (Xml.member "GetTemplateResult") - in + Util.option_bind (Xml.member "GetTemplateResponse" (snd xml)) + (Xml.member "GetTemplateResult") in try - Util.or_error - (Util.option_bind resp GetTemplateOutput.parse) + Util.or_error (Util.option_bind resp GetTemplateOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetTemplateOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetTemplateOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetTemplateOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetTemplateOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getTemplate.mli b/libraries/cloudformation/lib/getTemplate.mli index 412a89b4f..3f2408857 100644 --- a/libraries/cloudformation/lib/getTemplate.mli +++ b/libraries/cloudformation/lib/getTemplate.mli @@ -1,10 +1,7 @@ open Types - type input = GetTemplateInput.t - type output = GetTemplateOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getTemplateSummary.ml b/libraries/cloudformation/lib/getTemplateSummary.ml index 88353f9d9..644beef3c 100644 --- a/libraries/cloudformation/lib/getTemplateSummary.ml +++ b/libraries/cloudformation/lib/getTemplateSummary.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = GetTemplateSummaryInput.t - type output = GetTemplateSummaryOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "GetTemplateSummary" ] ] + [("Version", ["2010-05-15"]); ("Action", ["GetTemplateSummary"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetTemplateSummaryInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetTemplateSummaryInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetTemplateSummaryResponse" (snd xml)) - (Xml.member "GetTemplateSummaryResult") - in + Util.option_bind (Xml.member "GetTemplateSummaryResponse" (snd xml)) + (Xml.member "GetTemplateSummaryResult") in try - Util.or_error - (Util.option_bind resp GetTemplateSummaryOutput.parse) + Util.or_error (Util.option_bind resp GetTemplateSummaryOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetTemplateSummaryOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetTemplateSummaryOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetTemplateSummaryOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetTemplateSummaryOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/getTemplateSummary.mli b/libraries/cloudformation/lib/getTemplateSummary.mli index 1d95d7658..5a92d67e8 100644 --- a/libraries/cloudformation/lib/getTemplateSummary.mli +++ b/libraries/cloudformation/lib/getTemplateSummary.mli @@ -1,10 +1,7 @@ open Types - type input = GetTemplateSummaryInput.t - type output = GetTemplateSummaryOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/listStackResources.ml b/libraries/cloudformation/lib/listStackResources.ml index 0bb2b6510..a3aa04fc5 100644 --- a/libraries/cloudformation/lib/listStackResources.ml +++ b/libraries/cloudformation/lib/listStackResources.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = ListStackResourcesInput.t - type output = ListStackResourcesOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "ListStackResources" ] ] + [("Version", ["2010-05-15"]); ("Action", ["ListStackResources"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListStackResourcesInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListStackResourcesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListStackResourcesResponse" (snd xml)) - (Xml.member "ListStackResourcesResult") - in + Util.option_bind (Xml.member "ListStackResourcesResponse" (snd xml)) + (Xml.member "ListStackResourcesResult") in try - Util.or_error - (Util.option_bind resp ListStackResourcesOutput.parse) + Util.or_error (Util.option_bind resp ListStackResourcesOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListStackResourcesOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListStackResourcesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListStackResourcesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListStackResourcesOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/listStackResources.mli b/libraries/cloudformation/lib/listStackResources.mli index 44b551632..7395ab5da 100644 --- a/libraries/cloudformation/lib/listStackResources.mli +++ b/libraries/cloudformation/lib/listStackResources.mli @@ -1,10 +1,7 @@ open Types - type input = ListStackResourcesInput.t - type output = ListStackResourcesOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/listStacks.ml b/libraries/cloudformation/lib/listStacks.ml index bce791da6..01180cd17 100644 --- a/libraries/cloudformation/lib/listStacks.ml +++ b/libraries/cloudformation/lib/listStacks.ml @@ -1,61 +1,56 @@ open Types open Aws - type input = ListStacksInput.t - type output = ListStacksOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "ListStacks" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-05-15"]); ("Action", ["ListStacks"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListStacksInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListStacksInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListStacksResponse" (snd xml)) - (Xml.member "ListStacksResult") - in + Util.option_bind (Xml.member "ListStacksResponse" (snd xml)) + (Xml.member "ListStacksResult") in try - Util.or_error - (Util.option_bind resp ListStacksOutput.parse) + Util.or_error (Util.option_bind resp ListStacksOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListStacksOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ListStacksOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListStacksOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListStacksOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/listStacks.mli b/libraries/cloudformation/lib/listStacks.mli index c58560c2b..0d1467032 100644 --- a/libraries/cloudformation/lib/listStacks.mli +++ b/libraries/cloudformation/lib/listStacks.mli @@ -1,10 +1,7 @@ open Types - type input = ListStacksInput.t - type output = ListStacksOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/setStackPolicy.ml b/libraries/cloudformation/lib/setStackPolicy.ml index 87d20b5e9..716f3ad46 100644 --- a/libraries/cloudformation/lib/setStackPolicy.ml +++ b/libraries/cloudformation/lib/setStackPolicy.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = SetStackPolicyInput.t - type output = unit - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "SetStackPolicy" ] ] + [("Version", ["2010-05-15"]); ("Action", ["SetStackPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetStackPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetStackPolicyInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/setStackPolicy.mli b/libraries/cloudformation/lib/setStackPolicy.mli index 1ad6f76f1..8f9884ac9 100644 --- a/libraries/cloudformation/lib/setStackPolicy.mli +++ b/libraries/cloudformation/lib/setStackPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = SetStackPolicyInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/signalResource.ml b/libraries/cloudformation/lib/signalResource.ml index e80b12830..a8b725476 100644 --- a/libraries/cloudformation/lib/signalResource.ml +++ b/libraries/cloudformation/lib/signalResource.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = SignalResourceInput.t - type output = unit - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "SignalResource" ] ] + [("Version", ["2010-05-15"]); ("Action", ["SignalResource"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SignalResourceInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SignalResourceInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/signalResource.mli b/libraries/cloudformation/lib/signalResource.mli index f04aeae20..88442ba09 100644 --- a/libraries/cloudformation/lib/signalResource.mli +++ b/libraries/cloudformation/lib/signalResource.mli @@ -1,10 +1,7 @@ open Types - type input = SignalResourceInput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/types.ml b/libraries/cloudformation/lib/types.ml index 1ec1335fd..6a396d3cf 100644 --- a/libraries/cloudformation/lib/types.ml +++ b/libraries/cloudformation/lib/types.ml @@ -1,2816 +1,2894 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module AllowedValues = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Capability = struct - type t = CAPABILITY_IAM - - let str_to_t = [ "CAPABILITY_IAM", CAPABILITY_IAM ] - - let t_to_str = [ CAPABILITY_IAM, "CAPABILITY_IAM" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Output = struct - type t = - { output_key : String.t option - ; output_value : String.t option - ; description : String.t option - } - - let make ?output_key ?output_value ?description () = - { output_key; output_value; description } - - let parse xml = - Some - { output_key = Util.option_bind (Xml.member "OutputKey" xml) String.parse - ; output_value = Util.option_bind (Xml.member "OutputValue" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse +module AllowedValues = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Capability = + struct + type t = + | CAPABILITY_IAM + let str_to_t = [("CAPABILITY_IAM", CAPABILITY_IAM)] + let t_to_str = [(CAPABILITY_IAM, "CAPABILITY_IAM")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Output = + struct + type t = + { + output_key: String.t option ; + output_value: String.t option ; + description: String.t option } + let make ?output_key ?output_value ?description () = + { output_key; output_value; description } + let parse xml = + Some + { + output_key = + (Util.option_bind (Xml.member "OutputKey" xml) String.parse); + output_value = + (Util.option_bind (Xml.member "OutputValue" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.output_value + (fun f -> Query.Pair ("OutputValue", (String.to_query f))); + Util.option_map v.output_key + (fun f -> Query.Pair ("OutputKey", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.output_value + (fun f -> ("output_value", (String.to_json f))); + Util.option_map v.output_key + (fun f -> ("output_key", (String.to_json f)))]) + let of_json j = + { + output_key = + (Util.option_map (Json.lookup j "output_key") String.of_json); + output_value = + (Util.option_map (Json.lookup j "output_value") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.output_value (fun f -> - Query.Pair ("OutputValue", String.to_query f)) - ; Util.option_map v.output_key (fun f -> - Query.Pair ("OutputKey", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.output_value (fun f -> "output_value", String.to_json f) - ; Util.option_map v.output_key (fun f -> "output_key", String.to_json f) - ]) - - let of_json j = - { output_key = Util.option_map (Json.lookup j "output_key") String.of_json - ; output_value = Util.option_map (Json.lookup j "output_value") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module Parameter = struct - type t = - { parameter_key : String.t option - ; parameter_value : String.t option - ; use_previous_value : Boolean.t option - } - - let make ?parameter_key ?parameter_value ?use_previous_value () = - { parameter_key; parameter_value; use_previous_value } - - let parse xml = - Some - { parameter_key = Util.option_bind (Xml.member "ParameterKey" xml) String.parse - ; parameter_value = Util.option_bind (Xml.member "ParameterValue" xml) String.parse - ; use_previous_value = - Util.option_bind (Xml.member "UsePreviousValue" xml) Boolean.parse + end +module Parameter = + struct + type t = + { + parameter_key: String.t option ; + parameter_value: String.t option ; + use_previous_value: Boolean.t option } + let make ?parameter_key ?parameter_value ?use_previous_value () = + { parameter_key; parameter_value; use_previous_value } + let parse xml = + Some + { + parameter_key = + (Util.option_bind (Xml.member "ParameterKey" xml) String.parse); + parameter_value = + (Util.option_bind (Xml.member "ParameterValue" xml) String.parse); + use_previous_value = + (Util.option_bind (Xml.member "UsePreviousValue" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.use_previous_value + (fun f -> Query.Pair ("UsePreviousValue", (Boolean.to_query f))); + Util.option_map v.parameter_value + (fun f -> Query.Pair ("ParameterValue", (String.to_query f))); + Util.option_map v.parameter_key + (fun f -> Query.Pair ("ParameterKey", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.use_previous_value + (fun f -> ("use_previous_value", (Boolean.to_json f))); + Util.option_map v.parameter_value + (fun f -> ("parameter_value", (String.to_json f))); + Util.option_map v.parameter_key + (fun f -> ("parameter_key", (String.to_json f)))]) + let of_json j = + { + parameter_key = + (Util.option_map (Json.lookup j "parameter_key") String.of_json); + parameter_value = + (Util.option_map (Json.lookup j "parameter_value") String.of_json); + use_previous_value = + (Util.option_map (Json.lookup j "use_previous_value") + Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.use_previous_value (fun f -> - Query.Pair ("UsePreviousValue", Boolean.to_query f)) - ; Util.option_map v.parameter_value (fun f -> - Query.Pair ("ParameterValue", String.to_query f)) - ; Util.option_map v.parameter_key (fun f -> - Query.Pair ("ParameterKey", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.use_previous_value (fun f -> - "use_previous_value", Boolean.to_json f) - ; Util.option_map v.parameter_value (fun f -> - "parameter_value", String.to_json f) - ; Util.option_map v.parameter_key (fun f -> "parameter_key", String.to_json f) - ]) - - let of_json j = - { parameter_key = Util.option_map (Json.lookup j "parameter_key") String.of_json - ; parameter_value = Util.option_map (Json.lookup j "parameter_value") String.of_json - ; use_previous_value = - Util.option_map (Json.lookup j "use_previous_value") Boolean.of_json - } -end - -module Tag = struct - type t = - { key : String.t option - ; value : String.t option - } - - let make ?key ?value () = { key; value } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse + end +module Tag = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module ResourceStatus = struct - type t = - | CREATE_IN_PROGRESS - | CREATE_FAILED - | CREATE_COMPLETE - | DELETE_IN_PROGRESS - | DELETE_FAILED - | DELETE_COMPLETE - | DELETE_SKIPPED - | UPDATE_IN_PROGRESS - | UPDATE_FAILED - | UPDATE_COMPLETE - - let str_to_t = - [ "UPDATE_COMPLETE", UPDATE_COMPLETE - ; "UPDATE_FAILED", UPDATE_FAILED - ; "UPDATE_IN_PROGRESS", UPDATE_IN_PROGRESS - ; "DELETE_SKIPPED", DELETE_SKIPPED - ; "DELETE_COMPLETE", DELETE_COMPLETE - ; "DELETE_FAILED", DELETE_FAILED - ; "DELETE_IN_PROGRESS", DELETE_IN_PROGRESS - ; "CREATE_COMPLETE", CREATE_COMPLETE - ; "CREATE_FAILED", CREATE_FAILED - ; "CREATE_IN_PROGRESS", CREATE_IN_PROGRESS - ] - - let t_to_str = - [ UPDATE_COMPLETE, "UPDATE_COMPLETE" - ; UPDATE_FAILED, "UPDATE_FAILED" - ; UPDATE_IN_PROGRESS, "UPDATE_IN_PROGRESS" - ; DELETE_SKIPPED, "DELETE_SKIPPED" - ; DELETE_COMPLETE, "DELETE_COMPLETE" - ; DELETE_FAILED, "DELETE_FAILED" - ; DELETE_IN_PROGRESS, "DELETE_IN_PROGRESS" - ; CREATE_COMPLETE, "CREATE_COMPLETE" - ; CREATE_FAILED, "CREATE_FAILED" - ; CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module StackStatus = struct - type t = - | CREATE_IN_PROGRESS - | CREATE_FAILED - | CREATE_COMPLETE - | ROLLBACK_IN_PROGRESS - | ROLLBACK_FAILED - | ROLLBACK_COMPLETE - | DELETE_IN_PROGRESS - | DELETE_FAILED - | DELETE_COMPLETE - | UPDATE_IN_PROGRESS - | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - | UPDATE_COMPLETE - | UPDATE_ROLLBACK_IN_PROGRESS - | UPDATE_ROLLBACK_FAILED - | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - | UPDATE_ROLLBACK_COMPLETE - - let str_to_t = - [ "UPDATE_ROLLBACK_COMPLETE", UPDATE_ROLLBACK_COMPLETE - ; ( "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS" - , UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS ) - ; "UPDATE_ROLLBACK_FAILED", UPDATE_ROLLBACK_FAILED - ; "UPDATE_ROLLBACK_IN_PROGRESS", UPDATE_ROLLBACK_IN_PROGRESS - ; "UPDATE_COMPLETE", UPDATE_COMPLETE - ; "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - ; "UPDATE_IN_PROGRESS", UPDATE_IN_PROGRESS - ; "DELETE_COMPLETE", DELETE_COMPLETE - ; "DELETE_FAILED", DELETE_FAILED - ; "DELETE_IN_PROGRESS", DELETE_IN_PROGRESS - ; "ROLLBACK_COMPLETE", ROLLBACK_COMPLETE - ; "ROLLBACK_FAILED", ROLLBACK_FAILED - ; "ROLLBACK_IN_PROGRESS", ROLLBACK_IN_PROGRESS - ; "CREATE_COMPLETE", CREATE_COMPLETE - ; "CREATE_FAILED", CREATE_FAILED - ; "CREATE_IN_PROGRESS", CREATE_IN_PROGRESS - ] - - let t_to_str = - [ UPDATE_ROLLBACK_COMPLETE, "UPDATE_ROLLBACK_COMPLETE" - ; ( UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - , "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS" ) - ; UPDATE_ROLLBACK_FAILED, "UPDATE_ROLLBACK_FAILED" - ; UPDATE_ROLLBACK_IN_PROGRESS, "UPDATE_ROLLBACK_IN_PROGRESS" - ; UPDATE_COMPLETE, "UPDATE_COMPLETE" - ; UPDATE_COMPLETE_CLEANUP_IN_PROGRESS, "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS" - ; UPDATE_IN_PROGRESS, "UPDATE_IN_PROGRESS" - ; DELETE_COMPLETE, "DELETE_COMPLETE" - ; DELETE_FAILED, "DELETE_FAILED" - ; DELETE_IN_PROGRESS, "DELETE_IN_PROGRESS" - ; ROLLBACK_COMPLETE, "ROLLBACK_COMPLETE" - ; ROLLBACK_FAILED, "ROLLBACK_FAILED" - ; ROLLBACK_IN_PROGRESS, "ROLLBACK_IN_PROGRESS" - ; CREATE_COMPLETE, "CREATE_COMPLETE" - ; CREATE_FAILED, "CREATE_FAILED" - ; CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ParameterConstraints = struct - type t = { allowed_values : AllowedValues.t } - - let make ?(allowed_values = []) () = { allowed_values } - - let parse xml = - Some - { allowed_values = - Util.of_option - [] - (Util.option_bind (Xml.member "AllowedValues" xml) AllowedValues.parse) + end +module ResourceStatus = + struct + type t = + | CREATE_IN_PROGRESS + | CREATE_FAILED + | CREATE_COMPLETE + | DELETE_IN_PROGRESS + | DELETE_FAILED + | DELETE_COMPLETE + | DELETE_SKIPPED + | UPDATE_IN_PROGRESS + | UPDATE_FAILED + | UPDATE_COMPLETE + let str_to_t = + [("UPDATE_COMPLETE", UPDATE_COMPLETE); + ("UPDATE_FAILED", UPDATE_FAILED); + ("UPDATE_IN_PROGRESS", UPDATE_IN_PROGRESS); + ("DELETE_SKIPPED", DELETE_SKIPPED); + ("DELETE_COMPLETE", DELETE_COMPLETE); + ("DELETE_FAILED", DELETE_FAILED); + ("DELETE_IN_PROGRESS", DELETE_IN_PROGRESS); + ("CREATE_COMPLETE", CREATE_COMPLETE); + ("CREATE_FAILED", CREATE_FAILED); + ("CREATE_IN_PROGRESS", CREATE_IN_PROGRESS)] + let t_to_str = + [(UPDATE_COMPLETE, "UPDATE_COMPLETE"); + (UPDATE_FAILED, "UPDATE_FAILED"); + (UPDATE_IN_PROGRESS, "UPDATE_IN_PROGRESS"); + (DELETE_SKIPPED, "DELETE_SKIPPED"); + (DELETE_COMPLETE, "DELETE_COMPLETE"); + (DELETE_FAILED, "DELETE_FAILED"); + (DELETE_IN_PROGRESS, "DELETE_IN_PROGRESS"); + (CREATE_COMPLETE, "CREATE_COMPLETE"); + (CREATE_FAILED, "CREATE_FAILED"); + (CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StackStatus = + struct + type t = + | CREATE_IN_PROGRESS + | CREATE_FAILED + | CREATE_COMPLETE + | ROLLBACK_IN_PROGRESS + | ROLLBACK_FAILED + | ROLLBACK_COMPLETE + | DELETE_IN_PROGRESS + | DELETE_FAILED + | DELETE_COMPLETE + | UPDATE_IN_PROGRESS + | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS + | UPDATE_COMPLETE + | UPDATE_ROLLBACK_IN_PROGRESS + | UPDATE_ROLLBACK_FAILED + | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS + | UPDATE_ROLLBACK_COMPLETE + let str_to_t = + [("UPDATE_ROLLBACK_COMPLETE", UPDATE_ROLLBACK_COMPLETE); + ("UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS", + UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS); + ("UPDATE_ROLLBACK_FAILED", UPDATE_ROLLBACK_FAILED); + ("UPDATE_ROLLBACK_IN_PROGRESS", UPDATE_ROLLBACK_IN_PROGRESS); + ("UPDATE_COMPLETE", UPDATE_COMPLETE); + ("UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", + UPDATE_COMPLETE_CLEANUP_IN_PROGRESS); + ("UPDATE_IN_PROGRESS", UPDATE_IN_PROGRESS); + ("DELETE_COMPLETE", DELETE_COMPLETE); + ("DELETE_FAILED", DELETE_FAILED); + ("DELETE_IN_PROGRESS", DELETE_IN_PROGRESS); + ("ROLLBACK_COMPLETE", ROLLBACK_COMPLETE); + ("ROLLBACK_FAILED", ROLLBACK_FAILED); + ("ROLLBACK_IN_PROGRESS", ROLLBACK_IN_PROGRESS); + ("CREATE_COMPLETE", CREATE_COMPLETE); + ("CREATE_FAILED", CREATE_FAILED); + ("CREATE_IN_PROGRESS", CREATE_IN_PROGRESS)] + let t_to_str = + [(UPDATE_ROLLBACK_COMPLETE, "UPDATE_ROLLBACK_COMPLETE"); + (UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS, + "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"); + (UPDATE_ROLLBACK_FAILED, "UPDATE_ROLLBACK_FAILED"); + (UPDATE_ROLLBACK_IN_PROGRESS, "UPDATE_ROLLBACK_IN_PROGRESS"); + (UPDATE_COMPLETE, "UPDATE_COMPLETE"); + (UPDATE_COMPLETE_CLEANUP_IN_PROGRESS, + "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"); + (UPDATE_IN_PROGRESS, "UPDATE_IN_PROGRESS"); + (DELETE_COMPLETE, "DELETE_COMPLETE"); + (DELETE_FAILED, "DELETE_FAILED"); + (DELETE_IN_PROGRESS, "DELETE_IN_PROGRESS"); + (ROLLBACK_COMPLETE, "ROLLBACK_COMPLETE"); + (ROLLBACK_FAILED, "ROLLBACK_FAILED"); + (ROLLBACK_IN_PROGRESS, "ROLLBACK_IN_PROGRESS"); + (CREATE_COMPLETE, "CREATE_COMPLETE"); + (CREATE_FAILED, "CREATE_FAILED"); + (CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ParameterConstraints = + struct + type t = { + allowed_values: AllowedValues.t } + let make ?(allowed_values= []) () = { allowed_values } + let parse xml = + Some + { + allowed_values = + (Util.of_option [] + (Util.option_bind (Xml.member "AllowedValues" xml) + AllowedValues.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AllowedValues.member", + (AllowedValues.to_query v.allowed_values)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("allowed_values", (AllowedValues.to_json v.allowed_values))]) + let of_json j = + { + allowed_values = + (AllowedValues.of_json + (Util.of_option_exn (Json.lookup j "allowed_values"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("AllowedValues.member", AllowedValues.to_query v.allowed_values)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("allowed_values", AllowedValues.to_json v.allowed_values) ]) - - let of_json j = - { allowed_values = - AllowedValues.of_json (Util.of_option_exn (Json.lookup j "allowed_values")) - } -end - -module Capabilities = struct - type t = Capability.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Capability.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Capability.to_query v - - let to_json v = `List (List.map Capability.to_json v) - - let of_json j = Json.to_list Capability.of_json j -end - -module NotificationARNs = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Outputs = struct - type t = Output.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Output.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Output.to_query v - - let to_json v = `List (List.map Output.to_json v) - - let of_json j = Json.to_list Output.of_json j -end - -module Parameters = struct - type t = Parameter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Parameter.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Parameter.to_query v - - let to_json v = `List (List.map Parameter.to_json v) - - let of_json j = Json.to_list Parameter.of_json j -end - -module Tags = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module StackResourceSummary = struct - type t = - { logical_resource_id : String.t - ; physical_resource_id : String.t option - ; resource_type : String.t - ; last_updated_timestamp : DateTime.t - ; resource_status : ResourceStatus.t - ; resource_status_reason : String.t option - } - - let make - ~logical_resource_id - ?physical_resource_id - ~resource_type - ~last_updated_timestamp - ~resource_status - ?resource_status_reason - () = - { logical_resource_id - ; physical_resource_id - ; resource_type - ; last_updated_timestamp - ; resource_status - ; resource_status_reason - } - - let parse xml = - Some - { logical_resource_id = - Xml.required - "LogicalResourceId" - (Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse) - ; physical_resource_id = - Util.option_bind (Xml.member "PhysicalResourceId" xml) String.parse - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) String.parse) - ; last_updated_timestamp = - Xml.required - "LastUpdatedTimestamp" - (Util.option_bind (Xml.member "LastUpdatedTimestamp" xml) DateTime.parse) - ; resource_status = - Xml.required - "ResourceStatus" - (Util.option_bind (Xml.member "ResourceStatus" xml) ResourceStatus.parse) - ; resource_status_reason = - Util.option_bind (Xml.member "ResourceStatusReason" xml) String.parse + end +module Capabilities = + struct + type t = Capability.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Capability.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Capability.to_query v + let to_json v = `List (List.map Capability.to_json v) + let of_json j = Json.to_list Capability.of_json j + end +module NotificationARNs = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Outputs = + struct + type t = Output.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Output.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Output.to_query v + let to_json v = `List (List.map Output.to_json v) + let of_json j = Json.to_list Output.of_json j + end +module Parameters = + struct + type t = Parameter.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Parameter.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Parameter.to_query v + let to_json v = `List (List.map Parameter.to_json v) + let of_json j = Json.to_list Parameter.of_json j + end +module Tags = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module StackResourceSummary = + struct + type t = + { + logical_resource_id: String.t ; + physical_resource_id: String.t option ; + resource_type: String.t ; + last_updated_timestamp: DateTime.t ; + resource_status: ResourceStatus.t ; + resource_status_reason: String.t option } + let make ~logical_resource_id ?physical_resource_id ~resource_type + ~last_updated_timestamp ~resource_status ?resource_status_reason () + = + { + logical_resource_id; + physical_resource_id; + resource_type; + last_updated_timestamp; + resource_status; + resource_status_reason } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.resource_status_reason (fun f -> - Query.Pair ("ResourceStatusReason", String.to_query f)) - ; Some (Query.Pair ("ResourceStatus", ResourceStatus.to_query v.resource_status)) - ; Some + let parse xml = + Some + { + logical_resource_id = + (Xml.required "LogicalResourceId" + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse)); + physical_resource_id = + (Util.option_bind (Xml.member "PhysicalResourceId" xml) + String.parse); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) String.parse)); + last_updated_timestamp = + (Xml.required "LastUpdatedTimestamp" + (Util.option_bind (Xml.member "LastUpdatedTimestamp" xml) + DateTime.parse)); + resource_status = + (Xml.required "ResourceStatus" + (Util.option_bind (Xml.member "ResourceStatus" xml) + ResourceStatus.parse)); + resource_status_reason = + (Util.option_bind (Xml.member "ResourceStatusReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.resource_status_reason + (fun f -> + Query.Pair ("ResourceStatusReason", (String.to_query f))); + Some (Query.Pair - ("LastUpdatedTimestamp", DateTime.to_query v.last_updated_timestamp)) - ; Some (Query.Pair ("ResourceType", String.to_query v.resource_type)) - ; Util.option_map v.physical_resource_id (fun f -> - Query.Pair ("PhysicalResourceId", String.to_query f)) - ; Some (Query.Pair ("LogicalResourceId", String.to_query v.logical_resource_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.resource_status_reason (fun f -> - "resource_status_reason", String.to_json f) - ; Some ("resource_status", ResourceStatus.to_json v.resource_status) - ; Some ("last_updated_timestamp", DateTime.to_json v.last_updated_timestamp) - ; Some ("resource_type", String.to_json v.resource_type) - ; Util.option_map v.physical_resource_id (fun f -> - "physical_resource_id", String.to_json f) - ; Some ("logical_resource_id", String.to_json v.logical_resource_id) - ]) - - let of_json j = - { logical_resource_id = - String.of_json (Util.of_option_exn (Json.lookup j "logical_resource_id")) - ; physical_resource_id = - Util.option_map (Json.lookup j "physical_resource_id") String.of_json - ; resource_type = String.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; last_updated_timestamp = - DateTime.of_json (Util.of_option_exn (Json.lookup j "last_updated_timestamp")) - ; resource_status = - ResourceStatus.of_json (Util.of_option_exn (Json.lookup j "resource_status")) - ; resource_status_reason = - Util.option_map (Json.lookup j "resource_status_reason") String.of_json - } -end - -module StackSummary = struct - type t = - { stack_id : String.t option - ; stack_name : String.t - ; template_description : String.t option - ; creation_time : DateTime.t - ; last_updated_time : DateTime.t option - ; deletion_time : DateTime.t option - ; stack_status : StackStatus.t - ; stack_status_reason : String.t option - } - - let make - ?stack_id - ~stack_name - ?template_description - ~creation_time - ?last_updated_time - ?deletion_time - ~stack_status - ?stack_status_reason - () = - { stack_id - ; stack_name - ; template_description - ; creation_time - ; last_updated_time - ; deletion_time - ; stack_status - ; stack_status_reason - } - - let parse xml = - Some - { stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse - ; stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; template_description = - Util.option_bind (Xml.member "TemplateDescription" xml) String.parse - ; creation_time = - Xml.required - "CreationTime" - (Util.option_bind (Xml.member "CreationTime" xml) DateTime.parse) - ; last_updated_time = - Util.option_bind (Xml.member "LastUpdatedTime" xml) DateTime.parse - ; deletion_time = Util.option_bind (Xml.member "DeletionTime" xml) DateTime.parse - ; stack_status = - Xml.required - "StackStatus" - (Util.option_bind (Xml.member "StackStatus" xml) StackStatus.parse) - ; stack_status_reason = - Util.option_bind (Xml.member "StackStatusReason" xml) String.parse + ("ResourceStatus", + (ResourceStatus.to_query v.resource_status))); + Some + (Query.Pair + ("LastUpdatedTimestamp", + (DateTime.to_query v.last_updated_timestamp))); + Some + (Query.Pair ("ResourceType", (String.to_query v.resource_type))); + Util.option_map v.physical_resource_id + (fun f -> Query.Pair ("PhysicalResourceId", (String.to_query f))); + Some + (Query.Pair + ("LogicalResourceId", + (String.to_query v.logical_resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.resource_status_reason + (fun f -> ("resource_status_reason", (String.to_json f))); + Some + ("resource_status", (ResourceStatus.to_json v.resource_status)); + Some + ("last_updated_timestamp", + (DateTime.to_json v.last_updated_timestamp)); + Some ("resource_type", (String.to_json v.resource_type)); + Util.option_map v.physical_resource_id + (fun f -> ("physical_resource_id", (String.to_json f))); + Some + ("logical_resource_id", (String.to_json v.logical_resource_id))]) + let of_json j = + { + logical_resource_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "logical_resource_id"))); + physical_resource_id = + (Util.option_map (Json.lookup j "physical_resource_id") + String.of_json); + resource_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + last_updated_timestamp = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "last_updated_timestamp"))); + resource_status = + (ResourceStatus.of_json + (Util.of_option_exn (Json.lookup j "resource_status"))); + resource_status_reason = + (Util.option_map (Json.lookup j "resource_status_reason") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_status_reason (fun f -> - Query.Pair ("StackStatusReason", String.to_query f)) - ; Some (Query.Pair ("StackStatus", StackStatus.to_query v.stack_status)) - ; Util.option_map v.deletion_time (fun f -> - Query.Pair ("DeletionTime", DateTime.to_query f)) - ; Util.option_map v.last_updated_time (fun f -> - Query.Pair ("LastUpdatedTime", DateTime.to_query f)) - ; Some (Query.Pair ("CreationTime", DateTime.to_query v.creation_time)) - ; Util.option_map v.template_description (fun f -> - Query.Pair ("TemplateDescription", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ; Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_status_reason (fun f -> - "stack_status_reason", String.to_json f) - ; Some ("stack_status", StackStatus.to_json v.stack_status) - ; Util.option_map v.deletion_time (fun f -> "deletion_time", DateTime.to_json f) - ; Util.option_map v.last_updated_time (fun f -> - "last_updated_time", DateTime.to_json f) - ; Some ("creation_time", DateTime.to_json v.creation_time) - ; Util.option_map v.template_description (fun f -> - "template_description", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ; Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) - ]) - - let of_json j = - { stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json - ; stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; template_description = - Util.option_map (Json.lookup j "template_description") String.of_json - ; creation_time = - DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_time")) - ; last_updated_time = - Util.option_map (Json.lookup j "last_updated_time") DateTime.of_json - ; deletion_time = Util.option_map (Json.lookup j "deletion_time") DateTime.of_json - ; stack_status = - StackStatus.of_json (Util.of_option_exn (Json.lookup j "stack_status")) - ; stack_status_reason = - Util.option_map (Json.lookup j "stack_status_reason") String.of_json - } -end - -module ParameterDeclaration = struct - type t = - { parameter_key : String.t option - ; default_value : String.t option - ; parameter_type : String.t option - ; no_echo : Boolean.t option - ; description : String.t option - ; parameter_constraints : ParameterConstraints.t option - } - - let make - ?parameter_key - ?default_value - ?parameter_type - ?no_echo - ?description - ?parameter_constraints - () = - { parameter_key - ; default_value - ; parameter_type - ; no_echo - ; description - ; parameter_constraints - } - - let parse xml = - Some - { parameter_key = Util.option_bind (Xml.member "ParameterKey" xml) String.parse - ; default_value = Util.option_bind (Xml.member "DefaultValue" xml) String.parse - ; parameter_type = Util.option_bind (Xml.member "ParameterType" xml) String.parse - ; no_echo = Util.option_bind (Xml.member "NoEcho" xml) Boolean.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; parameter_constraints = - Util.option_bind - (Xml.member "ParameterConstraints" xml) - ParameterConstraints.parse + end +module StackSummary = + struct + type t = + { + stack_id: String.t option ; + stack_name: String.t ; + template_description: String.t option ; + creation_time: DateTime.t ; + last_updated_time: DateTime.t option ; + deletion_time: DateTime.t option ; + stack_status: StackStatus.t ; + stack_status_reason: String.t option } + let make ?stack_id ~stack_name ?template_description ~creation_time + ?last_updated_time ?deletion_time ~stack_status ?stack_status_reason + () = + { + stack_id; + stack_name; + template_description; + creation_time; + last_updated_time; + deletion_time; + stack_status; + stack_status_reason } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.parameter_constraints (fun f -> - Query.Pair ("ParameterConstraints", ParameterConstraints.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.no_echo (fun f -> Query.Pair ("NoEcho", Boolean.to_query f)) - ; Util.option_map v.parameter_type (fun f -> - Query.Pair ("ParameterType", String.to_query f)) - ; Util.option_map v.default_value (fun f -> - Query.Pair ("DefaultValue", String.to_query f)) - ; Util.option_map v.parameter_key (fun f -> - Query.Pair ("ParameterKey", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.parameter_constraints (fun f -> - "parameter_constraints", ParameterConstraints.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.no_echo (fun f -> "no_echo", Boolean.to_json f) - ; Util.option_map v.parameter_type (fun f -> "parameter_type", String.to_json f) - ; Util.option_map v.default_value (fun f -> "default_value", String.to_json f) - ; Util.option_map v.parameter_key (fun f -> "parameter_key", String.to_json f) - ]) - - let of_json j = - { parameter_key = Util.option_map (Json.lookup j "parameter_key") String.of_json - ; default_value = Util.option_map (Json.lookup j "default_value") String.of_json - ; parameter_type = Util.option_map (Json.lookup j "parameter_type") String.of_json - ; no_echo = Util.option_map (Json.lookup j "no_echo") Boolean.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; parameter_constraints = - Util.option_map - (Json.lookup j "parameter_constraints") - ParameterConstraints.of_json - } -end - -module TemplateParameter = struct - type t = - { parameter_key : String.t option - ; default_value : String.t option - ; no_echo : Boolean.t option - ; description : String.t option - } - - let make ?parameter_key ?default_value ?no_echo ?description () = - { parameter_key; default_value; no_echo; description } - - let parse xml = - Some - { parameter_key = Util.option_bind (Xml.member "ParameterKey" xml) String.parse - ; default_value = Util.option_bind (Xml.member "DefaultValue" xml) String.parse - ; no_echo = Util.option_bind (Xml.member "NoEcho" xml) Boolean.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse + let parse xml = + Some + { + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse); + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + template_description = + (Util.option_bind (Xml.member "TemplateDescription" xml) + String.parse); + creation_time = + (Xml.required "CreationTime" + (Util.option_bind (Xml.member "CreationTime" xml) + DateTime.parse)); + last_updated_time = + (Util.option_bind (Xml.member "LastUpdatedTime" xml) + DateTime.parse); + deletion_time = + (Util.option_bind (Xml.member "DeletionTime" xml) DateTime.parse); + stack_status = + (Xml.required "StackStatus" + (Util.option_bind (Xml.member "StackStatus" xml) + StackStatus.parse)); + stack_status_reason = + (Util.option_bind (Xml.member "StackStatusReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_status_reason + (fun f -> Query.Pair ("StackStatusReason", (String.to_query f))); + Some + (Query.Pair + ("StackStatus", (StackStatus.to_query v.stack_status))); + Util.option_map v.deletion_time + (fun f -> Query.Pair ("DeletionTime", (DateTime.to_query f))); + Util.option_map v.last_updated_time + (fun f -> Query.Pair ("LastUpdatedTime", (DateTime.to_query f))); + Some + (Query.Pair + ("CreationTime", (DateTime.to_query v.creation_time))); + Util.option_map v.template_description + (fun f -> + Query.Pair ("TemplateDescription", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name))); + Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_status_reason + (fun f -> ("stack_status_reason", (String.to_json f))); + Some ("stack_status", (StackStatus.to_json v.stack_status)); + Util.option_map v.deletion_time + (fun f -> ("deletion_time", (DateTime.to_json f))); + Util.option_map v.last_updated_time + (fun f -> ("last_updated_time", (DateTime.to_json f))); + Some ("creation_time", (DateTime.to_json v.creation_time)); + Util.option_map v.template_description + (fun f -> ("template_description", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name)); + Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f)))]) + let of_json j = + { + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json); + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + template_description = + (Util.option_map (Json.lookup j "template_description") + String.of_json); + creation_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_time"))); + last_updated_time = + (Util.option_map (Json.lookup j "last_updated_time") + DateTime.of_json); + deletion_time = + (Util.option_map (Json.lookup j "deletion_time") DateTime.of_json); + stack_status = + (StackStatus.of_json + (Util.of_option_exn (Json.lookup j "stack_status"))); + stack_status_reason = + (Util.option_map (Json.lookup j "stack_status_reason") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.no_echo (fun f -> Query.Pair ("NoEcho", Boolean.to_query f)) - ; Util.option_map v.default_value (fun f -> - Query.Pair ("DefaultValue", String.to_query f)) - ; Util.option_map v.parameter_key (fun f -> - Query.Pair ("ParameterKey", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.no_echo (fun f -> "no_echo", Boolean.to_json f) - ; Util.option_map v.default_value (fun f -> "default_value", String.to_json f) - ; Util.option_map v.parameter_key (fun f -> "parameter_key", String.to_json f) - ]) - - let of_json j = - { parameter_key = Util.option_map (Json.lookup j "parameter_key") String.of_json - ; default_value = Util.option_map (Json.lookup j "default_value") String.of_json - ; no_echo = Util.option_map (Json.lookup j "no_echo") Boolean.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module Stack = struct - type t = - { stack_id : String.t option - ; stack_name : String.t - ; description : String.t option - ; parameters : Parameters.t - ; creation_time : DateTime.t - ; last_updated_time : DateTime.t option - ; stack_status : StackStatus.t - ; stack_status_reason : String.t option - ; disable_rollback : Boolean.t option - ; notification_a_r_ns : NotificationARNs.t - ; timeout_in_minutes : Integer.t option - ; capabilities : Capabilities.t - ; outputs : Outputs.t - ; tags : Tags.t - } - - let make - ?stack_id - ~stack_name - ?description - ?(parameters = []) - ~creation_time - ?last_updated_time - ~stack_status - ?stack_status_reason - ?disable_rollback - ?(notification_a_r_ns = []) - ?timeout_in_minutes - ?(capabilities = []) - ?(outputs = []) - ?(tags = []) - () = - { stack_id - ; stack_name - ; description - ; parameters - ; creation_time - ; last_updated_time - ; stack_status - ; stack_status_reason - ; disable_rollback - ; notification_a_r_ns - ; timeout_in_minutes - ; capabilities - ; outputs - ; tags - } - - let parse xml = - Some - { stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse - ; stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) Parameters.parse) - ; creation_time = - Xml.required - "CreationTime" - (Util.option_bind (Xml.member "CreationTime" xml) DateTime.parse) - ; last_updated_time = - Util.option_bind (Xml.member "LastUpdatedTime" xml) DateTime.parse - ; stack_status = - Xml.required - "StackStatus" - (Util.option_bind (Xml.member "StackStatus" xml) StackStatus.parse) - ; stack_status_reason = - Util.option_bind (Xml.member "StackStatusReason" xml) String.parse - ; disable_rollback = - Util.option_bind (Xml.member "DisableRollback" xml) Boolean.parse - ; notification_a_r_ns = - Util.of_option - [] - (Util.option_bind (Xml.member "NotificationARNs" xml) NotificationARNs.parse) - ; timeout_in_minutes = - Util.option_bind (Xml.member "TimeoutInMinutes" xml) Integer.parse - ; capabilities = - Util.of_option - [] - (Util.option_bind (Xml.member "Capabilities" xml) Capabilities.parse) - ; outputs = - Util.of_option [] (Util.option_bind (Xml.member "Outputs" xml) Outputs.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) Tags.parse) + end +module ParameterDeclaration = + struct + type t = + { + parameter_key: String.t option ; + default_value: String.t option ; + parameter_type: String.t option ; + no_echo: Boolean.t option ; + description: String.t option ; + parameter_constraints: ParameterConstraints.t option } + let make ?parameter_key ?default_value ?parameter_type ?no_echo + ?description ?parameter_constraints () = + { + parameter_key; + default_value; + parameter_type; + no_echo; + description; + parameter_constraints } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", Tags.to_query v.tags)) - ; Some (Query.Pair ("Outputs.member", Outputs.to_query v.outputs)) - ; Some (Query.Pair ("Capabilities.member", Capabilities.to_query v.capabilities)) - ; Util.option_map v.timeout_in_minutes (fun f -> - Query.Pair ("TimeoutInMinutes", Integer.to_query f)) - ; Some - (Query.Pair - ( "NotificationARNs.member" - , NotificationARNs.to_query v.notification_a_r_ns )) - ; Util.option_map v.disable_rollback (fun f -> - Query.Pair ("DisableRollback", Boolean.to_query f)) - ; Util.option_map v.stack_status_reason (fun f -> - Query.Pair ("StackStatusReason", String.to_query f)) - ; Some (Query.Pair ("StackStatus", StackStatus.to_query v.stack_status)) - ; Util.option_map v.last_updated_time (fun f -> - Query.Pair ("LastUpdatedTime", DateTime.to_query f)) - ; Some (Query.Pair ("CreationTime", DateTime.to_query v.creation_time)) - ; Some (Query.Pair ("Parameters.member", Parameters.to_query v.parameters)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ; Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", Tags.to_json v.tags) - ; Some ("outputs", Outputs.to_json v.outputs) - ; Some ("capabilities", Capabilities.to_json v.capabilities) - ; Util.option_map v.timeout_in_minutes (fun f -> - "timeout_in_minutes", Integer.to_json f) - ; Some ("notification_a_r_ns", NotificationARNs.to_json v.notification_a_r_ns) - ; Util.option_map v.disable_rollback (fun f -> - "disable_rollback", Boolean.to_json f) - ; Util.option_map v.stack_status_reason (fun f -> - "stack_status_reason", String.to_json f) - ; Some ("stack_status", StackStatus.to_json v.stack_status) - ; Util.option_map v.last_updated_time (fun f -> - "last_updated_time", DateTime.to_json f) - ; Some ("creation_time", DateTime.to_json v.creation_time) - ; Some ("parameters", Parameters.to_json v.parameters) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ; Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) - ]) - - let of_json j = - { stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json - ; stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; parameters = Parameters.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; creation_time = - DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_time")) - ; last_updated_time = - Util.option_map (Json.lookup j "last_updated_time") DateTime.of_json - ; stack_status = - StackStatus.of_json (Util.of_option_exn (Json.lookup j "stack_status")) - ; stack_status_reason = - Util.option_map (Json.lookup j "stack_status_reason") String.of_json - ; disable_rollback = - Util.option_map (Json.lookup j "disable_rollback") Boolean.of_json - ; notification_a_r_ns = - NotificationARNs.of_json - (Util.of_option_exn (Json.lookup j "notification_a_r_ns")) - ; timeout_in_minutes = - Util.option_map (Json.lookup j "timeout_in_minutes") Integer.of_json - ; capabilities = - Capabilities.of_json (Util.of_option_exn (Json.lookup j "capabilities")) - ; outputs = Outputs.of_json (Util.of_option_exn (Json.lookup j "outputs")) - ; tags = Tags.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module StackEvent = struct - type t = - { stack_id : String.t - ; event_id : String.t - ; stack_name : String.t - ; logical_resource_id : String.t option - ; physical_resource_id : String.t option - ; resource_type : String.t option - ; timestamp : DateTime.t - ; resource_status : ResourceStatus.t option - ; resource_status_reason : String.t option - ; resource_properties : String.t option - } - - let make - ~stack_id - ~event_id - ~stack_name - ?logical_resource_id - ?physical_resource_id - ?resource_type - ~timestamp - ?resource_status - ?resource_status_reason - ?resource_properties - () = - { stack_id - ; event_id - ; stack_name - ; logical_resource_id - ; physical_resource_id - ; resource_type - ; timestamp - ; resource_status - ; resource_status_reason - ; resource_properties - } - - let parse xml = - Some - { stack_id = - Xml.required - "StackId" - (Util.option_bind (Xml.member "StackId" xml) String.parse) - ; event_id = - Xml.required - "EventId" - (Util.option_bind (Xml.member "EventId" xml) String.parse) - ; stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; logical_resource_id = - Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse - ; physical_resource_id = - Util.option_bind (Xml.member "PhysicalResourceId" xml) String.parse - ; resource_type = Util.option_bind (Xml.member "ResourceType" xml) String.parse - ; timestamp = - Xml.required - "Timestamp" - (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse) - ; resource_status = - Util.option_bind (Xml.member "ResourceStatus" xml) ResourceStatus.parse - ; resource_status_reason = - Util.option_bind (Xml.member "ResourceStatusReason" xml) String.parse - ; resource_properties = - Util.option_bind (Xml.member "ResourceProperties" xml) String.parse + let parse xml = + Some + { + parameter_key = + (Util.option_bind (Xml.member "ParameterKey" xml) String.parse); + default_value = + (Util.option_bind (Xml.member "DefaultValue" xml) String.parse); + parameter_type = + (Util.option_bind (Xml.member "ParameterType" xml) String.parse); + no_echo = + (Util.option_bind (Xml.member "NoEcho" xml) Boolean.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + parameter_constraints = + (Util.option_bind (Xml.member "ParameterConstraints" xml) + ParameterConstraints.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.parameter_constraints + (fun f -> + Query.Pair + ("ParameterConstraints", + (ParameterConstraints.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.no_echo + (fun f -> Query.Pair ("NoEcho", (Boolean.to_query f))); + Util.option_map v.parameter_type + (fun f -> Query.Pair ("ParameterType", (String.to_query f))); + Util.option_map v.default_value + (fun f -> Query.Pair ("DefaultValue", (String.to_query f))); + Util.option_map v.parameter_key + (fun f -> Query.Pair ("ParameterKey", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.parameter_constraints + (fun f -> + ("parameter_constraints", (ParameterConstraints.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.no_echo + (fun f -> ("no_echo", (Boolean.to_json f))); + Util.option_map v.parameter_type + (fun f -> ("parameter_type", (String.to_json f))); + Util.option_map v.default_value + (fun f -> ("default_value", (String.to_json f))); + Util.option_map v.parameter_key + (fun f -> ("parameter_key", (String.to_json f)))]) + let of_json j = + { + parameter_key = + (Util.option_map (Json.lookup j "parameter_key") String.of_json); + default_value = + (Util.option_map (Json.lookup j "default_value") String.of_json); + parameter_type = + (Util.option_map (Json.lookup j "parameter_type") String.of_json); + no_echo = (Util.option_map (Json.lookup j "no_echo") Boolean.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + parameter_constraints = + (Util.option_map (Json.lookup j "parameter_constraints") + ParameterConstraints.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.resource_properties (fun f -> - Query.Pair ("ResourceProperties", String.to_query f)) - ; Util.option_map v.resource_status_reason (fun f -> - Query.Pair ("ResourceStatusReason", String.to_query f)) - ; Util.option_map v.resource_status (fun f -> - Query.Pair ("ResourceStatus", ResourceStatus.to_query f)) - ; Some (Query.Pair ("Timestamp", DateTime.to_query v.timestamp)) - ; Util.option_map v.resource_type (fun f -> - Query.Pair ("ResourceType", String.to_query f)) - ; Util.option_map v.physical_resource_id (fun f -> - Query.Pair ("PhysicalResourceId", String.to_query f)) - ; Util.option_map v.logical_resource_id (fun f -> - Query.Pair ("LogicalResourceId", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ; Some (Query.Pair ("EventId", String.to_query v.event_id)) - ; Some (Query.Pair ("StackId", String.to_query v.stack_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.resource_properties (fun f -> - "resource_properties", String.to_json f) - ; Util.option_map v.resource_status_reason (fun f -> - "resource_status_reason", String.to_json f) - ; Util.option_map v.resource_status (fun f -> - "resource_status", ResourceStatus.to_json f) - ; Some ("timestamp", DateTime.to_json v.timestamp) - ; Util.option_map v.resource_type (fun f -> "resource_type", String.to_json f) - ; Util.option_map v.physical_resource_id (fun f -> - "physical_resource_id", String.to_json f) - ; Util.option_map v.logical_resource_id (fun f -> - "logical_resource_id", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ; Some ("event_id", String.to_json v.event_id) - ; Some ("stack_id", String.to_json v.stack_id) - ]) - - let of_json j = - { stack_id = String.of_json (Util.of_option_exn (Json.lookup j "stack_id")) - ; event_id = String.of_json (Util.of_option_exn (Json.lookup j "event_id")) - ; stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; logical_resource_id = - Util.option_map (Json.lookup j "logical_resource_id") String.of_json - ; physical_resource_id = - Util.option_map (Json.lookup j "physical_resource_id") String.of_json - ; resource_type = Util.option_map (Json.lookup j "resource_type") String.of_json - ; timestamp = DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp")) - ; resource_status = - Util.option_map (Json.lookup j "resource_status") ResourceStatus.of_json - ; resource_status_reason = - Util.option_map (Json.lookup j "resource_status_reason") String.of_json - ; resource_properties = - Util.option_map (Json.lookup j "resource_properties") String.of_json - } -end - -module StackResource = struct - type t = - { stack_name : String.t option - ; stack_id : String.t option - ; logical_resource_id : String.t - ; physical_resource_id : String.t option - ; resource_type : String.t - ; timestamp : DateTime.t - ; resource_status : ResourceStatus.t - ; resource_status_reason : String.t option - ; description : String.t option - } - - let make - ?stack_name - ?stack_id - ~logical_resource_id - ?physical_resource_id - ~resource_type - ~timestamp - ~resource_status - ?resource_status_reason - ?description - () = - { stack_name - ; stack_id - ; logical_resource_id - ; physical_resource_id - ; resource_type - ; timestamp - ; resource_status - ; resource_status_reason - ; description - } - - let parse xml = - Some - { stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse - ; stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse - ; logical_resource_id = - Xml.required - "LogicalResourceId" - (Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse) - ; physical_resource_id = - Util.option_bind (Xml.member "PhysicalResourceId" xml) String.parse - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) String.parse) - ; timestamp = - Xml.required - "Timestamp" - (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse) - ; resource_status = - Xml.required - "ResourceStatus" - (Util.option_bind (Xml.member "ResourceStatus" xml) ResourceStatus.parse) - ; resource_status_reason = - Util.option_bind (Xml.member "ResourceStatusReason" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse + end +module TemplateParameter = + struct + type t = + { + parameter_key: String.t option ; + default_value: String.t option ; + no_echo: Boolean.t option ; + description: String.t option } + let make ?parameter_key ?default_value ?no_echo ?description () = + { parameter_key; default_value; no_echo; description } + let parse xml = + Some + { + parameter_key = + (Util.option_bind (Xml.member "ParameterKey" xml) String.parse); + default_value = + (Util.option_bind (Xml.member "DefaultValue" xml) String.parse); + no_echo = + (Util.option_bind (Xml.member "NoEcho" xml) Boolean.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.no_echo + (fun f -> Query.Pair ("NoEcho", (Boolean.to_query f))); + Util.option_map v.default_value + (fun f -> Query.Pair ("DefaultValue", (String.to_query f))); + Util.option_map v.parameter_key + (fun f -> Query.Pair ("ParameterKey", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.no_echo + (fun f -> ("no_echo", (Boolean.to_json f))); + Util.option_map v.default_value + (fun f -> ("default_value", (String.to_json f))); + Util.option_map v.parameter_key + (fun f -> ("parameter_key", (String.to_json f)))]) + let of_json j = + { + parameter_key = + (Util.option_map (Json.lookup j "parameter_key") String.of_json); + default_value = + (Util.option_map (Json.lookup j "default_value") String.of_json); + no_echo = (Util.option_map (Json.lookup j "no_echo") Boolean.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.resource_status_reason (fun f -> - Query.Pair ("ResourceStatusReason", String.to_query f)) - ; Some (Query.Pair ("ResourceStatus", ResourceStatus.to_query v.resource_status)) - ; Some (Query.Pair ("Timestamp", DateTime.to_query v.timestamp)) - ; Some (Query.Pair ("ResourceType", String.to_query v.resource_type)) - ; Util.option_map v.physical_resource_id (fun f -> - Query.Pair ("PhysicalResourceId", String.to_query f)) - ; Some (Query.Pair ("LogicalResourceId", String.to_query v.logical_resource_id)) - ; Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ; Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.resource_status_reason (fun f -> - "resource_status_reason", String.to_json f) - ; Some ("resource_status", ResourceStatus.to_json v.resource_status) - ; Some ("timestamp", DateTime.to_json v.timestamp) - ; Some ("resource_type", String.to_json v.resource_type) - ; Util.option_map v.physical_resource_id (fun f -> - "physical_resource_id", String.to_json f) - ; Some ("logical_resource_id", String.to_json v.logical_resource_id) - ; Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) - ; Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ]) - - let of_json j = - { stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - ; stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json - ; logical_resource_id = - String.of_json (Util.of_option_exn (Json.lookup j "logical_resource_id")) - ; physical_resource_id = - Util.option_map (Json.lookup j "physical_resource_id") String.of_json - ; resource_type = String.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; timestamp = DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp")) - ; resource_status = - ResourceStatus.of_json (Util.of_option_exn (Json.lookup j "resource_status")) - ; resource_status_reason = - Util.option_map (Json.lookup j "resource_status_reason") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module StackResourceSummaries = struct - type t = StackResourceSummary.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map StackResourceSummary.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StackResourceSummary.to_query v - - let to_json v = `List (List.map StackResourceSummary.to_json v) - - let of_json j = Json.to_list StackResourceSummary.of_json j -end - -module StackSummaries = struct - type t = StackSummary.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map StackSummary.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StackSummary.to_query v - - let to_json v = `List (List.map StackSummary.to_json v) - - let of_json j = Json.to_list StackSummary.of_json j -end - -module StackStatusFilter = struct - type t = StackStatus.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map StackStatus.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StackStatus.to_query v - - let to_json v = `List (List.map StackStatus.to_json v) - - let of_json j = Json.to_list StackStatus.of_json j -end - -module ResourceSignalStatus = struct - type t = - | SUCCESS - | FAILURE - - let str_to_t = [ "FAILURE", FAILURE; "SUCCESS", SUCCESS ] - - let t_to_str = [ FAILURE, "FAILURE"; SUCCESS, "SUCCESS" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ParameterDeclarations = struct - type t = ParameterDeclaration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ParameterDeclaration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ParameterDeclaration.to_query v - - let to_json v = `List (List.map ParameterDeclaration.to_json v) - - let of_json j = Json.to_list ParameterDeclaration.of_json j -end - -module TemplateParameters = struct - type t = TemplateParameter.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map TemplateParameter.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list TemplateParameter.to_query v - - let to_json v = `List (List.map TemplateParameter.to_json v) - - let of_json j = Json.to_list TemplateParameter.of_json j -end - -module Stacks = struct - type t = Stack.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Stack.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Stack.to_query v - - let to_json v = `List (List.map Stack.to_json v) - - let of_json j = Json.to_list Stack.of_json j -end - -module StackResourceDetail = struct - type t = - { stack_name : String.t option - ; stack_id : String.t option - ; logical_resource_id : String.t - ; physical_resource_id : String.t option - ; resource_type : String.t - ; last_updated_timestamp : DateTime.t - ; resource_status : ResourceStatus.t - ; resource_status_reason : String.t option - ; description : String.t option - ; metadata : String.t option - } - - let make - ?stack_name - ?stack_id - ~logical_resource_id - ?physical_resource_id - ~resource_type - ~last_updated_timestamp - ~resource_status - ?resource_status_reason - ?description - ?metadata - () = - { stack_name - ; stack_id - ; logical_resource_id - ; physical_resource_id - ; resource_type - ; last_updated_timestamp - ; resource_status - ; resource_status_reason - ; description - ; metadata - } - - let parse xml = - Some - { stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse - ; stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse - ; logical_resource_id = - Xml.required - "LogicalResourceId" - (Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse) - ; physical_resource_id = - Util.option_bind (Xml.member "PhysicalResourceId" xml) String.parse - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) String.parse) - ; last_updated_timestamp = - Xml.required - "LastUpdatedTimestamp" - (Util.option_bind (Xml.member "LastUpdatedTimestamp" xml) DateTime.parse) - ; resource_status = - Xml.required - "ResourceStatus" - (Util.option_bind (Xml.member "ResourceStatus" xml) ResourceStatus.parse) - ; resource_status_reason = - Util.option_bind (Xml.member "ResourceStatusReason" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; metadata = Util.option_bind (Xml.member "Metadata" xml) String.parse + end +module Stack = + struct + type t = + { + stack_id: String.t option ; + stack_name: String.t ; + description: String.t option ; + parameters: Parameters.t ; + creation_time: DateTime.t ; + last_updated_time: DateTime.t option ; + stack_status: StackStatus.t ; + stack_status_reason: String.t option ; + disable_rollback: Boolean.t option ; + notification_a_r_ns: NotificationARNs.t ; + timeout_in_minutes: Integer.t option ; + capabilities: Capabilities.t ; + outputs: Outputs.t ; + tags: Tags.t } + let make ?stack_id ~stack_name ?description ?(parameters= []) + ~creation_time ?last_updated_time ~stack_status ?stack_status_reason + ?disable_rollback ?(notification_a_r_ns= []) ?timeout_in_minutes + ?(capabilities= []) ?(outputs= []) ?(tags= []) () = + { + stack_id; + stack_name; + description; + parameters; + creation_time; + last_updated_time; + stack_status; + stack_status_reason; + disable_rollback; + notification_a_r_ns; + timeout_in_minutes; + capabilities; + outputs; + tags } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.metadata (fun f -> - Query.Pair ("Metadata", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.resource_status_reason (fun f -> - Query.Pair ("ResourceStatusReason", String.to_query f)) - ; Some (Query.Pair ("ResourceStatus", ResourceStatus.to_query v.resource_status)) - ; Some + let parse xml = + Some + { + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse); + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + Parameters.parse)); + creation_time = + (Xml.required "CreationTime" + (Util.option_bind (Xml.member "CreationTime" xml) + DateTime.parse)); + last_updated_time = + (Util.option_bind (Xml.member "LastUpdatedTime" xml) + DateTime.parse); + stack_status = + (Xml.required "StackStatus" + (Util.option_bind (Xml.member "StackStatus" xml) + StackStatus.parse)); + stack_status_reason = + (Util.option_bind (Xml.member "StackStatusReason" xml) + String.parse); + disable_rollback = + (Util.option_bind (Xml.member "DisableRollback" xml) + Boolean.parse); + notification_a_r_ns = + (Util.of_option [] + (Util.option_bind (Xml.member "NotificationARNs" xml) + NotificationARNs.parse)); + timeout_in_minutes = + (Util.option_bind (Xml.member "TimeoutInMinutes" xml) + Integer.parse); + capabilities = + (Util.of_option [] + (Util.option_bind (Xml.member "Capabilities" xml) + Capabilities.parse)); + outputs = + (Util.of_option [] + (Util.option_bind (Xml.member "Outputs" xml) Outputs.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) Tags.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (Tags.to_query v.tags))); + Some (Query.Pair ("Outputs.member", (Outputs.to_query v.outputs))); + Some (Query.Pair - ("LastUpdatedTimestamp", DateTime.to_query v.last_updated_timestamp)) - ; Some (Query.Pair ("ResourceType", String.to_query v.resource_type)) - ; Util.option_map v.physical_resource_id (fun f -> - Query.Pair ("PhysicalResourceId", String.to_query f)) - ; Some (Query.Pair ("LogicalResourceId", String.to_query v.logical_resource_id)) - ; Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ; Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.metadata (fun f -> "metadata", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.resource_status_reason (fun f -> - "resource_status_reason", String.to_json f) - ; Some ("resource_status", ResourceStatus.to_json v.resource_status) - ; Some ("last_updated_timestamp", DateTime.to_json v.last_updated_timestamp) - ; Some ("resource_type", String.to_json v.resource_type) - ; Util.option_map v.physical_resource_id (fun f -> - "physical_resource_id", String.to_json f) - ; Some ("logical_resource_id", String.to_json v.logical_resource_id) - ; Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) - ; Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ]) - - let of_json j = - { stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - ; stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json - ; logical_resource_id = - String.of_json (Util.of_option_exn (Json.lookup j "logical_resource_id")) - ; physical_resource_id = - Util.option_map (Json.lookup j "physical_resource_id") String.of_json - ; resource_type = String.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; last_updated_timestamp = - DateTime.of_json (Util.of_option_exn (Json.lookup j "last_updated_timestamp")) - ; resource_status = - ResourceStatus.of_json (Util.of_option_exn (Json.lookup j "resource_status")) - ; resource_status_reason = - Util.option_map (Json.lookup j "resource_status_reason") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; metadata = Util.option_map (Json.lookup j "metadata") String.of_json - } -end - -module OnFailure = struct - type t = - | DO_NOTHING - | ROLLBACK - | DELETE - - let str_to_t = [ "DELETE", DELETE; "ROLLBACK", ROLLBACK; "DO_NOTHING", DO_NOTHING ] - - let t_to_str = [ DELETE, "DELETE"; ROLLBACK, "ROLLBACK"; DO_NOTHING, "DO_NOTHING" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module StackEvents = struct - type t = StackEvent.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map StackEvent.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StackEvent.to_query v - - let to_json v = `List (List.map StackEvent.to_json v) - - let of_json j = Json.to_list StackEvent.of_json j -end - -module StackResources = struct - type t = StackResource.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map StackResource.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list StackResource.to_query v - - let to_json v = `List (List.map StackResource.to_json v) - - let of_json j = Json.to_list StackResource.of_json j -end - -module ListStackResourcesOutput = struct - type t = - { stack_resource_summaries : StackResourceSummaries.t - ; next_token : String.t option - } - - let make ?(stack_resource_summaries = []) ?next_token () = - { stack_resource_summaries; next_token } - - let parse xml = - Some - { stack_resource_summaries = - Util.of_option - [] - (Util.option_bind - (Xml.member "StackResourceSummaries" xml) - StackResourceSummaries.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("Capabilities.member", + (Capabilities.to_query v.capabilities))); + Util.option_map v.timeout_in_minutes + (fun f -> Query.Pair ("TimeoutInMinutes", (Integer.to_query f))); + Some (Query.Pair - ( "StackResourceSummaries.member" - , StackResourceSummaries.to_query v.stack_resource_summaries )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "stack_resource_summaries" - , StackResourceSummaries.to_json v.stack_resource_summaries ) - ]) - - let of_json j = - { stack_resource_summaries = - StackResourceSummaries.of_json - (Util.of_option_exn (Json.lookup j "stack_resource_summaries")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module SetStackPolicyInput = struct - type t = - { stack_name : String.t - ; stack_policy_body : String.t option - ; stack_policy_u_r_l : String.t option - } - - let make ~stack_name ?stack_policy_body ?stack_policy_u_r_l () = - { stack_name; stack_policy_body; stack_policy_u_r_l } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; stack_policy_body = - Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse - ; stack_policy_u_r_l = - Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse + ("NotificationARNs.member", + (NotificationARNs.to_query v.notification_a_r_ns))); + Util.option_map v.disable_rollback + (fun f -> Query.Pair ("DisableRollback", (Boolean.to_query f))); + Util.option_map v.stack_status_reason + (fun f -> Query.Pair ("StackStatusReason", (String.to_query f))); + Some + (Query.Pair + ("StackStatus", (StackStatus.to_query v.stack_status))); + Util.option_map v.last_updated_time + (fun f -> Query.Pair ("LastUpdatedTime", (DateTime.to_query f))); + Some + (Query.Pair + ("CreationTime", (DateTime.to_query v.creation_time))); + Some + (Query.Pair + ("Parameters.member", (Parameters.to_query v.parameters))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name))); + Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (Tags.to_json v.tags)); + Some ("outputs", (Outputs.to_json v.outputs)); + Some ("capabilities", (Capabilities.to_json v.capabilities)); + Util.option_map v.timeout_in_minutes + (fun f -> ("timeout_in_minutes", (Integer.to_json f))); + Some + ("notification_a_r_ns", + (NotificationARNs.to_json v.notification_a_r_ns)); + Util.option_map v.disable_rollback + (fun f -> ("disable_rollback", (Boolean.to_json f))); + Util.option_map v.stack_status_reason + (fun f -> ("stack_status_reason", (String.to_json f))); + Some ("stack_status", (StackStatus.to_json v.stack_status)); + Util.option_map v.last_updated_time + (fun f -> ("last_updated_time", (DateTime.to_json f))); + Some ("creation_time", (DateTime.to_json v.creation_time)); + Some ("parameters", (Parameters.to_json v.parameters)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name)); + Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f)))]) + let of_json j = + { + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json); + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + parameters = + (Parameters.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + creation_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_time"))); + last_updated_time = + (Util.option_map (Json.lookup j "last_updated_time") + DateTime.of_json); + stack_status = + (StackStatus.of_json + (Util.of_option_exn (Json.lookup j "stack_status"))); + stack_status_reason = + (Util.option_map (Json.lookup j "stack_status_reason") + String.of_json); + disable_rollback = + (Util.option_map (Json.lookup j "disable_rollback") Boolean.of_json); + notification_a_r_ns = + (NotificationARNs.of_json + (Util.of_option_exn (Json.lookup j "notification_a_r_ns"))); + timeout_in_minutes = + (Util.option_map (Json.lookup j "timeout_in_minutes") + Integer.of_json); + capabilities = + (Capabilities.of_json + (Util.of_option_exn (Json.lookup j "capabilities"))); + outputs = + (Outputs.of_json (Util.of_option_exn (Json.lookup j "outputs"))); + tags = (Tags.of_json (Util.of_option_exn (Json.lookup j "tags"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_policy_u_r_l (fun f -> - Query.Pair ("StackPolicyURL", String.to_query f)) - ; Util.option_map v.stack_policy_body (fun f -> - Query.Pair ("StackPolicyBody", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_policy_u_r_l (fun f -> - "stack_policy_u_r_l", String.to_json f) - ; Util.option_map v.stack_policy_body (fun f -> - "stack_policy_body", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; stack_policy_body = - Util.option_map (Json.lookup j "stack_policy_body") String.of_json - ; stack_policy_u_r_l = - Util.option_map (Json.lookup j "stack_policy_u_r_l") String.of_json - } -end - -module CreateStackOutput = struct - type t = { stack_id : String.t option } - - let make ?stack_id () = { stack_id } - - let parse xml = - Some { stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) ]) - - let of_json j = { stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json } -end - -module DescribeStackResourceInput = struct - type t = - { stack_name : String.t - ; logical_resource_id : String.t - } - - let make ~stack_name ~logical_resource_id () = { stack_name; logical_resource_id } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; logical_resource_id = - Xml.required - "LogicalResourceId" - (Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse) + end +module StackEvent = + struct + type t = + { + stack_id: String.t ; + event_id: String.t ; + stack_name: String.t ; + logical_resource_id: String.t option ; + physical_resource_id: String.t option ; + resource_type: String.t option ; + timestamp: DateTime.t ; + resource_status: ResourceStatus.t option ; + resource_status_reason: String.t option ; + resource_properties: String.t option } + let make ~stack_id ~event_id ~stack_name ?logical_resource_id + ?physical_resource_id ?resource_type ~timestamp ?resource_status + ?resource_status_reason ?resource_properties () = + { + stack_id; + event_id; + stack_name; + logical_resource_id; + physical_resource_id; + resource_type; + timestamp; + resource_status; + resource_status_reason; + resource_properties } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("LogicalResourceId", String.to_query v.logical_resource_id)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("logical_resource_id", String.to_json v.logical_resource_id) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; logical_resource_id = - String.of_json (Util.of_option_exn (Json.lookup j "logical_resource_id")) - } -end - -module ListStacksOutput = struct - type t = - { stack_summaries : StackSummaries.t - ; next_token : String.t option - } - - let make ?(stack_summaries = []) ?next_token () = { stack_summaries; next_token } - - let parse xml = - Some - { stack_summaries = - Util.of_option - [] - (Util.option_bind (Xml.member "StackSummaries" xml) StackSummaries.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + let parse xml = + Some + { + stack_id = + (Xml.required "StackId" + (Util.option_bind (Xml.member "StackId" xml) String.parse)); + event_id = + (Xml.required "EventId" + (Util.option_bind (Xml.member "EventId" xml) String.parse)); + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + logical_resource_id = + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse); + physical_resource_id = + (Util.option_bind (Xml.member "PhysicalResourceId" xml) + String.parse); + resource_type = + (Util.option_bind (Xml.member "ResourceType" xml) String.parse); + timestamp = + (Xml.required "Timestamp" + (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse)); + resource_status = + (Util.option_bind (Xml.member "ResourceStatus" xml) + ResourceStatus.parse); + resource_status_reason = + (Util.option_bind (Xml.member "ResourceStatusReason" xml) + String.parse); + resource_properties = + (Util.option_bind (Xml.member "ResourceProperties" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.resource_properties + (fun f -> + Query.Pair ("ResourceProperties", (String.to_query f))); + Util.option_map v.resource_status_reason + (fun f -> + Query.Pair ("ResourceStatusReason", (String.to_query f))); + Util.option_map v.resource_status + (fun f -> + Query.Pair ("ResourceStatus", (ResourceStatus.to_query f))); + Some (Query.Pair ("Timestamp", (DateTime.to_query v.timestamp))); + Util.option_map v.resource_type + (fun f -> Query.Pair ("ResourceType", (String.to_query f))); + Util.option_map v.physical_resource_id + (fun f -> Query.Pair ("PhysicalResourceId", (String.to_query f))); + Util.option_map v.logical_resource_id + (fun f -> Query.Pair ("LogicalResourceId", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name))); + Some (Query.Pair ("EventId", (String.to_query v.event_id))); + Some (Query.Pair ("StackId", (String.to_query v.stack_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.resource_properties + (fun f -> ("resource_properties", (String.to_json f))); + Util.option_map v.resource_status_reason + (fun f -> ("resource_status_reason", (String.to_json f))); + Util.option_map v.resource_status + (fun f -> ("resource_status", (ResourceStatus.to_json f))); + Some ("timestamp", (DateTime.to_json v.timestamp)); + Util.option_map v.resource_type + (fun f -> ("resource_type", (String.to_json f))); + Util.option_map v.physical_resource_id + (fun f -> ("physical_resource_id", (String.to_json f))); + Util.option_map v.logical_resource_id + (fun f -> ("logical_resource_id", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name)); + Some ("event_id", (String.to_json v.event_id)); + Some ("stack_id", (String.to_json v.stack_id))]) + let of_json j = + { + stack_id = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_id"))); + event_id = + (String.of_json (Util.of_option_exn (Json.lookup j "event_id"))); + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + logical_resource_id = + (Util.option_map (Json.lookup j "logical_resource_id") + String.of_json); + physical_resource_id = + (Util.option_map (Json.lookup j "physical_resource_id") + String.of_json); + resource_type = + (Util.option_map (Json.lookup j "resource_type") String.of_json); + timestamp = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp"))); + resource_status = + (Util.option_map (Json.lookup j "resource_status") + ResourceStatus.of_json); + resource_status_reason = + (Util.option_map (Json.lookup j "resource_status_reason") + String.of_json); + resource_properties = + (Util.option_map (Json.lookup j "resource_properties") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module StackResource = + struct + type t = + { + stack_name: String.t option ; + stack_id: String.t option ; + logical_resource_id: String.t ; + physical_resource_id: String.t option ; + resource_type: String.t ; + timestamp: DateTime.t ; + resource_status: ResourceStatus.t ; + resource_status_reason: String.t option ; + description: String.t option } + let make ?stack_name ?stack_id ~logical_resource_id + ?physical_resource_id ~resource_type ~timestamp ~resource_status + ?resource_status_reason ?description () = + { + stack_name; + stack_id; + logical_resource_id; + physical_resource_id; + resource_type; + timestamp; + resource_status; + resource_status_reason; + description + } + let parse xml = + Some + { + stack_name = + (Util.option_bind (Xml.member "StackName" xml) String.parse); + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse); + logical_resource_id = + (Xml.required "LogicalResourceId" + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse)); + physical_resource_id = + (Util.option_bind (Xml.member "PhysicalResourceId" xml) + String.parse); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) String.parse)); + timestamp = + (Xml.required "Timestamp" + (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse)); + resource_status = + (Xml.required "ResourceStatus" + (Util.option_bind (Xml.member "ResourceStatus" xml) + ResourceStatus.parse)); + resource_status_reason = + (Util.option_bind (Xml.member "ResourceStatusReason" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.resource_status_reason + (fun f -> + Query.Pair ("ResourceStatusReason", (String.to_query f))); + Some (Query.Pair - ("StackSummaries.member", StackSummaries.to_query v.stack_summaries)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("stack_summaries", StackSummaries.to_json v.stack_summaries) - ]) - - let of_json j = - { stack_summaries = - StackSummaries.of_json (Util.of_option_exn (Json.lookup j "stack_summaries")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module GetTemplateInput = struct - type t = { stack_name : String.t } - - let make ~stack_name () = { stack_name } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) + ("ResourceStatus", + (ResourceStatus.to_query v.resource_status))); + Some (Query.Pair ("Timestamp", (DateTime.to_query v.timestamp))); + Some + (Query.Pair ("ResourceType", (String.to_query v.resource_type))); + Util.option_map v.physical_resource_id + (fun f -> Query.Pair ("PhysicalResourceId", (String.to_query f))); + Some + (Query.Pair + ("LogicalResourceId", + (String.to_query v.logical_resource_id))); + Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f))); + Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.resource_status_reason + (fun f -> ("resource_status_reason", (String.to_json f))); + Some + ("resource_status", (ResourceStatus.to_json v.resource_status)); + Some ("timestamp", (DateTime.to_json v.timestamp)); + Some ("resource_type", (String.to_json v.resource_type)); + Util.option_map v.physical_resource_id + (fun f -> ("physical_resource_id", (String.to_json f))); + Some + ("logical_resource_id", (String.to_json v.logical_resource_id)); + Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f))); + Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f)))]) + let of_json j = + { + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json); + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json); + logical_resource_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "logical_resource_id"))); + physical_resource_id = + (Util.option_map (Json.lookup j "physical_resource_id") + String.of_json); + resource_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + timestamp = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp"))); + resource_status = + (ResourceStatus.of_json + (Util.of_option_exn (Json.lookup j "resource_status"))); + resource_status_reason = + (Util.option_map (Json.lookup j "resource_status_reason") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("StackName", String.to_query v.stack_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("stack_name", String.to_json v.stack_name) ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) } -end - -module EstimateTemplateCostOutput = struct - type t = { url : String.t option } - - let make ?url () = { url } - - let parse xml = Some { url = Util.option_bind (Xml.member "Url" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.url (fun f -> Query.Pair ("Url", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Util.option_map v.url (fun f -> "url", String.to_json f) ]) - - let of_json j = { url = Util.option_map (Json.lookup j "url") String.of_json } -end - -module ListStacksInput = struct - type t = - { next_token : String.t option - ; stack_status_filter : StackStatusFilter.t - } - - let make ?next_token ?(stack_status_filter = []) () = - { next_token; stack_status_filter } - - let parse xml = - Some - { next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; stack_status_filter = - Util.of_option - [] - (Util.option_bind - (Xml.member "StackStatusFilter" xml) - StackStatusFilter.parse) + end +module StackResourceSummaries = + struct + type t = StackResourceSummary.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map StackResourceSummary.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StackResourceSummary.to_query v + let to_json v = `List (List.map StackResourceSummary.to_json v) + let of_json j = Json.to_list StackResourceSummary.of_json j + end +module StackSummaries = + struct + type t = StackSummary.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map StackSummary.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StackSummary.to_query v + let to_json v = `List (List.map StackSummary.to_json v) + let of_json j = Json.to_list StackSummary.of_json j + end +module StackStatusFilter = + struct + type t = StackStatus.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StackStatus.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StackStatus.to_query v + let to_json v = `List (List.map StackStatus.to_json v) + let of_json j = Json.to_list StackStatus.of_json j + end +module ResourceSignalStatus = + struct + type t = + | SUCCESS + | FAILURE + let str_to_t = [("FAILURE", FAILURE); ("SUCCESS", SUCCESS)] + let t_to_str = [(FAILURE, "FAILURE"); (SUCCESS, "SUCCESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ParameterDeclarations = + struct + type t = ParameterDeclaration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ParameterDeclaration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ParameterDeclaration.to_query v + let to_json v = `List (List.map ParameterDeclaration.to_json v) + let of_json j = Json.to_list ParameterDeclaration.of_json j + end +module TemplateParameters = + struct + type t = TemplateParameter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map TemplateParameter.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list TemplateParameter.to_query v + let to_json v = `List (List.map TemplateParameter.to_json v) + let of_json j = Json.to_list TemplateParameter.of_json j + end +module Stacks = + struct + type t = Stack.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Stack.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Stack.to_query v + let to_json v = `List (List.map Stack.to_json v) + let of_json j = Json.to_list Stack.of_json j + end +module StackResourceDetail = + struct + type t = + { + stack_name: String.t option ; + stack_id: String.t option ; + logical_resource_id: String.t ; + physical_resource_id: String.t option ; + resource_type: String.t ; + last_updated_timestamp: DateTime.t ; + resource_status: ResourceStatus.t ; + resource_status_reason: String.t option ; + description: String.t option ; + metadata: String.t option } + let make ?stack_name ?stack_id ~logical_resource_id + ?physical_resource_id ~resource_type ~last_updated_timestamp + ~resource_status ?resource_status_reason ?description ?metadata () + = + { + stack_name; + stack_id; + logical_resource_id; + physical_resource_id; + resource_type; + last_updated_timestamp; + resource_status; + resource_status_reason; + description; + metadata } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + stack_name = + (Util.option_bind (Xml.member "StackName" xml) String.parse); + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse); + logical_resource_id = + (Xml.required "LogicalResourceId" + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse)); + physical_resource_id = + (Util.option_bind (Xml.member "PhysicalResourceId" xml) + String.parse); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) String.parse)); + last_updated_timestamp = + (Xml.required "LastUpdatedTimestamp" + (Util.option_bind (Xml.member "LastUpdatedTimestamp" xml) + DateTime.parse)); + resource_status = + (Xml.required "ResourceStatus" + (Util.option_bind (Xml.member "ResourceStatus" xml) + ResourceStatus.parse)); + resource_status_reason = + (Util.option_bind (Xml.member "ResourceStatusReason" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + metadata = + (Util.option_bind (Xml.member "Metadata" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.metadata + (fun f -> Query.Pair ("Metadata", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.resource_status_reason + (fun f -> + Query.Pair ("ResourceStatusReason", (String.to_query f))); + Some (Query.Pair - ( "StackStatusFilter.member" - , StackStatusFilter.to_query v.stack_status_filter )) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("stack_status_filter", StackStatusFilter.to_json v.stack_status_filter) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ]) - - let of_json j = - { next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; stack_status_filter = - StackStatusFilter.of_json - (Util.of_option_exn (Json.lookup j "stack_status_filter")) - } -end - -module GetStackPolicyInput = struct - type t = { stack_name : String.t } - - let make ~stack_name () = { stack_name } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) + ("ResourceStatus", + (ResourceStatus.to_query v.resource_status))); + Some + (Query.Pair + ("LastUpdatedTimestamp", + (DateTime.to_query v.last_updated_timestamp))); + Some + (Query.Pair ("ResourceType", (String.to_query v.resource_type))); + Util.option_map v.physical_resource_id + (fun f -> Query.Pair ("PhysicalResourceId", (String.to_query f))); + Some + (Query.Pair + ("LogicalResourceId", + (String.to_query v.logical_resource_id))); + Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f))); + Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.metadata + (fun f -> ("metadata", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.resource_status_reason + (fun f -> ("resource_status_reason", (String.to_json f))); + Some + ("resource_status", (ResourceStatus.to_json v.resource_status)); + Some + ("last_updated_timestamp", + (DateTime.to_json v.last_updated_timestamp)); + Some ("resource_type", (String.to_json v.resource_type)); + Util.option_map v.physical_resource_id + (fun f -> ("physical_resource_id", (String.to_json f))); + Some + ("logical_resource_id", (String.to_json v.logical_resource_id)); + Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f))); + Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f)))]) + let of_json j = + { + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json); + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json); + logical_resource_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "logical_resource_id"))); + physical_resource_id = + (Util.option_map (Json.lookup j "physical_resource_id") + String.of_json); + resource_type = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + last_updated_timestamp = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "last_updated_timestamp"))); + resource_status = + (ResourceStatus.of_json + (Util.of_option_exn (Json.lookup j "resource_status"))); + resource_status_reason = + (Util.option_map (Json.lookup j "resource_status_reason") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + metadata = + (Util.option_map (Json.lookup j "metadata") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("StackName", String.to_query v.stack_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("stack_name", String.to_json v.stack_name) ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) } -end - -module GetStackPolicyOutput = struct - type t = { stack_policy_body : String.t option } - - let make ?stack_policy_body () = { stack_policy_body } - - let parse xml = - Some - { stack_policy_body = - Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse + end +module OnFailure = + struct + type t = + | DO_NOTHING + | ROLLBACK + | DELETE + let str_to_t = + [("DELETE", DELETE); + ("ROLLBACK", ROLLBACK); + ("DO_NOTHING", DO_NOTHING)] + let t_to_str = + [(DELETE, "DELETE"); + (ROLLBACK, "ROLLBACK"); + (DO_NOTHING, "DO_NOTHING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StackEvents = + struct + type t = StackEvent.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map StackEvent.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StackEvent.to_query v + let to_json v = `List (List.map StackEvent.to_json v) + let of_json j = Json.to_list StackEvent.of_json j + end +module StackResources = + struct + type t = StackResource.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map StackResource.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list StackResource.to_query v + let to_json v = `List (List.map StackResource.to_json v) + let of_json j = Json.to_list StackResource.of_json j + end +module ListStackResourcesOutput = + struct + type t = + { + stack_resource_summaries: StackResourceSummaries.t ; + next_token: String.t option } + let make ?(stack_resource_summaries= []) ?next_token () = + { stack_resource_summaries; next_token } + let parse xml = + Some + { + stack_resource_summaries = + (Util.of_option [] + (Util.option_bind (Xml.member "StackResourceSummaries" xml) + StackResourceSummaries.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("StackResourceSummaries.member", + (StackResourceSummaries.to_query v.stack_resource_summaries)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("stack_resource_summaries", + (StackResourceSummaries.to_json v.stack_resource_summaries))]) + let of_json j = + { + stack_resource_summaries = + (StackResourceSummaries.of_json + (Util.of_option_exn (Json.lookup j "stack_resource_summaries"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_policy_body (fun f -> - Query.Pair ("StackPolicyBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_policy_body (fun f -> - "stack_policy_body", String.to_json f) - ]) - - let of_json j = - { stack_policy_body = - Util.option_map (Json.lookup j "stack_policy_body") String.of_json - } -end - -module InsufficientCapabilitiesException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeStackResourcesInput = struct - type t = - { stack_name : String.t option - ; logical_resource_id : String.t option - ; physical_resource_id : String.t option - } - - let make ?stack_name ?logical_resource_id ?physical_resource_id () = - { stack_name; logical_resource_id; physical_resource_id } - - let parse xml = - Some - { stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse - ; logical_resource_id = - Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse - ; physical_resource_id = - Util.option_bind (Xml.member "PhysicalResourceId" xml) String.parse + end +module SetStackPolicyInput = + struct + type t = + { + stack_name: String.t ; + stack_policy_body: String.t option ; + stack_policy_u_r_l: String.t option } + let make ~stack_name ?stack_policy_body ?stack_policy_u_r_l () = + { stack_name; stack_policy_body; stack_policy_u_r_l } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + stack_policy_body = + (Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse); + stack_policy_u_r_l = + (Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_policy_u_r_l + (fun f -> Query.Pair ("StackPolicyURL", (String.to_query f))); + Util.option_map v.stack_policy_body + (fun f -> Query.Pair ("StackPolicyBody", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_policy_u_r_l + (fun f -> ("stack_policy_u_r_l", (String.to_json f))); + Util.option_map v.stack_policy_body + (fun f -> ("stack_policy_body", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + stack_policy_body = + (Util.option_map (Json.lookup j "stack_policy_body") String.of_json); + stack_policy_u_r_l = + (Util.option_map (Json.lookup j "stack_policy_u_r_l") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.physical_resource_id (fun f -> - Query.Pair ("PhysicalResourceId", String.to_query f)) - ; Util.option_map v.logical_resource_id (fun f -> - Query.Pair ("LogicalResourceId", String.to_query f)) - ; Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.physical_resource_id (fun f -> - "physical_resource_id", String.to_json f) - ; Util.option_map v.logical_resource_id (fun f -> - "logical_resource_id", String.to_json f) - ; Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ]) - - let of_json j = - { stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - ; logical_resource_id = - Util.option_map (Json.lookup j "logical_resource_id") String.of_json - ; physical_resource_id = - Util.option_map (Json.lookup j "physical_resource_id") String.of_json - } -end - -module SignalResourceInput = struct - type t = - { stack_name : String.t - ; logical_resource_id : String.t - ; unique_id : String.t - ; status : ResourceSignalStatus.t - } - - let make ~stack_name ~logical_resource_id ~unique_id ~status () = - { stack_name; logical_resource_id; unique_id; status } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; logical_resource_id = - Xml.required - "LogicalResourceId" - (Util.option_bind (Xml.member "LogicalResourceId" xml) String.parse) - ; unique_id = - Xml.required - "UniqueId" - (Util.option_bind (Xml.member "UniqueId" xml) String.parse) - ; status = - Xml.required - "Status" - (Util.option_bind (Xml.member "Status" xml) ResourceSignalStatus.parse) + end +module CreateStackOutput = + struct + type t = { + stack_id: String.t option } + let make ?stack_id () = { stack_id } + let parse xml = + Some + { + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f)))]) + let of_json j = + { + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Status", ResourceSignalStatus.to_query v.status)) - ; Some (Query.Pair ("UniqueId", String.to_query v.unique_id)) - ; Some (Query.Pair ("LogicalResourceId", String.to_query v.logical_resource_id)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("status", ResourceSignalStatus.to_json v.status) - ; Some ("unique_id", String.to_json v.unique_id) - ; Some ("logical_resource_id", String.to_json v.logical_resource_id) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; logical_resource_id = - String.of_json (Util.of_option_exn (Json.lookup j "logical_resource_id")) - ; unique_id = String.of_json (Util.of_option_exn (Json.lookup j "unique_id")) - ; status = ResourceSignalStatus.of_json (Util.of_option_exn (Json.lookup j "status")) - } -end - -module DeleteStackInput = struct - type t = { stack_name : String.t } - - let make ~stack_name () = { stack_name } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) + end +module DescribeStackResourceInput = + struct + type t = { + stack_name: String.t ; + logical_resource_id: String.t } + let make ~stack_name ~logical_resource_id () = + { stack_name; logical_resource_id } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + logical_resource_id = + (Xml.required "LogicalResourceId" + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LogicalResourceId", + (String.to_query v.logical_resource_id))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("logical_resource_id", (String.to_json v.logical_resource_id)); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + logical_resource_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "logical_resource_id"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("StackName", String.to_query v.stack_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("stack_name", String.to_json v.stack_name) ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) } -end - -module GetTemplateSummaryOutput = struct - type t = - { parameters : ParameterDeclarations.t - ; description : String.t option - ; capabilities : Capabilities.t - ; capabilities_reason : String.t option - ; version : String.t option - ; metadata : String.t option - } - - let make - ?(parameters = []) - ?description - ?(capabilities = []) - ?capabilities_reason - ?version - ?metadata - () = - { parameters; description; capabilities; capabilities_reason; version; metadata } - - let parse xml = - Some - { parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParameterDeclarations.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; capabilities = - Util.of_option - [] - (Util.option_bind (Xml.member "Capabilities" xml) Capabilities.parse) - ; capabilities_reason = - Util.option_bind (Xml.member "CapabilitiesReason" xml) String.parse - ; version = Util.option_bind (Xml.member "Version" xml) String.parse - ; metadata = Util.option_bind (Xml.member "Metadata" xml) String.parse + end +module ListStacksOutput = + struct + type t = + { + stack_summaries: StackSummaries.t ; + next_token: String.t option } + let make ?(stack_summaries= []) ?next_token () = + { stack_summaries; next_token } + let parse xml = + Some + { + stack_summaries = + (Util.of_option [] + (Util.option_bind (Xml.member "StackSummaries" xml) + StackSummaries.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("StackSummaries.member", + (StackSummaries.to_query v.stack_summaries)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("stack_summaries", (StackSummaries.to_json v.stack_summaries))]) + let of_json j = + { + stack_summaries = + (StackSummaries.of_json + (Util.of_option_exn (Json.lookup j "stack_summaries"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.metadata (fun f -> - Query.Pair ("Metadata", String.to_query f)) - ; Util.option_map v.version (fun f -> Query.Pair ("Version", String.to_query f)) - ; Util.option_map v.capabilities_reason (fun f -> - Query.Pair ("CapabilitiesReason", String.to_query f)) - ; Some (Query.Pair ("Capabilities.member", Capabilities.to_query v.capabilities)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some - (Query.Pair ("Parameters.member", ParameterDeclarations.to_query v.parameters)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.metadata (fun f -> "metadata", String.to_json f) - ; Util.option_map v.version (fun f -> "version", String.to_json f) - ; Util.option_map v.capabilities_reason (fun f -> - "capabilities_reason", String.to_json f) - ; Some ("capabilities", Capabilities.to_json v.capabilities) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("parameters", ParameterDeclarations.to_json v.parameters) - ]) - - let of_json j = - { parameters = - ParameterDeclarations.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; capabilities = - Capabilities.of_json (Util.of_option_exn (Json.lookup j "capabilities")) - ; capabilities_reason = - Util.option_map (Json.lookup j "capabilities_reason") String.of_json - ; version = Util.option_map (Json.lookup j "version") String.of_json - ; metadata = Util.option_map (Json.lookup j "metadata") String.of_json - } -end - -module AlreadyExistsException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeStackEventsInput = struct - type t = - { stack_name : String.t option - ; next_token : String.t option - } - - let make ?stack_name ?next_token () = { stack_name; next_token } - - let parse xml = - Some - { stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module GetTemplateInput = + struct + type t = { + stack_name: String.t } + let make ~stack_name () = { stack_name } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ]) - - let of_json j = - { stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ValidateTemplateInput = struct - type t = - { template_body : String.t option - ; template_u_r_l : String.t option - } - - let make ?template_body ?template_u_r_l () = { template_body; template_u_r_l } - - let parse xml = - Some - { template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse - ; template_u_r_l = Util.option_bind (Xml.member "TemplateURL" xml) String.parse + end +module EstimateTemplateCostOutput = + struct + type t = { + url: String.t option } + let make ?url () = { url } + let parse xml = + Some { url = (Util.option_bind (Xml.member "Url" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.url + (fun f -> Query.Pair ("Url", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.url (fun f -> ("url", (String.to_json f)))]) + let of_json j = + { url = (Util.option_map (Json.lookup j "url") String.of_json) } + end +module ListStacksInput = + struct + type t = + { + next_token: String.t option ; + stack_status_filter: StackStatusFilter.t } + let make ?next_token ?(stack_status_filter= []) () = + { next_token; stack_status_filter } + let parse xml = + Some + { + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + stack_status_filter = + (Util.of_option [] + (Util.option_bind (Xml.member "StackStatusFilter" xml) + StackStatusFilter.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("StackStatusFilter.member", + (StackStatusFilter.to_query v.stack_status_filter))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("stack_status_filter", + (StackStatusFilter.to_json v.stack_status_filter)); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f)))]) + let of_json j = + { + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + stack_status_filter = + (StackStatusFilter.of_json + (Util.of_option_exn (Json.lookup j "stack_status_filter"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.template_u_r_l (fun f -> - Query.Pair ("TemplateURL", String.to_query f)) - ; Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.template_u_r_l (fun f -> "template_u_r_l", String.to_json f) - ; Util.option_map v.template_body (fun f -> "template_body", String.to_json f) - ]) - - let of_json j = - { template_body = Util.option_map (Json.lookup j "template_body") String.of_json - ; template_u_r_l = Util.option_map (Json.lookup j "template_u_r_l") String.of_json - } -end - -module ValidateTemplateOutput = struct - type t = - { parameters : TemplateParameters.t - ; description : String.t option - ; capabilities : Capabilities.t - ; capabilities_reason : String.t option - } - - let make ?(parameters = []) ?description ?(capabilities = []) ?capabilities_reason () = - { parameters; description; capabilities; capabilities_reason } - - let parse xml = - Some - { parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) TemplateParameters.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; capabilities = - Util.of_option - [] - (Util.option_bind (Xml.member "Capabilities" xml) Capabilities.parse) - ; capabilities_reason = - Util.option_bind (Xml.member "CapabilitiesReason" xml) String.parse + end +module GetStackPolicyInput = + struct + type t = { + stack_name: String.t } + let make ~stack_name () = { stack_name } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.capabilities_reason (fun f -> - Query.Pair ("CapabilitiesReason", String.to_query f)) - ; Some (Query.Pair ("Capabilities.member", Capabilities.to_query v.capabilities)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some - (Query.Pair ("Parameters.member", TemplateParameters.to_query v.parameters)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.capabilities_reason (fun f -> - "capabilities_reason", String.to_json f) - ; Some ("capabilities", Capabilities.to_json v.capabilities) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("parameters", TemplateParameters.to_json v.parameters) - ]) - - let of_json j = - { parameters = - TemplateParameters.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; capabilities = - Capabilities.of_json (Util.of_option_exn (Json.lookup j "capabilities")) - ; capabilities_reason = - Util.option_map (Json.lookup j "capabilities_reason") String.of_json - } -end - -module GetTemplateSummaryInput = struct - type t = - { template_body : String.t option - ; template_u_r_l : String.t option - ; stack_name : String.t option - } - - let make ?template_body ?template_u_r_l ?stack_name () = - { template_body; template_u_r_l; stack_name } - - let parse xml = - Some - { template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse - ; template_u_r_l = Util.option_bind (Xml.member "TemplateURL" xml) String.parse - ; stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse + end +module GetStackPolicyOutput = + struct + type t = { + stack_policy_body: String.t option } + let make ?stack_policy_body () = { stack_policy_body } + let parse xml = + Some + { + stack_policy_body = + (Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_policy_body + (fun f -> Query.Pair ("StackPolicyBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_policy_body + (fun f -> ("stack_policy_body", (String.to_json f)))]) + let of_json j = + { + stack_policy_body = + (Util.option_map (Json.lookup j "stack_policy_body") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ; Util.option_map v.template_u_r_l (fun f -> - Query.Pair ("TemplateURL", String.to_query f)) - ; Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ; Util.option_map v.template_u_r_l (fun f -> "template_u_r_l", String.to_json f) - ; Util.option_map v.template_body (fun f -> "template_body", String.to_json f) - ]) - - let of_json j = - { template_body = Util.option_map (Json.lookup j "template_body") String.of_json - ; template_u_r_l = Util.option_map (Json.lookup j "template_u_r_l") String.of_json - ; stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - } -end - -module CancelUpdateStackInput = struct - type t = { stack_name : String.t } - - let make ~stack_name () = { stack_name } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) + end +module InsufficientCapabilitiesException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeStackResourcesInput = + struct + type t = + { + stack_name: String.t option ; + logical_resource_id: String.t option ; + physical_resource_id: String.t option } + let make ?stack_name ?logical_resource_id ?physical_resource_id () = + { stack_name; logical_resource_id; physical_resource_id } + let parse xml = + Some + { + stack_name = + (Util.option_bind (Xml.member "StackName" xml) String.parse); + logical_resource_id = + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse); + physical_resource_id = + (Util.option_bind (Xml.member "PhysicalResourceId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.physical_resource_id + (fun f -> + Query.Pair ("PhysicalResourceId", (String.to_query f))); + Util.option_map v.logical_resource_id + (fun f -> Query.Pair ("LogicalResourceId", (String.to_query f))); + Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.physical_resource_id + (fun f -> ("physical_resource_id", (String.to_json f))); + Util.option_map v.logical_resource_id + (fun f -> ("logical_resource_id", (String.to_json f))); + Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f)))]) + let of_json j = + { + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json); + logical_resource_id = + (Util.option_map (Json.lookup j "logical_resource_id") + String.of_json); + physical_resource_id = + (Util.option_map (Json.lookup j "physical_resource_id") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("StackName", String.to_query v.stack_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("stack_name", String.to_json v.stack_name) ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) } -end - -module UpdateStackOutput = struct - type t = { stack_id : String.t option } - - let make ?stack_id () = { stack_id } - - let parse xml = - Some { stack_id = Util.option_bind (Xml.member "StackId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_id (fun f -> Query.Pair ("StackId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_id (fun f -> "stack_id", String.to_json f) ]) - - let of_json j = { stack_id = Util.option_map (Json.lookup j "stack_id") String.of_json } -end - -module DescribeStacksOutput = struct - type t = - { stacks : Stacks.t - ; next_token : String.t option - } - - let make ?(stacks = []) ?next_token () = { stacks; next_token } - - let parse xml = - Some - { stacks = - Util.of_option [] (Util.option_bind (Xml.member "Stacks" xml) Stacks.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module SignalResourceInput = + struct + type t = + { + stack_name: String.t ; + logical_resource_id: String.t ; + unique_id: String.t ; + status: ResourceSignalStatus.t } + let make ~stack_name ~logical_resource_id ~unique_id ~status () = + { stack_name; logical_resource_id; unique_id; status } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + logical_resource_id = + (Xml.required "LogicalResourceId" + (Util.option_bind (Xml.member "LogicalResourceId" xml) + String.parse)); + unique_id = + (Xml.required "UniqueId" + (Util.option_bind (Xml.member "UniqueId" xml) String.parse)); + status = + (Xml.required "Status" + (Util.option_bind (Xml.member "Status" xml) + ResourceSignalStatus.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Status", (ResourceSignalStatus.to_query v.status))); + Some (Query.Pair ("UniqueId", (String.to_query v.unique_id))); + Some + (Query.Pair + ("LogicalResourceId", + (String.to_query v.logical_resource_id))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("status", (ResourceSignalStatus.to_json v.status)); + Some ("unique_id", (String.to_json v.unique_id)); + Some + ("logical_resource_id", (String.to_json v.logical_resource_id)); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + logical_resource_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "logical_resource_id"))); + unique_id = + (String.of_json (Util.of_option_exn (Json.lookup j "unique_id"))); + status = + (ResourceSignalStatus.of_json + (Util.of_option_exn (Json.lookup j "status"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Stacks.member", Stacks.to_query v.stacks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("stacks", Stacks.to_json v.stacks) - ]) - - let of_json j = - { stacks = Stacks.of_json (Util.of_option_exn (Json.lookup j "stacks")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module LimitExceededException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeStackResourceOutput = struct - type t = { stack_resource_detail : StackResourceDetail.t option } - - let make ?stack_resource_detail () = { stack_resource_detail } - - let parse xml = - Some - { stack_resource_detail = - Util.option_bind - (Xml.member "StackResourceDetail" xml) - StackResourceDetail.parse + end +module DeleteStackInput = + struct + type t = { + stack_name: String.t } + let make ~stack_name () = { stack_name } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.stack_resource_detail (fun f -> - Query.Pair ("StackResourceDetail", StackResourceDetail.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.stack_resource_detail (fun f -> - "stack_resource_detail", StackResourceDetail.to_json f) - ]) - - let of_json j = - { stack_resource_detail = - Util.option_map - (Json.lookup j "stack_resource_detail") - StackResourceDetail.of_json - } -end - -module DescribeStacksInput = struct - type t = - { stack_name : String.t option - ; next_token : String.t option - } - - let make ?stack_name ?next_token () = { stack_name; next_token } - - let parse xml = - Some - { stack_name = Util.option_bind (Xml.member "StackName" xml) String.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module GetTemplateSummaryOutput = + struct + type t = + { + parameters: ParameterDeclarations.t ; + description: String.t option ; + capabilities: Capabilities.t ; + capabilities_reason: String.t option ; + version: String.t option ; + metadata: String.t option } + let make ?(parameters= []) ?description ?(capabilities= []) + ?capabilities_reason ?version ?metadata () = + { + parameters; + description; + capabilities; + capabilities_reason; + version; + metadata } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.stack_name (fun f -> - Query.Pair ("StackName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.stack_name (fun f -> "stack_name", String.to_json f) - ]) - - let of_json j = - { stack_name = Util.option_map (Json.lookup j "stack_name") String.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module EstimateTemplateCostInput = struct - type t = - { template_body : String.t option - ; template_u_r_l : String.t option - ; parameters : Parameters.t - } - - let make ?template_body ?template_u_r_l ?(parameters = []) () = - { template_body; template_u_r_l; parameters } - - let parse xml = - Some - { template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse - ; template_u_r_l = Util.option_bind (Xml.member "TemplateURL" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) Parameters.parse) + let parse xml = + Some + { + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParameterDeclarations.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + capabilities = + (Util.of_option [] + (Util.option_bind (Xml.member "Capabilities" xml) + Capabilities.parse)); + capabilities_reason = + (Util.option_bind (Xml.member "CapabilitiesReason" xml) + String.parse); + version = + (Util.option_bind (Xml.member "Version" xml) String.parse); + metadata = + (Util.option_bind (Xml.member "Metadata" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.metadata + (fun f -> Query.Pair ("Metadata", (String.to_query f))); + Util.option_map v.version + (fun f -> Query.Pair ("Version", (String.to_query f))); + Util.option_map v.capabilities_reason + (fun f -> Query.Pair ("CapabilitiesReason", (String.to_query f))); + Some + (Query.Pair + ("Capabilities.member", + (Capabilities.to_query v.capabilities))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some + (Query.Pair + ("Parameters.member", + (ParameterDeclarations.to_query v.parameters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.metadata + (fun f -> ("metadata", (String.to_json f))); + Util.option_map v.version + (fun f -> ("version", (String.to_json f))); + Util.option_map v.capabilities_reason + (fun f -> ("capabilities_reason", (String.to_json f))); + Some ("capabilities", (Capabilities.to_json v.capabilities)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("parameters", (ParameterDeclarations.to_json v.parameters))]) + let of_json j = + { + parameters = + (ParameterDeclarations.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + capabilities = + (Capabilities.of_json + (Util.of_option_exn (Json.lookup j "capabilities"))); + capabilities_reason = + (Util.option_map (Json.lookup j "capabilities_reason") + String.of_json); + version = (Util.option_map (Json.lookup j "version") String.of_json); + metadata = + (Util.option_map (Json.lookup j "metadata") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", Parameters.to_query v.parameters)) - ; Util.option_map v.template_u_r_l (fun f -> - Query.Pair ("TemplateURL", String.to_query f)) - ; Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", Parameters.to_json v.parameters) - ; Util.option_map v.template_u_r_l (fun f -> "template_u_r_l", String.to_json f) - ; Util.option_map v.template_body (fun f -> "template_body", String.to_json f) - ]) - - let of_json j = - { template_body = Util.option_map (Json.lookup j "template_body") String.of_json - ; template_u_r_l = Util.option_map (Json.lookup j "template_u_r_l") String.of_json - ; parameters = Parameters.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module UpdateStackInput = struct - type t = - { stack_name : String.t - ; template_body : String.t option - ; template_u_r_l : String.t option - ; use_previous_template : Boolean.t option - ; stack_policy_during_update_body : String.t option - ; stack_policy_during_update_u_r_l : String.t option - ; parameters : Parameters.t - ; capabilities : Capabilities.t - ; stack_policy_body : String.t option - ; stack_policy_u_r_l : String.t option - ; notification_a_r_ns : NotificationARNs.t - } - - let make - ~stack_name - ?template_body - ?template_u_r_l - ?use_previous_template - ?stack_policy_during_update_body - ?stack_policy_during_update_u_r_l - ?(parameters = []) - ?(capabilities = []) - ?stack_policy_body - ?stack_policy_u_r_l - ?(notification_a_r_ns = []) - () = - { stack_name - ; template_body - ; template_u_r_l - ; use_previous_template - ; stack_policy_during_update_body - ; stack_policy_during_update_u_r_l - ; parameters - ; capabilities - ; stack_policy_body - ; stack_policy_u_r_l - ; notification_a_r_ns - } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse - ; template_u_r_l = Util.option_bind (Xml.member "TemplateURL" xml) String.parse - ; use_previous_template = - Util.option_bind (Xml.member "UsePreviousTemplate" xml) Boolean.parse - ; stack_policy_during_update_body = - Util.option_bind (Xml.member "StackPolicyDuringUpdateBody" xml) String.parse - ; stack_policy_during_update_u_r_l = - Util.option_bind (Xml.member "StackPolicyDuringUpdateURL" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) Parameters.parse) - ; capabilities = - Util.of_option - [] - (Util.option_bind (Xml.member "Capabilities" xml) Capabilities.parse) - ; stack_policy_body = - Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse - ; stack_policy_u_r_l = - Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse - ; notification_a_r_ns = - Util.of_option - [] - (Util.option_bind (Xml.member "NotificationARNs" xml) NotificationARNs.parse) + end +module AlreadyExistsException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeStackEventsInput = + struct + type t = { + stack_name: String.t option ; + next_token: String.t option } + let make ?stack_name ?next_token () = { stack_name; next_token } + let parse xml = + Some + { + stack_name = + (Util.option_bind (Xml.member "StackName" xml) String.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f)))]) + let of_json j = + { + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module ValidateTemplateInput = + struct + type t = + { + template_body: String.t option ; + template_u_r_l: String.t option } + let make ?template_body ?template_u_r_l () = + { template_body; template_u_r_l } + let parse xml = + Some + { + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse); + template_u_r_l = + (Util.option_bind (Xml.member "TemplateURL" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.template_u_r_l + (fun f -> Query.Pair ("TemplateURL", (String.to_query f))); + Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.template_u_r_l + (fun f -> ("template_u_r_l", (String.to_json f))); + Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f)))]) + let of_json j = + { + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json); + template_u_r_l = + (Util.option_map (Json.lookup j "template_u_r_l") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module ValidateTemplateOutput = + struct + type t = + { + parameters: TemplateParameters.t ; + description: String.t option ; + capabilities: Capabilities.t ; + capabilities_reason: String.t option } + let make ?(parameters= []) ?description ?(capabilities= []) + ?capabilities_reason () = + { parameters; description; capabilities; capabilities_reason } + let parse xml = + Some + { + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + TemplateParameters.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + capabilities = + (Util.of_option [] + (Util.option_bind (Xml.member "Capabilities" xml) + Capabilities.parse)); + capabilities_reason = + (Util.option_bind (Xml.member "CapabilitiesReason" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.capabilities_reason + (fun f -> + Query.Pair ("CapabilitiesReason", (String.to_query f))); + Some + (Query.Pair + ("Capabilities.member", + (Capabilities.to_query v.capabilities))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair - ( "NotificationARNs.member" - , NotificationARNs.to_query v.notification_a_r_ns )) - ; Util.option_map v.stack_policy_u_r_l (fun f -> - Query.Pair ("StackPolicyURL", String.to_query f)) - ; Util.option_map v.stack_policy_body (fun f -> - Query.Pair ("StackPolicyBody", String.to_query f)) - ; Some (Query.Pair ("Capabilities.member", Capabilities.to_query v.capabilities)) - ; Some (Query.Pair ("Parameters.member", Parameters.to_query v.parameters)) - ; Util.option_map v.stack_policy_during_update_u_r_l (fun f -> - Query.Pair ("StackPolicyDuringUpdateURL", String.to_query f)) - ; Util.option_map v.stack_policy_during_update_body (fun f -> - Query.Pair ("StackPolicyDuringUpdateBody", String.to_query f)) - ; Util.option_map v.use_previous_template (fun f -> - Query.Pair ("UsePreviousTemplate", Boolean.to_query f)) - ; Util.option_map v.template_u_r_l (fun f -> - Query.Pair ("TemplateURL", String.to_query f)) - ; Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("notification_a_r_ns", NotificationARNs.to_json v.notification_a_r_ns) - ; Util.option_map v.stack_policy_u_r_l (fun f -> - "stack_policy_u_r_l", String.to_json f) - ; Util.option_map v.stack_policy_body (fun f -> - "stack_policy_body", String.to_json f) - ; Some ("capabilities", Capabilities.to_json v.capabilities) - ; Some ("parameters", Parameters.to_json v.parameters) - ; Util.option_map v.stack_policy_during_update_u_r_l (fun f -> - "stack_policy_during_update_u_r_l", String.to_json f) - ; Util.option_map v.stack_policy_during_update_body (fun f -> - "stack_policy_during_update_body", String.to_json f) - ; Util.option_map v.use_previous_template (fun f -> - "use_previous_template", Boolean.to_json f) - ; Util.option_map v.template_u_r_l (fun f -> "template_u_r_l", String.to_json f) - ; Util.option_map v.template_body (fun f -> "template_body", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; template_body = Util.option_map (Json.lookup j "template_body") String.of_json - ; template_u_r_l = Util.option_map (Json.lookup j "template_u_r_l") String.of_json - ; use_previous_template = - Util.option_map (Json.lookup j "use_previous_template") Boolean.of_json - ; stack_policy_during_update_body = - Util.option_map (Json.lookup j "stack_policy_during_update_body") String.of_json - ; stack_policy_during_update_u_r_l = - Util.option_map (Json.lookup j "stack_policy_during_update_u_r_l") String.of_json - ; parameters = Parameters.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; capabilities = - Capabilities.of_json (Util.of_option_exn (Json.lookup j "capabilities")) - ; stack_policy_body = - Util.option_map (Json.lookup j "stack_policy_body") String.of_json - ; stack_policy_u_r_l = - Util.option_map (Json.lookup j "stack_policy_u_r_l") String.of_json - ; notification_a_r_ns = - NotificationARNs.of_json - (Util.of_option_exn (Json.lookup j "notification_a_r_ns")) - } -end - -module CreateStackInput = struct - type t = - { stack_name : String.t - ; template_body : String.t option - ; template_u_r_l : String.t option - ; parameters : Parameters.t - ; disable_rollback : Boolean.t option - ; timeout_in_minutes : Integer.t option - ; notification_a_r_ns : NotificationARNs.t - ; capabilities : Capabilities.t - ; on_failure : OnFailure.t option - ; stack_policy_body : String.t option - ; stack_policy_u_r_l : String.t option - ; tags : Tags.t - } - - let make - ~stack_name - ?template_body - ?template_u_r_l - ?(parameters = []) - ?disable_rollback - ?timeout_in_minutes - ?(notification_a_r_ns = []) - ?(capabilities = []) - ?on_failure - ?stack_policy_body - ?stack_policy_u_r_l - ?(tags = []) - () = - { stack_name - ; template_body - ; template_u_r_l - ; parameters - ; disable_rollback - ; timeout_in_minutes - ; notification_a_r_ns - ; capabilities - ; on_failure - ; stack_policy_body - ; stack_policy_u_r_l - ; tags - } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" + ("Parameters.member", + (TemplateParameters.to_query v.parameters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.capabilities_reason + (fun f -> ("capabilities_reason", (String.to_json f))); + Some ("capabilities", (Capabilities.to_json v.capabilities)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("parameters", (TemplateParameters.to_json v.parameters))]) + let of_json j = + { + parameters = + (TemplateParameters.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + capabilities = + (Capabilities.of_json + (Util.of_option_exn (Json.lookup j "capabilities"))); + capabilities_reason = + (Util.option_map (Json.lookup j "capabilities_reason") + String.of_json) + } + end +module GetTemplateSummaryInput = + struct + type t = + { + template_body: String.t option ; + template_u_r_l: String.t option ; + stack_name: String.t option } + let make ?template_body ?template_u_r_l ?stack_name () = + { template_body; template_u_r_l; stack_name } + let parse xml = + Some + { + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse); + template_u_r_l = + (Util.option_bind (Xml.member "TemplateURL" xml) String.parse); + stack_name = (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse - ; template_u_r_l = Util.option_bind (Xml.member "TemplateURL" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) Parameters.parse) - ; disable_rollback = - Util.option_bind (Xml.member "DisableRollback" xml) Boolean.parse - ; timeout_in_minutes = - Util.option_bind (Xml.member "TimeoutInMinutes" xml) Integer.parse - ; notification_a_r_ns = - Util.of_option - [] - (Util.option_bind (Xml.member "NotificationARNs" xml) NotificationARNs.parse) - ; capabilities = - Util.of_option - [] - (Util.option_bind (Xml.member "Capabilities" xml) Capabilities.parse) - ; on_failure = Util.option_bind (Xml.member "OnFailure" xml) OnFailure.parse - ; stack_policy_body = - Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse - ; stack_policy_u_r_l = - Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) Tags.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f))); + Util.option_map v.template_u_r_l + (fun f -> Query.Pair ("TemplateURL", (String.to_query f))); + Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f))); + Util.option_map v.template_u_r_l + (fun f -> ("template_u_r_l", (String.to_json f))); + Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f)))]) + let of_json j = + { + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json); + template_u_r_l = + (Util.option_map (Json.lookup j "template_u_r_l") String.of_json); + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json) + } + end +module CancelUpdateStackInput = + struct + type t = { + stack_name: String.t } + let make ~stack_name () = { stack_name } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))) + } + end +module UpdateStackOutput = + struct + type t = { + stack_id: String.t option } + let make ?stack_id () = { stack_id } + let parse xml = + Some + { + stack_id = + (Util.option_bind (Xml.member "StackId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_id + (fun f -> Query.Pair ("StackId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_id + (fun f -> ("stack_id", (String.to_json f)))]) + let of_json j = + { + stack_id = + (Util.option_map (Json.lookup j "stack_id") String.of_json) + } + end +module DescribeStacksOutput = + struct + type t = { + stacks: Stacks.t ; + next_token: String.t option } + let make ?(stacks= []) ?next_token () = { stacks; next_token } + let parse xml = + Some + { + stacks = + (Util.of_option [] + (Util.option_bind (Xml.member "Stacks" xml) Stacks.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Stacks.member", (Stacks.to_query v.stacks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("stacks", (Stacks.to_json v.stacks))]) + let of_json j = + { + stacks = + (Stacks.of_json (Util.of_option_exn (Json.lookup j "stacks"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module LimitExceededException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeStackResourceOutput = + struct + type t = { + stack_resource_detail: StackResourceDetail.t option } + let make ?stack_resource_detail () = { stack_resource_detail } + let parse xml = + Some + { + stack_resource_detail = + (Util.option_bind (Xml.member "StackResourceDetail" xml) + StackResourceDetail.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.stack_resource_detail + (fun f -> + Query.Pair + ("StackResourceDetail", (StackResourceDetail.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.stack_resource_detail + (fun f -> + ("stack_resource_detail", (StackResourceDetail.to_json f)))]) + let of_json j = + { + stack_resource_detail = + (Util.option_map (Json.lookup j "stack_resource_detail") + StackResourceDetail.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", Tags.to_query v.tags)) - ; Util.option_map v.stack_policy_u_r_l (fun f -> - Query.Pair ("StackPolicyURL", String.to_query f)) - ; Util.option_map v.stack_policy_body (fun f -> - Query.Pair ("StackPolicyBody", String.to_query f)) - ; Util.option_map v.on_failure (fun f -> - Query.Pair ("OnFailure", OnFailure.to_query f)) - ; Some (Query.Pair ("Capabilities.member", Capabilities.to_query v.capabilities)) - ; Some + end +module DescribeStacksInput = + struct + type t = { + stack_name: String.t option ; + next_token: String.t option } + let make ?stack_name ?next_token () = { stack_name; next_token } + let parse xml = + Some + { + stack_name = + (Util.option_bind (Xml.member "StackName" xml) String.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.stack_name + (fun f -> Query.Pair ("StackName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.stack_name + (fun f -> ("stack_name", (String.to_json f)))]) + let of_json j = + { + stack_name = + (Util.option_map (Json.lookup j "stack_name") String.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module EstimateTemplateCostInput = + struct + type t = + { + template_body: String.t option ; + template_u_r_l: String.t option ; + parameters: Parameters.t } + let make ?template_body ?template_u_r_l ?(parameters= []) () = + { template_body; template_u_r_l; parameters } + let parse xml = + Some + { + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse); + template_u_r_l = + (Util.option_bind (Xml.member "TemplateURL" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + Parameters.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", (Parameters.to_query v.parameters))); + Util.option_map v.template_u_r_l + (fun f -> Query.Pair ("TemplateURL", (String.to_query f))); + Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (Parameters.to_json v.parameters)); + Util.option_map v.template_u_r_l + (fun f -> ("template_u_r_l", (String.to_json f))); + Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f)))]) + let of_json j = + { + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json); + template_u_r_l = + (Util.option_map (Json.lookup j "template_u_r_l") String.of_json); + parameters = + (Parameters.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module UpdateStackInput = + struct + type t = + { + stack_name: String.t ; + template_body: String.t option ; + template_u_r_l: String.t option ; + use_previous_template: Boolean.t option ; + stack_policy_during_update_body: String.t option ; + stack_policy_during_update_u_r_l: String.t option ; + parameters: Parameters.t ; + capabilities: Capabilities.t ; + stack_policy_body: String.t option ; + stack_policy_u_r_l: String.t option ; + notification_a_r_ns: NotificationARNs.t } + let make ~stack_name ?template_body ?template_u_r_l + ?use_previous_template ?stack_policy_during_update_body + ?stack_policy_during_update_u_r_l ?(parameters= []) ?(capabilities= + []) ?stack_policy_body ?stack_policy_u_r_l ?(notification_a_r_ns= + []) () = + { + stack_name; + template_body; + template_u_r_l; + use_previous_template; + stack_policy_during_update_body; + stack_policy_during_update_u_r_l; + parameters; + capabilities; + stack_policy_body; + stack_policy_u_r_l; + notification_a_r_ns + } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse); + template_u_r_l = + (Util.option_bind (Xml.member "TemplateURL" xml) String.parse); + use_previous_template = + (Util.option_bind (Xml.member "UsePreviousTemplate" xml) + Boolean.parse); + stack_policy_during_update_body = + (Util.option_bind (Xml.member "StackPolicyDuringUpdateBody" xml) + String.parse); + stack_policy_during_update_u_r_l = + (Util.option_bind (Xml.member "StackPolicyDuringUpdateURL" xml) + String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + Parameters.parse)); + capabilities = + (Util.of_option [] + (Util.option_bind (Xml.member "Capabilities" xml) + Capabilities.parse)); + stack_policy_body = + (Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse); + stack_policy_u_r_l = + (Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse); + notification_a_r_ns = + (Util.of_option [] + (Util.option_bind (Xml.member "NotificationARNs" xml) + NotificationARNs.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NotificationARNs.member", + (NotificationARNs.to_query v.notification_a_r_ns))); + Util.option_map v.stack_policy_u_r_l + (fun f -> Query.Pair ("StackPolicyURL", (String.to_query f))); + Util.option_map v.stack_policy_body + (fun f -> Query.Pair ("StackPolicyBody", (String.to_query f))); + Some (Query.Pair - ( "NotificationARNs.member" - , NotificationARNs.to_query v.notification_a_r_ns )) - ; Util.option_map v.timeout_in_minutes (fun f -> - Query.Pair ("TimeoutInMinutes", Integer.to_query f)) - ; Util.option_map v.disable_rollback (fun f -> - Query.Pair ("DisableRollback", Boolean.to_query f)) - ; Some (Query.Pair ("Parameters.member", Parameters.to_query v.parameters)) - ; Util.option_map v.template_u_r_l (fun f -> - Query.Pair ("TemplateURL", String.to_query f)) - ; Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", Tags.to_json v.tags) - ; Util.option_map v.stack_policy_u_r_l (fun f -> - "stack_policy_u_r_l", String.to_json f) - ; Util.option_map v.stack_policy_body (fun f -> - "stack_policy_body", String.to_json f) - ; Util.option_map v.on_failure (fun f -> "on_failure", OnFailure.to_json f) - ; Some ("capabilities", Capabilities.to_json v.capabilities) - ; Some ("notification_a_r_ns", NotificationARNs.to_json v.notification_a_r_ns) - ; Util.option_map v.timeout_in_minutes (fun f -> - "timeout_in_minutes", Integer.to_json f) - ; Util.option_map v.disable_rollback (fun f -> - "disable_rollback", Boolean.to_json f) - ; Some ("parameters", Parameters.to_json v.parameters) - ; Util.option_map v.template_u_r_l (fun f -> "template_u_r_l", String.to_json f) - ; Util.option_map v.template_body (fun f -> "template_body", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; template_body = Util.option_map (Json.lookup j "template_body") String.of_json - ; template_u_r_l = Util.option_map (Json.lookup j "template_u_r_l") String.of_json - ; parameters = Parameters.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; disable_rollback = - Util.option_map (Json.lookup j "disable_rollback") Boolean.of_json - ; timeout_in_minutes = - Util.option_map (Json.lookup j "timeout_in_minutes") Integer.of_json - ; notification_a_r_ns = - NotificationARNs.of_json - (Util.of_option_exn (Json.lookup j "notification_a_r_ns")) - ; capabilities = - Capabilities.of_json (Util.of_option_exn (Json.lookup j "capabilities")) - ; on_failure = Util.option_map (Json.lookup j "on_failure") OnFailure.of_json - ; stack_policy_body = - Util.option_map (Json.lookup j "stack_policy_body") String.of_json - ; stack_policy_u_r_l = - Util.option_map (Json.lookup j "stack_policy_u_r_l") String.of_json - ; tags = Tags.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DescribeStackEventsOutput = struct - type t = - { stack_events : StackEvents.t - ; next_token : String.t option - } - - let make ?(stack_events = []) ?next_token () = { stack_events; next_token } - - let parse xml = - Some - { stack_events = - Util.of_option - [] - (Util.option_bind (Xml.member "StackEvents" xml) StackEvents.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("Capabilities.member", + (Capabilities.to_query v.capabilities))); + Some + (Query.Pair + ("Parameters.member", (Parameters.to_query v.parameters))); + Util.option_map v.stack_policy_during_update_u_r_l + (fun f -> + Query.Pair + ("StackPolicyDuringUpdateURL", (String.to_query f))); + Util.option_map v.stack_policy_during_update_body + (fun f -> + Query.Pair + ("StackPolicyDuringUpdateBody", (String.to_query f))); + Util.option_map v.use_previous_template + (fun f -> + Query.Pair ("UsePreviousTemplate", (Boolean.to_query f))); + Util.option_map v.template_u_r_l + (fun f -> Query.Pair ("TemplateURL", (String.to_query f))); + Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("notification_a_r_ns", + (NotificationARNs.to_json v.notification_a_r_ns)); + Util.option_map v.stack_policy_u_r_l + (fun f -> ("stack_policy_u_r_l", (String.to_json f))); + Util.option_map v.stack_policy_body + (fun f -> ("stack_policy_body", (String.to_json f))); + Some ("capabilities", (Capabilities.to_json v.capabilities)); + Some ("parameters", (Parameters.to_json v.parameters)); + Util.option_map v.stack_policy_during_update_u_r_l + (fun f -> + ("stack_policy_during_update_u_r_l", (String.to_json f))); + Util.option_map v.stack_policy_during_update_body + (fun f -> + ("stack_policy_during_update_body", (String.to_json f))); + Util.option_map v.use_previous_template + (fun f -> ("use_previous_template", (Boolean.to_json f))); + Util.option_map v.template_u_r_l + (fun f -> ("template_u_r_l", (String.to_json f))); + Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json); + template_u_r_l = + (Util.option_map (Json.lookup j "template_u_r_l") String.of_json); + use_previous_template = + (Util.option_map (Json.lookup j "use_previous_template") + Boolean.of_json); + stack_policy_during_update_body = + (Util.option_map (Json.lookup j "stack_policy_during_update_body") + String.of_json); + stack_policy_during_update_u_r_l = + (Util.option_map (Json.lookup j "stack_policy_during_update_u_r_l") + String.of_json); + parameters = + (Parameters.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + capabilities = + (Capabilities.of_json + (Util.of_option_exn (Json.lookup j "capabilities"))); + stack_policy_body = + (Util.option_map (Json.lookup j "stack_policy_body") String.of_json); + stack_policy_u_r_l = + (Util.option_map (Json.lookup j "stack_policy_u_r_l") + String.of_json); + notification_a_r_ns = + (NotificationARNs.of_json + (Util.of_option_exn (Json.lookup j "notification_a_r_ns"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("StackEvents.member", StackEvents.to_query v.stack_events)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("stack_events", StackEvents.to_json v.stack_events) - ]) - - let of_json j = - { stack_events = - StackEvents.of_json (Util.of_option_exn (Json.lookup j "stack_events")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeStackResourcesOutput = struct - type t = { stack_resources : StackResources.t } - - let make ?(stack_resources = []) () = { stack_resources } - - let parse xml = - Some - { stack_resources = - Util.of_option - [] - (Util.option_bind (Xml.member "StackResources" xml) StackResources.parse) + end +module CreateStackInput = + struct + type t = + { + stack_name: String.t ; + template_body: String.t option ; + template_u_r_l: String.t option ; + parameters: Parameters.t ; + disable_rollback: Boolean.t option ; + timeout_in_minutes: Integer.t option ; + notification_a_r_ns: NotificationARNs.t ; + capabilities: Capabilities.t ; + on_failure: OnFailure.t option ; + stack_policy_body: String.t option ; + stack_policy_u_r_l: String.t option ; + tags: Tags.t } + let make ~stack_name ?template_body ?template_u_r_l ?(parameters= []) + ?disable_rollback ?timeout_in_minutes ?(notification_a_r_ns= []) + ?(capabilities= []) ?on_failure ?stack_policy_body + ?stack_policy_u_r_l ?(tags= []) () = + { + stack_name; + template_body; + template_u_r_l; + parameters; + disable_rollback; + timeout_in_minutes; + notification_a_r_ns; + capabilities; + on_failure; + stack_policy_body; + stack_policy_u_r_l; + tags } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse); + template_u_r_l = + (Util.option_bind (Xml.member "TemplateURL" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + Parameters.parse)); + disable_rollback = + (Util.option_bind (Xml.member "DisableRollback" xml) + Boolean.parse); + timeout_in_minutes = + (Util.option_bind (Xml.member "TimeoutInMinutes" xml) + Integer.parse); + notification_a_r_ns = + (Util.of_option [] + (Util.option_bind (Xml.member "NotificationARNs" xml) + NotificationARNs.parse)); + capabilities = + (Util.of_option [] + (Util.option_bind (Xml.member "Capabilities" xml) + Capabilities.parse)); + on_failure = + (Util.option_bind (Xml.member "OnFailure" xml) OnFailure.parse); + stack_policy_body = + (Util.option_bind (Xml.member "StackPolicyBody" xml) String.parse); + stack_policy_u_r_l = + (Util.option_bind (Xml.member "StackPolicyURL" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) Tags.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (Tags.to_query v.tags))); + Util.option_map v.stack_policy_u_r_l + (fun f -> Query.Pair ("StackPolicyURL", (String.to_query f))); + Util.option_map v.stack_policy_body + (fun f -> Query.Pair ("StackPolicyBody", (String.to_query f))); + Util.option_map v.on_failure + (fun f -> Query.Pair ("OnFailure", (OnFailure.to_query f))); + Some (Query.Pair - ("StackResources.member", StackResources.to_query v.stack_resources)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("stack_resources", StackResources.to_json v.stack_resources) ]) - - let of_json j = - { stack_resources = - StackResources.of_json (Util.of_option_exn (Json.lookup j "stack_resources")) - } -end - -module ListStackResourcesInput = struct - type t = - { stack_name : String.t - ; next_token : String.t option - } - - let make ~stack_name ?next_token () = { stack_name; next_token } - - let parse xml = - Some - { stack_name = - Xml.required - "StackName" - (Util.option_bind (Xml.member "StackName" xml) String.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("Capabilities.member", + (Capabilities.to_query v.capabilities))); + Some + (Query.Pair + ("NotificationARNs.member", + (NotificationARNs.to_query v.notification_a_r_ns))); + Util.option_map v.timeout_in_minutes + (fun f -> Query.Pair ("TimeoutInMinutes", (Integer.to_query f))); + Util.option_map v.disable_rollback + (fun f -> Query.Pair ("DisableRollback", (Boolean.to_query f))); + Some + (Query.Pair + ("Parameters.member", (Parameters.to_query v.parameters))); + Util.option_map v.template_u_r_l + (fun f -> Query.Pair ("TemplateURL", (String.to_query f))); + Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (Tags.to_json v.tags)); + Util.option_map v.stack_policy_u_r_l + (fun f -> ("stack_policy_u_r_l", (String.to_json f))); + Util.option_map v.stack_policy_body + (fun f -> ("stack_policy_body", (String.to_json f))); + Util.option_map v.on_failure + (fun f -> ("on_failure", (OnFailure.to_json f))); + Some ("capabilities", (Capabilities.to_json v.capabilities)); + Some + ("notification_a_r_ns", + (NotificationARNs.to_json v.notification_a_r_ns)); + Util.option_map v.timeout_in_minutes + (fun f -> ("timeout_in_minutes", (Integer.to_json f))); + Util.option_map v.disable_rollback + (fun f -> ("disable_rollback", (Boolean.to_json f))); + Some ("parameters", (Parameters.to_json v.parameters)); + Util.option_map v.template_u_r_l + (fun f -> ("template_u_r_l", (String.to_json f))); + Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json); + template_u_r_l = + (Util.option_map (Json.lookup j "template_u_r_l") String.of_json); + parameters = + (Parameters.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + disable_rollback = + (Util.option_map (Json.lookup j "disable_rollback") Boolean.of_json); + timeout_in_minutes = + (Util.option_map (Json.lookup j "timeout_in_minutes") + Integer.of_json); + notification_a_r_ns = + (NotificationARNs.of_json + (Util.of_option_exn (Json.lookup j "notification_a_r_ns"))); + capabilities = + (Capabilities.of_json + (Util.of_option_exn (Json.lookup j "capabilities"))); + on_failure = + (Util.option_map (Json.lookup j "on_failure") OnFailure.of_json); + stack_policy_body = + (Util.option_map (Json.lookup j "stack_policy_body") String.of_json); + stack_policy_u_r_l = + (Util.option_map (Json.lookup j "stack_policy_u_r_l") + String.of_json); + tags = (Tags.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DescribeStackEventsOutput = + struct + type t = { + stack_events: StackEvents.t ; + next_token: String.t option } + let make ?(stack_events= []) ?next_token () = + { stack_events; next_token } + let parse xml = + Some + { + stack_events = + (Util.of_option [] + (Util.option_bind (Xml.member "StackEvents" xml) + StackEvents.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("StackEvents.member", (StackEvents.to_query v.stack_events)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("stack_events", (StackEvents.to_json v.stack_events))]) + let of_json j = + { + stack_events = + (StackEvents.of_json + (Util.of_option_exn (Json.lookup j "stack_events"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeStackResourcesOutput = + struct + type t = { + stack_resources: StackResources.t } + let make ?(stack_resources= []) () = { stack_resources } + let parse xml = + Some + { + stack_resources = + (Util.of_option [] + (Util.option_bind (Xml.member "StackResources" xml) + StackResources.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("StackResources.member", + (StackResources.to_query v.stack_resources)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("stack_resources", (StackResources.to_json v.stack_resources))]) + let of_json j = + { + stack_resources = + (StackResources.of_json + (Util.of_option_exn (Json.lookup j "stack_resources"))) + } + end +module ListStackResourcesInput = + struct + type t = { + stack_name: String.t ; + next_token: String.t option } + let make ~stack_name ?next_token () = { stack_name; next_token } + let parse xml = + Some + { + stack_name = + (Xml.required "StackName" + (Util.option_bind (Xml.member "StackName" xml) String.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("StackName", (String.to_query v.stack_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("stack_name", (String.to_json v.stack_name))]) + let of_json j = + { + stack_name = + (String.of_json (Util.of_option_exn (Json.lookup j "stack_name"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module GetTemplateOutput = + struct + type t = { + template_body: String.t option } + let make ?template_body () = { template_body } + let parse xml = + Some + { + template_body = + (Util.option_bind (Xml.member "TemplateBody" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.template_body + (fun f -> Query.Pair ("TemplateBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.template_body + (fun f -> ("template_body", (String.to_json f)))]) + let of_json j = + { + template_body = + (Util.option_map (Json.lookup j "template_body") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("StackName", String.to_query v.stack_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("stack_name", String.to_json v.stack_name) - ]) - - let of_json j = - { stack_name = String.of_json (Util.of_option_exn (Json.lookup j "stack_name")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module GetTemplateOutput = struct - type t = { template_body : String.t option } - - let make ?template_body () = { template_body } - - let parse xml = - Some { template_body = Util.option_bind (Xml.member "TemplateBody" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.template_body (fun f -> - Query.Pair ("TemplateBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.template_body (fun f -> "template_body", String.to_json f) ]) - - let of_json j = - { template_body = Util.option_map (Json.lookup j "template_body") String.of_json } -end + end \ No newline at end of file diff --git a/libraries/cloudformation/lib/updateStack.ml b/libraries/cloudformation/lib/updateStack.ml index 43bd37b1f..7375dbd02 100644 --- a/libraries/cloudformation/lib/updateStack.ml +++ b/libraries/cloudformation/lib/updateStack.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = UpdateStackInput.t - type output = UpdateStackOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "UpdateStack" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-05-15"]); ("Action", ["UpdateStack"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UpdateStackInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (UpdateStackInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "UpdateStackResponse" (snd xml)) - (Xml.member "UpdateStackResult") - in + Util.option_bind (Xml.member "UpdateStackResponse" (snd xml)) + (Xml.member "UpdateStackResult") in try - Util.or_error - (Util.option_bind resp UpdateStackOutput.parse) + Util.or_error (Util.option_bind resp UpdateStackOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed UpdateStackOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed UpdateStackOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UpdateStackOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UpdateStackOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientCapabilitiesException ] @ Errors_internal.common - in + [Errors_internal.InsufficientCapabilitiesException] @ + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/updateStack.mli b/libraries/cloudformation/lib/updateStack.mli index ecbf2d3e8..2314101a0 100644 --- a/libraries/cloudformation/lib/updateStack.mli +++ b/libraries/cloudformation/lib/updateStack.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateStackInput.t - type output = UpdateStackOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/validateTemplate.ml b/libraries/cloudformation/lib/validateTemplate.ml index 572ff3c07..cf087afeb 100644 --- a/libraries/cloudformation/lib/validateTemplate.ml +++ b/libraries/cloudformation/lib/validateTemplate.ml @@ -1,63 +1,59 @@ open Types open Aws - type input = ValidateTemplateInput.t - type output = ValidateTemplateOutput.t - type error = Errors_internal.t - let service = "cloudformation" - 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", [ "2010-05-15" ]; "Action", [ "ValidateTemplate" ] ] + [("Version", ["2010-05-15"]); ("Action", ["ValidateTemplate"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ValidateTemplateInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ValidateTemplateInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ValidateTemplateResponse" (snd xml)) - (Xml.member "ValidateTemplateResult") - in + Util.option_bind (Xml.member "ValidateTemplateResponse" (snd xml)) + (Xml.member "ValidateTemplateResult") in try - Util.or_error - (Util.option_bind resp ValidateTemplateOutput.parse) + Util.or_error (Util.option_bind resp ValidateTemplateOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ValidateTemplateOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ValidateTemplateOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ValidateTemplateOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ValidateTemplateOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudformation/lib/validateTemplate.mli b/libraries/cloudformation/lib/validateTemplate.mli index 221384b70..39e6fc9ec 100644 --- a/libraries/cloudformation/lib/validateTemplate.mli +++ b/libraries/cloudformation/lib/validateTemplate.mli @@ -1,10 +1,7 @@ open Types - type input = ValidateTemplateInput.t - type output = ValidateTemplateOutput.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 \ No newline at end of file diff --git a/libraries/cloudformation/lib_test/dune b/libraries/cloudformation/lib_test/dune index 6736f69c5..115b3f261 100644 --- a/libraries/cloudformation/lib_test/dune +++ b/libraries/cloudformation/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_cloudformation_test) - (libraries aws aws_cloudformation aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_cloudformation aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/cloudformation/lib_test/test_async.ml b/libraries/cloudformation/lib_test/test_async.ml index 2e82565f9..e22f5fecd 100644 --- a/libraries/cloudformation/lib_test/test_async.ml +++ b/libraries/cloudformation/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_cloudformation_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/cloudformation/lib_test/test_lwt.ml b/libraries/cloudformation/lib_test/test_lwt.ml index 979da21ec..f965150c2 100644 --- a/libraries/cloudformation/lib_test/test_lwt.ml +++ b/libraries/cloudformation/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_cloudformation_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/cloudtrail/lib/createTrail.ml b/libraries/cloudtrail/lib/createTrail.ml index bd6ab5014..1bde58868 100644 --- a/libraries/cloudtrail/lib/createTrail.ml +++ b/libraries/cloudtrail/lib/createTrail.ml @@ -1,72 +1,68 @@ open Types open Aws - type input = CreateTrailRequest.t - type output = CreateTrailResponse.t - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "CreateTrail" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2013-11-01"]); ("Action", ["CreateTrail"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateTrailRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateTrailRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateTrailResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateTrailResponse.parse) + Util.or_error (Util.option_bind resp CreateTrailResponse.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateTrailResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateTrailResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateTrailResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateTrailResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.CloudWatchLogsDeliveryUnavailable - ; Errors_internal.InvalidCloudWatchLogsRoleArn - ; Errors_internal.InvalidCloudWatchLogsLogGroupArn - ; Errors_internal.InvalidTrailName - ; Errors_internal.InvalidSnsTopicName - ; Errors_internal.InvalidS3Prefix - ; Errors_internal.InvalidS3BucketName - ; Errors_internal.InsufficientSnsTopicPolicy - ; Errors_internal.InsufficientS3BucketPolicy - ; Errors_internal.S3BucketDoesNotExist - ; Errors_internal.TrailAlreadyExists - ; Errors_internal.MaximumNumberOfTrailsExceeded - ] - @ Errors_internal.common - in + [Errors_internal.CloudWatchLogsDeliveryUnavailable; + Errors_internal.InvalidCloudWatchLogsRoleArn; + Errors_internal.InvalidCloudWatchLogsLogGroupArn; + Errors_internal.InvalidTrailName; + Errors_internal.InvalidSnsTopicName; + Errors_internal.InvalidS3Prefix; + Errors_internal.InvalidS3BucketName; + Errors_internal.InsufficientSnsTopicPolicy; + Errors_internal.InsufficientS3BucketPolicy; + Errors_internal.S3BucketDoesNotExist; + Errors_internal.TrailAlreadyExists; + Errors_internal.MaximumNumberOfTrailsExceeded] @ 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/createTrail.mli b/libraries/cloudtrail/lib/createTrail.mli index 7a2e9944d..d694ae3c0 100644 --- a/libraries/cloudtrail/lib/createTrail.mli +++ b/libraries/cloudtrail/lib/createTrail.mli @@ -1,10 +1,7 @@ open Types - type input = CreateTrailRequest.t - type output = CreateTrailResponse.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/deleteTrail.ml b/libraries/cloudtrail/lib/deleteTrail.ml index 4feb9947f..cb46482ec 100644 --- a/libraries/cloudtrail/lib/deleteTrail.ml +++ b/libraries/cloudtrail/lib/deleteTrail.ml @@ -1,39 +1,31 @@ open Types open Aws - type input = DeleteTrailRequest.t - type output = unit - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "DeleteTrail" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2013-11-01"]); ("Action", ["DeleteTrail"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteTrailRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteTrailRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/deleteTrail.mli b/libraries/cloudtrail/lib/deleteTrail.mli index 2bb172290..7d5100c17 100644 --- a/libraries/cloudtrail/lib/deleteTrail.mli +++ b/libraries/cloudtrail/lib/deleteTrail.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteTrailRequest.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/describeTrails.ml b/libraries/cloudtrail/lib/describeTrails.ml index 6373bdd11..30c3942a7 100644 --- a/libraries/cloudtrail/lib/describeTrails.ml +++ b/libraries/cloudtrail/lib/describeTrails.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = DescribeTrailsRequest.t - type output = DescribeTrailsResponse.t - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "DescribeTrails" ] ] + [("Version", ["2013-11-01"]); ("Action", ["DescribeTrails"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeTrailsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeTrailsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeTrailsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeTrailsResponse.parse) + Util.or_error (Util.option_bind resp DescribeTrailsResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeTrailsResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeTrailsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeTrailsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeTrailsResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/describeTrails.mli b/libraries/cloudtrail/lib/describeTrails.mli index 87dca9e1a..a03b67342 100644 --- a/libraries/cloudtrail/lib/describeTrails.mli +++ b/libraries/cloudtrail/lib/describeTrails.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeTrailsRequest.t - type output = DescribeTrailsResponse.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/dune b/libraries/cloudtrail/lib/dune index 6dfec722f..0d2596c19 100644 --- a/libraries/cloudtrail/lib/dune +++ b/libraries/cloudtrail/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_cloudtrail) + (name aws_cloudtrail) (public_name aws-cloudtrail) (synopsis "aws-AWS CloudTrail") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/cloudtrail/lib/errors_internal.ml b/libraries/cloudtrail/lib/errors_internal.ml index 61eb311cb..733dc23fd 100644 --- a/libraries/cloudtrail/lib/errors_internal.ml +++ b/libraries/cloudtrail/lib/errors_internal.ml @@ -1,78 +1,75 @@ type t = - | AuthFailure - | Blocked - | CloudWatchLogsDeliveryUnavailable - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InsufficientS3BucketPolicy - | InsufficientSnsTopicPolicy - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidCloudWatchLogsLogGroupArn - | InvalidCloudWatchLogsRoleArn - | InvalidLookupAttributes - | InvalidMaxResults - | InvalidNextToken - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidS3BucketName - | InvalidS3Prefix - | InvalidSnsTopicName - | InvalidTimeRange - | InvalidTrailName - | MalformedQueryString - | MaximumNumberOfTrailsExceeded - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | S3BucketDoesNotExist - | ServiceUnavailable - | Throttling - | TrailAlreadyExists - | TrailNotFound - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | CloudWatchLogsDeliveryUnavailable + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InsufficientS3BucketPolicy + | InsufficientSnsTopicPolicy + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidCloudWatchLogsLogGroupArn + | InvalidCloudWatchLogsRoleArn + | InvalidLookupAttributes + | InvalidMaxResults + | InvalidNextToken + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidS3BucketName + | InvalidS3Prefix + | InvalidSnsTopicName + | InvalidTimeRange + | InvalidTrailName + | MalformedQueryString + | MaximumNumberOfTrailsExceeded + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | S3BucketDoesNotExist + | ServiceUnavailable + | Throttling + | TrailAlreadyExists + | TrailNotFound + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -119,7 +116,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -166,12 +162,12 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure | "Blocked" -> Some Blocked - | "CloudWatchLogsDeliveryUnavailable" -> Some CloudWatchLogsDeliveryUnavailable + | "CloudWatchLogsDeliveryUnavailable" -> + Some CloudWatchLogsDeliveryUnavailable | "DryRunOperation" -> Some DryRunOperation | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch | "IncompleteSignature" -> Some IncompleteSignature @@ -180,7 +176,8 @@ let of_string e = | "InternalFailure" -> Some InternalFailure | "InvalidAction" -> Some InvalidAction | "InvalidClientTokenId" -> Some InvalidClientTokenId - | "InvalidCloudWatchLogsLogGroupArn" -> Some InvalidCloudWatchLogsLogGroupArn + | "InvalidCloudWatchLogsLogGroupArn" -> + Some InvalidCloudWatchLogsLogGroupArn | "InvalidCloudWatchLogsRoleArn" -> Some InvalidCloudWatchLogsRoleArn | "InvalidLookupAttributes" -> Some InvalidLookupAttributes | "InvalidMaxResults" -> Some InvalidMaxResults @@ -213,4 +210,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/cloudtrail/lib/getTrailStatus.ml b/libraries/cloudtrail/lib/getTrailStatus.ml index 50771b607..9a8980499 100644 --- a/libraries/cloudtrail/lib/getTrailStatus.ml +++ b/libraries/cloudtrail/lib/getTrailStatus.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = GetTrailStatusRequest.t - type output = GetTrailStatusResponse.t - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "GetTrailStatus" ] ] + [("Version", ["2013-11-01"]); ("Action", ["GetTrailStatus"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetTrailStatusRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetTrailStatusRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetTrailStatusResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetTrailStatusResponse.parse) + Util.or_error (Util.option_bind resp GetTrailStatusResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetTrailStatusResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetTrailStatusResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetTrailStatusResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetTrailStatusResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/getTrailStatus.mli b/libraries/cloudtrail/lib/getTrailStatus.mli index 83035e78c..610b498f5 100644 --- a/libraries/cloudtrail/lib/getTrailStatus.mli +++ b/libraries/cloudtrail/lib/getTrailStatus.mli @@ -1,10 +1,7 @@ open Types - type input = GetTrailStatusRequest.t - type output = GetTrailStatusResponse.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/lookupEvents.ml b/libraries/cloudtrail/lib/lookupEvents.ml index 02e252845..3206e037c 100644 --- a/libraries/cloudtrail/lib/lookupEvents.ml +++ b/libraries/cloudtrail/lib/lookupEvents.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = LookupEventsRequest.t - type output = LookupEventsResponse.t - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "LookupEvents" ] ] + [("Version", ["2013-11-01"]); ("Action", ["LookupEvents"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (LookupEventsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (LookupEventsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "LookupEventsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp LookupEventsResponse.parse) + Util.or_error (Util.option_bind resp LookupEventsResponse.parse) (let open Error in - BadResponse { body; message = "Could not find well formed LookupEventsResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed LookupEventsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing LookupEventsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing LookupEventsResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidNextToken - ; Errors_internal.InvalidMaxResults - ; Errors_internal.InvalidTimeRange - ; Errors_internal.InvalidLookupAttributes - ] - @ Errors_internal.common - in + [Errors_internal.InvalidNextToken; + Errors_internal.InvalidMaxResults; + Errors_internal.InvalidTimeRange; + Errors_internal.InvalidLookupAttributes] @ 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/lookupEvents.mli b/libraries/cloudtrail/lib/lookupEvents.mli index 858d6c20b..dd8db1846 100644 --- a/libraries/cloudtrail/lib/lookupEvents.mli +++ b/libraries/cloudtrail/lib/lookupEvents.mli @@ -1,10 +1,7 @@ open Types - type input = LookupEventsRequest.t - type output = LookupEventsResponse.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/startLogging.ml b/libraries/cloudtrail/lib/startLogging.ml index a897cebc8..67ef3c55e 100644 --- a/libraries/cloudtrail/lib/startLogging.ml +++ b/libraries/cloudtrail/lib/startLogging.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = StartLoggingRequest.t - type output = unit - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "StartLogging" ] ] + [("Version", ["2013-11-01"]); ("Action", ["StartLogging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (StartLoggingRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (StartLoggingRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/startLogging.mli b/libraries/cloudtrail/lib/startLogging.mli index b387012ba..b7b01705a 100644 --- a/libraries/cloudtrail/lib/startLogging.mli +++ b/libraries/cloudtrail/lib/startLogging.mli @@ -1,10 +1,7 @@ open Types - type input = StartLoggingRequest.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/stopLogging.ml b/libraries/cloudtrail/lib/stopLogging.ml index 0fe480883..67be9a4b4 100644 --- a/libraries/cloudtrail/lib/stopLogging.ml +++ b/libraries/cloudtrail/lib/stopLogging.ml @@ -1,39 +1,31 @@ open Types open Aws - type input = StopLoggingRequest.t - type output = unit - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "StopLogging" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2013-11-01"]); ("Action", ["StopLogging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (StopLoggingRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (StopLoggingRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidTrailName; Errors_internal.TrailNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/stopLogging.mli b/libraries/cloudtrail/lib/stopLogging.mli index 3d7ec31da..e035c1e27 100644 --- a/libraries/cloudtrail/lib/stopLogging.mli +++ b/libraries/cloudtrail/lib/stopLogging.mli @@ -1,10 +1,7 @@ open Types - type input = StopLoggingRequest.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/types.ml b/libraries/cloudtrail/lib/types.ml index d5d60e9d7..0324bdec1 100644 --- a/libraries/cloudtrail/lib/types.ml +++ b/libraries/cloudtrail/lib/types.ml @@ -1,1360 +1,1340 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module Resource = struct - type t = - { resource_type : String.t option - ; resource_name : String.t option - } - - let make ?resource_type ?resource_name () = { resource_type; resource_name } - - let parse xml = - Some - { resource_type = Util.option_bind (Xml.member "ResourceType" xml) String.parse - ; resource_name = Util.option_bind (Xml.member "ResourceName" xml) String.parse +module Resource = + struct + type t = + { + resource_type: String.t option ; + resource_name: String.t option } + let make ?resource_type ?resource_name () = + { resource_type; resource_name } + let parse xml = + Some + { + resource_type = + (Util.option_bind (Xml.member "ResourceType" xml) String.parse); + resource_name = + (Util.option_bind (Xml.member "ResourceName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.resource_name + (fun f -> Query.Pair ("ResourceName", (String.to_query f))); + Util.option_map v.resource_type + (fun f -> Query.Pair ("ResourceType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.resource_name + (fun f -> ("resource_name", (String.to_json f))); + Util.option_map v.resource_type + (fun f -> ("resource_type", (String.to_json f)))]) + let of_json j = + { + resource_type = + (Util.option_map (Json.lookup j "resource_type") String.of_json); + resource_name = + (Util.option_map (Json.lookup j "resource_name") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.resource_name (fun f -> - Query.Pair ("ResourceName", String.to_query f)) - ; Util.option_map v.resource_type (fun f -> - Query.Pair ("ResourceType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.resource_name (fun f -> "resource_name", String.to_json f) - ; Util.option_map v.resource_type (fun f -> "resource_type", String.to_json f) - ]) - - let of_json j = - { resource_type = Util.option_map (Json.lookup j "resource_type") String.of_json - ; resource_name = Util.option_map (Json.lookup j "resource_name") String.of_json - } -end - -module LookupAttributeKey = struct - type t = - | EventId - | EventName - | Username - | ResourceType - | ResourceName - - let str_to_t = - [ "ResourceName", ResourceName - ; "ResourceType", ResourceType - ; "Username", Username - ; "EventName", EventName - ; "EventId", EventId - ] - - let t_to_str = - [ ResourceName, "ResourceName" - ; ResourceType, "ResourceType" - ; Username, "Username" - ; EventName, "EventName" - ; EventId, "EventId" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ResourceList = struct - type t = Resource.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Resource.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Resource.to_query v - - let to_json v = `List (List.map Resource.to_json v) - - let of_json j = Json.to_list Resource.of_json j -end - -module LookupAttribute = struct - type t = - { attribute_key : LookupAttributeKey.t - ; attribute_value : String.t - } - - let make ~attribute_key ~attribute_value () = { attribute_key; attribute_value } - - let parse xml = - Some - { attribute_key = - Xml.required - "AttributeKey" - (Util.option_bind (Xml.member "AttributeKey" xml) LookupAttributeKey.parse) - ; attribute_value = - Xml.required - "AttributeValue" - (Util.option_bind (Xml.member "AttributeValue" xml) String.parse) + end +module LookupAttributeKey = + struct + type t = + | EventId + | EventName + | Username + | ResourceType + | ResourceName + let str_to_t = + [("ResourceName", ResourceName); + ("ResourceType", ResourceType); + ("Username", Username); + ("EventName", EventName); + ("EventId", EventId)] + let t_to_str = + [(ResourceName, "ResourceName"); + (ResourceType, "ResourceType"); + (Username, "Username"); + (EventName, "EventName"); + (EventId, "EventId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ResourceList = + struct + type t = Resource.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Resource.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Resource.to_query v + let to_json v = `List (List.map Resource.to_json v) + let of_json j = Json.to_list Resource.of_json j + end +module LookupAttribute = + struct + type t = + { + attribute_key: LookupAttributeKey.t ; + attribute_value: String.t } + let make ~attribute_key ~attribute_value () = + { attribute_key; attribute_value } + let parse xml = + Some + { + attribute_key = + (Xml.required "AttributeKey" + (Util.option_bind (Xml.member "AttributeKey" xml) + LookupAttributeKey.parse)); + attribute_value = + (Xml.required "AttributeValue" + (Util.option_bind (Xml.member "AttributeValue" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AttributeValue", (String.to_query v.attribute_value))); + Some + (Query.Pair + ("AttributeKey", + (LookupAttributeKey.to_query v.attribute_key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute_value", (String.to_json v.attribute_value)); + Some + ("attribute_key", (LookupAttributeKey.to_json v.attribute_key))]) + let of_json j = + { + attribute_key = + (LookupAttributeKey.of_json + (Util.of_option_exn (Json.lookup j "attribute_key"))); + attribute_value = + (String.of_json + (Util.of_option_exn (Json.lookup j "attribute_value"))) + } + end +module Event = + struct + type t = + { + event_id: String.t option ; + event_name: String.t option ; + event_time: DateTime.t option ; + username: String.t option ; + resources: ResourceList.t ; + cloud_trail_event: String.t option } + let make ?event_id ?event_name ?event_time ?username ?(resources= []) + ?cloud_trail_event () = + { + event_id; + event_name; + event_time; + username; + resources; + cloud_trail_event + } + let parse xml = + Some + { + event_id = + (Util.option_bind (Xml.member "EventId" xml) String.parse); + event_name = + (Util.option_bind (Xml.member "EventName" xml) String.parse); + event_time = + (Util.option_bind (Xml.member "EventTime" xml) DateTime.parse); + username = + (Util.option_bind (Xml.member "Username" xml) String.parse); + resources = + (Util.of_option [] + (Util.option_bind (Xml.member "Resources" xml) + ResourceList.parse)); + cloud_trail_event = + (Util.option_bind (Xml.member "CloudTrailEvent" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_trail_event + (fun f -> Query.Pair ("CloudTrailEvent", (String.to_query f))); + Some + (Query.Pair + ("Resources.member", (ResourceList.to_query v.resources))); + Util.option_map v.username + (fun f -> Query.Pair ("Username", (String.to_query f))); + Util.option_map v.event_time + (fun f -> Query.Pair ("EventTime", (DateTime.to_query f))); + Util.option_map v.event_name + (fun f -> Query.Pair ("EventName", (String.to_query f))); + Util.option_map v.event_id + (fun f -> Query.Pair ("EventId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_trail_event + (fun f -> ("cloud_trail_event", (String.to_json f))); + Some ("resources", (ResourceList.to_json v.resources)); + Util.option_map v.username + (fun f -> ("username", (String.to_json f))); + Util.option_map v.event_time + (fun f -> ("event_time", (DateTime.to_json f))); + Util.option_map v.event_name + (fun f -> ("event_name", (String.to_json f))); + Util.option_map v.event_id + (fun f -> ("event_id", (String.to_json f)))]) + let of_json j = + { + event_id = + (Util.option_map (Json.lookup j "event_id") String.of_json); + event_name = + (Util.option_map (Json.lookup j "event_name") String.of_json); + event_time = + (Util.option_map (Json.lookup j "event_time") DateTime.of_json); + username = + (Util.option_map (Json.lookup j "username") String.of_json); + resources = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "resources"))); + cloud_trail_event = + (Util.option_map (Json.lookup j "cloud_trail_event") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AttributeValue", String.to_query v.attribute_value)) - ; Some (Query.Pair ("AttributeKey", LookupAttributeKey.to_query v.attribute_key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute_value", String.to_json v.attribute_value) - ; Some ("attribute_key", LookupAttributeKey.to_json v.attribute_key) - ]) - - let of_json j = - { attribute_key = - LookupAttributeKey.of_json (Util.of_option_exn (Json.lookup j "attribute_key")) - ; attribute_value = - String.of_json (Util.of_option_exn (Json.lookup j "attribute_value")) - } -end - -module Event = struct - type t = - { event_id : String.t option - ; event_name : String.t option - ; event_time : DateTime.t option - ; username : String.t option - ; resources : ResourceList.t - ; cloud_trail_event : String.t option - } - - let make - ?event_id - ?event_name - ?event_time - ?username - ?(resources = []) - ?cloud_trail_event - () = - { event_id; event_name; event_time; username; resources; cloud_trail_event } - - let parse xml = - Some - { event_id = Util.option_bind (Xml.member "EventId" xml) String.parse - ; event_name = Util.option_bind (Xml.member "EventName" xml) String.parse - ; event_time = Util.option_bind (Xml.member "EventTime" xml) DateTime.parse - ; username = Util.option_bind (Xml.member "Username" xml) String.parse - ; resources = - Util.of_option - [] - (Util.option_bind (Xml.member "Resources" xml) ResourceList.parse) - ; cloud_trail_event = - Util.option_bind (Xml.member "CloudTrailEvent" xml) String.parse + end +module Trail = + struct + type t = + { + name: String.t option ; + s3_bucket_name: String.t option ; + s3_key_prefix: String.t option ; + sns_topic_name: String.t option ; + include_global_service_events: Boolean.t option ; + cloud_watch_logs_log_group_arn: String.t option ; + cloud_watch_logs_role_arn: String.t option } + let make ?name ?s3_bucket_name ?s3_key_prefix ?sns_topic_name + ?include_global_service_events ?cloud_watch_logs_log_group_arn + ?cloud_watch_logs_role_arn () = + { + name; + s3_bucket_name; + s3_key_prefix; + sns_topic_name; + include_global_service_events; + cloud_watch_logs_log_group_arn; + cloud_watch_logs_role_arn } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_trail_event (fun f -> - Query.Pair ("CloudTrailEvent", String.to_query f)) - ; Some (Query.Pair ("Resources.member", ResourceList.to_query v.resources)) - ; Util.option_map v.username (fun f -> - Query.Pair ("Username", String.to_query f)) - ; Util.option_map v.event_time (fun f -> - Query.Pair ("EventTime", DateTime.to_query f)) - ; Util.option_map v.event_name (fun f -> - Query.Pair ("EventName", String.to_query f)) - ; Util.option_map v.event_id (fun f -> Query.Pair ("EventId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_trail_event (fun f -> - "cloud_trail_event", String.to_json f) - ; Some ("resources", ResourceList.to_json v.resources) - ; Util.option_map v.username (fun f -> "username", String.to_json f) - ; Util.option_map v.event_time (fun f -> "event_time", DateTime.to_json f) - ; Util.option_map v.event_name (fun f -> "event_name", String.to_json f) - ; Util.option_map v.event_id (fun f -> "event_id", String.to_json f) - ]) - - let of_json j = - { event_id = Util.option_map (Json.lookup j "event_id") String.of_json - ; event_name = Util.option_map (Json.lookup j "event_name") String.of_json - ; event_time = Util.option_map (Json.lookup j "event_time") DateTime.of_json - ; username = Util.option_map (Json.lookup j "username") String.of_json - ; resources = ResourceList.of_json (Util.of_option_exn (Json.lookup j "resources")) - ; cloud_trail_event = - Util.option_map (Json.lookup j "cloud_trail_event") String.of_json - } -end - -module Trail = struct - type t = - { name : String.t option - ; s3_bucket_name : String.t option - ; s3_key_prefix : String.t option - ; sns_topic_name : String.t option - ; include_global_service_events : Boolean.t option - ; cloud_watch_logs_log_group_arn : String.t option - ; cloud_watch_logs_role_arn : String.t option - } - - let make - ?name - ?s3_bucket_name - ?s3_key_prefix - ?sns_topic_name - ?include_global_service_events - ?cloud_watch_logs_log_group_arn - ?cloud_watch_logs_role_arn - () = - { name - ; s3_bucket_name - ; s3_key_prefix - ; sns_topic_name - ; include_global_service_events - ; cloud_watch_logs_log_group_arn - ; cloud_watch_logs_role_arn - } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; s3_bucket_name = Util.option_bind (Xml.member "S3BucketName" xml) String.parse - ; s3_key_prefix = Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse - ; sns_topic_name = Util.option_bind (Xml.member "SnsTopicName" xml) String.parse - ; include_global_service_events = - Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) Boolean.parse - ; cloud_watch_logs_log_group_arn = - Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) String.parse - ; cloud_watch_logs_role_arn = - Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) String.parse + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + s3_bucket_name = + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse); + s3_key_prefix = + (Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse); + sns_topic_name = + (Util.option_bind (Xml.member "SnsTopicName" xml) String.parse); + include_global_service_events = + (Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) + Boolean.parse); + cloud_watch_logs_log_group_arn = + (Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) + String.parse); + cloud_watch_logs_role_arn = + (Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> + Query.Pair ("CloudWatchLogsRoleArn", (String.to_query f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> + Query.Pair ("CloudWatchLogsLogGroupArn", (String.to_query f))); + Util.option_map v.include_global_service_events + (fun f -> + Query.Pair + ("IncludeGlobalServiceEvents", (Boolean.to_query f))); + Util.option_map v.sns_topic_name + (fun f -> Query.Pair ("SnsTopicName", (String.to_query f))); + Util.option_map v.s3_key_prefix + (fun f -> Query.Pair ("S3KeyPrefix", (String.to_query f))); + Util.option_map v.s3_bucket_name + (fun f -> Query.Pair ("S3BucketName", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> ("cloud_watch_logs_role_arn", (String.to_json f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> ("cloud_watch_logs_log_group_arn", (String.to_json f))); + Util.option_map v.include_global_service_events + (fun f -> ("include_global_service_events", (Boolean.to_json f))); + Util.option_map v.sns_topic_name + (fun f -> ("sns_topic_name", (String.to_json f))); + Util.option_map v.s3_key_prefix + (fun f -> ("s3_key_prefix", (String.to_json f))); + Util.option_map v.s3_bucket_name + (fun f -> ("s3_bucket_name", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + s3_bucket_name = + (Util.option_map (Json.lookup j "s3_bucket_name") String.of_json); + s3_key_prefix = + (Util.option_map (Json.lookup j "s3_key_prefix") String.of_json); + sns_topic_name = + (Util.option_map (Json.lookup j "sns_topic_name") String.of_json); + include_global_service_events = + (Util.option_map (Json.lookup j "include_global_service_events") + Boolean.of_json); + cloud_watch_logs_log_group_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") + String.of_json); + cloud_watch_logs_role_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - Query.Pair ("CloudWatchLogsRoleArn", String.to_query f)) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - Query.Pair ("CloudWatchLogsLogGroupArn", String.to_query f)) - ; Util.option_map v.include_global_service_events (fun f -> - Query.Pair ("IncludeGlobalServiceEvents", Boolean.to_query f)) - ; Util.option_map v.sns_topic_name (fun f -> - Query.Pair ("SnsTopicName", String.to_query f)) - ; Util.option_map v.s3_key_prefix (fun f -> - Query.Pair ("S3KeyPrefix", String.to_query f)) - ; Util.option_map v.s3_bucket_name (fun f -> - Query.Pair ("S3BucketName", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - "cloud_watch_logs_role_arn", String.to_json f) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - "cloud_watch_logs_log_group_arn", String.to_json f) - ; Util.option_map v.include_global_service_events (fun f -> - "include_global_service_events", Boolean.to_json f) - ; Util.option_map v.sns_topic_name (fun f -> "sns_topic_name", String.to_json f) - ; Util.option_map v.s3_key_prefix (fun f -> "s3_key_prefix", String.to_json f) - ; Util.option_map v.s3_bucket_name (fun f -> "s3_bucket_name", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; s3_bucket_name = Util.option_map (Json.lookup j "s3_bucket_name") String.of_json - ; s3_key_prefix = Util.option_map (Json.lookup j "s3_key_prefix") String.of_json - ; sns_topic_name = Util.option_map (Json.lookup j "sns_topic_name") String.of_json - ; include_global_service_events = - Util.option_map (Json.lookup j "include_global_service_events") Boolean.of_json - ; cloud_watch_logs_log_group_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") String.of_json - ; cloud_watch_logs_role_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") String.of_json - } -end - -module LookupAttributesList = struct - type t = LookupAttribute.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LookupAttribute.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LookupAttribute.to_query v - - let to_json v = `List (List.map LookupAttribute.to_json v) - - let of_json j = Json.to_list LookupAttribute.of_json j -end - -module TrailNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module EventsList = struct - type t = Event.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Event.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Event.to_query v - - let to_json v = `List (List.map Event.to_json v) - - let of_json j = Json.to_list Event.of_json j -end - -module TrailList = struct - type t = Trail.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Trail.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Trail.to_query v - - let to_json v = `List (List.map Trail.to_json v) - - let of_json j = Json.to_list Trail.of_json j -end - -module DeleteTrailResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module StopLoggingRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module LookupAttributesList = + struct + type t = LookupAttribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LookupAttribute.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LookupAttribute.to_query v + let to_json v = `List (List.map LookupAttribute.to_json v) + let of_json j = Json.to_list LookupAttribute.of_json j + end +module TrailNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module EventsList = + struct + type t = Event.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Event.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Event.to_query v + let to_json v = `List (List.map Event.to_json v) + let of_json j = Json.to_list Event.of_json j + end +module TrailList = + struct + type t = Trail.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Trail.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Trail.to_query v + let to_json v = `List (List.map Trail.to_json v) + let of_json j = Json.to_list Trail.of_json j + end +module DeleteTrailResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module StopLoggingRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module TrailAlreadyExistsException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module StartLoggingRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module InvalidS3BucketNameException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidCloudWatchLogsRoleArnException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module LookupEventsRequest = + struct + type t = + { + lookup_attributes: LookupAttributesList.t ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?(lookup_attributes= []) ?start_time ?end_time ?max_results + ?next_token () = + { lookup_attributes; start_time; end_time; max_results; next_token } + let parse xml = + Some + { + lookup_attributes = + (Util.of_option [] + (Util.option_bind (Xml.member "LookupAttributes" xml) + LookupAttributesList.parse)); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Some + (Query.Pair + ("LookupAttributes.member", + (LookupAttributesList.to_query v.lookup_attributes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Some + ("lookup_attributes", + (LookupAttributesList.to_json v.lookup_attributes))]) + let of_json j = + { + lookup_attributes = + (LookupAttributesList.of_json + (Util.of_option_exn (Json.lookup j "lookup_attributes"))); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module TrailAlreadyExistsException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module StartLoggingRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module StopLoggingResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetTrailStatusResponse = + struct + type t = + { + is_logging: Boolean.t option ; + latest_delivery_error: String.t option ; + latest_notification_error: String.t option ; + latest_delivery_time: DateTime.t option ; + latest_notification_time: DateTime.t option ; + start_logging_time: DateTime.t option ; + stop_logging_time: DateTime.t option ; + latest_cloud_watch_logs_delivery_error: String.t option ; + latest_cloud_watch_logs_delivery_time: DateTime.t option } + let make ?is_logging ?latest_delivery_error ?latest_notification_error + ?latest_delivery_time ?latest_notification_time ?start_logging_time + ?stop_logging_time ?latest_cloud_watch_logs_delivery_error + ?latest_cloud_watch_logs_delivery_time () = + { + is_logging; + latest_delivery_error; + latest_notification_error; + latest_delivery_time; + latest_notification_time; + start_logging_time; + stop_logging_time; + latest_cloud_watch_logs_delivery_error; + latest_cloud_watch_logs_delivery_time } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module InvalidS3BucketNameException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidCloudWatchLogsRoleArnException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module LookupEventsRequest = struct - type t = - { lookup_attributes : LookupAttributesList.t - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?(lookup_attributes = []) ?start_time ?end_time ?max_results ?next_token () = - { lookup_attributes; start_time; end_time; max_results; next_token } - - let parse xml = - Some - { lookup_attributes = - Util.of_option - [] + let parse xml = + Some + { + is_logging = + (Util.option_bind (Xml.member "IsLogging" xml) Boolean.parse); + latest_delivery_error = + (Util.option_bind (Xml.member "LatestDeliveryError" xml) + String.parse); + latest_notification_error = + (Util.option_bind (Xml.member "LatestNotificationError" xml) + String.parse); + latest_delivery_time = + (Util.option_bind (Xml.member "LatestDeliveryTime" xml) + DateTime.parse); + latest_notification_time = + (Util.option_bind (Xml.member "LatestNotificationTime" xml) + DateTime.parse); + start_logging_time = + (Util.option_bind (Xml.member "StartLoggingTime" xml) + DateTime.parse); + stop_logging_time = + (Util.option_bind (Xml.member "StopLoggingTime" xml) + DateTime.parse); + latest_cloud_watch_logs_delivery_error = + (Util.option_bind + (Xml.member "LatestCloudWatchLogsDeliveryError" xml) + String.parse); + latest_cloud_watch_logs_delivery_time = (Util.option_bind - (Xml.member "LookupAttributes" xml) - LookupAttributesList.parse) - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + (Xml.member "LatestCloudWatchLogsDeliveryTime" xml) + DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.latest_cloud_watch_logs_delivery_time + (fun f -> + Query.Pair + ("LatestCloudWatchLogsDeliveryTime", + (DateTime.to_query f))); + Util.option_map v.latest_cloud_watch_logs_delivery_error + (fun f -> + Query.Pair + ("LatestCloudWatchLogsDeliveryError", (String.to_query f))); + Util.option_map v.stop_logging_time + (fun f -> Query.Pair ("StopLoggingTime", (DateTime.to_query f))); + Util.option_map v.start_logging_time + (fun f -> Query.Pair ("StartLoggingTime", (DateTime.to_query f))); + Util.option_map v.latest_notification_time + (fun f -> + Query.Pair ("LatestNotificationTime", (DateTime.to_query f))); + Util.option_map v.latest_delivery_time + (fun f -> + Query.Pair ("LatestDeliveryTime", (DateTime.to_query f))); + Util.option_map v.latest_notification_error + (fun f -> + Query.Pair ("LatestNotificationError", (String.to_query f))); + Util.option_map v.latest_delivery_error + (fun f -> + Query.Pair ("LatestDeliveryError", (String.to_query f))); + Util.option_map v.is_logging + (fun f -> Query.Pair ("IsLogging", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.latest_cloud_watch_logs_delivery_time + (fun f -> + ("latest_cloud_watch_logs_delivery_time", + (DateTime.to_json f))); + Util.option_map v.latest_cloud_watch_logs_delivery_error + (fun f -> + ("latest_cloud_watch_logs_delivery_error", + (String.to_json f))); + Util.option_map v.stop_logging_time + (fun f -> ("stop_logging_time", (DateTime.to_json f))); + Util.option_map v.start_logging_time + (fun f -> ("start_logging_time", (DateTime.to_json f))); + Util.option_map v.latest_notification_time + (fun f -> ("latest_notification_time", (DateTime.to_json f))); + Util.option_map v.latest_delivery_time + (fun f -> ("latest_delivery_time", (DateTime.to_json f))); + Util.option_map v.latest_notification_error + (fun f -> ("latest_notification_error", (String.to_json f))); + Util.option_map v.latest_delivery_error + (fun f -> ("latest_delivery_error", (String.to_json f))); + Util.option_map v.is_logging + (fun f -> ("is_logging", (Boolean.to_json f)))]) + let of_json j = + { + is_logging = + (Util.option_map (Json.lookup j "is_logging") Boolean.of_json); + latest_delivery_error = + (Util.option_map (Json.lookup j "latest_delivery_error") + String.of_json); + latest_notification_error = + (Util.option_map (Json.lookup j "latest_notification_error") + String.of_json); + latest_delivery_time = + (Util.option_map (Json.lookup j "latest_delivery_time") + DateTime.of_json); + latest_notification_time = + (Util.option_map (Json.lookup j "latest_notification_time") + DateTime.of_json); + start_logging_time = + (Util.option_map (Json.lookup j "start_logging_time") + DateTime.of_json); + stop_logging_time = + (Util.option_map (Json.lookup j "stop_logging_time") + DateTime.of_json); + latest_cloud_watch_logs_delivery_error = + (Util.option_map + (Json.lookup j "latest_cloud_watch_logs_delivery_error") + String.of_json); + latest_cloud_watch_logs_delivery_time = + (Util.option_map + (Json.lookup j "latest_cloud_watch_logs_delivery_time") + DateTime.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Some - (Query.Pair - ( "LookupAttributes.member" - , LookupAttributesList.to_query v.lookup_attributes )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Some ("lookup_attributes", LookupAttributesList.to_json v.lookup_attributes) - ]) - - let of_json j = - { lookup_attributes = - LookupAttributesList.of_json - (Util.of_option_exn (Json.lookup j "lookup_attributes")) - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module StopLoggingResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetTrailStatusResponse = struct - type t = - { is_logging : Boolean.t option - ; latest_delivery_error : String.t option - ; latest_notification_error : String.t option - ; latest_delivery_time : DateTime.t option - ; latest_notification_time : DateTime.t option - ; start_logging_time : DateTime.t option - ; stop_logging_time : DateTime.t option - ; latest_cloud_watch_logs_delivery_error : String.t option - ; latest_cloud_watch_logs_delivery_time : DateTime.t option - } - - let make - ?is_logging - ?latest_delivery_error - ?latest_notification_error - ?latest_delivery_time - ?latest_notification_time - ?start_logging_time - ?stop_logging_time - ?latest_cloud_watch_logs_delivery_error - ?latest_cloud_watch_logs_delivery_time - () = - { is_logging - ; latest_delivery_error - ; latest_notification_error - ; latest_delivery_time - ; latest_notification_time - ; start_logging_time - ; stop_logging_time - ; latest_cloud_watch_logs_delivery_error - ; latest_cloud_watch_logs_delivery_time - } - - let parse xml = - Some - { is_logging = Util.option_bind (Xml.member "IsLogging" xml) Boolean.parse - ; latest_delivery_error = - Util.option_bind (Xml.member "LatestDeliveryError" xml) String.parse - ; latest_notification_error = - Util.option_bind (Xml.member "LatestNotificationError" xml) String.parse - ; latest_delivery_time = - Util.option_bind (Xml.member "LatestDeliveryTime" xml) DateTime.parse - ; latest_notification_time = - Util.option_bind (Xml.member "LatestNotificationTime" xml) DateTime.parse - ; start_logging_time = - Util.option_bind (Xml.member "StartLoggingTime" xml) DateTime.parse - ; stop_logging_time = - Util.option_bind (Xml.member "StopLoggingTime" xml) DateTime.parse - ; latest_cloud_watch_logs_delivery_error = - Util.option_bind - (Xml.member "LatestCloudWatchLogsDeliveryError" xml) - String.parse - ; latest_cloud_watch_logs_delivery_time = - Util.option_bind - (Xml.member "LatestCloudWatchLogsDeliveryTime" xml) - DateTime.parse + end +module DeleteTrailRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module TrailNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module UpdateTrailResponse = + struct + type t = + { + name: String.t option ; + s3_bucket_name: String.t option ; + s3_key_prefix: String.t option ; + sns_topic_name: String.t option ; + include_global_service_events: Boolean.t option ; + cloud_watch_logs_log_group_arn: String.t option ; + cloud_watch_logs_role_arn: String.t option } + let make ?name ?s3_bucket_name ?s3_key_prefix ?sns_topic_name + ?include_global_service_events ?cloud_watch_logs_log_group_arn + ?cloud_watch_logs_role_arn () = + { + name; + s3_bucket_name; + s3_key_prefix; + sns_topic_name; + include_global_service_events; + cloud_watch_logs_log_group_arn; + cloud_watch_logs_role_arn + } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + s3_bucket_name = + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse); + s3_key_prefix = + (Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse); + sns_topic_name = + (Util.option_bind (Xml.member "SnsTopicName" xml) String.parse); + include_global_service_events = + (Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) + Boolean.parse); + cloud_watch_logs_log_group_arn = + (Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) + String.parse); + cloud_watch_logs_role_arn = + (Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> + Query.Pair ("CloudWatchLogsRoleArn", (String.to_query f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> + Query.Pair ("CloudWatchLogsLogGroupArn", (String.to_query f))); + Util.option_map v.include_global_service_events + (fun f -> + Query.Pair + ("IncludeGlobalServiceEvents", (Boolean.to_query f))); + Util.option_map v.sns_topic_name + (fun f -> Query.Pair ("SnsTopicName", (String.to_query f))); + Util.option_map v.s3_key_prefix + (fun f -> Query.Pair ("S3KeyPrefix", (String.to_query f))); + Util.option_map v.s3_bucket_name + (fun f -> Query.Pair ("S3BucketName", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> ("cloud_watch_logs_role_arn", (String.to_json f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> ("cloud_watch_logs_log_group_arn", (String.to_json f))); + Util.option_map v.include_global_service_events + (fun f -> ("include_global_service_events", (Boolean.to_json f))); + Util.option_map v.sns_topic_name + (fun f -> ("sns_topic_name", (String.to_json f))); + Util.option_map v.s3_key_prefix + (fun f -> ("s3_key_prefix", (String.to_json f))); + Util.option_map v.s3_bucket_name + (fun f -> ("s3_bucket_name", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + s3_bucket_name = + (Util.option_map (Json.lookup j "s3_bucket_name") String.of_json); + s3_key_prefix = + (Util.option_map (Json.lookup j "s3_key_prefix") String.of_json); + sns_topic_name = + (Util.option_map (Json.lookup j "sns_topic_name") String.of_json); + include_global_service_events = + (Util.option_map (Json.lookup j "include_global_service_events") + Boolean.of_json); + cloud_watch_logs_log_group_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") + String.of_json); + cloud_watch_logs_role_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.latest_cloud_watch_logs_delivery_time (fun f -> - Query.Pair ("LatestCloudWatchLogsDeliveryTime", DateTime.to_query f)) - ; Util.option_map v.latest_cloud_watch_logs_delivery_error (fun f -> - Query.Pair ("LatestCloudWatchLogsDeliveryError", String.to_query f)) - ; Util.option_map v.stop_logging_time (fun f -> - Query.Pair ("StopLoggingTime", DateTime.to_query f)) - ; Util.option_map v.start_logging_time (fun f -> - Query.Pair ("StartLoggingTime", DateTime.to_query f)) - ; Util.option_map v.latest_notification_time (fun f -> - Query.Pair ("LatestNotificationTime", DateTime.to_query f)) - ; Util.option_map v.latest_delivery_time (fun f -> - Query.Pair ("LatestDeliveryTime", DateTime.to_query f)) - ; Util.option_map v.latest_notification_error (fun f -> - Query.Pair ("LatestNotificationError", String.to_query f)) - ; Util.option_map v.latest_delivery_error (fun f -> - Query.Pair ("LatestDeliveryError", String.to_query f)) - ; Util.option_map v.is_logging (fun f -> - Query.Pair ("IsLogging", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.latest_cloud_watch_logs_delivery_time (fun f -> - "latest_cloud_watch_logs_delivery_time", DateTime.to_json f) - ; Util.option_map v.latest_cloud_watch_logs_delivery_error (fun f -> - "latest_cloud_watch_logs_delivery_error", String.to_json f) - ; Util.option_map v.stop_logging_time (fun f -> - "stop_logging_time", DateTime.to_json f) - ; Util.option_map v.start_logging_time (fun f -> - "start_logging_time", DateTime.to_json f) - ; Util.option_map v.latest_notification_time (fun f -> - "latest_notification_time", DateTime.to_json f) - ; Util.option_map v.latest_delivery_time (fun f -> - "latest_delivery_time", DateTime.to_json f) - ; Util.option_map v.latest_notification_error (fun f -> - "latest_notification_error", String.to_json f) - ; Util.option_map v.latest_delivery_error (fun f -> - "latest_delivery_error", String.to_json f) - ; Util.option_map v.is_logging (fun f -> "is_logging", Boolean.to_json f) - ]) - - let of_json j = - { is_logging = Util.option_map (Json.lookup j "is_logging") Boolean.of_json - ; latest_delivery_error = - Util.option_map (Json.lookup j "latest_delivery_error") String.of_json - ; latest_notification_error = - Util.option_map (Json.lookup j "latest_notification_error") String.of_json - ; latest_delivery_time = - Util.option_map (Json.lookup j "latest_delivery_time") DateTime.of_json - ; latest_notification_time = - Util.option_map (Json.lookup j "latest_notification_time") DateTime.of_json - ; start_logging_time = - Util.option_map (Json.lookup j "start_logging_time") DateTime.of_json - ; stop_logging_time = - Util.option_map (Json.lookup j "stop_logging_time") DateTime.of_json - ; latest_cloud_watch_logs_delivery_error = - Util.option_map - (Json.lookup j "latest_cloud_watch_logs_delivery_error") - String.of_json - ; latest_cloud_watch_logs_delivery_time = - Util.option_map - (Json.lookup j "latest_cloud_watch_logs_delivery_time") - DateTime.of_json - } -end - -module DeleteTrailRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module CreateTrailRequest = + struct + type t = + { + name: String.t ; + s3_bucket_name: String.t ; + s3_key_prefix: String.t option ; + sns_topic_name: String.t option ; + include_global_service_events: Boolean.t option ; + cloud_watch_logs_log_group_arn: String.t option ; + cloud_watch_logs_role_arn: String.t option } + let make ~name ~s3_bucket_name ?s3_key_prefix ?sns_topic_name + ?include_global_service_events ?cloud_watch_logs_log_group_arn + ?cloud_watch_logs_role_arn () = + { + name; + s3_bucket_name; + s3_key_prefix; + sns_topic_name; + include_global_service_events; + cloud_watch_logs_log_group_arn; + cloud_watch_logs_role_arn } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module TrailNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module UpdateTrailResponse = struct - type t = - { name : String.t option - ; s3_bucket_name : String.t option - ; s3_key_prefix : String.t option - ; sns_topic_name : String.t option - ; include_global_service_events : Boolean.t option - ; cloud_watch_logs_log_group_arn : String.t option - ; cloud_watch_logs_role_arn : String.t option - } - - let make - ?name - ?s3_bucket_name - ?s3_key_prefix - ?sns_topic_name - ?include_global_service_events - ?cloud_watch_logs_log_group_arn - ?cloud_watch_logs_role_arn - () = - { name - ; s3_bucket_name - ; s3_key_prefix - ; sns_topic_name - ; include_global_service_events - ; cloud_watch_logs_log_group_arn - ; cloud_watch_logs_role_arn - } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; s3_bucket_name = Util.option_bind (Xml.member "S3BucketName" xml) String.parse - ; s3_key_prefix = Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse - ; sns_topic_name = Util.option_bind (Xml.member "SnsTopicName" xml) String.parse - ; include_global_service_events = - Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) Boolean.parse - ; cloud_watch_logs_log_group_arn = - Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) String.parse - ; cloud_watch_logs_role_arn = - Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) String.parse + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + s3_bucket_name = + (Xml.required "S3BucketName" + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse)); + s3_key_prefix = + (Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse); + sns_topic_name = + (Util.option_bind (Xml.member "SnsTopicName" xml) String.parse); + include_global_service_events = + (Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) + Boolean.parse); + cloud_watch_logs_log_group_arn = + (Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) + String.parse); + cloud_watch_logs_role_arn = + (Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> + Query.Pair ("CloudWatchLogsRoleArn", (String.to_query f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> + Query.Pair ("CloudWatchLogsLogGroupArn", (String.to_query f))); + Util.option_map v.include_global_service_events + (fun f -> + Query.Pair + ("IncludeGlobalServiceEvents", (Boolean.to_query f))); + Util.option_map v.sns_topic_name + (fun f -> Query.Pair ("SnsTopicName", (String.to_query f))); + Util.option_map v.s3_key_prefix + (fun f -> Query.Pair ("S3KeyPrefix", (String.to_query f))); + Some + (Query.Pair ("S3BucketName", (String.to_query v.s3_bucket_name))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> ("cloud_watch_logs_role_arn", (String.to_json f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> ("cloud_watch_logs_log_group_arn", (String.to_json f))); + Util.option_map v.include_global_service_events + (fun f -> ("include_global_service_events", (Boolean.to_json f))); + Util.option_map v.sns_topic_name + (fun f -> ("sns_topic_name", (String.to_json f))); + Util.option_map v.s3_key_prefix + (fun f -> ("s3_key_prefix", (String.to_json f))); + Some ("s3_bucket_name", (String.to_json v.s3_bucket_name)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + s3_bucket_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "s3_bucket_name"))); + s3_key_prefix = + (Util.option_map (Json.lookup j "s3_key_prefix") String.of_json); + sns_topic_name = + (Util.option_map (Json.lookup j "sns_topic_name") String.of_json); + include_global_service_events = + (Util.option_map (Json.lookup j "include_global_service_events") + Boolean.of_json); + cloud_watch_logs_log_group_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") + String.of_json); + cloud_watch_logs_role_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - Query.Pair ("CloudWatchLogsRoleArn", String.to_query f)) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - Query.Pair ("CloudWatchLogsLogGroupArn", String.to_query f)) - ; Util.option_map v.include_global_service_events (fun f -> - Query.Pair ("IncludeGlobalServiceEvents", Boolean.to_query f)) - ; Util.option_map v.sns_topic_name (fun f -> - Query.Pair ("SnsTopicName", String.to_query f)) - ; Util.option_map v.s3_key_prefix (fun f -> - Query.Pair ("S3KeyPrefix", String.to_query f)) - ; Util.option_map v.s3_bucket_name (fun f -> - Query.Pair ("S3BucketName", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - "cloud_watch_logs_role_arn", String.to_json f) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - "cloud_watch_logs_log_group_arn", String.to_json f) - ; Util.option_map v.include_global_service_events (fun f -> - "include_global_service_events", Boolean.to_json f) - ; Util.option_map v.sns_topic_name (fun f -> "sns_topic_name", String.to_json f) - ; Util.option_map v.s3_key_prefix (fun f -> "s3_key_prefix", String.to_json f) - ; Util.option_map v.s3_bucket_name (fun f -> "s3_bucket_name", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; s3_bucket_name = Util.option_map (Json.lookup j "s3_bucket_name") String.of_json - ; s3_key_prefix = Util.option_map (Json.lookup j "s3_key_prefix") String.of_json - ; sns_topic_name = Util.option_map (Json.lookup j "sns_topic_name") String.of_json - ; include_global_service_events = - Util.option_map (Json.lookup j "include_global_service_events") Boolean.of_json - ; cloud_watch_logs_log_group_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") String.of_json - ; cloud_watch_logs_role_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") String.of_json - } -end - -module CreateTrailRequest = struct - type t = - { name : String.t - ; s3_bucket_name : String.t - ; s3_key_prefix : String.t option - ; sns_topic_name : String.t option - ; include_global_service_events : Boolean.t option - ; cloud_watch_logs_log_group_arn : String.t option - ; cloud_watch_logs_role_arn : String.t option - } - - let make - ~name - ~s3_bucket_name - ?s3_key_prefix - ?sns_topic_name - ?include_global_service_events - ?cloud_watch_logs_log_group_arn - ?cloud_watch_logs_role_arn - () = - { name - ; s3_bucket_name - ; s3_key_prefix - ; sns_topic_name - ; include_global_service_events - ; cloud_watch_logs_log_group_arn - ; cloud_watch_logs_role_arn - } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; s3_bucket_name = - Xml.required - "S3BucketName" - (Util.option_bind (Xml.member "S3BucketName" xml) String.parse) - ; s3_key_prefix = Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse - ; sns_topic_name = Util.option_bind (Xml.member "SnsTopicName" xml) String.parse - ; include_global_service_events = - Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) Boolean.parse - ; cloud_watch_logs_log_group_arn = - Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) String.parse - ; cloud_watch_logs_role_arn = - Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) String.parse + end +module StartLoggingResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetTrailStatusRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module UpdateTrailRequest = + struct + type t = + { + name: String.t ; + s3_bucket_name: String.t option ; + s3_key_prefix: String.t option ; + sns_topic_name: String.t option ; + include_global_service_events: Boolean.t option ; + cloud_watch_logs_log_group_arn: String.t option ; + cloud_watch_logs_role_arn: String.t option } + let make ~name ?s3_bucket_name ?s3_key_prefix ?sns_topic_name + ?include_global_service_events ?cloud_watch_logs_log_group_arn + ?cloud_watch_logs_role_arn () = + { + name; + s3_bucket_name; + s3_key_prefix; + sns_topic_name; + include_global_service_events; + cloud_watch_logs_log_group_arn; + cloud_watch_logs_role_arn } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - Query.Pair ("CloudWatchLogsRoleArn", String.to_query f)) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - Query.Pair ("CloudWatchLogsLogGroupArn", String.to_query f)) - ; Util.option_map v.include_global_service_events (fun f -> - Query.Pair ("IncludeGlobalServiceEvents", Boolean.to_query f)) - ; Util.option_map v.sns_topic_name (fun f -> - Query.Pair ("SnsTopicName", String.to_query f)) - ; Util.option_map v.s3_key_prefix (fun f -> - Query.Pair ("S3KeyPrefix", String.to_query f)) - ; Some (Query.Pair ("S3BucketName", String.to_query v.s3_bucket_name)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - "cloud_watch_logs_role_arn", String.to_json f) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - "cloud_watch_logs_log_group_arn", String.to_json f) - ; Util.option_map v.include_global_service_events (fun f -> - "include_global_service_events", Boolean.to_json f) - ; Util.option_map v.sns_topic_name (fun f -> "sns_topic_name", String.to_json f) - ; Util.option_map v.s3_key_prefix (fun f -> "s3_key_prefix", String.to_json f) - ; Some ("s3_bucket_name", String.to_json v.s3_bucket_name) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; s3_bucket_name = - String.of_json (Util.of_option_exn (Json.lookup j "s3_bucket_name")) - ; s3_key_prefix = Util.option_map (Json.lookup j "s3_key_prefix") String.of_json - ; sns_topic_name = Util.option_map (Json.lookup j "sns_topic_name") String.of_json - ; include_global_service_events = - Util.option_map (Json.lookup j "include_global_service_events") Boolean.of_json - ; cloud_watch_logs_log_group_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") String.of_json - ; cloud_watch_logs_role_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") String.of_json - } -end - -module StartLoggingResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetTrailStatusRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + s3_bucket_name = + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse); + s3_key_prefix = + (Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse); + sns_topic_name = + (Util.option_bind (Xml.member "SnsTopicName" xml) String.parse); + include_global_service_events = + (Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) + Boolean.parse); + cloud_watch_logs_log_group_arn = + (Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) + String.parse); + cloud_watch_logs_role_arn = + (Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> + Query.Pair ("CloudWatchLogsRoleArn", (String.to_query f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> + Query.Pair ("CloudWatchLogsLogGroupArn", (String.to_query f))); + Util.option_map v.include_global_service_events + (fun f -> + Query.Pair + ("IncludeGlobalServiceEvents", (Boolean.to_query f))); + Util.option_map v.sns_topic_name + (fun f -> Query.Pair ("SnsTopicName", (String.to_query f))); + Util.option_map v.s3_key_prefix + (fun f -> Query.Pair ("S3KeyPrefix", (String.to_query f))); + Util.option_map v.s3_bucket_name + (fun f -> Query.Pair ("S3BucketName", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> ("cloud_watch_logs_role_arn", (String.to_json f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> ("cloud_watch_logs_log_group_arn", (String.to_json f))); + Util.option_map v.include_global_service_events + (fun f -> ("include_global_service_events", (Boolean.to_json f))); + Util.option_map v.sns_topic_name + (fun f -> ("sns_topic_name", (String.to_json f))); + Util.option_map v.s3_key_prefix + (fun f -> ("s3_key_prefix", (String.to_json f))); + Util.option_map v.s3_bucket_name + (fun f -> ("s3_bucket_name", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + s3_bucket_name = + (Util.option_map (Json.lookup j "s3_bucket_name") String.of_json); + s3_key_prefix = + (Util.option_map (Json.lookup j "s3_key_prefix") String.of_json); + sns_topic_name = + (Util.option_map (Json.lookup j "sns_topic_name") String.of_json); + include_global_service_events = + (Util.option_map (Json.lookup j "include_global_service_events") + Boolean.of_json); + cloud_watch_logs_log_group_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") + String.of_json); + cloud_watch_logs_role_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module UpdateTrailRequest = struct - type t = - { name : String.t - ; s3_bucket_name : String.t option - ; s3_key_prefix : String.t option - ; sns_topic_name : String.t option - ; include_global_service_events : Boolean.t option - ; cloud_watch_logs_log_group_arn : String.t option - ; cloud_watch_logs_role_arn : String.t option - } - - let make - ~name - ?s3_bucket_name - ?s3_key_prefix - ?sns_topic_name - ?include_global_service_events - ?cloud_watch_logs_log_group_arn - ?cloud_watch_logs_role_arn - () = - { name - ; s3_bucket_name - ; s3_key_prefix - ; sns_topic_name - ; include_global_service_events - ; cloud_watch_logs_log_group_arn - ; cloud_watch_logs_role_arn - } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; s3_bucket_name = Util.option_bind (Xml.member "S3BucketName" xml) String.parse - ; s3_key_prefix = Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse - ; sns_topic_name = Util.option_bind (Xml.member "SnsTopicName" xml) String.parse - ; include_global_service_events = - Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) Boolean.parse - ; cloud_watch_logs_log_group_arn = - Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) String.parse - ; cloud_watch_logs_role_arn = - Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) String.parse + end +module InvalidLookupAttributesException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidTrailNameException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module S3BucketDoesNotExistException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeTrailsRequest = + struct + type t = { + trail_name_list: TrailNameList.t } + let make ?(trail_name_list= []) () = { trail_name_list } + let parse xml = + Some + { + trail_name_list = + (Util.of_option [] + (Util.option_bind (Xml.member "trailNameList" xml) + TrailNameList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("trailNameList.member", + (TrailNameList.to_query v.trail_name_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("trail_name_list", (TrailNameList.to_json v.trail_name_list))]) + let of_json j = + { + trail_name_list = + (TrailNameList.of_json + (Util.of_option_exn (Json.lookup j "trail_name_list"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - Query.Pair ("CloudWatchLogsRoleArn", String.to_query f)) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - Query.Pair ("CloudWatchLogsLogGroupArn", String.to_query f)) - ; Util.option_map v.include_global_service_events (fun f -> - Query.Pair ("IncludeGlobalServiceEvents", Boolean.to_query f)) - ; Util.option_map v.sns_topic_name (fun f -> - Query.Pair ("SnsTopicName", String.to_query f)) - ; Util.option_map v.s3_key_prefix (fun f -> - Query.Pair ("S3KeyPrefix", String.to_query f)) - ; Util.option_map v.s3_bucket_name (fun f -> - Query.Pair ("S3BucketName", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - "cloud_watch_logs_role_arn", String.to_json f) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - "cloud_watch_logs_log_group_arn", String.to_json f) - ; Util.option_map v.include_global_service_events (fun f -> - "include_global_service_events", Boolean.to_json f) - ; Util.option_map v.sns_topic_name (fun f -> "sns_topic_name", String.to_json f) - ; Util.option_map v.s3_key_prefix (fun f -> "s3_key_prefix", String.to_json f) - ; Util.option_map v.s3_bucket_name (fun f -> "s3_bucket_name", String.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; s3_bucket_name = Util.option_map (Json.lookup j "s3_bucket_name") String.of_json - ; s3_key_prefix = Util.option_map (Json.lookup j "s3_key_prefix") String.of_json - ; sns_topic_name = Util.option_map (Json.lookup j "sns_topic_name") String.of_json - ; include_global_service_events = - Util.option_map (Json.lookup j "include_global_service_events") Boolean.of_json - ; cloud_watch_logs_log_group_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") String.of_json - ; cloud_watch_logs_role_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") String.of_json - } -end - -module InvalidLookupAttributesException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidTrailNameException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module S3BucketDoesNotExistException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeTrailsRequest = struct - type t = { trail_name_list : TrailNameList.t } - - let make ?(trail_name_list = []) () = { trail_name_list } - - let parse xml = - Some - { trail_name_list = - Util.of_option - [] - (Util.option_bind (Xml.member "trailNameList" xml) TrailNameList.parse) + end +module CloudWatchLogsDeliveryUnavailableException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidMaxResultsException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidTimeRangeException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InsufficientSnsTopicPolicyException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InsufficientS3BucketPolicyException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module LookupEventsResponse = + struct + type t = { + events: EventsList.t ; + next_token: String.t option } + let make ?(events= []) ?next_token () = { events; next_token } + let parse xml = + Some + { + events = + (Util.of_option [] + (Util.option_bind (Xml.member "Events" xml) EventsList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair ("Events.member", (EventsList.to_query v.events)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("events", (EventsList.to_json v.events))]) + let of_json j = + { + events = + (EventsList.of_json (Util.of_option_exn (Json.lookup j "events"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("trailNameList.member", TrailNameList.to_query v.trail_name_list)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("trail_name_list", TrailNameList.to_json v.trail_name_list) ]) - - let of_json j = - { trail_name_list = - TrailNameList.of_json (Util.of_option_exn (Json.lookup j "trail_name_list")) - } -end - -module CloudWatchLogsDeliveryUnavailableException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidMaxResultsException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidTimeRangeException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InsufficientSnsTopicPolicyException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InsufficientS3BucketPolicyException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module LookupEventsResponse = struct - type t = - { events : EventsList.t - ; next_token : String.t option - } - - let make ?(events = []) ?next_token () = { events; next_token } - - let parse xml = - Some - { events = - Util.of_option [] (Util.option_bind (Xml.member "Events" xml) EventsList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module InvalidCloudWatchLogsLogGroupArnException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidS3PrefixException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidNextTokenException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module MaximumNumberOfTrailsExceededException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidSnsTopicNameException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateTrailResponse = + struct + type t = + { + name: String.t option ; + s3_bucket_name: String.t option ; + s3_key_prefix: String.t option ; + sns_topic_name: String.t option ; + include_global_service_events: Boolean.t option ; + cloud_watch_logs_log_group_arn: String.t option ; + cloud_watch_logs_role_arn: String.t option } + let make ?name ?s3_bucket_name ?s3_key_prefix ?sns_topic_name + ?include_global_service_events ?cloud_watch_logs_log_group_arn + ?cloud_watch_logs_role_arn () = + { + name; + s3_bucket_name; + s3_key_prefix; + sns_topic_name; + include_global_service_events; + cloud_watch_logs_log_group_arn; + cloud_watch_logs_role_arn } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Events.member", EventsList.to_query v.events)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("events", EventsList.to_json v.events) - ]) - - let of_json j = - { events = EventsList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InvalidCloudWatchLogsLogGroupArnException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidS3PrefixException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidNextTokenException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module MaximumNumberOfTrailsExceededException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidSnsTopicNameException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateTrailResponse = struct - type t = - { name : String.t option - ; s3_bucket_name : String.t option - ; s3_key_prefix : String.t option - ; sns_topic_name : String.t option - ; include_global_service_events : Boolean.t option - ; cloud_watch_logs_log_group_arn : String.t option - ; cloud_watch_logs_role_arn : String.t option - } - - let make - ?name - ?s3_bucket_name - ?s3_key_prefix - ?sns_topic_name - ?include_global_service_events - ?cloud_watch_logs_log_group_arn - ?cloud_watch_logs_role_arn - () = - { name - ; s3_bucket_name - ; s3_key_prefix - ; sns_topic_name - ; include_global_service_events - ; cloud_watch_logs_log_group_arn - ; cloud_watch_logs_role_arn - } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; s3_bucket_name = Util.option_bind (Xml.member "S3BucketName" xml) String.parse - ; s3_key_prefix = Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse - ; sns_topic_name = Util.option_bind (Xml.member "SnsTopicName" xml) String.parse - ; include_global_service_events = - Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) Boolean.parse - ; cloud_watch_logs_log_group_arn = - Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) String.parse - ; cloud_watch_logs_role_arn = - Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) String.parse + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + s3_bucket_name = + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse); + s3_key_prefix = + (Util.option_bind (Xml.member "S3KeyPrefix" xml) String.parse); + sns_topic_name = + (Util.option_bind (Xml.member "SnsTopicName" xml) String.parse); + include_global_service_events = + (Util.option_bind (Xml.member "IncludeGlobalServiceEvents" xml) + Boolean.parse); + cloud_watch_logs_log_group_arn = + (Util.option_bind (Xml.member "CloudWatchLogsLogGroupArn" xml) + String.parse); + cloud_watch_logs_role_arn = + (Util.option_bind (Xml.member "CloudWatchLogsRoleArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> + Query.Pair ("CloudWatchLogsRoleArn", (String.to_query f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> + Query.Pair ("CloudWatchLogsLogGroupArn", (String.to_query f))); + Util.option_map v.include_global_service_events + (fun f -> + Query.Pair + ("IncludeGlobalServiceEvents", (Boolean.to_query f))); + Util.option_map v.sns_topic_name + (fun f -> Query.Pair ("SnsTopicName", (String.to_query f))); + Util.option_map v.s3_key_prefix + (fun f -> Query.Pair ("S3KeyPrefix", (String.to_query f))); + Util.option_map v.s3_bucket_name + (fun f -> Query.Pair ("S3BucketName", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_watch_logs_role_arn + (fun f -> ("cloud_watch_logs_role_arn", (String.to_json f))); + Util.option_map v.cloud_watch_logs_log_group_arn + (fun f -> ("cloud_watch_logs_log_group_arn", (String.to_json f))); + Util.option_map v.include_global_service_events + (fun f -> ("include_global_service_events", (Boolean.to_json f))); + Util.option_map v.sns_topic_name + (fun f -> ("sns_topic_name", (String.to_json f))); + Util.option_map v.s3_key_prefix + (fun f -> ("s3_key_prefix", (String.to_json f))); + Util.option_map v.s3_bucket_name + (fun f -> ("s3_bucket_name", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + s3_bucket_name = + (Util.option_map (Json.lookup j "s3_bucket_name") String.of_json); + s3_key_prefix = + (Util.option_map (Json.lookup j "s3_key_prefix") String.of_json); + sns_topic_name = + (Util.option_map (Json.lookup j "sns_topic_name") String.of_json); + include_global_service_events = + (Util.option_map (Json.lookup j "include_global_service_events") + Boolean.of_json); + cloud_watch_logs_log_group_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") + String.of_json); + cloud_watch_logs_role_arn = + (Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - Query.Pair ("CloudWatchLogsRoleArn", String.to_query f)) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - Query.Pair ("CloudWatchLogsLogGroupArn", String.to_query f)) - ; Util.option_map v.include_global_service_events (fun f -> - Query.Pair ("IncludeGlobalServiceEvents", Boolean.to_query f)) - ; Util.option_map v.sns_topic_name (fun f -> - Query.Pair ("SnsTopicName", String.to_query f)) - ; Util.option_map v.s3_key_prefix (fun f -> - Query.Pair ("S3KeyPrefix", String.to_query f)) - ; Util.option_map v.s3_bucket_name (fun f -> - Query.Pair ("S3BucketName", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_watch_logs_role_arn (fun f -> - "cloud_watch_logs_role_arn", String.to_json f) - ; Util.option_map v.cloud_watch_logs_log_group_arn (fun f -> - "cloud_watch_logs_log_group_arn", String.to_json f) - ; Util.option_map v.include_global_service_events (fun f -> - "include_global_service_events", Boolean.to_json f) - ; Util.option_map v.sns_topic_name (fun f -> "sns_topic_name", String.to_json f) - ; Util.option_map v.s3_key_prefix (fun f -> "s3_key_prefix", String.to_json f) - ; Util.option_map v.s3_bucket_name (fun f -> "s3_bucket_name", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; s3_bucket_name = Util.option_map (Json.lookup j "s3_bucket_name") String.of_json - ; s3_key_prefix = Util.option_map (Json.lookup j "s3_key_prefix") String.of_json - ; sns_topic_name = Util.option_map (Json.lookup j "sns_topic_name") String.of_json - ; include_global_service_events = - Util.option_map (Json.lookup j "include_global_service_events") Boolean.of_json - ; cloud_watch_logs_log_group_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_log_group_arn") String.of_json - ; cloud_watch_logs_role_arn = - Util.option_map (Json.lookup j "cloud_watch_logs_role_arn") String.of_json - } -end - -module DescribeTrailsResponse = struct - type t = { trail_list : TrailList.t } - - let make ?(trail_list = []) () = { trail_list } - - let parse xml = - Some - { trail_list = - Util.of_option - [] - (Util.option_bind (Xml.member "trailList" xml) TrailList.parse) + end +module DescribeTrailsResponse = + struct + type t = { + trail_list: TrailList.t } + let make ?(trail_list= []) () = { trail_list } + let parse xml = + Some + { + trail_list = + (Util.of_option [] + (Util.option_bind (Xml.member "trailList" xml) TrailList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("trailList.member", (TrailList.to_query v.trail_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("trail_list", (TrailList.to_json v.trail_list))]) + let of_json j = + { + trail_list = + (TrailList.of_json + (Util.of_option_exn (Json.lookup j "trail_list"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("trailList.member", TrailList.to_query v.trail_list)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("trail_list", TrailList.to_json v.trail_list) ]) - - let of_json j = - { trail_list = TrailList.of_json (Util.of_option_exn (Json.lookup j "trail_list")) } -end + end \ No newline at end of file diff --git a/libraries/cloudtrail/lib/updateTrail.ml b/libraries/cloudtrail/lib/updateTrail.ml index ef8ebf767..0ab46dda5 100644 --- a/libraries/cloudtrail/lib/updateTrail.ml +++ b/libraries/cloudtrail/lib/updateTrail.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = UpdateTrailRequest.t - type output = UpdateTrailResponse.t - type error = Errors_internal.t - let service = "cloudtrail" - 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", [ "2013-11-01" ]; "Action", [ "UpdateTrail" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2013-11-01"]); ("Action", ["UpdateTrail"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UpdateTrailRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (UpdateTrailRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "UpdateTrailResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp UpdateTrailResponse.parse) + Util.or_error (Util.option_bind resp UpdateTrailResponse.parse) (let open Error in - BadResponse { body; message = "Could not find well formed UpdateTrailResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed UpdateTrailResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UpdateTrailResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UpdateTrailResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.CloudWatchLogsDeliveryUnavailable - ; Errors_internal.InvalidCloudWatchLogsRoleArn - ; Errors_internal.InvalidCloudWatchLogsLogGroupArn - ; Errors_internal.InvalidTrailName - ; Errors_internal.InvalidSnsTopicName - ; Errors_internal.InvalidS3Prefix - ; Errors_internal.InvalidS3BucketName - ; Errors_internal.TrailNotFound - ; Errors_internal.InsufficientSnsTopicPolicy - ; Errors_internal.InsufficientS3BucketPolicy - ; Errors_internal.S3BucketDoesNotExist - ] - @ Errors_internal.common - in + [Errors_internal.CloudWatchLogsDeliveryUnavailable; + Errors_internal.InvalidCloudWatchLogsRoleArn; + Errors_internal.InvalidCloudWatchLogsLogGroupArn; + Errors_internal.InvalidTrailName; + Errors_internal.InvalidSnsTopicName; + Errors_internal.InvalidS3Prefix; + Errors_internal.InvalidS3BucketName; + Errors_internal.TrailNotFound; + Errors_internal.InsufficientSnsTopicPolicy; + Errors_internal.InsufficientS3BucketPolicy; + Errors_internal.S3BucketDoesNotExist] @ 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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib/updateTrail.mli b/libraries/cloudtrail/lib/updateTrail.mli index ea72fc631..2f1d064e6 100644 --- a/libraries/cloudtrail/lib/updateTrail.mli +++ b/libraries/cloudtrail/lib/updateTrail.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateTrailRequest.t - type output = UpdateTrailResponse.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 \ No newline at end of file diff --git a/libraries/cloudtrail/lib_test/dune b/libraries/cloudtrail/lib_test/dune index 144ce8223..a1b75ab23 100644 --- a/libraries/cloudtrail/lib_test/dune +++ b/libraries/cloudtrail/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_cloudtrail_test) - (libraries aws aws_cloudtrail aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_cloudtrail aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/cloudtrail/lib_test/test_async.ml b/libraries/cloudtrail/lib_test/test_async.ml index f5fe8d6de..76512dbbd 100644 --- a/libraries/cloudtrail/lib_test/test_async.ml +++ b/libraries/cloudtrail/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_cloudtrail_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/cloudtrail/lib_test/test_lwt.ml b/libraries/cloudtrail/lib_test/test_lwt.ml index 7592ec143..67860abb7 100644 --- a/libraries/cloudtrail/lib_test/test_lwt.ml +++ b/libraries/cloudtrail/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_cloudtrail_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/cloudwatch/lib/deleteAlarms.ml b/libraries/cloudwatch/lib/deleteAlarms.ml index 80723b9c1..277505ec0 100644 --- a/libraries/cloudwatch/lib/deleteAlarms.ml +++ b/libraries/cloudwatch/lib/deleteAlarms.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteAlarmsInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "DeleteAlarms" ] ] + [("Version", ["2010-08-01"]); ("Action", ["DeleteAlarms"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteAlarmsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteAlarmsInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.ResourceNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.ResourceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/deleteAlarms.mli b/libraries/cloudwatch/lib/deleteAlarms.mli index e0669afb1..39c838244 100644 --- a/libraries/cloudwatch/lib/deleteAlarms.mli +++ b/libraries/cloudwatch/lib/deleteAlarms.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteAlarmsInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarmHistory.ml b/libraries/cloudwatch/lib/describeAlarmHistory.ml index 8ee24dff8..9c4072381 100644 --- a/libraries/cloudwatch/lib/describeAlarmHistory.ml +++ b/libraries/cloudwatch/lib/describeAlarmHistory.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = DescribeAlarmHistoryInput.t - type output = DescribeAlarmHistoryOutput.t - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "DescribeAlarmHistory" ] ] + [("Version", ["2010-08-01"]); ("Action", ["DescribeAlarmHistory"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeAlarmHistoryInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeAlarmHistoryInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeAlarmHistoryResponse" (snd xml)) - (Xml.member "DescribeAlarmHistoryResult") - in + Util.option_bind (Xml.member "DescribeAlarmHistoryResponse" (snd xml)) + (Xml.member "DescribeAlarmHistoryResult") in try - Util.or_error - (Util.option_bind resp DescribeAlarmHistoryOutput.parse) + Util.or_error (Util.option_bind resp DescribeAlarmHistoryOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAlarmHistoryOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAlarmHistoryOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAlarmHistoryOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAlarmHistoryOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.InvalidNextToken ] @ Errors_internal.common in + let errors = [Errors_internal.InvalidNextToken] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarmHistory.mli b/libraries/cloudwatch/lib/describeAlarmHistory.mli index 21612041e..2e4712251 100644 --- a/libraries/cloudwatch/lib/describeAlarmHistory.mli +++ b/libraries/cloudwatch/lib/describeAlarmHistory.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAlarmHistoryInput.t - type output = DescribeAlarmHistoryOutput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarms.ml b/libraries/cloudwatch/lib/describeAlarms.ml index 1a055a157..544599645 100644 --- a/libraries/cloudwatch/lib/describeAlarms.ml +++ b/libraries/cloudwatch/lib/describeAlarms.ml @@ -1,61 +1,59 @@ open Types open Aws - type input = DescribeAlarmsInput.t - type output = DescribeAlarmsOutput.t - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "DescribeAlarms" ] ] + [("Version", ["2010-08-01"]); ("Action", ["DescribeAlarms"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeAlarmsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeAlarmsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeAlarmsResponse" (snd xml)) - (Xml.member "DescribeAlarmsResult") - in + Util.option_bind (Xml.member "DescribeAlarmsResponse" (snd xml)) + (Xml.member "DescribeAlarmsResult") in try - Util.or_error - (Util.option_bind resp DescribeAlarmsOutput.parse) + Util.or_error (Util.option_bind resp DescribeAlarmsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeAlarmsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeAlarmsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAlarmsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAlarmsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.InvalidNextToken ] @ Errors_internal.common in + let errors = [Errors_internal.InvalidNextToken] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarms.mli b/libraries/cloudwatch/lib/describeAlarms.mli index 15d4be477..bf001e18c 100644 --- a/libraries/cloudwatch/lib/describeAlarms.mli +++ b/libraries/cloudwatch/lib/describeAlarms.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAlarmsInput.t - type output = DescribeAlarmsOutput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarmsForMetric.ml b/libraries/cloudwatch/lib/describeAlarmsForMetric.ml index b99c71fca..1c5bf873a 100644 --- a/libraries/cloudwatch/lib/describeAlarmsForMetric.ml +++ b/libraries/cloudwatch/lib/describeAlarmsForMetric.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeAlarmsForMetricInput.t - type output = DescribeAlarmsForMetricOutput.t - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "DescribeAlarmsForMetric" ] ] + [("Version", ["2010-08-01"]); + ("Action", ["DescribeAlarmsForMetric"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeAlarmsForMetricInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeAlarmsForMetricInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAlarmsForMetricResponse" (snd xml)) - (Xml.member "DescribeAlarmsForMetricResult") - in + (Xml.member "DescribeAlarmsForMetricResult") in try Util.or_error (Util.option_bind resp DescribeAlarmsForMetricOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAlarmsForMetricOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAlarmsForMetricOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAlarmsForMetricOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAlarmsForMetricOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/describeAlarmsForMetric.mli b/libraries/cloudwatch/lib/describeAlarmsForMetric.mli index 9a5e70af3..5a836e815 100644 --- a/libraries/cloudwatch/lib/describeAlarmsForMetric.mli +++ b/libraries/cloudwatch/lib/describeAlarmsForMetric.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAlarmsForMetricInput.t - type output = DescribeAlarmsForMetricOutput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/disableAlarmActions.ml b/libraries/cloudwatch/lib/disableAlarmActions.ml index bf3f5b898..8f25b3d26 100644 --- a/libraries/cloudwatch/lib/disableAlarmActions.ml +++ b/libraries/cloudwatch/lib/disableAlarmActions.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DisableAlarmActionsInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "DisableAlarmActions" ] ] + [("Version", ["2010-08-01"]); ("Action", ["DisableAlarmActions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DisableAlarmActionsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DisableAlarmActionsInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/disableAlarmActions.mli b/libraries/cloudwatch/lib/disableAlarmActions.mli index 6b5392095..215481ca0 100644 --- a/libraries/cloudwatch/lib/disableAlarmActions.mli +++ b/libraries/cloudwatch/lib/disableAlarmActions.mli @@ -1,10 +1,7 @@ open Types - type input = DisableAlarmActionsInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/dune b/libraries/cloudwatch/lib/dune index f9e96d2e9..5a950f6bf 100644 --- a/libraries/cloudwatch/lib/dune +++ b/libraries/cloudwatch/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_cloudwatch) + (name aws_cloudwatch) (public_name aws-cloudwatch) (synopsis "aws-Amazon CloudWatch") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/cloudwatch/lib/enableAlarmActions.ml b/libraries/cloudwatch/lib/enableAlarmActions.ml index 2fca53d52..d9c2c589e 100644 --- a/libraries/cloudwatch/lib/enableAlarmActions.ml +++ b/libraries/cloudwatch/lib/enableAlarmActions.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = EnableAlarmActionsInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "EnableAlarmActions" ] ] + [("Version", ["2010-08-01"]); ("Action", ["EnableAlarmActions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (EnableAlarmActionsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (EnableAlarmActionsInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/enableAlarmActions.mli b/libraries/cloudwatch/lib/enableAlarmActions.mli index b092fdbf2..47d963338 100644 --- a/libraries/cloudwatch/lib/enableAlarmActions.mli +++ b/libraries/cloudwatch/lib/enableAlarmActions.mli @@ -1,10 +1,7 @@ open Types - type input = EnableAlarmActionsInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/errors_internal.ml b/libraries/cloudwatch/lib/errors_internal.ml index 97d012f3a..f91eb4e9b 100644 --- a/libraries/cloudwatch/lib/errors_internal.ml +++ b/libraries/cloudwatch/lib/errors_internal.ml @@ -1,66 +1,63 @@ type t = - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InternalServiceError - | InvalidAction - | InvalidClientTokenId - | InvalidFormat - | InvalidNextToken - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | LimitExceeded - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ResourceNotFound - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InternalServiceError + | InvalidAction + | InvalidClientTokenId + | InvalidFormat + | InvalidNextToken + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | LimitExceeded + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ResourceNotFound + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -95,7 +92,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -130,7 +126,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -165,4 +160,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/cloudwatch/lib/getMetricStatistics.ml b/libraries/cloudwatch/lib/getMetricStatistics.ml index a025e2409..6b3b65bdd 100644 --- a/libraries/cloudwatch/lib/getMetricStatistics.ml +++ b/libraries/cloudwatch/lib/getMetricStatistics.ml @@ -1,70 +1,64 @@ open Types open Aws - type input = GetMetricStatisticsInput.t - type output = GetMetricStatisticsOutput.t - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "GetMetricStatistics" ] ] + [("Version", ["2010-08-01"]); ("Action", ["GetMetricStatistics"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetMetricStatisticsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetMetricStatisticsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetMetricStatisticsResponse" (snd xml)) - (Xml.member "GetMetricStatisticsResult") - in + Util.option_bind (Xml.member "GetMetricStatisticsResponse" (snd xml)) + (Xml.member "GetMetricStatisticsResult") in try - Util.or_error - (Util.option_bind resp GetMetricStatisticsOutput.parse) + Util.or_error (Util.option_bind resp GetMetricStatisticsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetMetricStatisticsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetMetricStatisticsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetMetricStatisticsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetMetricStatisticsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InternalServiceError - ; Errors_internal.InvalidParameterCombination - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.InternalServiceError; + Errors_internal.InvalidParameterCombination; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/getMetricStatistics.mli b/libraries/cloudwatch/lib/getMetricStatistics.mli index 286dceb69..6aa0e1d4b 100644 --- a/libraries/cloudwatch/lib/getMetricStatistics.mli +++ b/libraries/cloudwatch/lib/getMetricStatistics.mli @@ -1,10 +1,7 @@ open Types - type input = GetMetricStatisticsInput.t - type output = GetMetricStatisticsOutput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/listMetrics.ml b/libraries/cloudwatch/lib/listMetrics.ml index faf307f36..28d8e3a7f 100644 --- a/libraries/cloudwatch/lib/listMetrics.ml +++ b/libraries/cloudwatch/lib/listMetrics.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = ListMetricsInput.t - type output = ListMetricsOutput.t - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "ListMetrics" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2010-08-01"]); ("Action", ["ListMetrics"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListMetricsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListMetricsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListMetricsResponse" (snd xml)) - (Xml.member "ListMetricsResult") - in + Util.option_bind (Xml.member "ListMetricsResponse" (snd xml)) + (Xml.member "ListMetricsResult") in try - Util.or_error - (Util.option_bind resp ListMetricsOutput.parse) + Util.or_error (Util.option_bind resp ListMetricsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListMetricsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListMetricsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListMetricsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListMetricsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterValue; Errors_internal.InternalServiceError ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterValue; + Errors_internal.InternalServiceError] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/listMetrics.mli b/libraries/cloudwatch/lib/listMetrics.mli index 5edb361e4..1fee5f1ea 100644 --- a/libraries/cloudwatch/lib/listMetrics.mli +++ b/libraries/cloudwatch/lib/listMetrics.mli @@ -1,10 +1,7 @@ open Types - type input = ListMetricsInput.t - type output = ListMetricsOutput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/putMetricAlarm.ml b/libraries/cloudwatch/lib/putMetricAlarm.ml index 30548fbfe..92ca4680b 100644 --- a/libraries/cloudwatch/lib/putMetricAlarm.ml +++ b/libraries/cloudwatch/lib/putMetricAlarm.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutMetricAlarmInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "PutMetricAlarm" ] ] + [("Version", ["2010-08-01"]); ("Action", ["PutMetricAlarm"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutMetricAlarmInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutMetricAlarmInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.LimitExceeded ] @ Errors_internal.common in + let errors = [Errors_internal.LimitExceeded] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/putMetricAlarm.mli b/libraries/cloudwatch/lib/putMetricAlarm.mli index ce9652a7c..7dcb863d5 100644 --- a/libraries/cloudwatch/lib/putMetricAlarm.mli +++ b/libraries/cloudwatch/lib/putMetricAlarm.mli @@ -1,10 +1,7 @@ open Types - type input = PutMetricAlarmInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/putMetricData.ml b/libraries/cloudwatch/lib/putMetricData.ml index 395da1974..fb091169c 100644 --- a/libraries/cloudwatch/lib/putMetricData.ml +++ b/libraries/cloudwatch/lib/putMetricData.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = PutMetricDataInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "PutMetricData" ] ] + [("Version", ["2010-08-01"]); ("Action", ["PutMetricData"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutMetricDataInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutMetricDataInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InternalServiceError - ; Errors_internal.InvalidParameterCombination - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.InternalServiceError; + Errors_internal.InvalidParameterCombination; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/putMetricData.mli b/libraries/cloudwatch/lib/putMetricData.mli index 17e799f0b..ac97fe1de 100644 --- a/libraries/cloudwatch/lib/putMetricData.mli +++ b/libraries/cloudwatch/lib/putMetricData.mli @@ -1,10 +1,7 @@ open Types - type input = PutMetricDataInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/setAlarmState.ml b/libraries/cloudwatch/lib/setAlarmState.ml index a56df3dc4..31b33f42b 100644 --- a/libraries/cloudwatch/lib/setAlarmState.ml +++ b/libraries/cloudwatch/lib/setAlarmState.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = SetAlarmStateInput.t - type output = unit - type error = Errors_internal.t - let service = "monitoring" - 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", [ "2010-08-01" ]; "Action", [ "SetAlarmState" ] ] + [("Version", ["2010-08-01"]); ("Action", ["SetAlarmState"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetAlarmStateInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetAlarmStateInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidFormat; Errors_internal.ResourceNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidFormat; Errors_internal.ResourceNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/setAlarmState.mli b/libraries/cloudwatch/lib/setAlarmState.mli index f4ce4f8fe..04a4d74be 100644 --- a/libraries/cloudwatch/lib/setAlarmState.mli +++ b/libraries/cloudwatch/lib/setAlarmState.mli @@ -1,10 +1,7 @@ open Types - type input = SetAlarmStateInput.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 \ No newline at end of file diff --git a/libraries/cloudwatch/lib/types.ml b/libraries/cloudwatch/lib/types.ml index 468a5ef6f..1e87a6c38 100644 --- a/libraries/cloudwatch/lib/types.ml +++ b/libraries/cloudwatch/lib/types.ml @@ -1,2068 +1,2157 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module Dimension = struct - type t = - { name : String.t - ; value : String.t - } - - let make ~name ~value () = { name; value } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) +module Dimension = + struct + type t = { + name: String.t ; + value: String.t } + let make ~name ~value () = { name; value } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value); Some ("name", String.to_json v.name) ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module HistoryItemType = struct - type t = - | ConfigurationUpdate - | StateUpdate - | Action - - let str_to_t = - [ "Action", Action - ; "StateUpdate", StateUpdate - ; "ConfigurationUpdate", ConfigurationUpdate - ] - - let t_to_str = - [ Action, "Action" - ; StateUpdate, "StateUpdate" - ; ConfigurationUpdate, "ConfigurationUpdate" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ComparisonOperator = struct - type t = - | GreaterThanOrEqualToThreshold - | GreaterThanThreshold - | LessThanThreshold - | LessThanOrEqualToThreshold - - let str_to_t = - [ "LessThanOrEqualToThreshold", LessThanOrEqualToThreshold - ; "LessThanThreshold", LessThanThreshold - ; "GreaterThanThreshold", GreaterThanThreshold - ; "GreaterThanOrEqualToThreshold", GreaterThanOrEqualToThreshold - ] - - let t_to_str = - [ LessThanOrEqualToThreshold, "LessThanOrEqualToThreshold" - ; LessThanThreshold, "LessThanThreshold" - ; GreaterThanThreshold, "GreaterThanThreshold" - ; GreaterThanOrEqualToThreshold, "GreaterThanOrEqualToThreshold" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Dimensions = struct - type t = Dimension.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Dimension.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Dimension.to_query v - - let to_json v = `List (List.map Dimension.to_json v) - - let of_json j = Json.to_list Dimension.of_json j -end - -module ResourceList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module StandardUnit = struct - type t = - | Seconds - | Microseconds - | Milliseconds - | Bytes - | Kilobytes - | Megabytes - | Gigabytes - | Terabytes - | Bits - | Kilobits - | Megabits - | Gigabits - | Terabits - | Percent - | Count - | Bytes_Second - | Kilobytes_Second - | Megabytes_Second - | Gigabytes_Second - | Terabytes_Second - | Bits_Second - | Kilobits_Second - | Megabits_Second - | Gigabits_Second - | Terabits_Second - | Count_Second - | None - - let str_to_t = - [ "None", None - ; "Count/Second", Count_Second - ; "Terabits/Second", Terabits_Second - ; "Gigabits/Second", Gigabits_Second - ; "Megabits/Second", Megabits_Second - ; "Kilobits/Second", Kilobits_Second - ; "Bits/Second", Bits_Second - ; "Terabytes/Second", Terabytes_Second - ; "Gigabytes/Second", Gigabytes_Second - ; "Megabytes/Second", Megabytes_Second - ; "Kilobytes/Second", Kilobytes_Second - ; "Bytes/Second", Bytes_Second - ; "Count", Count - ; "Percent", Percent - ; "Terabits", Terabits - ; "Gigabits", Gigabits - ; "Megabits", Megabits - ; "Kilobits", Kilobits - ; "Bits", Bits - ; "Terabytes", Terabytes - ; "Gigabytes", Gigabytes - ; "Megabytes", Megabytes - ; "Kilobytes", Kilobytes - ; "Bytes", Bytes - ; "Milliseconds", Milliseconds - ; "Microseconds", Microseconds - ; "Seconds", Seconds - ] - - let t_to_str = - [ None, "None" - ; Count_Second, "Count/Second" - ; Terabits_Second, "Terabits/Second" - ; Gigabits_Second, "Gigabits/Second" - ; Megabits_Second, "Megabits/Second" - ; Kilobits_Second, "Kilobits/Second" - ; Bits_Second, "Bits/Second" - ; Terabytes_Second, "Terabytes/Second" - ; Gigabytes_Second, "Gigabytes/Second" - ; Megabytes_Second, "Megabytes/Second" - ; Kilobytes_Second, "Kilobytes/Second" - ; Bytes_Second, "Bytes/Second" - ; Count, "Count" - ; Percent, "Percent" - ; Terabits, "Terabits" - ; Gigabits, "Gigabits" - ; Megabits, "Megabits" - ; Kilobits, "Kilobits" - ; Bits, "Bits" - ; Terabytes, "Terabytes" - ; Gigabytes, "Gigabytes" - ; Megabytes, "Megabytes" - ; Kilobytes, "Kilobytes" - ; Bytes, "Bytes" - ; Milliseconds, "Milliseconds" - ; Microseconds, "Microseconds" - ; Seconds, "Seconds" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module StateValue = struct - type t = - | OK - | ALARM - | INSUFFICIENT_DATA - - let str_to_t = [ "INSUFFICIENT_DATA", INSUFFICIENT_DATA; "ALARM", ALARM; "OK", OK ] - - let t_to_str = [ INSUFFICIENT_DATA, "INSUFFICIENT_DATA"; ALARM, "ALARM"; OK, "OK" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Statistic = struct - type t = - | SampleCount - | Average - | Sum - | Minimum - | Maximum - - let str_to_t = - [ "Maximum", Maximum - ; "Minimum", Minimum - ; "Sum", Sum - ; "Average", Average - ; "SampleCount", SampleCount - ] - - let t_to_str = - [ Maximum, "Maximum" - ; Minimum, "Minimum" - ; Sum, "Sum" - ; Average, "Average" - ; SampleCount, "SampleCount" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module StatisticSet = struct - type t = - { sample_count : Double.t - ; sum : Double.t - ; minimum : Double.t - ; maximum : Double.t - } - - let make ~sample_count ~sum ~minimum ~maximum () = - { sample_count; sum; minimum; maximum } - - let parse xml = - Some - { sample_count = - Xml.required - "SampleCount" - (Util.option_bind (Xml.member "SampleCount" xml) Double.parse) - ; sum = Xml.required "Sum" (Util.option_bind (Xml.member "Sum" xml) Double.parse) - ; minimum = - Xml.required - "Minimum" - (Util.option_bind (Xml.member "Minimum" xml) Double.parse) - ; maximum = - Xml.required - "Maximum" - (Util.option_bind (Xml.member "Maximum" xml) Double.parse) + end +module HistoryItemType = + struct + type t = + | ConfigurationUpdate + | StateUpdate + | Action + let str_to_t = + [("Action", Action); + ("StateUpdate", StateUpdate); + ("ConfigurationUpdate", ConfigurationUpdate)] + let t_to_str = + [(Action, "Action"); + (StateUpdate, "StateUpdate"); + (ConfigurationUpdate, "ConfigurationUpdate")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ComparisonOperator = + struct + type t = + | GreaterThanOrEqualToThreshold + | GreaterThanThreshold + | LessThanThreshold + | LessThanOrEqualToThreshold + let str_to_t = + [("LessThanOrEqualToThreshold", LessThanOrEqualToThreshold); + ("LessThanThreshold", LessThanThreshold); + ("GreaterThanThreshold", GreaterThanThreshold); + ("GreaterThanOrEqualToThreshold", GreaterThanOrEqualToThreshold)] + let t_to_str = + [(LessThanOrEqualToThreshold, "LessThanOrEqualToThreshold"); + (LessThanThreshold, "LessThanThreshold"); + (GreaterThanThreshold, "GreaterThanThreshold"); + (GreaterThanOrEqualToThreshold, "GreaterThanOrEqualToThreshold")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Dimensions = + struct + type t = Dimension.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Dimension.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Dimension.to_query v + let to_json v = `List (List.map Dimension.to_json v) + let of_json j = Json.to_list Dimension.of_json j + end +module ResourceList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module StandardUnit = + struct + type t = + | Seconds + | Microseconds + | Milliseconds + | Bytes + | Kilobytes + | Megabytes + | Gigabytes + | Terabytes + | Bits + | Kilobits + | Megabits + | Gigabits + | Terabits + | Percent + | Count + | Bytes_Second + | Kilobytes_Second + | Megabytes_Second + | Gigabytes_Second + | Terabytes_Second + | Bits_Second + | Kilobits_Second + | Megabits_Second + | Gigabits_Second + | Terabits_Second + | Count_Second + | None + let str_to_t = + [("None", None); + ("Count/Second", Count_Second); + ("Terabits/Second", Terabits_Second); + ("Gigabits/Second", Gigabits_Second); + ("Megabits/Second", Megabits_Second); + ("Kilobits/Second", Kilobits_Second); + ("Bits/Second", Bits_Second); + ("Terabytes/Second", Terabytes_Second); + ("Gigabytes/Second", Gigabytes_Second); + ("Megabytes/Second", Megabytes_Second); + ("Kilobytes/Second", Kilobytes_Second); + ("Bytes/Second", Bytes_Second); + ("Count", Count); + ("Percent", Percent); + ("Terabits", Terabits); + ("Gigabits", Gigabits); + ("Megabits", Megabits); + ("Kilobits", Kilobits); + ("Bits", Bits); + ("Terabytes", Terabytes); + ("Gigabytes", Gigabytes); + ("Megabytes", Megabytes); + ("Kilobytes", Kilobytes); + ("Bytes", Bytes); + ("Milliseconds", Milliseconds); + ("Microseconds", Microseconds); + ("Seconds", Seconds)] + let t_to_str = + [(None, "None"); + (Count_Second, "Count/Second"); + (Terabits_Second, "Terabits/Second"); + (Gigabits_Second, "Gigabits/Second"); + (Megabits_Second, "Megabits/Second"); + (Kilobits_Second, "Kilobits/Second"); + (Bits_Second, "Bits/Second"); + (Terabytes_Second, "Terabytes/Second"); + (Gigabytes_Second, "Gigabytes/Second"); + (Megabytes_Second, "Megabytes/Second"); + (Kilobytes_Second, "Kilobytes/Second"); + (Bytes_Second, "Bytes/Second"); + (Count, "Count"); + (Percent, "Percent"); + (Terabits, "Terabits"); + (Gigabits, "Gigabits"); + (Megabits, "Megabits"); + (Kilobits, "Kilobits"); + (Bits, "Bits"); + (Terabytes, "Terabytes"); + (Gigabytes, "Gigabytes"); + (Megabytes, "Megabytes"); + (Kilobytes, "Kilobytes"); + (Bytes, "Bytes"); + (Milliseconds, "Milliseconds"); + (Microseconds, "Microseconds"); + (Seconds, "Seconds")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StateValue = + struct + type t = + | OK + | ALARM + | INSUFFICIENT_DATA + let str_to_t = + [("INSUFFICIENT_DATA", INSUFFICIENT_DATA); + ("ALARM", ALARM); + ("OK", OK)] + let t_to_str = + [(INSUFFICIENT_DATA, "INSUFFICIENT_DATA"); + (ALARM, "ALARM"); + (OK, "OK")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Statistic = + struct + type t = + | SampleCount + | Average + | Sum + | Minimum + | Maximum + let str_to_t = + [("Maximum", Maximum); + ("Minimum", Minimum); + ("Sum", Sum); + ("Average", Average); + ("SampleCount", SampleCount)] + let t_to_str = + [(Maximum, "Maximum"); + (Minimum, "Minimum"); + (Sum, "Sum"); + (Average, "Average"); + (SampleCount, "SampleCount")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StatisticSet = + struct + type t = + { + sample_count: Double.t ; + sum: Double.t ; + minimum: Double.t ; + maximum: Double.t } + let make ~sample_count ~sum ~minimum ~maximum () = + { sample_count; sum; minimum; maximum } + let parse xml = + Some + { + sample_count = + (Xml.required "SampleCount" + (Util.option_bind (Xml.member "SampleCount" xml) Double.parse)); + sum = + (Xml.required "Sum" + (Util.option_bind (Xml.member "Sum" xml) Double.parse)); + minimum = + (Xml.required "Minimum" + (Util.option_bind (Xml.member "Minimum" xml) Double.parse)); + maximum = + (Xml.required "Maximum" + (Util.option_bind (Xml.member "Maximum" xml) Double.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Maximum", (Double.to_query v.maximum))); + Some (Query.Pair ("Minimum", (Double.to_query v.minimum))); + Some (Query.Pair ("Sum", (Double.to_query v.sum))); + Some + (Query.Pair ("SampleCount", (Double.to_query v.sample_count)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("maximum", (Double.to_json v.maximum)); + Some ("minimum", (Double.to_json v.minimum)); + Some ("sum", (Double.to_json v.sum)); + Some ("sample_count", (Double.to_json v.sample_count))]) + let of_json j = + { + sample_count = + (Double.of_json (Util.of_option_exn (Json.lookup j "sample_count"))); + sum = (Double.of_json (Util.of_option_exn (Json.lookup j "sum"))); + minimum = + (Double.of_json (Util.of_option_exn (Json.lookup j "minimum"))); + maximum = + (Double.of_json (Util.of_option_exn (Json.lookup j "maximum"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Maximum", Double.to_query v.maximum)) - ; Some (Query.Pair ("Minimum", Double.to_query v.minimum)) - ; Some (Query.Pair ("Sum", Double.to_query v.sum)) - ; Some (Query.Pair ("SampleCount", Double.to_query v.sample_count)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("maximum", Double.to_json v.maximum) - ; Some ("minimum", Double.to_json v.minimum) - ; Some ("sum", Double.to_json v.sum) - ; Some ("sample_count", Double.to_json v.sample_count) - ]) - - let of_json j = - { sample_count = Double.of_json (Util.of_option_exn (Json.lookup j "sample_count")) - ; sum = Double.of_json (Util.of_option_exn (Json.lookup j "sum")) - ; minimum = Double.of_json (Util.of_option_exn (Json.lookup j "minimum")) - ; maximum = Double.of_json (Util.of_option_exn (Json.lookup j "maximum")) - } -end - -module AlarmHistoryItem = struct - type t = - { alarm_name : String.t option - ; timestamp : DateTime.t option - ; history_item_type : HistoryItemType.t option - ; history_summary : String.t option - ; history_data : String.t option - } - - let make ?alarm_name ?timestamp ?history_item_type ?history_summary ?history_data () = - { alarm_name; timestamp; history_item_type; history_summary; history_data } - - let parse xml = - Some - { alarm_name = Util.option_bind (Xml.member "AlarmName" xml) String.parse - ; timestamp = Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse - ; history_item_type = - Util.option_bind (Xml.member "HistoryItemType" xml) HistoryItemType.parse - ; history_summary = Util.option_bind (Xml.member "HistorySummary" xml) String.parse - ; history_data = Util.option_bind (Xml.member "HistoryData" xml) String.parse + end +module AlarmHistoryItem = + struct + type t = + { + alarm_name: String.t option ; + timestamp: DateTime.t option ; + history_item_type: HistoryItemType.t option ; + history_summary: String.t option ; + history_data: String.t option } + let make ?alarm_name ?timestamp ?history_item_type ?history_summary + ?history_data () = + { + alarm_name; + timestamp; + history_item_type; + history_summary; + history_data } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.history_data (fun f -> - Query.Pair ("HistoryData", String.to_query f)) - ; Util.option_map v.history_summary (fun f -> - Query.Pair ("HistorySummary", String.to_query f)) - ; Util.option_map v.history_item_type (fun f -> - Query.Pair ("HistoryItemType", HistoryItemType.to_query f)) - ; Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", DateTime.to_query f)) - ; Util.option_map v.alarm_name (fun f -> - Query.Pair ("AlarmName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.history_data (fun f -> "history_data", String.to_json f) - ; Util.option_map v.history_summary (fun f -> - "history_summary", String.to_json f) - ; Util.option_map v.history_item_type (fun f -> - "history_item_type", HistoryItemType.to_json f) - ; Util.option_map v.timestamp (fun f -> "timestamp", DateTime.to_json f) - ; Util.option_map v.alarm_name (fun f -> "alarm_name", String.to_json f) - ]) - - let of_json j = - { alarm_name = Util.option_map (Json.lookup j "alarm_name") String.of_json - ; timestamp = Util.option_map (Json.lookup j "timestamp") DateTime.of_json - ; history_item_type = - Util.option_map (Json.lookup j "history_item_type") HistoryItemType.of_json - ; history_summary = Util.option_map (Json.lookup j "history_summary") String.of_json - ; history_data = Util.option_map (Json.lookup j "history_data") String.of_json - } -end - -module DimensionFilter = struct - type t = - { name : String.t - ; value : String.t option - } - - let make ~name ?value () = { name; value } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; value = Util.option_bind (Xml.member "Value" xml) String.parse + let parse xml = + Some + { + alarm_name = + (Util.option_bind (Xml.member "AlarmName" xml) String.parse); + timestamp = + (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse); + history_item_type = + (Util.option_bind (Xml.member "HistoryItemType" xml) + HistoryItemType.parse); + history_summary = + (Util.option_bind (Xml.member "HistorySummary" xml) String.parse); + history_data = + (Util.option_bind (Xml.member "HistoryData" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.history_data + (fun f -> Query.Pair ("HistoryData", (String.to_query f))); + Util.option_map v.history_summary + (fun f -> Query.Pair ("HistorySummary", (String.to_query f))); + Util.option_map v.history_item_type + (fun f -> + Query.Pair ("HistoryItemType", (HistoryItemType.to_query f))); + Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (DateTime.to_query f))); + Util.option_map v.alarm_name + (fun f -> Query.Pair ("AlarmName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.history_data + (fun f -> ("history_data", (String.to_json f))); + Util.option_map v.history_summary + (fun f -> ("history_summary", (String.to_json f))); + Util.option_map v.history_item_type + (fun f -> ("history_item_type", (HistoryItemType.to_json f))); + Util.option_map v.timestamp + (fun f -> ("timestamp", (DateTime.to_json f))); + Util.option_map v.alarm_name + (fun f -> ("alarm_name", (String.to_json f)))]) + let of_json j = + { + alarm_name = + (Util.option_map (Json.lookup j "alarm_name") String.of_json); + timestamp = + (Util.option_map (Json.lookup j "timestamp") DateTime.of_json); + history_item_type = + (Util.option_map (Json.lookup j "history_item_type") + HistoryItemType.of_json); + history_summary = + (Util.option_map (Json.lookup j "history_summary") String.of_json); + history_data = + (Util.option_map (Json.lookup j "history_data") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module MetricAlarm = struct - type t = - { alarm_name : String.t option - ; alarm_arn : String.t option - ; alarm_description : String.t option - ; alarm_configuration_updated_timestamp : DateTime.t option - ; actions_enabled : Boolean.t option - ; o_k_actions : ResourceList.t - ; alarm_actions : ResourceList.t - ; insufficient_data_actions : ResourceList.t - ; state_value : StateValue.t option - ; state_reason : String.t option - ; state_reason_data : String.t option - ; state_updated_timestamp : DateTime.t option - ; metric_name : String.t option - ; namespace : String.t option - ; statistic : Statistic.t option - ; dimensions : Dimensions.t - ; period : Integer.t option - ; unit : StandardUnit.t option - ; evaluation_periods : Integer.t option - ; threshold : Double.t option - ; comparison_operator : ComparisonOperator.t option - } - - let make - ?alarm_name - ?alarm_arn - ?alarm_description - ?alarm_configuration_updated_timestamp - ?actions_enabled - ?(o_k_actions = []) - ?(alarm_actions = []) - ?(insufficient_data_actions = []) - ?state_value - ?state_reason - ?state_reason_data - ?state_updated_timestamp - ?metric_name - ?namespace - ?statistic - ?(dimensions = []) - ?period - ?unit - ?evaluation_periods - ?threshold - ?comparison_operator - () = - { alarm_name - ; alarm_arn - ; alarm_description - ; alarm_configuration_updated_timestamp - ; actions_enabled - ; o_k_actions - ; alarm_actions - ; insufficient_data_actions - ; state_value - ; state_reason - ; state_reason_data - ; state_updated_timestamp - ; metric_name - ; namespace - ; statistic - ; dimensions - ; period - ; unit - ; evaluation_periods - ; threshold - ; comparison_operator - } - - let parse xml = - Some - { alarm_name = Util.option_bind (Xml.member "AlarmName" xml) String.parse - ; alarm_arn = Util.option_bind (Xml.member "AlarmArn" xml) String.parse - ; alarm_description = - Util.option_bind (Xml.member "AlarmDescription" xml) String.parse - ; alarm_configuration_updated_timestamp = - Util.option_bind - (Xml.member "AlarmConfigurationUpdatedTimestamp" xml) - DateTime.parse - ; actions_enabled = Util.option_bind (Xml.member "ActionsEnabled" xml) Boolean.parse - ; o_k_actions = - Util.of_option - [] - (Util.option_bind (Xml.member "OKActions" xml) ResourceList.parse) - ; alarm_actions = - Util.of_option - [] - (Util.option_bind (Xml.member "AlarmActions" xml) ResourceList.parse) - ; insufficient_data_actions = - Util.of_option - [] + end +module DimensionFilter = + struct + type t = { + name: String.t ; + value: String.t option } + let make ~name ?value () = { name; value } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module MetricAlarm = + struct + type t = + { + alarm_name: String.t option ; + alarm_arn: String.t option ; + alarm_description: String.t option ; + alarm_configuration_updated_timestamp: DateTime.t option ; + actions_enabled: Boolean.t option ; + o_k_actions: ResourceList.t ; + alarm_actions: ResourceList.t ; + insufficient_data_actions: ResourceList.t ; + state_value: StateValue.t option ; + state_reason: String.t option ; + state_reason_data: String.t option ; + state_updated_timestamp: DateTime.t option ; + metric_name: String.t option ; + namespace: String.t option ; + statistic: Statistic.t option ; + dimensions: Dimensions.t ; + period: Integer.t option ; + unit: StandardUnit.t option ; + evaluation_periods: Integer.t option ; + threshold: Double.t option ; + comparison_operator: ComparisonOperator.t option } + let make ?alarm_name ?alarm_arn ?alarm_description + ?alarm_configuration_updated_timestamp ?actions_enabled + ?(o_k_actions= []) ?(alarm_actions= []) ?(insufficient_data_actions= + []) ?state_value ?state_reason ?state_reason_data + ?state_updated_timestamp ?metric_name ?namespace ?statistic + ?(dimensions= []) ?period ?unit ?evaluation_periods ?threshold + ?comparison_operator () = + { + alarm_name; + alarm_arn; + alarm_description; + alarm_configuration_updated_timestamp; + actions_enabled; + o_k_actions; + alarm_actions; + insufficient_data_actions; + state_value; + state_reason; + state_reason_data; + state_updated_timestamp; + metric_name; + namespace; + statistic; + dimensions; + period; + unit; + evaluation_periods; + threshold; + comparison_operator + } + let parse xml = + Some + { + alarm_name = + (Util.option_bind (Xml.member "AlarmName" xml) String.parse); + alarm_arn = + (Util.option_bind (Xml.member "AlarmArn" xml) String.parse); + alarm_description = + (Util.option_bind (Xml.member "AlarmDescription" xml) + String.parse); + alarm_configuration_updated_timestamp = (Util.option_bind - (Xml.member "InsufficientDataActions" xml) - ResourceList.parse) - ; state_value = Util.option_bind (Xml.member "StateValue" xml) StateValue.parse - ; state_reason = Util.option_bind (Xml.member "StateReason" xml) String.parse - ; state_reason_data = - Util.option_bind (Xml.member "StateReasonData" xml) String.parse - ; state_updated_timestamp = - Util.option_bind (Xml.member "StateUpdatedTimestamp" xml) DateTime.parse - ; metric_name = Util.option_bind (Xml.member "MetricName" xml) String.parse - ; namespace = Util.option_bind (Xml.member "Namespace" xml) String.parse - ; statistic = Util.option_bind (Xml.member "Statistic" xml) Statistic.parse - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) - ; period = Util.option_bind (Xml.member "Period" xml) Integer.parse - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse - ; evaluation_periods = - Util.option_bind (Xml.member "EvaluationPeriods" xml) Integer.parse - ; threshold = Util.option_bind (Xml.member "Threshold" xml) Double.parse - ; comparison_operator = - Util.option_bind (Xml.member "ComparisonOperator" xml) ComparisonOperator.parse + (Xml.member "AlarmConfigurationUpdatedTimestamp" xml) + DateTime.parse); + actions_enabled = + (Util.option_bind (Xml.member "ActionsEnabled" xml) Boolean.parse); + o_k_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "OKActions" xml) + ResourceList.parse)); + alarm_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "AlarmActions" xml) + ResourceList.parse)); + insufficient_data_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "InsufficientDataActions" xml) + ResourceList.parse)); + state_value = + (Util.option_bind (Xml.member "StateValue" xml) StateValue.parse); + state_reason = + (Util.option_bind (Xml.member "StateReason" xml) String.parse); + state_reason_data = + (Util.option_bind (Xml.member "StateReasonData" xml) String.parse); + state_updated_timestamp = + (Util.option_bind (Xml.member "StateUpdatedTimestamp" xml) + DateTime.parse); + metric_name = + (Util.option_bind (Xml.member "MetricName" xml) String.parse); + namespace = + (Util.option_bind (Xml.member "Namespace" xml) String.parse); + statistic = + (Util.option_bind (Xml.member "Statistic" xml) Statistic.parse); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)); + period = (Util.option_bind (Xml.member "Period" xml) Integer.parse); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse); + evaluation_periods = + (Util.option_bind (Xml.member "EvaluationPeriods" xml) + Integer.parse); + threshold = + (Util.option_bind (Xml.member "Threshold" xml) Double.parse); + comparison_operator = + (Util.option_bind (Xml.member "ComparisonOperator" xml) + ComparisonOperator.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comparison_operator + (fun f -> + Query.Pair + ("ComparisonOperator", (ComparisonOperator.to_query f))); + Util.option_map v.threshold + (fun f -> Query.Pair ("Threshold", (Double.to_query f))); + Util.option_map v.evaluation_periods + (fun f -> Query.Pair ("EvaluationPeriods", (Integer.to_query f))); + Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Util.option_map v.period + (fun f -> Query.Pair ("Period", (Integer.to_query f))); + Some + (Query.Pair + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Util.option_map v.statistic + (fun f -> Query.Pair ("Statistic", (Statistic.to_query f))); + Util.option_map v.namespace + (fun f -> Query.Pair ("Namespace", (String.to_query f))); + Util.option_map v.metric_name + (fun f -> Query.Pair ("MetricName", (String.to_query f))); + Util.option_map v.state_updated_timestamp + (fun f -> + Query.Pair ("StateUpdatedTimestamp", (DateTime.to_query f))); + Util.option_map v.state_reason_data + (fun f -> Query.Pair ("StateReasonData", (String.to_query f))); + Util.option_map v.state_reason + (fun f -> Query.Pair ("StateReason", (String.to_query f))); + Util.option_map v.state_value + (fun f -> Query.Pair ("StateValue", (StateValue.to_query f))); + Some + (Query.Pair + ("InsufficientDataActions.member", + (ResourceList.to_query v.insufficient_data_actions))); + Some + (Query.Pair + ("AlarmActions.member", + (ResourceList.to_query v.alarm_actions))); + Some + (Query.Pair + ("OKActions.member", (ResourceList.to_query v.o_k_actions))); + Util.option_map v.actions_enabled + (fun f -> Query.Pair ("ActionsEnabled", (Boolean.to_query f))); + Util.option_map v.alarm_configuration_updated_timestamp + (fun f -> + Query.Pair + ("AlarmConfigurationUpdatedTimestamp", + (DateTime.to_query f))); + Util.option_map v.alarm_description + (fun f -> Query.Pair ("AlarmDescription", (String.to_query f))); + Util.option_map v.alarm_arn + (fun f -> Query.Pair ("AlarmArn", (String.to_query f))); + Util.option_map v.alarm_name + (fun f -> Query.Pair ("AlarmName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comparison_operator + (fun f -> + ("comparison_operator", (ComparisonOperator.to_json f))); + Util.option_map v.threshold + (fun f -> ("threshold", (Double.to_json f))); + Util.option_map v.evaluation_periods + (fun f -> ("evaluation_periods", (Integer.to_json f))); + Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Util.option_map v.period + (fun f -> ("period", (Integer.to_json f))); + Some ("dimensions", (Dimensions.to_json v.dimensions)); + Util.option_map v.statistic + (fun f -> ("statistic", (Statistic.to_json f))); + Util.option_map v.namespace + (fun f -> ("namespace", (String.to_json f))); + Util.option_map v.metric_name + (fun f -> ("metric_name", (String.to_json f))); + Util.option_map v.state_updated_timestamp + (fun f -> ("state_updated_timestamp", (DateTime.to_json f))); + Util.option_map v.state_reason_data + (fun f -> ("state_reason_data", (String.to_json f))); + Util.option_map v.state_reason + (fun f -> ("state_reason", (String.to_json f))); + Util.option_map v.state_value + (fun f -> ("state_value", (StateValue.to_json f))); + Some + ("insufficient_data_actions", + (ResourceList.to_json v.insufficient_data_actions)); + Some ("alarm_actions", (ResourceList.to_json v.alarm_actions)); + Some ("o_k_actions", (ResourceList.to_json v.o_k_actions)); + Util.option_map v.actions_enabled + (fun f -> ("actions_enabled", (Boolean.to_json f))); + Util.option_map v.alarm_configuration_updated_timestamp + (fun f -> + ("alarm_configuration_updated_timestamp", + (DateTime.to_json f))); + Util.option_map v.alarm_description + (fun f -> ("alarm_description", (String.to_json f))); + Util.option_map v.alarm_arn + (fun f -> ("alarm_arn", (String.to_json f))); + Util.option_map v.alarm_name + (fun f -> ("alarm_name", (String.to_json f)))]) + let of_json j = + { + alarm_name = + (Util.option_map (Json.lookup j "alarm_name") String.of_json); + alarm_arn = + (Util.option_map (Json.lookup j "alarm_arn") String.of_json); + alarm_description = + (Util.option_map (Json.lookup j "alarm_description") String.of_json); + alarm_configuration_updated_timestamp = + (Util.option_map + (Json.lookup j "alarm_configuration_updated_timestamp") + DateTime.of_json); + actions_enabled = + (Util.option_map (Json.lookup j "actions_enabled") Boolean.of_json); + o_k_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "o_k_actions"))); + alarm_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "alarm_actions"))); + insufficient_data_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "insufficient_data_actions"))); + state_value = + (Util.option_map (Json.lookup j "state_value") StateValue.of_json); + state_reason = + (Util.option_map (Json.lookup j "state_reason") String.of_json); + state_reason_data = + (Util.option_map (Json.lookup j "state_reason_data") String.of_json); + state_updated_timestamp = + (Util.option_map (Json.lookup j "state_updated_timestamp") + DateTime.of_json); + metric_name = + (Util.option_map (Json.lookup j "metric_name") String.of_json); + namespace = + (Util.option_map (Json.lookup j "namespace") String.of_json); + statistic = + (Util.option_map (Json.lookup j "statistic") Statistic.of_json); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + period = (Util.option_map (Json.lookup j "period") Integer.of_json); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json); + evaluation_periods = + (Util.option_map (Json.lookup j "evaluation_periods") + Integer.of_json); + threshold = + (Util.option_map (Json.lookup j "threshold") Double.of_json); + comparison_operator = + (Util.option_map (Json.lookup j "comparison_operator") + ComparisonOperator.of_json) + } + end +module Metric = + struct + type t = + { + namespace: String.t option ; + metric_name: String.t option ; + dimensions: Dimensions.t } + let make ?namespace ?metric_name ?(dimensions= []) () = + { namespace; metric_name; dimensions } + let parse xml = + Some + { + namespace = + (Util.option_bind (Xml.member "Namespace" xml) String.parse); + metric_name = + (Util.option_bind (Xml.member "MetricName" xml) String.parse); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Util.option_map v.metric_name + (fun f -> Query.Pair ("MetricName", (String.to_query f))); + Util.option_map v.namespace + (fun f -> Query.Pair ("Namespace", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("dimensions", (Dimensions.to_json v.dimensions)); + Util.option_map v.metric_name + (fun f -> ("metric_name", (String.to_json f))); + Util.option_map v.namespace + (fun f -> ("namespace", (String.to_json f)))]) + let of_json j = + { + namespace = + (Util.option_map (Json.lookup j "namespace") String.of_json); + metric_name = + (Util.option_map (Json.lookup j "metric_name") String.of_json); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comparison_operator (fun f -> - Query.Pair ("ComparisonOperator", ComparisonOperator.to_query f)) - ; Util.option_map v.threshold (fun f -> - Query.Pair ("Threshold", Double.to_query f)) - ; Util.option_map v.evaluation_periods (fun f -> - Query.Pair ("EvaluationPeriods", Integer.to_query f)) - ; Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Util.option_map v.period (fun f -> Query.Pair ("Period", Integer.to_query f)) - ; Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Util.option_map v.statistic (fun f -> - Query.Pair ("Statistic", Statistic.to_query f)) - ; Util.option_map v.namespace (fun f -> - Query.Pair ("Namespace", String.to_query f)) - ; Util.option_map v.metric_name (fun f -> - Query.Pair ("MetricName", String.to_query f)) - ; Util.option_map v.state_updated_timestamp (fun f -> - Query.Pair ("StateUpdatedTimestamp", DateTime.to_query f)) - ; Util.option_map v.state_reason_data (fun f -> - Query.Pair ("StateReasonData", String.to_query f)) - ; Util.option_map v.state_reason (fun f -> - Query.Pair ("StateReason", String.to_query f)) - ; Util.option_map v.state_value (fun f -> - Query.Pair ("StateValue", StateValue.to_query f)) - ; Some + end +module MetricDatum = + struct + type t = + { + metric_name: String.t ; + dimensions: Dimensions.t ; + timestamp: DateTime.t option ; + value: Double.t option ; + statistic_values: StatisticSet.t option ; + unit: StandardUnit.t option } + let make ~metric_name ?(dimensions= []) ?timestamp ?value + ?statistic_values ?unit () = + { metric_name; dimensions; timestamp; value; statistic_values; unit } + let parse xml = + Some + { + metric_name = + (Xml.required "MetricName" + (Util.option_bind (Xml.member "MetricName" xml) String.parse)); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)); + timestamp = + (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse); + value = (Util.option_bind (Xml.member "Value" xml) Double.parse); + statistic_values = + (Util.option_bind (Xml.member "StatisticValues" xml) + StatisticSet.parse); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Util.option_map v.statistic_values + (fun f -> + Query.Pair ("StatisticValues", (StatisticSet.to_query f))); + Util.option_map v.value + (fun f -> Query.Pair ("Value", (Double.to_query f))); + Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (DateTime.to_query f))); + Some (Query.Pair - ( "InsufficientDataActions.member" - , ResourceList.to_query v.insufficient_data_actions )) - ; Some - (Query.Pair ("AlarmActions.member", ResourceList.to_query v.alarm_actions)) - ; Some (Query.Pair ("OKActions.member", ResourceList.to_query v.o_k_actions)) - ; Util.option_map v.actions_enabled (fun f -> - Query.Pair ("ActionsEnabled", Boolean.to_query f)) - ; Util.option_map v.alarm_configuration_updated_timestamp (fun f -> - Query.Pair ("AlarmConfigurationUpdatedTimestamp", DateTime.to_query f)) - ; Util.option_map v.alarm_description (fun f -> - Query.Pair ("AlarmDescription", String.to_query f)) - ; Util.option_map v.alarm_arn (fun f -> - Query.Pair ("AlarmArn", String.to_query f)) - ; Util.option_map v.alarm_name (fun f -> - Query.Pair ("AlarmName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comparison_operator (fun f -> - "comparison_operator", ComparisonOperator.to_json f) - ; Util.option_map v.threshold (fun f -> "threshold", Double.to_json f) - ; Util.option_map v.evaluation_periods (fun f -> - "evaluation_periods", Integer.to_json f) - ; Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Util.option_map v.period (fun f -> "period", Integer.to_json f) - ; Some ("dimensions", Dimensions.to_json v.dimensions) - ; Util.option_map v.statistic (fun f -> "statistic", Statistic.to_json f) - ; Util.option_map v.namespace (fun f -> "namespace", String.to_json f) - ; Util.option_map v.metric_name (fun f -> "metric_name", String.to_json f) - ; Util.option_map v.state_updated_timestamp (fun f -> - "state_updated_timestamp", DateTime.to_json f) - ; Util.option_map v.state_reason_data (fun f -> - "state_reason_data", String.to_json f) - ; Util.option_map v.state_reason (fun f -> "state_reason", String.to_json f) - ; Util.option_map v.state_value (fun f -> "state_value", StateValue.to_json f) - ; Some - ( "insufficient_data_actions" - , ResourceList.to_json v.insufficient_data_actions ) - ; Some ("alarm_actions", ResourceList.to_json v.alarm_actions) - ; Some ("o_k_actions", ResourceList.to_json v.o_k_actions) - ; Util.option_map v.actions_enabled (fun f -> - "actions_enabled", Boolean.to_json f) - ; Util.option_map v.alarm_configuration_updated_timestamp (fun f -> - "alarm_configuration_updated_timestamp", DateTime.to_json f) - ; Util.option_map v.alarm_description (fun f -> - "alarm_description", String.to_json f) - ; Util.option_map v.alarm_arn (fun f -> "alarm_arn", String.to_json f) - ; Util.option_map v.alarm_name (fun f -> "alarm_name", String.to_json f) - ]) - - let of_json j = - { alarm_name = Util.option_map (Json.lookup j "alarm_name") String.of_json - ; alarm_arn = Util.option_map (Json.lookup j "alarm_arn") String.of_json - ; alarm_description = - Util.option_map (Json.lookup j "alarm_description") String.of_json - ; alarm_configuration_updated_timestamp = - Util.option_map - (Json.lookup j "alarm_configuration_updated_timestamp") - DateTime.of_json - ; actions_enabled = Util.option_map (Json.lookup j "actions_enabled") Boolean.of_json - ; o_k_actions = - ResourceList.of_json (Util.of_option_exn (Json.lookup j "o_k_actions")) - ; alarm_actions = - ResourceList.of_json (Util.of_option_exn (Json.lookup j "alarm_actions")) - ; insufficient_data_actions = - ResourceList.of_json - (Util.of_option_exn (Json.lookup j "insufficient_data_actions")) - ; state_value = Util.option_map (Json.lookup j "state_value") StateValue.of_json - ; state_reason = Util.option_map (Json.lookup j "state_reason") String.of_json - ; state_reason_data = - Util.option_map (Json.lookup j "state_reason_data") String.of_json - ; state_updated_timestamp = - Util.option_map (Json.lookup j "state_updated_timestamp") DateTime.of_json - ; metric_name = Util.option_map (Json.lookup j "metric_name") String.of_json - ; namespace = Util.option_map (Json.lookup j "namespace") String.of_json - ; statistic = Util.option_map (Json.lookup j "statistic") Statistic.of_json - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; period = Util.option_map (Json.lookup j "period") Integer.of_json - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - ; evaluation_periods = - Util.option_map (Json.lookup j "evaluation_periods") Integer.of_json - ; threshold = Util.option_map (Json.lookup j "threshold") Double.of_json - ; comparison_operator = - Util.option_map (Json.lookup j "comparison_operator") ComparisonOperator.of_json - } -end - -module Metric = struct - type t = - { namespace : String.t option - ; metric_name : String.t option - ; dimensions : Dimensions.t - } - - let make ?namespace ?metric_name ?(dimensions = []) () = - { namespace; metric_name; dimensions } - - let parse xml = - Some - { namespace = Util.option_bind (Xml.member "Namespace" xml) String.parse - ; metric_name = Util.option_bind (Xml.member "MetricName" xml) String.parse - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Some (Query.Pair ("MetricName", (String.to_query v.metric_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Util.option_map v.statistic_values + (fun f -> ("statistic_values", (StatisticSet.to_json f))); + Util.option_map v.value (fun f -> ("value", (Double.to_json f))); + Util.option_map v.timestamp + (fun f -> ("timestamp", (DateTime.to_json f))); + Some ("dimensions", (Dimensions.to_json v.dimensions)); + Some ("metric_name", (String.to_json v.metric_name))]) + let of_json j = + { + metric_name = + (String.of_json (Util.of_option_exn (Json.lookup j "metric_name"))); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + timestamp = + (Util.option_map (Json.lookup j "timestamp") DateTime.of_json); + value = (Util.option_map (Json.lookup j "value") Double.of_json); + statistic_values = + (Util.option_map (Json.lookup j "statistic_values") + StatisticSet.of_json); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Util.option_map v.metric_name (fun f -> - Query.Pair ("MetricName", String.to_query f)) - ; Util.option_map v.namespace (fun f -> - Query.Pair ("Namespace", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("dimensions", Dimensions.to_json v.dimensions) - ; Util.option_map v.metric_name (fun f -> "metric_name", String.to_json f) - ; Util.option_map v.namespace (fun f -> "namespace", String.to_json f) - ]) - - let of_json j = - { namespace = Util.option_map (Json.lookup j "namespace") String.of_json - ; metric_name = Util.option_map (Json.lookup j "metric_name") String.of_json - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - } -end - -module MetricDatum = struct - type t = - { metric_name : String.t - ; dimensions : Dimensions.t - ; timestamp : DateTime.t option - ; value : Double.t option - ; statistic_values : StatisticSet.t option - ; unit : StandardUnit.t option - } - - let make ~metric_name ?(dimensions = []) ?timestamp ?value ?statistic_values ?unit () = - { metric_name; dimensions; timestamp; value; statistic_values; unit } - - let parse xml = - Some - { metric_name = - Xml.required - "MetricName" - (Util.option_bind (Xml.member "MetricName" xml) String.parse) - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) - ; timestamp = Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse - ; value = Util.option_bind (Xml.member "Value" xml) Double.parse - ; statistic_values = - Util.option_bind (Xml.member "StatisticValues" xml) StatisticSet.parse - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse + end +module Datapoint = + struct + type t = + { + timestamp: DateTime.t option ; + sample_count: Double.t option ; + average: Double.t option ; + sum: Double.t option ; + minimum: Double.t option ; + maximum: Double.t option ; + unit: StandardUnit.t option } + let make ?timestamp ?sample_count ?average ?sum ?minimum ?maximum + ?unit () = + { timestamp; sample_count; average; sum; minimum; maximum; unit } + let parse xml = + Some + { + timestamp = + (Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse); + sample_count = + (Util.option_bind (Xml.member "SampleCount" xml) Double.parse); + average = + (Util.option_bind (Xml.member "Average" xml) Double.parse); + sum = (Util.option_bind (Xml.member "Sum" xml) Double.parse); + minimum = + (Util.option_bind (Xml.member "Minimum" xml) Double.parse); + maximum = + (Util.option_bind (Xml.member "Maximum" xml) Double.parse); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Util.option_map v.maximum + (fun f -> Query.Pair ("Maximum", (Double.to_query f))); + Util.option_map v.minimum + (fun f -> Query.Pair ("Minimum", (Double.to_query f))); + Util.option_map v.sum + (fun f -> Query.Pair ("Sum", (Double.to_query f))); + Util.option_map v.average + (fun f -> Query.Pair ("Average", (Double.to_query f))); + Util.option_map v.sample_count + (fun f -> Query.Pair ("SampleCount", (Double.to_query f))); + Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Util.option_map v.maximum + (fun f -> ("maximum", (Double.to_json f))); + Util.option_map v.minimum + (fun f -> ("minimum", (Double.to_json f))); + Util.option_map v.sum (fun f -> ("sum", (Double.to_json f))); + Util.option_map v.average + (fun f -> ("average", (Double.to_json f))); + Util.option_map v.sample_count + (fun f -> ("sample_count", (Double.to_json f))); + Util.option_map v.timestamp + (fun f -> ("timestamp", (DateTime.to_json f)))]) + let of_json j = + { + timestamp = + (Util.option_map (Json.lookup j "timestamp") DateTime.of_json); + sample_count = + (Util.option_map (Json.lookup j "sample_count") Double.of_json); + average = (Util.option_map (Json.lookup j "average") Double.of_json); + sum = (Util.option_map (Json.lookup j "sum") Double.of_json); + minimum = (Util.option_map (Json.lookup j "minimum") Double.of_json); + maximum = (Util.option_map (Json.lookup j "maximum") Double.of_json); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Util.option_map v.statistic_values (fun f -> - Query.Pair ("StatisticValues", StatisticSet.to_query f)) - ; Util.option_map v.value (fun f -> Query.Pair ("Value", Double.to_query f)) - ; Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", DateTime.to_query f)) - ; Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Some (Query.Pair ("MetricName", String.to_query v.metric_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Util.option_map v.statistic_values (fun f -> - "statistic_values", StatisticSet.to_json f) - ; Util.option_map v.value (fun f -> "value", Double.to_json f) - ; Util.option_map v.timestamp (fun f -> "timestamp", DateTime.to_json f) - ; Some ("dimensions", Dimensions.to_json v.dimensions) - ; Some ("metric_name", String.to_json v.metric_name) - ]) - - let of_json j = - { metric_name = String.of_json (Util.of_option_exn (Json.lookup j "metric_name")) - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; timestamp = Util.option_map (Json.lookup j "timestamp") DateTime.of_json - ; value = Util.option_map (Json.lookup j "value") Double.of_json - ; statistic_values = - Util.option_map (Json.lookup j "statistic_values") StatisticSet.of_json - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - } -end - -module Datapoint = struct - type t = - { timestamp : DateTime.t option - ; sample_count : Double.t option - ; average : Double.t option - ; sum : Double.t option - ; minimum : Double.t option - ; maximum : Double.t option - ; unit : StandardUnit.t option - } - - let make ?timestamp ?sample_count ?average ?sum ?minimum ?maximum ?unit () = - { timestamp; sample_count; average; sum; minimum; maximum; unit } - - let parse xml = - Some - { timestamp = Util.option_bind (Xml.member "Timestamp" xml) DateTime.parse - ; sample_count = Util.option_bind (Xml.member "SampleCount" xml) Double.parse - ; average = Util.option_bind (Xml.member "Average" xml) Double.parse - ; sum = Util.option_bind (Xml.member "Sum" xml) Double.parse - ; minimum = Util.option_bind (Xml.member "Minimum" xml) Double.parse - ; maximum = Util.option_bind (Xml.member "Maximum" xml) Double.parse - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse + end +module AlarmHistoryItems = + struct + type t = AlarmHistoryItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AlarmHistoryItem.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list AlarmHistoryItem.to_query v + let to_json v = `List (List.map AlarmHistoryItem.to_json v) + let of_json j = Json.to_list AlarmHistoryItem.of_json j + end +module DimensionFilters = + struct + type t = DimensionFilter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DimensionFilter.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list DimensionFilter.to_query v + let to_json v = `List (List.map DimensionFilter.to_json v) + let of_json j = Json.to_list DimensionFilter.of_json j + end +module AlarmNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MetricAlarms = + struct + type t = MetricAlarm.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map MetricAlarm.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list MetricAlarm.to_query v + let to_json v = `List (List.map MetricAlarm.to_json v) + let of_json j = Json.to_list MetricAlarm.of_json j + end +module Metrics = + struct + type t = Metric.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Metric.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Metric.to_query v + let to_json v = `List (List.map Metric.to_json v) + let of_json j = Json.to_list Metric.of_json j + end +module Statistics = + struct + type t = Statistic.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Statistic.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Statistic.to_query v + let to_json v = `List (List.map Statistic.to_json v) + let of_json j = Json.to_list Statistic.of_json j + end +module MetricData = + struct + type t = MetricDatum.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map MetricDatum.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list MetricDatum.to_query v + let to_json v = `List (List.map MetricDatum.to_json v) + let of_json j = Json.to_list MetricDatum.of_json j + end +module Datapoints = + struct + type t = Datapoint.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Datapoint.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Datapoint.to_query v + let to_json v = `List (List.map Datapoint.to_json v) + let of_json j = Json.to_list Datapoint.of_json j + end +module DescribeAlarmHistoryOutput = + struct + type t = + { + alarm_history_items: AlarmHistoryItems.t ; + next_token: String.t option } + let make ?(alarm_history_items= []) ?next_token () = + { alarm_history_items; next_token } + let parse xml = + Some + { + alarm_history_items = + (Util.of_option [] + (Util.option_bind (Xml.member "AlarmHistoryItems" xml) + AlarmHistoryItems.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("AlarmHistoryItems.member", + (AlarmHistoryItems.to_query v.alarm_history_items)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("alarm_history_items", + (AlarmHistoryItems.to_json v.alarm_history_items))]) + let of_json j = + { + alarm_history_items = + (AlarmHistoryItems.of_json + (Util.of_option_exn (Json.lookup j "alarm_history_items"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Util.option_map v.maximum (fun f -> Query.Pair ("Maximum", Double.to_query f)) - ; Util.option_map v.minimum (fun f -> Query.Pair ("Minimum", Double.to_query f)) - ; Util.option_map v.sum (fun f -> Query.Pair ("Sum", Double.to_query f)) - ; Util.option_map v.average (fun f -> Query.Pair ("Average", Double.to_query f)) - ; Util.option_map v.sample_count (fun f -> - Query.Pair ("SampleCount", Double.to_query f)) - ; Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", DateTime.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Util.option_map v.maximum (fun f -> "maximum", Double.to_json f) - ; Util.option_map v.minimum (fun f -> "minimum", Double.to_json f) - ; Util.option_map v.sum (fun f -> "sum", Double.to_json f) - ; Util.option_map v.average (fun f -> "average", Double.to_json f) - ; Util.option_map v.sample_count (fun f -> "sample_count", Double.to_json f) - ; Util.option_map v.timestamp (fun f -> "timestamp", DateTime.to_json f) - ]) - - let of_json j = - { timestamp = Util.option_map (Json.lookup j "timestamp") DateTime.of_json - ; sample_count = Util.option_map (Json.lookup j "sample_count") Double.of_json - ; average = Util.option_map (Json.lookup j "average") Double.of_json - ; sum = Util.option_map (Json.lookup j "sum") Double.of_json - ; minimum = Util.option_map (Json.lookup j "minimum") Double.of_json - ; maximum = Util.option_map (Json.lookup j "maximum") Double.of_json - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - } -end - -module AlarmHistoryItems = struct - type t = AlarmHistoryItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AlarmHistoryItem.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AlarmHistoryItem.to_query v - - let to_json v = `List (List.map AlarmHistoryItem.to_json v) - - let of_json j = Json.to_list AlarmHistoryItem.of_json j -end - -module DimensionFilters = struct - type t = DimensionFilter.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DimensionFilter.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list DimensionFilter.to_query v - - let to_json v = `List (List.map DimensionFilter.to_json v) - - let of_json j = Json.to_list DimensionFilter.of_json j -end - -module AlarmNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module MetricAlarms = struct - type t = MetricAlarm.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map MetricAlarm.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list MetricAlarm.to_query v - - let to_json v = `List (List.map MetricAlarm.to_json v) - - let of_json j = Json.to_list MetricAlarm.of_json j -end - -module Metrics = struct - type t = Metric.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Metric.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Metric.to_query v - - let to_json v = `List (List.map Metric.to_json v) - - let of_json j = Json.to_list Metric.of_json j -end - -module Statistics = struct - type t = Statistic.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Statistic.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Statistic.to_query v - - let to_json v = `List (List.map Statistic.to_json v) - - let of_json j = Json.to_list Statistic.of_json j -end - -module MetricData = struct - type t = MetricDatum.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map MetricDatum.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list MetricDatum.to_query v - - let to_json v = `List (List.map MetricDatum.to_json v) - - let of_json j = Json.to_list MetricDatum.of_json j -end - -module Datapoints = struct - type t = Datapoint.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Datapoint.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Datapoint.to_query v - - let to_json v = `List (List.map Datapoint.to_json v) - - let of_json j = Json.to_list Datapoint.of_json j -end - -module DescribeAlarmHistoryOutput = struct - type t = - { alarm_history_items : AlarmHistoryItems.t - ; next_token : String.t option - } - - let make ?(alarm_history_items = []) ?next_token () = - { alarm_history_items; next_token } - - let parse xml = - Some - { alarm_history_items = - Util.of_option - [] - (Util.option_bind - (Xml.member "AlarmHistoryItems" xml) - AlarmHistoryItems.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module ListMetricsInput = + struct + type t = + { + namespace: String.t option ; + metric_name: String.t option ; + dimensions: DimensionFilters.t ; + next_token: String.t option } + let make ?namespace ?metric_name ?(dimensions= []) ?next_token () = + { namespace; metric_name; dimensions; next_token } + let parse xml = + Some + { + namespace = + (Util.option_bind (Xml.member "Namespace" xml) String.parse); + metric_name = + (Util.option_bind (Xml.member "MetricName" xml) String.parse); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + DimensionFilters.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("Dimensions.member", + (DimensionFilters.to_query v.dimensions))); + Util.option_map v.metric_name + (fun f -> Query.Pair ("MetricName", (String.to_query f))); + Util.option_map v.namespace + (fun f -> Query.Pair ("Namespace", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("dimensions", (DimensionFilters.to_json v.dimensions)); + Util.option_map v.metric_name + (fun f -> ("metric_name", (String.to_json f))); + Util.option_map v.namespace + (fun f -> ("namespace", (String.to_json f)))]) + let of_json j = + { + namespace = + (Util.option_map (Json.lookup j "namespace") String.of_json); + metric_name = + (Util.option_map (Json.lookup j "metric_name") String.of_json); + dimensions = + (DimensionFilters.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module InternalServiceFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module DescribeAlarmHistoryInput = + struct + type t = + { + alarm_name: String.t option ; + history_item_type: HistoryItemType.t option ; + start_date: DateTime.t option ; + end_date: DateTime.t option ; + max_records: Integer.t option ; + next_token: String.t option } + let make ?alarm_name ?history_item_type ?start_date ?end_date + ?max_records ?next_token () = + { + alarm_name; + history_item_type; + start_date; + end_date; + max_records; + next_token + } + let parse xml = + Some + { + alarm_name = + (Util.option_bind (Xml.member "AlarmName" xml) String.parse); + history_item_type = + (Util.option_bind (Xml.member "HistoryItemType" xml) + HistoryItemType.parse); + start_date = + (Util.option_bind (Xml.member "StartDate" xml) DateTime.parse); + end_date = + (Util.option_bind (Xml.member "EndDate" xml) DateTime.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.end_date + (fun f -> Query.Pair ("EndDate", (DateTime.to_query f))); + Util.option_map v.start_date + (fun f -> Query.Pair ("StartDate", (DateTime.to_query f))); + Util.option_map v.history_item_type + (fun f -> + Query.Pair ("HistoryItemType", (HistoryItemType.to_query f))); + Util.option_map v.alarm_name + (fun f -> Query.Pair ("AlarmName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.end_date + (fun f -> ("end_date", (DateTime.to_json f))); + Util.option_map v.start_date + (fun f -> ("start_date", (DateTime.to_json f))); + Util.option_map v.history_item_type + (fun f -> ("history_item_type", (HistoryItemType.to_json f))); + Util.option_map v.alarm_name + (fun f -> ("alarm_name", (String.to_json f)))]) + let of_json j = + { + alarm_name = + (Util.option_map (Json.lookup j "alarm_name") String.of_json); + history_item_type = + (Util.option_map (Json.lookup j "history_item_type") + HistoryItemType.of_json); + start_date = + (Util.option_map (Json.lookup j "start_date") DateTime.of_json); + end_date = + (Util.option_map (Json.lookup j "end_date") DateTime.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeAlarmsInput = + struct + type t = + { + alarm_names: AlarmNames.t ; + alarm_name_prefix: String.t option ; + state_value: StateValue.t option ; + action_prefix: String.t option ; + max_records: Integer.t option ; + next_token: String.t option } + let make ?(alarm_names= []) ?alarm_name_prefix ?state_value + ?action_prefix ?max_records ?next_token () = + { + alarm_names; + alarm_name_prefix; + state_value; + action_prefix; + max_records; + next_token + } + let parse xml = + Some + { + alarm_names = + (Util.of_option [] + (Util.option_bind (Xml.member "AlarmNames" xml) + AlarmNames.parse)); + alarm_name_prefix = + (Util.option_bind (Xml.member "AlarmNamePrefix" xml) String.parse); + state_value = + (Util.option_bind (Xml.member "StateValue" xml) StateValue.parse); + action_prefix = + (Util.option_bind (Xml.member "ActionPrefix" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.action_prefix + (fun f -> Query.Pair ("ActionPrefix", (String.to_query f))); + Util.option_map v.state_value + (fun f -> Query.Pair ("StateValue", (StateValue.to_query f))); + Util.option_map v.alarm_name_prefix + (fun f -> Query.Pair ("AlarmNamePrefix", (String.to_query f))); + Some (Query.Pair - ( "AlarmHistoryItems.member" - , AlarmHistoryItems.to_query v.alarm_history_items )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("alarm_history_items", AlarmHistoryItems.to_json v.alarm_history_items) - ]) - - let of_json j = - { alarm_history_items = - AlarmHistoryItems.of_json - (Util.of_option_exn (Json.lookup j "alarm_history_items")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ListMetricsInput = struct - type t = - { namespace : String.t option - ; metric_name : String.t option - ; dimensions : DimensionFilters.t - ; next_token : String.t option - } - - let make ?namespace ?metric_name ?(dimensions = []) ?next_token () = - { namespace; metric_name; dimensions; next_token } - - let parse xml = - Some - { namespace = Util.option_bind (Xml.member "Namespace" xml) String.parse - ; metric_name = Util.option_bind (Xml.member "MetricName" xml) String.parse - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) DimensionFilters.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + ("AlarmNames.member", (AlarmNames.to_query v.alarm_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.action_prefix + (fun f -> ("action_prefix", (String.to_json f))); + Util.option_map v.state_value + (fun f -> ("state_value", (StateValue.to_json f))); + Util.option_map v.alarm_name_prefix + (fun f -> ("alarm_name_prefix", (String.to_json f))); + Some ("alarm_names", (AlarmNames.to_json v.alarm_names))]) + let of_json j = + { + alarm_names = + (AlarmNames.of_json + (Util.of_option_exn (Json.lookup j "alarm_names"))); + alarm_name_prefix = + (Util.option_map (Json.lookup j "alarm_name_prefix") String.of_json); + state_value = + (Util.option_map (Json.lookup j "state_value") StateValue.of_json); + action_prefix = + (Util.option_map (Json.lookup j "action_prefix") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Dimensions.member", DimensionFilters.to_query v.dimensions)) - ; Util.option_map v.metric_name (fun f -> - Query.Pair ("MetricName", String.to_query f)) - ; Util.option_map v.namespace (fun f -> - Query.Pair ("Namespace", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("dimensions", DimensionFilters.to_json v.dimensions) - ; Util.option_map v.metric_name (fun f -> "metric_name", String.to_json f) - ; Util.option_map v.namespace (fun f -> "namespace", String.to_json f) - ]) - - let of_json j = - { namespace = Util.option_map (Json.lookup j "namespace") String.of_json - ; metric_name = Util.option_map (Json.lookup j "metric_name") String.of_json - ; dimensions = - DimensionFilters.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InternalServiceFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "Message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DescribeAlarmHistoryInput = struct - type t = - { alarm_name : String.t option - ; history_item_type : HistoryItemType.t option - ; start_date : DateTime.t option - ; end_date : DateTime.t option - ; max_records : Integer.t option - ; next_token : String.t option - } - - let make - ?alarm_name - ?history_item_type - ?start_date - ?end_date - ?max_records - ?next_token - () = - { alarm_name; history_item_type; start_date; end_date; max_records; next_token } - - let parse xml = - Some - { alarm_name = Util.option_bind (Xml.member "AlarmName" xml) String.parse - ; history_item_type = - Util.option_bind (Xml.member "HistoryItemType" xml) HistoryItemType.parse - ; start_date = Util.option_bind (Xml.member "StartDate" xml) DateTime.parse - ; end_date = Util.option_bind (Xml.member "EndDate" xml) DateTime.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module LimitExceededFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.end_date (fun f -> - Query.Pair ("EndDate", DateTime.to_query f)) - ; Util.option_map v.start_date (fun f -> - Query.Pair ("StartDate", DateTime.to_query f)) - ; Util.option_map v.history_item_type (fun f -> - Query.Pair ("HistoryItemType", HistoryItemType.to_query f)) - ; Util.option_map v.alarm_name (fun f -> - Query.Pair ("AlarmName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.end_date (fun f -> "end_date", DateTime.to_json f) - ; Util.option_map v.start_date (fun f -> "start_date", DateTime.to_json f) - ; Util.option_map v.history_item_type (fun f -> - "history_item_type", HistoryItemType.to_json f) - ; Util.option_map v.alarm_name (fun f -> "alarm_name", String.to_json f) - ]) - - let of_json j = - { alarm_name = Util.option_map (Json.lookup j "alarm_name") String.of_json - ; history_item_type = - Util.option_map (Json.lookup j "history_item_type") HistoryItemType.of_json - ; start_date = Util.option_map (Json.lookup j "start_date") DateTime.of_json - ; end_date = Util.option_map (Json.lookup j "end_date") DateTime.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeAlarmsInput = struct - type t = - { alarm_names : AlarmNames.t - ; alarm_name_prefix : String.t option - ; state_value : StateValue.t option - ; action_prefix : String.t option - ; max_records : Integer.t option - ; next_token : String.t option - } - - let make - ?(alarm_names = []) - ?alarm_name_prefix - ?state_value - ?action_prefix - ?max_records - ?next_token - () = - { alarm_names - ; alarm_name_prefix - ; state_value - ; action_prefix - ; max_records - ; next_token - } - - let parse xml = - Some - { alarm_names = - Util.of_option - [] - (Util.option_bind (Xml.member "AlarmNames" xml) AlarmNames.parse) - ; alarm_name_prefix = - Util.option_bind (Xml.member "AlarmNamePrefix" xml) String.parse - ; state_value = Util.option_bind (Xml.member "StateValue" xml) StateValue.parse - ; action_prefix = Util.option_bind (Xml.member "ActionPrefix" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module PutMetricAlarmInput = + struct + type t = + { + alarm_name: String.t ; + alarm_description: String.t option ; + actions_enabled: Boolean.t option ; + o_k_actions: ResourceList.t ; + alarm_actions: ResourceList.t ; + insufficient_data_actions: ResourceList.t ; + metric_name: String.t ; + namespace: String.t ; + statistic: Statistic.t ; + dimensions: Dimensions.t ; + period: Integer.t ; + unit: StandardUnit.t option ; + evaluation_periods: Integer.t ; + threshold: Double.t ; + comparison_operator: ComparisonOperator.t } + let make ~alarm_name ?alarm_description ?actions_enabled + ?(o_k_actions= []) ?(alarm_actions= []) ?(insufficient_data_actions= + []) ~metric_name ~namespace ~statistic ?(dimensions= []) ~period + ?unit ~evaluation_periods ~threshold ~comparison_operator () = + { + alarm_name; + alarm_description; + actions_enabled; + o_k_actions; + alarm_actions; + insufficient_data_actions; + metric_name; + namespace; + statistic; + dimensions; + period; + unit; + evaluation_periods; + threshold; + comparison_operator } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.action_prefix (fun f -> - Query.Pair ("ActionPrefix", String.to_query f)) - ; Util.option_map v.state_value (fun f -> - Query.Pair ("StateValue", StateValue.to_query f)) - ; Util.option_map v.alarm_name_prefix (fun f -> - Query.Pair ("AlarmNamePrefix", String.to_query f)) - ; Some (Query.Pair ("AlarmNames.member", AlarmNames.to_query v.alarm_names)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.action_prefix (fun f -> "action_prefix", String.to_json f) - ; Util.option_map v.state_value (fun f -> "state_value", StateValue.to_json f) - ; Util.option_map v.alarm_name_prefix (fun f -> - "alarm_name_prefix", String.to_json f) - ; Some ("alarm_names", AlarmNames.to_json v.alarm_names) - ]) - - let of_json j = - { alarm_names = AlarmNames.of_json (Util.of_option_exn (Json.lookup j "alarm_names")) - ; alarm_name_prefix = - Util.option_map (Json.lookup j "alarm_name_prefix") String.of_json - ; state_value = Util.option_map (Json.lookup j "state_value") StateValue.of_json - ; action_prefix = Util.option_map (Json.lookup j "action_prefix") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module LimitExceededFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module PutMetricAlarmInput = struct - type t = - { alarm_name : String.t - ; alarm_description : String.t option - ; actions_enabled : Boolean.t option - ; o_k_actions : ResourceList.t - ; alarm_actions : ResourceList.t - ; insufficient_data_actions : ResourceList.t - ; metric_name : String.t - ; namespace : String.t - ; statistic : Statistic.t - ; dimensions : Dimensions.t - ; period : Integer.t - ; unit : StandardUnit.t option - ; evaluation_periods : Integer.t - ; threshold : Double.t - ; comparison_operator : ComparisonOperator.t - } - - let make - ~alarm_name - ?alarm_description - ?actions_enabled - ?(o_k_actions = []) - ?(alarm_actions = []) - ?(insufficient_data_actions = []) - ~metric_name - ~namespace - ~statistic - ?(dimensions = []) - ~period - ?unit - ~evaluation_periods - ~threshold - ~comparison_operator - () = - { alarm_name - ; alarm_description - ; actions_enabled - ; o_k_actions - ; alarm_actions - ; insufficient_data_actions - ; metric_name - ; namespace - ; statistic - ; dimensions - ; period - ; unit - ; evaluation_periods - ; threshold - ; comparison_operator - } - - let parse xml = - Some - { alarm_name = - Xml.required - "AlarmName" - (Util.option_bind (Xml.member "AlarmName" xml) String.parse) - ; alarm_description = - Util.option_bind (Xml.member "AlarmDescription" xml) String.parse - ; actions_enabled = Util.option_bind (Xml.member "ActionsEnabled" xml) Boolean.parse - ; o_k_actions = - Util.of_option - [] - (Util.option_bind (Xml.member "OKActions" xml) ResourceList.parse) - ; alarm_actions = - Util.of_option - [] - (Util.option_bind (Xml.member "AlarmActions" xml) ResourceList.parse) - ; insufficient_data_actions = - Util.of_option - [] - (Util.option_bind - (Xml.member "InsufficientDataActions" xml) - ResourceList.parse) - ; metric_name = - Xml.required - "MetricName" - (Util.option_bind (Xml.member "MetricName" xml) String.parse) - ; namespace = - Xml.required - "Namespace" - (Util.option_bind (Xml.member "Namespace" xml) String.parse) - ; statistic = - Xml.required - "Statistic" - (Util.option_bind (Xml.member "Statistic" xml) Statistic.parse) - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) - ; period = - Xml.required "Period" (Util.option_bind (Xml.member "Period" xml) Integer.parse) - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse - ; evaluation_periods = - Xml.required - "EvaluationPeriods" - (Util.option_bind (Xml.member "EvaluationPeriods" xml) Integer.parse) - ; threshold = - Xml.required - "Threshold" - (Util.option_bind (Xml.member "Threshold" xml) Double.parse) - ; comparison_operator = - Xml.required - "ComparisonOperator" - (Util.option_bind - (Xml.member "ComparisonOperator" xml) - ComparisonOperator.parse) + let parse xml = + Some + { + alarm_name = + (Xml.required "AlarmName" + (Util.option_bind (Xml.member "AlarmName" xml) String.parse)); + alarm_description = + (Util.option_bind (Xml.member "AlarmDescription" xml) + String.parse); + actions_enabled = + (Util.option_bind (Xml.member "ActionsEnabled" xml) Boolean.parse); + o_k_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "OKActions" xml) + ResourceList.parse)); + alarm_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "AlarmActions" xml) + ResourceList.parse)); + insufficient_data_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "InsufficientDataActions" xml) + ResourceList.parse)); + metric_name = + (Xml.required "MetricName" + (Util.option_bind (Xml.member "MetricName" xml) String.parse)); + namespace = + (Xml.required "Namespace" + (Util.option_bind (Xml.member "Namespace" xml) String.parse)); + statistic = + (Xml.required "Statistic" + (Util.option_bind (Xml.member "Statistic" xml) Statistic.parse)); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)); + period = + (Xml.required "Period" + (Util.option_bind (Xml.member "Period" xml) Integer.parse)); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse); + evaluation_periods = + (Xml.required "EvaluationPeriods" + (Util.option_bind (Xml.member "EvaluationPeriods" xml) + Integer.parse)); + threshold = + (Xml.required "Threshold" + (Util.option_bind (Xml.member "Threshold" xml) Double.parse)); + comparison_operator = + (Xml.required "ComparisonOperator" + (Util.option_bind (Xml.member "ComparisonOperator" xml) + ComparisonOperator.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ComparisonOperator", + (ComparisonOperator.to_query v.comparison_operator))); + Some (Query.Pair ("Threshold", (Double.to_query v.threshold))); + Some + (Query.Pair + ("EvaluationPeriods", + (Integer.to_query v.evaluation_periods))); + Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Some (Query.Pair ("Period", (Integer.to_query v.period))); + Some + (Query.Pair + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Some (Query.Pair ("Statistic", (Statistic.to_query v.statistic))); + Some (Query.Pair ("Namespace", (String.to_query v.namespace))); + Some (Query.Pair ("MetricName", (String.to_query v.metric_name))); + Some + (Query.Pair + ("InsufficientDataActions.member", + (ResourceList.to_query v.insufficient_data_actions))); + Some + (Query.Pair + ("AlarmActions.member", + (ResourceList.to_query v.alarm_actions))); + Some + (Query.Pair + ("OKActions.member", (ResourceList.to_query v.o_k_actions))); + Util.option_map v.actions_enabled + (fun f -> Query.Pair ("ActionsEnabled", (Boolean.to_query f))); + Util.option_map v.alarm_description + (fun f -> Query.Pair ("AlarmDescription", (String.to_query f))); + Some (Query.Pair ("AlarmName", (String.to_query v.alarm_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("comparison_operator", + (ComparisonOperator.to_json v.comparison_operator)); + Some ("threshold", (Double.to_json v.threshold)); + Some + ("evaluation_periods", (Integer.to_json v.evaluation_periods)); + Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Some ("period", (Integer.to_json v.period)); + Some ("dimensions", (Dimensions.to_json v.dimensions)); + Some ("statistic", (Statistic.to_json v.statistic)); + Some ("namespace", (String.to_json v.namespace)); + Some ("metric_name", (String.to_json v.metric_name)); + Some + ("insufficient_data_actions", + (ResourceList.to_json v.insufficient_data_actions)); + Some ("alarm_actions", (ResourceList.to_json v.alarm_actions)); + Some ("o_k_actions", (ResourceList.to_json v.o_k_actions)); + Util.option_map v.actions_enabled + (fun f -> ("actions_enabled", (Boolean.to_json f))); + Util.option_map v.alarm_description + (fun f -> ("alarm_description", (String.to_json f))); + Some ("alarm_name", (String.to_json v.alarm_name))]) + let of_json j = + { + alarm_name = + (String.of_json (Util.of_option_exn (Json.lookup j "alarm_name"))); + alarm_description = + (Util.option_map (Json.lookup j "alarm_description") String.of_json); + actions_enabled = + (Util.option_map (Json.lookup j "actions_enabled") Boolean.of_json); + o_k_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "o_k_actions"))); + alarm_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "alarm_actions"))); + insufficient_data_actions = + (ResourceList.of_json + (Util.of_option_exn (Json.lookup j "insufficient_data_actions"))); + metric_name = + (String.of_json (Util.of_option_exn (Json.lookup j "metric_name"))); + namespace = + (String.of_json (Util.of_option_exn (Json.lookup j "namespace"))); + statistic = + (Statistic.of_json (Util.of_option_exn (Json.lookup j "statistic"))); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + period = + (Integer.of_json (Util.of_option_exn (Json.lookup j "period"))); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json); + evaluation_periods = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "evaluation_periods"))); + threshold = + (Double.of_json (Util.of_option_exn (Json.lookup j "threshold"))); + comparison_operator = + (ComparisonOperator.of_json + (Util.of_option_exn (Json.lookup j "comparison_operator"))) + } + end +module SetAlarmStateInput = + struct + type t = + { + alarm_name: String.t ; + state_value: StateValue.t ; + state_reason: String.t ; + state_reason_data: String.t option } + let make ~alarm_name ~state_value ~state_reason ?state_reason_data () + = { alarm_name; state_value; state_reason; state_reason_data } + let parse xml = + Some + { + alarm_name = + (Xml.required "AlarmName" + (Util.option_bind (Xml.member "AlarmName" xml) String.parse)); + state_value = + (Xml.required "StateValue" + (Util.option_bind (Xml.member "StateValue" xml) + StateValue.parse)); + state_reason = + (Xml.required "StateReason" + (Util.option_bind (Xml.member "StateReason" xml) String.parse)); + state_reason_data = + (Util.option_bind (Xml.member "StateReasonData" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state_reason_data + (fun f -> Query.Pair ("StateReasonData", (String.to_query f))); + Some + (Query.Pair ("StateReason", (String.to_query v.state_reason))); + Some + (Query.Pair ("StateValue", (StateValue.to_query v.state_value))); + Some (Query.Pair ("AlarmName", (String.to_query v.alarm_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state_reason_data + (fun f -> ("state_reason_data", (String.to_json f))); + Some ("state_reason", (String.to_json v.state_reason)); + Some ("state_value", (StateValue.to_json v.state_value)); + Some ("alarm_name", (String.to_json v.alarm_name))]) + let of_json j = + { + alarm_name = + (String.of_json (Util.of_option_exn (Json.lookup j "alarm_name"))); + state_value = + (StateValue.of_json + (Util.of_option_exn (Json.lookup j "state_value"))); + state_reason = + (String.of_json (Util.of_option_exn (Json.lookup j "state_reason"))); + state_reason_data = + (Util.option_map (Json.lookup j "state_reason_data") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module EnableAlarmActionsInput = + struct + type t = { + alarm_names: AlarmNames.t } + let make ~alarm_names () = { alarm_names } + let parse xml = + Some + { + alarm_names = + (Xml.required "AlarmNames" + (Util.option_bind (Xml.member "AlarmNames" xml) + AlarmNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AlarmNames.member", (AlarmNames.to_query v.alarm_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("alarm_names", (AlarmNames.to_json v.alarm_names))]) + let of_json j = + { + alarm_names = + (AlarmNames.of_json + (Util.of_option_exn (Json.lookup j "alarm_names"))) + } + end +module DescribeAlarmsForMetricInput = + struct + type t = + { + metric_name: String.t ; + namespace: String.t ; + statistic: Statistic.t option ; + dimensions: Dimensions.t ; + period: Integer.t option ; + unit: StandardUnit.t option } + let make ~metric_name ~namespace ?statistic ?(dimensions= []) ?period + ?unit () = + { metric_name; namespace; statistic; dimensions; period; unit } + let parse xml = + Some + { + metric_name = + (Xml.required "MetricName" + (Util.option_bind (Xml.member "MetricName" xml) String.parse)); + namespace = + (Xml.required "Namespace" + (Util.option_bind (Xml.member "Namespace" xml) String.parse)); + statistic = + (Util.option_bind (Xml.member "Statistic" xml) Statistic.parse); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)); + period = (Util.option_bind (Xml.member "Period" xml) Integer.parse); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Util.option_map v.period + (fun f -> Query.Pair ("Period", (Integer.to_query f))); + Some (Query.Pair - ("ComparisonOperator", ComparisonOperator.to_query v.comparison_operator)) - ; Some (Query.Pair ("Threshold", Double.to_query v.threshold)) - ; Some (Query.Pair ("EvaluationPeriods", Integer.to_query v.evaluation_periods)) - ; Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Some (Query.Pair ("Period", Integer.to_query v.period)) - ; Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Some (Query.Pair ("Statistic", Statistic.to_query v.statistic)) - ; Some (Query.Pair ("Namespace", String.to_query v.namespace)) - ; Some (Query.Pair ("MetricName", String.to_query v.metric_name)) - ; Some + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Util.option_map v.statistic + (fun f -> Query.Pair ("Statistic", (Statistic.to_query f))); + Some (Query.Pair ("Namespace", (String.to_query v.namespace))); + Some (Query.Pair ("MetricName", (String.to_query v.metric_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Util.option_map v.period + (fun f -> ("period", (Integer.to_json f))); + Some ("dimensions", (Dimensions.to_json v.dimensions)); + Util.option_map v.statistic + (fun f -> ("statistic", (Statistic.to_json f))); + Some ("namespace", (String.to_json v.namespace)); + Some ("metric_name", (String.to_json v.metric_name))]) + let of_json j = + { + metric_name = + (String.of_json (Util.of_option_exn (Json.lookup j "metric_name"))); + namespace = + (String.of_json (Util.of_option_exn (Json.lookup j "namespace"))); + statistic = + (Util.option_map (Json.lookup j "statistic") Statistic.of_json); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + period = (Util.option_map (Json.lookup j "period") Integer.of_json); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json) + } + end +module InvalidParameterValueException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ResourceNotFound = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module DescribeAlarmsOutput = + struct + type t = { + metric_alarms: MetricAlarms.t ; + next_token: String.t option } + let make ?(metric_alarms= []) ?next_token () = + { metric_alarms; next_token } + let parse xml = + Some + { + metric_alarms = + (Util.of_option [] + (Util.option_bind (Xml.member "MetricAlarms" xml) + MetricAlarms.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "InsufficientDataActions.member" - , ResourceList.to_query v.insufficient_data_actions )) - ; Some - (Query.Pair ("AlarmActions.member", ResourceList.to_query v.alarm_actions)) - ; Some (Query.Pair ("OKActions.member", ResourceList.to_query v.o_k_actions)) - ; Util.option_map v.actions_enabled (fun f -> - Query.Pair ("ActionsEnabled", Boolean.to_query f)) - ; Util.option_map v.alarm_description (fun f -> - Query.Pair ("AlarmDescription", String.to_query f)) - ; Some (Query.Pair ("AlarmName", String.to_query v.alarm_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("comparison_operator", ComparisonOperator.to_json v.comparison_operator) - ; Some ("threshold", Double.to_json v.threshold) - ; Some ("evaluation_periods", Integer.to_json v.evaluation_periods) - ; Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Some ("period", Integer.to_json v.period) - ; Some ("dimensions", Dimensions.to_json v.dimensions) - ; Some ("statistic", Statistic.to_json v.statistic) - ; Some ("namespace", String.to_json v.namespace) - ; Some ("metric_name", String.to_json v.metric_name) - ; Some - ( "insufficient_data_actions" - , ResourceList.to_json v.insufficient_data_actions ) - ; Some ("alarm_actions", ResourceList.to_json v.alarm_actions) - ; Some ("o_k_actions", ResourceList.to_json v.o_k_actions) - ; Util.option_map v.actions_enabled (fun f -> - "actions_enabled", Boolean.to_json f) - ; Util.option_map v.alarm_description (fun f -> - "alarm_description", String.to_json f) - ; Some ("alarm_name", String.to_json v.alarm_name) - ]) - - let of_json j = - { alarm_name = String.of_json (Util.of_option_exn (Json.lookup j "alarm_name")) - ; alarm_description = - Util.option_map (Json.lookup j "alarm_description") String.of_json - ; actions_enabled = Util.option_map (Json.lookup j "actions_enabled") Boolean.of_json - ; o_k_actions = - ResourceList.of_json (Util.of_option_exn (Json.lookup j "o_k_actions")) - ; alarm_actions = - ResourceList.of_json (Util.of_option_exn (Json.lookup j "alarm_actions")) - ; insufficient_data_actions = - ResourceList.of_json - (Util.of_option_exn (Json.lookup j "insufficient_data_actions")) - ; metric_name = String.of_json (Util.of_option_exn (Json.lookup j "metric_name")) - ; namespace = String.of_json (Util.of_option_exn (Json.lookup j "namespace")) - ; statistic = Statistic.of_json (Util.of_option_exn (Json.lookup j "statistic")) - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; period = Integer.of_json (Util.of_option_exn (Json.lookup j "period")) - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - ; evaluation_periods = - Integer.of_json (Util.of_option_exn (Json.lookup j "evaluation_periods")) - ; threshold = Double.of_json (Util.of_option_exn (Json.lookup j "threshold")) - ; comparison_operator = - ComparisonOperator.of_json - (Util.of_option_exn (Json.lookup j "comparison_operator")) - } -end - -module SetAlarmStateInput = struct - type t = - { alarm_name : String.t - ; state_value : StateValue.t - ; state_reason : String.t - ; state_reason_data : String.t option - } - - let make ~alarm_name ~state_value ~state_reason ?state_reason_data () = - { alarm_name; state_value; state_reason; state_reason_data } - - let parse xml = - Some - { alarm_name = - Xml.required - "AlarmName" - (Util.option_bind (Xml.member "AlarmName" xml) String.parse) - ; state_value = - Xml.required - "StateValue" - (Util.option_bind (Xml.member "StateValue" xml) StateValue.parse) - ; state_reason = - Xml.required - "StateReason" - (Util.option_bind (Xml.member "StateReason" xml) String.parse) - ; state_reason_data = - Util.option_bind (Xml.member "StateReasonData" xml) String.parse + ("MetricAlarms.member", + (MetricAlarms.to_query v.metric_alarms)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("metric_alarms", (MetricAlarms.to_json v.metric_alarms))]) + let of_json j = + { + metric_alarms = + (MetricAlarms.of_json + (Util.of_option_exn (Json.lookup j "metric_alarms"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state_reason_data (fun f -> - Query.Pair ("StateReasonData", String.to_query f)) - ; Some (Query.Pair ("StateReason", String.to_query v.state_reason)) - ; Some (Query.Pair ("StateValue", StateValue.to_query v.state_value)) - ; Some (Query.Pair ("AlarmName", String.to_query v.alarm_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state_reason_data (fun f -> - "state_reason_data", String.to_json f) - ; Some ("state_reason", String.to_json v.state_reason) - ; Some ("state_value", StateValue.to_json v.state_value) - ; Some ("alarm_name", String.to_json v.alarm_name) - ]) - - let of_json j = - { alarm_name = String.of_json (Util.of_option_exn (Json.lookup j "alarm_name")) - ; state_value = StateValue.of_json (Util.of_option_exn (Json.lookup j "state_value")) - ; state_reason = String.of_json (Util.of_option_exn (Json.lookup j "state_reason")) - ; state_reason_data = - Util.option_map (Json.lookup j "state_reason_data") String.of_json - } -end - -module EnableAlarmActionsInput = struct - type t = { alarm_names : AlarmNames.t } - - let make ~alarm_names () = { alarm_names } - - let parse xml = - Some - { alarm_names = - Xml.required - "AlarmNames" - (Util.option_bind (Xml.member "AlarmNames" xml) AlarmNames.parse) + end +module InvalidNextToken = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AlarmNames.member", AlarmNames.to_query v.alarm_names)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("alarm_names", AlarmNames.to_json v.alarm_names) ]) - - let of_json j = - { alarm_names = AlarmNames.of_json (Util.of_option_exn (Json.lookup j "alarm_names")) - } -end - -module DescribeAlarmsForMetricInput = struct - type t = - { metric_name : String.t - ; namespace : String.t - ; statistic : Statistic.t option - ; dimensions : Dimensions.t - ; period : Integer.t option - ; unit : StandardUnit.t option - } - - let make ~metric_name ~namespace ?statistic ?(dimensions = []) ?period ?unit () = - { metric_name; namespace; statistic; dimensions; period; unit } - - let parse xml = - Some - { metric_name = - Xml.required - "MetricName" - (Util.option_bind (Xml.member "MetricName" xml) String.parse) - ; namespace = - Xml.required - "Namespace" - (Util.option_bind (Xml.member "Namespace" xml) String.parse) - ; statistic = Util.option_bind (Xml.member "Statistic" xml) Statistic.parse - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) - ; period = Util.option_bind (Xml.member "Period" xml) Integer.parse - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse + end +module InvalidParameterCombinationException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Util.option_map v.period (fun f -> Query.Pair ("Period", Integer.to_query f)) - ; Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Util.option_map v.statistic (fun f -> - Query.Pair ("Statistic", Statistic.to_query f)) - ; Some (Query.Pair ("Namespace", String.to_query v.namespace)) - ; Some (Query.Pair ("MetricName", String.to_query v.metric_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Util.option_map v.period (fun f -> "period", Integer.to_json f) - ; Some ("dimensions", Dimensions.to_json v.dimensions) - ; Util.option_map v.statistic (fun f -> "statistic", Statistic.to_json f) - ; Some ("namespace", String.to_json v.namespace) - ; Some ("metric_name", String.to_json v.metric_name) - ]) - - let of_json j = - { metric_name = String.of_json (Util.of_option_exn (Json.lookup j "metric_name")) - ; namespace = String.of_json (Util.of_option_exn (Json.lookup j "namespace")) - ; statistic = Util.option_map (Json.lookup j "statistic") Statistic.of_json - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; period = Util.option_map (Json.lookup j "period") Integer.of_json - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - } -end - -module InvalidParameterValueException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ResourceNotFound = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DescribeAlarmsOutput = struct - type t = - { metric_alarms : MetricAlarms.t - ; next_token : String.t option - } - - let make ?(metric_alarms = []) ?next_token () = { metric_alarms; next_token } - - let parse xml = - Some - { metric_alarms = - Util.of_option - [] - (Util.option_bind (Xml.member "MetricAlarms" xml) MetricAlarms.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module MissingRequiredParameterException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("MetricAlarms.member", MetricAlarms.to_query v.metric_alarms)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("metric_alarms", MetricAlarms.to_json v.metric_alarms) - ]) - - let of_json j = - { metric_alarms = - MetricAlarms.of_json (Util.of_option_exn (Json.lookup j "metric_alarms")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InvalidNextToken = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module InvalidParameterCombinationException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module MissingRequiredParameterException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListMetricsOutput = struct - type t = - { metrics : Metrics.t - ; next_token : String.t option - } - - let make ?(metrics = []) ?next_token () = { metrics; next_token } - - let parse xml = - Some - { metrics = - Util.of_option [] (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module ListMetricsOutput = + struct + type t = { + metrics: Metrics.t ; + next_token: String.t option } + let make ?(metrics= []) ?next_token () = { metrics; next_token } + let parse xml = + Some + { + metrics = + (Util.of_option [] + (Util.option_bind (Xml.member "Metrics" xml) Metrics.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Metrics.member", (Metrics.to_query v.metrics)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("metrics", (Metrics.to_json v.metrics))]) + let of_json j = + { + metrics = + (Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Metrics.member", Metrics.to_query v.metrics)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("metrics", Metrics.to_json v.metrics) - ]) - - let of_json j = - { metrics = Metrics.of_json (Util.of_option_exn (Json.lookup j "metrics")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InvalidFormatFault = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetMetricStatisticsInput = struct - type t = - { namespace : String.t - ; metric_name : String.t - ; dimensions : Dimensions.t - ; start_time : DateTime.t - ; end_time : DateTime.t - ; period : Integer.t - ; statistics : Statistics.t - ; unit : StandardUnit.t option - } - - let make - ~namespace - ~metric_name - ?(dimensions = []) - ~start_time - ~end_time - ~period - ~statistics - ?unit - () = - { namespace; metric_name; dimensions; start_time; end_time; period; statistics; unit } - - let parse xml = - Some - { namespace = - Xml.required - "Namespace" - (Util.option_bind (Xml.member "Namespace" xml) String.parse) - ; metric_name = - Xml.required - "MetricName" - (Util.option_bind (Xml.member "MetricName" xml) String.parse) - ; dimensions = - Util.of_option - [] - (Util.option_bind (Xml.member "Dimensions" xml) Dimensions.parse) - ; start_time = - Xml.required - "StartTime" - (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse) - ; end_time = - Xml.required - "EndTime" - (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse) - ; period = - Xml.required "Period" (Util.option_bind (Xml.member "Period" xml) Integer.parse) - ; statistics = - Xml.required - "Statistics" - (Util.option_bind (Xml.member "Statistics" xml) Statistics.parse) - ; unit = Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse + end +module InvalidFormatFault = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetMetricStatisticsInput = + struct + type t = + { + namespace: String.t ; + metric_name: String.t ; + dimensions: Dimensions.t ; + start_time: DateTime.t ; + end_time: DateTime.t ; + period: Integer.t ; + statistics: Statistics.t ; + unit: StandardUnit.t option } + let make ~namespace ~metric_name ?(dimensions= []) ~start_time + ~end_time ~period ~statistics ?unit () = + { + namespace; + metric_name; + dimensions; + start_time; + end_time; + period; + statistics; + unit + } + let parse xml = + Some + { + namespace = + (Xml.required "Namespace" + (Util.option_bind (Xml.member "Namespace" xml) String.parse)); + metric_name = + (Xml.required "MetricName" + (Util.option_bind (Xml.member "MetricName" xml) String.parse)); + dimensions = + (Util.of_option [] + (Util.option_bind (Xml.member "Dimensions" xml) + Dimensions.parse)); + start_time = + (Xml.required "StartTime" + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse)); + end_time = + (Xml.required "EndTime" + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse)); + period = + (Xml.required "Period" + (Util.option_bind (Xml.member "Period" xml) Integer.parse)); + statistics = + (Xml.required "Statistics" + (Util.option_bind (Xml.member "Statistics" xml) + Statistics.parse)); + unit = + (Util.option_bind (Xml.member "Unit" xml) StandardUnit.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> Query.Pair ("Unit", (StandardUnit.to_query f))); + Some + (Query.Pair + ("Statistics.member", (Statistics.to_query v.statistics))); + Some (Query.Pair ("Period", (Integer.to_query v.period))); + Some (Query.Pair ("EndTime", (DateTime.to_query v.end_time))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Some + (Query.Pair + ("Dimensions.member", (Dimensions.to_query v.dimensions))); + Some (Query.Pair ("MetricName", (String.to_query v.metric_name))); + Some (Query.Pair ("Namespace", (String.to_query v.namespace)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.unit + (fun f -> ("unit", (StandardUnit.to_json f))); + Some ("statistics", (Statistics.to_json v.statistics)); + Some ("period", (Integer.to_json v.period)); + Some ("end_time", (DateTime.to_json v.end_time)); + Some ("start_time", (DateTime.to_json v.start_time)); + Some ("dimensions", (Dimensions.to_json v.dimensions)); + Some ("metric_name", (String.to_json v.metric_name)); + Some ("namespace", (String.to_json v.namespace))]) + let of_json j = + { + namespace = + (String.of_json (Util.of_option_exn (Json.lookup j "namespace"))); + metric_name = + (String.of_json (Util.of_option_exn (Json.lookup j "metric_name"))); + dimensions = + (Dimensions.of_json + (Util.of_option_exn (Json.lookup j "dimensions"))); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + end_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "end_time"))); + period = + (Integer.of_json (Util.of_option_exn (Json.lookup j "period"))); + statistics = + (Statistics.of_json + (Util.of_option_exn (Json.lookup j "statistics"))); + unit = (Util.option_map (Json.lookup j "unit") StandardUnit.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> Query.Pair ("Unit", StandardUnit.to_query f)) - ; Some (Query.Pair ("Statistics.member", Statistics.to_query v.statistics)) - ; Some (Query.Pair ("Period", Integer.to_query v.period)) - ; Some (Query.Pair ("EndTime", DateTime.to_query v.end_time)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Some (Query.Pair ("Dimensions.member", Dimensions.to_query v.dimensions)) - ; Some (Query.Pair ("MetricName", String.to_query v.metric_name)) - ; Some (Query.Pair ("Namespace", String.to_query v.namespace)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.unit (fun f -> "unit", StandardUnit.to_json f) - ; Some ("statistics", Statistics.to_json v.statistics) - ; Some ("period", Integer.to_json v.period) - ; Some ("end_time", DateTime.to_json v.end_time) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Some ("dimensions", Dimensions.to_json v.dimensions) - ; Some ("metric_name", String.to_json v.metric_name) - ; Some ("namespace", String.to_json v.namespace) - ]) - - let of_json j = - { namespace = String.of_json (Util.of_option_exn (Json.lookup j "namespace")) - ; metric_name = String.of_json (Util.of_option_exn (Json.lookup j "metric_name")) - ; dimensions = Dimensions.of_json (Util.of_option_exn (Json.lookup j "dimensions")) - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; end_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "end_time")) - ; period = Integer.of_json (Util.of_option_exn (Json.lookup j "period")) - ; statistics = Statistics.of_json (Util.of_option_exn (Json.lookup j "statistics")) - ; unit = Util.option_map (Json.lookup j "unit") StandardUnit.of_json - } -end - -module PutMetricDataInput = struct - type t = - { namespace : String.t - ; metric_data : MetricData.t - } - - let make ~namespace ~metric_data () = { namespace; metric_data } - - let parse xml = - Some - { namespace = - Xml.required - "Namespace" - (Util.option_bind (Xml.member "Namespace" xml) String.parse) - ; metric_data = - Xml.required - "MetricData" - (Util.option_bind (Xml.member "MetricData" xml) MetricData.parse) + end +module PutMetricDataInput = + struct + type t = { + namespace: String.t ; + metric_data: MetricData.t } + let make ~namespace ~metric_data () = { namespace; metric_data } + let parse xml = + Some + { + namespace = + (Xml.required "Namespace" + (Util.option_bind (Xml.member "Namespace" xml) String.parse)); + metric_data = + (Xml.required "MetricData" + (Util.option_bind (Xml.member "MetricData" xml) + MetricData.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("MetricData.member", (MetricData.to_query v.metric_data))); + Some (Query.Pair ("Namespace", (String.to_query v.namespace)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("metric_data", (MetricData.to_json v.metric_data)); + Some ("namespace", (String.to_json v.namespace))]) + let of_json j = + { + namespace = + (String.of_json (Util.of_option_exn (Json.lookup j "namespace"))); + metric_data = + (MetricData.of_json + (Util.of_option_exn (Json.lookup j "metric_data"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MetricData.member", MetricData.to_query v.metric_data)) - ; Some (Query.Pair ("Namespace", String.to_query v.namespace)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("metric_data", MetricData.to_json v.metric_data) - ; Some ("namespace", String.to_json v.namespace) - ]) - - let of_json j = - { namespace = String.of_json (Util.of_option_exn (Json.lookup j "namespace")) - ; metric_data = MetricData.of_json (Util.of_option_exn (Json.lookup j "metric_data")) - } -end - -module DescribeAlarmsForMetricOutput = struct - type t = { metric_alarms : MetricAlarms.t } - - let make ?(metric_alarms = []) () = { metric_alarms } - - let parse xml = - Some - { metric_alarms = - Util.of_option - [] - (Util.option_bind (Xml.member "MetricAlarms" xml) MetricAlarms.parse) + end +module DescribeAlarmsForMetricOutput = + struct + type t = { + metric_alarms: MetricAlarms.t } + let make ?(metric_alarms= []) () = { metric_alarms } + let parse xml = + Some + { + metric_alarms = + (Util.of_option [] + (Util.option_bind (Xml.member "MetricAlarms" xml) + MetricAlarms.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("MetricAlarms.member", + (MetricAlarms.to_query v.metric_alarms)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("metric_alarms", (MetricAlarms.to_json v.metric_alarms))]) + let of_json j = + { + metric_alarms = + (MetricAlarms.of_json + (Util.of_option_exn (Json.lookup j "metric_alarms"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("MetricAlarms.member", MetricAlarms.to_query v.metric_alarms)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("metric_alarms", MetricAlarms.to_json v.metric_alarms) ]) - - let of_json j = - { metric_alarms = - MetricAlarms.of_json (Util.of_option_exn (Json.lookup j "metric_alarms")) - } -end - -module DeleteAlarmsInput = struct - type t = { alarm_names : AlarmNames.t } - - let make ~alarm_names () = { alarm_names } - - let parse xml = - Some - { alarm_names = - Xml.required - "AlarmNames" - (Util.option_bind (Xml.member "AlarmNames" xml) AlarmNames.parse) + end +module DeleteAlarmsInput = + struct + type t = { + alarm_names: AlarmNames.t } + let make ~alarm_names () = { alarm_names } + let parse xml = + Some + { + alarm_names = + (Xml.required "AlarmNames" + (Util.option_bind (Xml.member "AlarmNames" xml) + AlarmNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AlarmNames.member", (AlarmNames.to_query v.alarm_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("alarm_names", (AlarmNames.to_json v.alarm_names))]) + let of_json j = + { + alarm_names = + (AlarmNames.of_json + (Util.of_option_exn (Json.lookup j "alarm_names"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AlarmNames.member", AlarmNames.to_query v.alarm_names)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("alarm_names", AlarmNames.to_json v.alarm_names) ]) - - let of_json j = - { alarm_names = AlarmNames.of_json (Util.of_option_exn (Json.lookup j "alarm_names")) - } -end - -module DisableAlarmActionsInput = struct - type t = { alarm_names : AlarmNames.t } - - let make ~alarm_names () = { alarm_names } - - let parse xml = - Some - { alarm_names = - Xml.required - "AlarmNames" - (Util.option_bind (Xml.member "AlarmNames" xml) AlarmNames.parse) + end +module DisableAlarmActionsInput = + struct + type t = { + alarm_names: AlarmNames.t } + let make ~alarm_names () = { alarm_names } + let parse xml = + Some + { + alarm_names = + (Xml.required "AlarmNames" + (Util.option_bind (Xml.member "AlarmNames" xml) + AlarmNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AlarmNames.member", (AlarmNames.to_query v.alarm_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("alarm_names", (AlarmNames.to_json v.alarm_names))]) + let of_json j = + { + alarm_names = + (AlarmNames.of_json + (Util.of_option_exn (Json.lookup j "alarm_names"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AlarmNames.member", AlarmNames.to_query v.alarm_names)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("alarm_names", AlarmNames.to_json v.alarm_names) ]) - - let of_json j = - { alarm_names = AlarmNames.of_json (Util.of_option_exn (Json.lookup j "alarm_names")) - } -end - -module GetMetricStatisticsOutput = struct - type t = - { label : String.t option - ; datapoints : Datapoints.t - } - - let make ?label ?(datapoints = []) () = { label; datapoints } - - let parse xml = - Some - { label = Util.option_bind (Xml.member "Label" xml) String.parse - ; datapoints = - Util.of_option - [] - (Util.option_bind (Xml.member "Datapoints" xml) Datapoints.parse) + end +module GetMetricStatisticsOutput = + struct + type t = { + label: String.t option ; + datapoints: Datapoints.t } + let make ?label ?(datapoints= []) () = { label; datapoints } + let parse xml = + Some + { + label = (Util.option_bind (Xml.member "Label" xml) String.parse); + datapoints = + (Util.of_option [] + (Util.option_bind (Xml.member "Datapoints" xml) + Datapoints.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Datapoints.member", (Datapoints.to_query v.datapoints))); + Util.option_map v.label + (fun f -> Query.Pair ("Label", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("datapoints", (Datapoints.to_json v.datapoints)); + Util.option_map v.label (fun f -> ("label", (String.to_json f)))]) + let of_json j = + { + label = (Util.option_map (Json.lookup j "label") String.of_json); + datapoints = + (Datapoints.of_json + (Util.of_option_exn (Json.lookup j "datapoints"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Datapoints.member", Datapoints.to_query v.datapoints)) - ; Util.option_map v.label (fun f -> Query.Pair ("Label", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("datapoints", Datapoints.to_json v.datapoints) - ; Util.option_map v.label (fun f -> "label", String.to_json f) - ]) - - let of_json j = - { label = Util.option_map (Json.lookup j "label") String.of_json - ; datapoints = Datapoints.of_json (Util.of_option_exn (Json.lookup j "datapoints")) - } -end + end \ No newline at end of file diff --git a/libraries/cloudwatch/lib_test/dune b/libraries/cloudwatch/lib_test/dune index 16fd57d30..62f7649a4 100644 --- a/libraries/cloudwatch/lib_test/dune +++ b/libraries/cloudwatch/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_cloudwatch_test) - (libraries aws aws_cloudwatch aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_cloudwatch aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/cloudwatch/lib_test/test_async.ml b/libraries/cloudwatch/lib_test/test_async.ml index 6102d2e51..3ed3d26d1 100644 --- a/libraries/cloudwatch/lib_test/test_async.ml +++ b/libraries/cloudwatch/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_cloudwatch_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/cloudwatch/lib_test/test_lwt.ml b/libraries/cloudwatch/lib_test/test_lwt.ml index c609a54c0..a85e98852 100644 --- a/libraries/cloudwatch/lib_test/test_lwt.ml +++ b/libraries/cloudwatch/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_cloudwatch_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/ec2/lib/acceptVpcPeeringConnection.ml b/libraries/ec2/lib/acceptVpcPeeringConnection.ml index f23b88e79..e108e3bb2 100644 --- a/libraries/ec2/lib/acceptVpcPeeringConnection.ml +++ b/libraries/ec2/lib/acceptVpcPeeringConnection.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = AcceptVpcPeeringConnectionRequest.t - type output = AcceptVpcPeeringConnectionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AcceptVpcPeeringConnection" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["AcceptVpcPeeringConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AcceptVpcPeeringConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AcceptVpcPeeringConnectionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp AcceptVpcPeeringConnectionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed AcceptVpcPeeringConnectionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AcceptVpcPeeringConnectionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AcceptVpcPeeringConnectionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AcceptVpcPeeringConnectionResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/acceptVpcPeeringConnection.mli b/libraries/ec2/lib/acceptVpcPeeringConnection.mli index 9093a8b8c..225b16577 100644 --- a/libraries/ec2/lib/acceptVpcPeeringConnection.mli +++ b/libraries/ec2/lib/acceptVpcPeeringConnection.mli @@ -1,10 +1,7 @@ open Types - type input = AcceptVpcPeeringConnectionRequest.t - type output = AcceptVpcPeeringConnectionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/allocateAddress.ml b/libraries/ec2/lib/allocateAddress.ml index 6585ea1c6..d5b3f1660 100644 --- a/libraries/ec2/lib/allocateAddress.ml +++ b/libraries/ec2/lib/allocateAddress.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = AllocateAddressRequest.t - type output = AllocateAddressResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AllocateAddress" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AllocateAddress"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AllocateAddressRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AllocateAddressRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AllocateAddressResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AllocateAddressResult.parse) + Util.or_error (Util.option_bind resp AllocateAddressResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AllocateAddressResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed AllocateAddressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AllocateAddressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AllocateAddressResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/allocateAddress.mli b/libraries/ec2/lib/allocateAddress.mli index 98348a107..d2e6a0eb6 100644 --- a/libraries/ec2/lib/allocateAddress.mli +++ b/libraries/ec2/lib/allocateAddress.mli @@ -1,10 +1,7 @@ open Types - type input = AllocateAddressRequest.t - type output = AllocateAddressResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/assignPrivateIpAddresses.ml b/libraries/ec2/lib/assignPrivateIpAddresses.ml index 334d3c3cd..c644281bd 100644 --- a/libraries/ec2/lib/assignPrivateIpAddresses.ml +++ b/libraries/ec2/lib/assignPrivateIpAddresses.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = AssignPrivateIpAddressesRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AssignPrivateIpAddresses" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["AssignPrivateIpAddresses"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AssignPrivateIpAddressesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AssignPrivateIpAddressesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/assignPrivateIpAddresses.mli b/libraries/ec2/lib/assignPrivateIpAddresses.mli index fc5c84c3b..80d157bc5 100644 --- a/libraries/ec2/lib/assignPrivateIpAddresses.mli +++ b/libraries/ec2/lib/assignPrivateIpAddresses.mli @@ -1,10 +1,7 @@ open Types - type input = AssignPrivateIpAddressesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateAddress.ml b/libraries/ec2/lib/associateAddress.ml index 7dfc8972a..df234e9ad 100644 --- a/libraries/ec2/lib/associateAddress.ml +++ b/libraries/ec2/lib/associateAddress.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = AssociateAddressRequest.t - type output = AssociateAddressResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AssociateAddress" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AssociateAddress"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AssociateAddressRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AssociateAddressRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AssociateAddressResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AssociateAddressResult.parse) + Util.or_error (Util.option_bind resp AssociateAddressResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AssociateAddressResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed AssociateAddressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssociateAddressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssociateAddressResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateAddress.mli b/libraries/ec2/lib/associateAddress.mli index e0e0add1e..4ac6dc7c8 100644 --- a/libraries/ec2/lib/associateAddress.mli +++ b/libraries/ec2/lib/associateAddress.mli @@ -1,10 +1,7 @@ open Types - type input = AssociateAddressRequest.t - type output = AssociateAddressResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateDhcpOptions.ml b/libraries/ec2/lib/associateDhcpOptions.ml index 7dae78093..8aa2151f3 100644 --- a/libraries/ec2/lib/associateDhcpOptions.ml +++ b/libraries/ec2/lib/associateDhcpOptions.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = AssociateDhcpOptionsRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AssociateDhcpOptions" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AssociateDhcpOptions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AssociateDhcpOptionsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AssociateDhcpOptionsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateDhcpOptions.mli b/libraries/ec2/lib/associateDhcpOptions.mli index 83841b428..f9a64254b 100644 --- a/libraries/ec2/lib/associateDhcpOptions.mli +++ b/libraries/ec2/lib/associateDhcpOptions.mli @@ -1,10 +1,7 @@ open Types - type input = AssociateDhcpOptionsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateRouteTable.ml b/libraries/ec2/lib/associateRouteTable.ml index e002fd680..5dc44a8b6 100644 --- a/libraries/ec2/lib/associateRouteTable.ml +++ b/libraries/ec2/lib/associateRouteTable.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = AssociateRouteTableRequest.t - type output = AssociateRouteTableResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AssociateRouteTable" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AssociateRouteTable"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AssociateRouteTableRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AssociateRouteTableRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AssociateRouteTableResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AssociateRouteTableResult.parse) + Util.or_error (Util.option_bind resp AssociateRouteTableResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AssociateRouteTableResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AssociateRouteTableResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssociateRouteTableResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssociateRouteTableResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/associateRouteTable.mli b/libraries/ec2/lib/associateRouteTable.mli index 86d8f7214..96492066d 100644 --- a/libraries/ec2/lib/associateRouteTable.mli +++ b/libraries/ec2/lib/associateRouteTable.mli @@ -1,10 +1,7 @@ open Types - type input = AssociateRouteTableRequest.t - type output = AssociateRouteTableResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachClassicLinkVpc.ml b/libraries/ec2/lib/attachClassicLinkVpc.ml index 221ee564a..2673c3c9e 100644 --- a/libraries/ec2/lib/attachClassicLinkVpc.ml +++ b/libraries/ec2/lib/attachClassicLinkVpc.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = AttachClassicLinkVpcRequest.t - type output = AttachClassicLinkVpcResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AttachClassicLinkVpc" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AttachClassicLinkVpc"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AttachClassicLinkVpcRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AttachClassicLinkVpcRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AttachClassicLinkVpcResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AttachClassicLinkVpcResult.parse) + Util.or_error (Util.option_bind resp AttachClassicLinkVpcResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AttachClassicLinkVpcResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AttachClassicLinkVpcResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AttachClassicLinkVpcResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AttachClassicLinkVpcResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachClassicLinkVpc.mli b/libraries/ec2/lib/attachClassicLinkVpc.mli index d7e95313f..904316205 100644 --- a/libraries/ec2/lib/attachClassicLinkVpc.mli +++ b/libraries/ec2/lib/attachClassicLinkVpc.mli @@ -1,10 +1,7 @@ open Types - type input = AttachClassicLinkVpcRequest.t - type output = AttachClassicLinkVpcResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachInternetGateway.ml b/libraries/ec2/lib/attachInternetGateway.ml index 250df99b9..d42179cc8 100644 --- a/libraries/ec2/lib/attachInternetGateway.ml +++ b/libraries/ec2/lib/attachInternetGateway.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = AttachInternetGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AttachInternetGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AttachInternetGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AttachInternetGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AttachInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachInternetGateway.mli b/libraries/ec2/lib/attachInternetGateway.mli index d4c8ba990..5ef442360 100644 --- a/libraries/ec2/lib/attachInternetGateway.mli +++ b/libraries/ec2/lib/attachInternetGateway.mli @@ -1,10 +1,7 @@ open Types - type input = AttachInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachNetworkInterface.ml b/libraries/ec2/lib/attachNetworkInterface.ml index 0674b8e0b..38d22aec6 100644 --- a/libraries/ec2/lib/attachNetworkInterface.ml +++ b/libraries/ec2/lib/attachNetworkInterface.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = AttachNetworkInterfaceRequest.t - type output = AttachNetworkInterfaceResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AttachNetworkInterface" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["AttachNetworkInterface"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AttachNetworkInterfaceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AttachNetworkInterfaceRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp AttachNetworkInterfaceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AttachNetworkInterfaceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AttachNetworkInterfaceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AttachNetworkInterfaceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AttachNetworkInterfaceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachNetworkInterface.mli b/libraries/ec2/lib/attachNetworkInterface.mli index 81c35bebe..f25731ef8 100644 --- a/libraries/ec2/lib/attachNetworkInterface.mli +++ b/libraries/ec2/lib/attachNetworkInterface.mli @@ -1,10 +1,7 @@ open Types - type input = AttachNetworkInterfaceRequest.t - type output = AttachNetworkInterfaceResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachVolume.ml b/libraries/ec2/lib/attachVolume.ml index bed713b58..05fb74e32 100644 --- a/libraries/ec2/lib/attachVolume.ml +++ b/libraries/ec2/lib/attachVolume.ml @@ -1,57 +1,55 @@ open Types open Aws - type input = AttachVolumeRequest.t - type output = VolumeAttachment.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AttachVolume" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AttachVolume"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AttachVolumeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AttachVolumeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AttachVolumeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp VolumeAttachment.parse) + Util.or_error (Util.option_bind resp VolumeAttachment.parse) (let open Error in - BadResponse { body; message = "Could not find well formed VolumeAttachment." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed VolumeAttachment." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing VolumeAttachment - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing VolumeAttachment - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachVolume.mli b/libraries/ec2/lib/attachVolume.mli index eb638a517..42e2ccd76 100644 --- a/libraries/ec2/lib/attachVolume.mli +++ b/libraries/ec2/lib/attachVolume.mli @@ -1,10 +1,7 @@ open Types - type input = AttachVolumeRequest.t - type output = VolumeAttachment.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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachVpnGateway.ml b/libraries/ec2/lib/attachVpnGateway.ml index 75d206e42..eebab35cc 100644 --- a/libraries/ec2/lib/attachVpnGateway.ml +++ b/libraries/ec2/lib/attachVpnGateway.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = AttachVpnGatewayRequest.t - type output = AttachVpnGatewayResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AttachVpnGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["AttachVpnGateway"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AttachVpnGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AttachVpnGatewayRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AttachVpnGatewayResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AttachVpnGatewayResult.parse) + Util.or_error (Util.option_bind resp AttachVpnGatewayResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AttachVpnGatewayResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed AttachVpnGatewayResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AttachVpnGatewayResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AttachVpnGatewayResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/attachVpnGateway.mli b/libraries/ec2/lib/attachVpnGateway.mli index a9bd0c5d1..d0015167d 100644 --- a/libraries/ec2/lib/attachVpnGateway.mli +++ b/libraries/ec2/lib/attachVpnGateway.mli @@ -1,10 +1,7 @@ open Types - type input = AttachVpnGatewayRequest.t - type output = AttachVpnGatewayResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/authorizeSecurityGroupEgress.ml b/libraries/ec2/lib/authorizeSecurityGroupEgress.ml index 7acf5c565..d00dd798f 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupEgress.ml +++ b/libraries/ec2/lib/authorizeSecurityGroupEgress.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = AuthorizeSecurityGroupEgressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AuthorizeSecurityGroupEgress" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["AuthorizeSecurityGroupEgress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AuthorizeSecurityGroupEgressRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (AuthorizeSecurityGroupEgressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/authorizeSecurityGroupEgress.mli b/libraries/ec2/lib/authorizeSecurityGroupEgress.mli index dd4f652ba..0b7115d3a 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupEgress.mli +++ b/libraries/ec2/lib/authorizeSecurityGroupEgress.mli @@ -1,10 +1,7 @@ open Types - type input = AuthorizeSecurityGroupEgressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/authorizeSecurityGroupIngress.ml b/libraries/ec2/lib/authorizeSecurityGroupIngress.ml index af82f125e..26939f118 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupIngress.ml +++ b/libraries/ec2/lib/authorizeSecurityGroupIngress.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = AuthorizeSecurityGroupIngressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "AuthorizeSecurityGroupIngress" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["AuthorizeSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AuthorizeSecurityGroupIngressRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (AuthorizeSecurityGroupIngressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/authorizeSecurityGroupIngress.mli b/libraries/ec2/lib/authorizeSecurityGroupIngress.mli index 32963c1c2..af0592d2d 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupIngress.mli +++ b/libraries/ec2/lib/authorizeSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = AuthorizeSecurityGroupIngressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/bundleInstance.ml b/libraries/ec2/lib/bundleInstance.ml index cc12e45c3..d571ca574 100644 --- a/libraries/ec2/lib/bundleInstance.ml +++ b/libraries/ec2/lib/bundleInstance.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = BundleInstanceRequest.t - type output = BundleInstanceResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "BundleInstance" ] ] + [("Version", ["2015-04-15"]); ("Action", ["BundleInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (BundleInstanceRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (BundleInstanceRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "BundleInstanceResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp BundleInstanceResult.parse) + Util.or_error (Util.option_bind resp BundleInstanceResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed BundleInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed BundleInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing BundleInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing BundleInstanceResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/bundleInstance.mli b/libraries/ec2/lib/bundleInstance.mli index 9909ad2b7..87d54f79f 100644 --- a/libraries/ec2/lib/bundleInstance.mli +++ b/libraries/ec2/lib/bundleInstance.mli @@ -1,10 +1,7 @@ open Types - type input = BundleInstanceRequest.t - type output = BundleInstanceResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelBundleTask.ml b/libraries/ec2/lib/cancelBundleTask.ml index c02e9e8eb..b0f2ae0b3 100644 --- a/libraries/ec2/lib/cancelBundleTask.ml +++ b/libraries/ec2/lib/cancelBundleTask.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = CancelBundleTaskRequest.t - type output = CancelBundleTaskResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelBundleTask" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CancelBundleTask"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelBundleTaskRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelBundleTaskRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CancelBundleTaskResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CancelBundleTaskResult.parse) + Util.or_error (Util.option_bind resp CancelBundleTaskResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CancelBundleTaskResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CancelBundleTaskResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelBundleTaskResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelBundleTaskResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelBundleTask.mli b/libraries/ec2/lib/cancelBundleTask.mli index 55c3b1491..c87e09d83 100644 --- a/libraries/ec2/lib/cancelBundleTask.mli +++ b/libraries/ec2/lib/cancelBundleTask.mli @@ -1,10 +1,7 @@ open Types - type input = CancelBundleTaskRequest.t - type output = CancelBundleTaskResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelConversionTask.ml b/libraries/ec2/lib/cancelConversionTask.ml index c81b041f2..8430c4a56 100644 --- a/libraries/ec2/lib/cancelConversionTask.ml +++ b/libraries/ec2/lib/cancelConversionTask.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = CancelConversionRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelConversionTask" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CancelConversionTask"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelConversionRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelConversionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelConversionTask.mli b/libraries/ec2/lib/cancelConversionTask.mli index 6d8c3f1db..b59b99f91 100644 --- a/libraries/ec2/lib/cancelConversionTask.mli +++ b/libraries/ec2/lib/cancelConversionTask.mli @@ -1,10 +1,7 @@ open Types - type input = CancelConversionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelExportTask.ml b/libraries/ec2/lib/cancelExportTask.ml index b90f2057a..cd58a0ffe 100644 --- a/libraries/ec2/lib/cancelExportTask.ml +++ b/libraries/ec2/lib/cancelExportTask.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = CancelExportTaskRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelExportTask" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CancelExportTask"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelExportTaskRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelExportTaskRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelExportTask.mli b/libraries/ec2/lib/cancelExportTask.mli index b96ae6ce3..3c9f2d81b 100644 --- a/libraries/ec2/lib/cancelExportTask.mli +++ b/libraries/ec2/lib/cancelExportTask.mli @@ -1,10 +1,7 @@ open Types - type input = CancelExportTaskRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelImportTask.ml b/libraries/ec2/lib/cancelImportTask.ml index e97d07cf6..e92151a14 100644 --- a/libraries/ec2/lib/cancelImportTask.ml +++ b/libraries/ec2/lib/cancelImportTask.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = CancelImportTaskRequest.t - type output = CancelImportTaskResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelImportTask" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CancelImportTask"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelImportTaskRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelImportTaskRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CancelImportTaskResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CancelImportTaskResult.parse) + Util.or_error (Util.option_bind resp CancelImportTaskResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CancelImportTaskResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CancelImportTaskResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelImportTaskResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelImportTaskResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelImportTask.mli b/libraries/ec2/lib/cancelImportTask.mli index 173cdbf8a..989c2feb1 100644 --- a/libraries/ec2/lib/cancelImportTask.mli +++ b/libraries/ec2/lib/cancelImportTask.mli @@ -1,10 +1,7 @@ open Types - type input = CancelImportTaskRequest.t - type output = CancelImportTaskResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelReservedInstancesListing.ml b/libraries/ec2/lib/cancelReservedInstancesListing.ml index b699055d2..3b6aaea37 100644 --- a/libraries/ec2/lib/cancelReservedInstancesListing.ml +++ b/libraries/ec2/lib/cancelReservedInstancesListing.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = CancelReservedInstancesListingRequest.t - type output = CancelReservedInstancesListingResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelReservedInstancesListing" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CancelReservedInstancesListing"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CancelReservedInstancesListingRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CancelReservedInstancesListingRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp CancelReservedInstancesListingResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CancelReservedInstancesListingResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CancelReservedInstancesListingResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelReservedInstancesListingResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelReservedInstancesListingResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelReservedInstancesListing.mli b/libraries/ec2/lib/cancelReservedInstancesListing.mli index e0fa5e72a..177e0fd52 100644 --- a/libraries/ec2/lib/cancelReservedInstancesListing.mli +++ b/libraries/ec2/lib/cancelReservedInstancesListing.mli @@ -1,10 +1,7 @@ open Types - type input = CancelReservedInstancesListingRequest.t - type output = CancelReservedInstancesListingResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelSpotFleetRequests.ml b/libraries/ec2/lib/cancelSpotFleetRequests.ml index 9de93f792..4bb0ad251 100644 --- a/libraries/ec2/lib/cancelSpotFleetRequests.ml +++ b/libraries/ec2/lib/cancelSpotFleetRequests.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CancelSpotFleetRequestsRequest.t - type output = CancelSpotFleetRequestsResponse.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelSpotFleetRequests" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CancelSpotFleetRequests"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CancelSpotFleetRequestsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CancelSpotFleetRequestsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CancelSpotFleetRequestsResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CancelSpotFleetRequestsResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CancelSpotFleetRequestsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelSpotFleetRequestsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelSpotFleetRequestsResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelSpotFleetRequests.mli b/libraries/ec2/lib/cancelSpotFleetRequests.mli index f7c371202..154a87927 100644 --- a/libraries/ec2/lib/cancelSpotFleetRequests.mli +++ b/libraries/ec2/lib/cancelSpotFleetRequests.mli @@ -1,10 +1,7 @@ open Types - type input = CancelSpotFleetRequestsRequest.t - type output = CancelSpotFleetRequestsResponse.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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelSpotInstanceRequests.ml b/libraries/ec2/lib/cancelSpotInstanceRequests.ml index 3dedd65db..106c87a87 100644 --- a/libraries/ec2/lib/cancelSpotInstanceRequests.ml +++ b/libraries/ec2/lib/cancelSpotInstanceRequests.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CancelSpotInstanceRequestsRequest.t - type output = CancelSpotInstanceRequestsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CancelSpotInstanceRequests" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CancelSpotInstanceRequests"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CancelSpotInstanceRequestsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CancelSpotInstanceRequestsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CancelSpotInstanceRequestsResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CancelSpotInstanceRequestsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CancelSpotInstanceRequestsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelSpotInstanceRequestsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelSpotInstanceRequestsResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/cancelSpotInstanceRequests.mli b/libraries/ec2/lib/cancelSpotInstanceRequests.mli index 117450c85..a2bf84d09 100644 --- a/libraries/ec2/lib/cancelSpotInstanceRequests.mli +++ b/libraries/ec2/lib/cancelSpotInstanceRequests.mli @@ -1,10 +1,7 @@ open Types - type input = CancelSpotInstanceRequestsRequest.t - type output = CancelSpotInstanceRequestsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/confirmProductInstance.ml b/libraries/ec2/lib/confirmProductInstance.ml index d3a1454b0..22ee73424 100644 --- a/libraries/ec2/lib/confirmProductInstance.ml +++ b/libraries/ec2/lib/confirmProductInstance.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ConfirmProductInstanceRequest.t - type output = ConfirmProductInstanceResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ConfirmProductInstance" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ConfirmProductInstance"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ConfirmProductInstanceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ConfirmProductInstanceRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ConfirmProductInstanceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ConfirmProductInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ConfirmProductInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ConfirmProductInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ConfirmProductInstanceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/confirmProductInstance.mli b/libraries/ec2/lib/confirmProductInstance.mli index a0f15f75f..20dd00b3a 100644 --- a/libraries/ec2/lib/confirmProductInstance.mli +++ b/libraries/ec2/lib/confirmProductInstance.mli @@ -1,10 +1,7 @@ open Types - type input = ConfirmProductInstanceRequest.t - type output = ConfirmProductInstanceResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/copyImage.ml b/libraries/ec2/lib/copyImage.ml index ab3ae7e9f..9dcd6c1e4 100644 --- a/libraries/ec2/lib/copyImage.ml +++ b/libraries/ec2/lib/copyImage.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = CopyImageRequest.t - type output = CopyImageResult.t - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "CopyImage" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["CopyImage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopyImageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CopyImageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CopyImageResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CopyImageResult.parse) + Util.or_error (Util.option_bind resp CopyImageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CopyImageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed CopyImageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyImageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyImageResult - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/copyImage.mli b/libraries/ec2/lib/copyImage.mli index 8b7cf042f..d6249e4be 100644 --- a/libraries/ec2/lib/copyImage.mli +++ b/libraries/ec2/lib/copyImage.mli @@ -1,10 +1,7 @@ open Types - type input = CopyImageRequest.t - type output = CopyImageResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/copySnapshot.ml b/libraries/ec2/lib/copySnapshot.ml index 085ef0414..345d4c6e8 100644 --- a/libraries/ec2/lib/copySnapshot.ml +++ b/libraries/ec2/lib/copySnapshot.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = CopySnapshotRequest.t - type output = CopySnapshotResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CopySnapshot" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CopySnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopySnapshotRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CopySnapshotRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CopySnapshotResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CopySnapshotResult.parse) + Util.or_error (Util.option_bind resp CopySnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CopySnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CopySnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopySnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopySnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/copySnapshot.mli b/libraries/ec2/lib/copySnapshot.mli index 60133614a..f9101f7ed 100644 --- a/libraries/ec2/lib/copySnapshot.mli +++ b/libraries/ec2/lib/copySnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CopySnapshotRequest.t - type output = CopySnapshotResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createCustomerGateway.ml b/libraries/ec2/lib/createCustomerGateway.ml index ccbf162a5..ae55c12b5 100644 --- a/libraries/ec2/lib/createCustomerGateway.ml +++ b/libraries/ec2/lib/createCustomerGateway.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = CreateCustomerGatewayRequest.t - type output = CreateCustomerGatewayResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateCustomerGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateCustomerGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateCustomerGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateCustomerGatewayRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateCustomerGatewayResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateCustomerGatewayResult.parse) + Util.or_error (Util.option_bind resp CreateCustomerGatewayResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateCustomerGatewayResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateCustomerGatewayResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateCustomerGatewayResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateCustomerGatewayResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createCustomerGateway.mli b/libraries/ec2/lib/createCustomerGateway.mli index 211945961..289e02461 100644 --- a/libraries/ec2/lib/createCustomerGateway.mli +++ b/libraries/ec2/lib/createCustomerGateway.mli @@ -1,10 +1,7 @@ open Types - type input = CreateCustomerGatewayRequest.t - type output = CreateCustomerGatewayResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createDhcpOptions.ml b/libraries/ec2/lib/createDhcpOptions.ml index 1a0439291..6096a7464 100644 --- a/libraries/ec2/lib/createDhcpOptions.ml +++ b/libraries/ec2/lib/createDhcpOptions.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = CreateDhcpOptionsRequest.t - type output = CreateDhcpOptionsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateDhcpOptions" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateDhcpOptions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDhcpOptionsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDhcpOptionsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateDhcpOptionsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateDhcpOptionsResult.parse) + Util.or_error (Util.option_bind resp CreateDhcpOptionsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDhcpOptionsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDhcpOptionsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDhcpOptionsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDhcpOptionsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createDhcpOptions.mli b/libraries/ec2/lib/createDhcpOptions.mli index d508c283f..418b657d2 100644 --- a/libraries/ec2/lib/createDhcpOptions.mli +++ b/libraries/ec2/lib/createDhcpOptions.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDhcpOptionsRequest.t - type output = CreateDhcpOptionsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createFlowLogs.ml b/libraries/ec2/lib/createFlowLogs.ml index bfa5516c4..10cacca52 100644 --- a/libraries/ec2/lib/createFlowLogs.ml +++ b/libraries/ec2/lib/createFlowLogs.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = CreateFlowLogsRequest.t - type output = CreateFlowLogsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateFlowLogs" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateFlowLogs"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateFlowLogsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateFlowLogsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateFlowLogsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateFlowLogsResult.parse) + Util.or_error (Util.option_bind resp CreateFlowLogsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateFlowLogsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateFlowLogsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateFlowLogsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateFlowLogsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createFlowLogs.mli b/libraries/ec2/lib/createFlowLogs.mli index 2ce56854b..e406c0714 100644 --- a/libraries/ec2/lib/createFlowLogs.mli +++ b/libraries/ec2/lib/createFlowLogs.mli @@ -1,10 +1,7 @@ open Types - type input = CreateFlowLogsRequest.t - type output = CreateFlowLogsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createImage.ml b/libraries/ec2/lib/createImage.ml index fa373df02..81bfb21fe 100644 --- a/libraries/ec2/lib/createImage.ml +++ b/libraries/ec2/lib/createImage.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = CreateImageRequest.t - type output = CreateImageResult.t - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "CreateImage" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateImage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateImageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateImageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateImageResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateImageResult.parse) + Util.or_error (Util.option_bind resp CreateImageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateImageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateImageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateImageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateImageResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createImage.mli b/libraries/ec2/lib/createImage.mli index 44e230338..8baaf90f7 100644 --- a/libraries/ec2/lib/createImage.mli +++ b/libraries/ec2/lib/createImage.mli @@ -1,10 +1,7 @@ open Types - type input = CreateImageRequest.t - type output = CreateImageResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createInstanceExportTask.ml b/libraries/ec2/lib/createInstanceExportTask.ml index 9bdb2dad3..d673e6623 100644 --- a/libraries/ec2/lib/createInstanceExportTask.ml +++ b/libraries/ec2/lib/createInstanceExportTask.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CreateInstanceExportTaskRequest.t - type output = CreateInstanceExportTaskResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateInstanceExportTask" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateInstanceExportTask"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateInstanceExportTaskRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateInstanceExportTaskRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateInstanceExportTaskResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateInstanceExportTaskResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateInstanceExportTaskResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateInstanceExportTaskResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateInstanceExportTaskResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createInstanceExportTask.mli b/libraries/ec2/lib/createInstanceExportTask.mli index 02233359d..df372b0bd 100644 --- a/libraries/ec2/lib/createInstanceExportTask.mli +++ b/libraries/ec2/lib/createInstanceExportTask.mli @@ -1,10 +1,7 @@ open Types - type input = CreateInstanceExportTaskRequest.t - type output = CreateInstanceExportTaskResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createInternetGateway.ml b/libraries/ec2/lib/createInternetGateway.ml index 9210d0b60..b824ce569 100644 --- a/libraries/ec2/lib/createInternetGateway.ml +++ b/libraries/ec2/lib/createInternetGateway.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = CreateInternetGatewayRequest.t - type output = CreateInternetGatewayResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateInternetGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateInternetGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateInternetGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateInternetGatewayRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateInternetGatewayResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateInternetGatewayResult.parse) + Util.or_error (Util.option_bind resp CreateInternetGatewayResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateInternetGatewayResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateInternetGatewayResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateInternetGatewayResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateInternetGatewayResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createInternetGateway.mli b/libraries/ec2/lib/createInternetGateway.mli index 9fa17cdc0..202710a57 100644 --- a/libraries/ec2/lib/createInternetGateway.mli +++ b/libraries/ec2/lib/createInternetGateway.mli @@ -1,10 +1,7 @@ open Types - type input = CreateInternetGatewayRequest.t - type output = CreateInternetGatewayResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createKeyPair.ml b/libraries/ec2/lib/createKeyPair.ml index 1f46181ae..5c9fb2d86 100644 --- a/libraries/ec2/lib/createKeyPair.ml +++ b/libraries/ec2/lib/createKeyPair.ml @@ -1,55 +1,54 @@ open Types open Aws - type input = CreateKeyPairRequest.t - type output = KeyPair.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateKeyPair" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateKeyPair"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateKeyPairRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateKeyPairRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateKeyPairResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp KeyPair.parse) + Util.or_error (Util.option_bind resp KeyPair.parse) (let open Error in - BadResponse { body; message = "Could not find well formed KeyPair." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed KeyPair." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing KeyPair - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = "Error parsing KeyPair - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createKeyPair.mli b/libraries/ec2/lib/createKeyPair.mli index 4e25def54..e67a92fd5 100644 --- a/libraries/ec2/lib/createKeyPair.mli +++ b/libraries/ec2/lib/createKeyPair.mli @@ -1,10 +1,7 @@ open Types - type input = CreateKeyPairRequest.t - type output = KeyPair.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkAcl.ml b/libraries/ec2/lib/createNetworkAcl.ml index a00cb05d3..796941d2a 100644 --- a/libraries/ec2/lib/createNetworkAcl.ml +++ b/libraries/ec2/lib/createNetworkAcl.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = CreateNetworkAclRequest.t - type output = CreateNetworkAclResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateNetworkAcl" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateNetworkAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateNetworkAclRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateNetworkAclRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateNetworkAclResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateNetworkAclResult.parse) + Util.or_error (Util.option_bind resp CreateNetworkAclResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateNetworkAclResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateNetworkAclResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateNetworkAclResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateNetworkAclResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkAcl.mli b/libraries/ec2/lib/createNetworkAcl.mli index df3eaddc1..7efa7e7c9 100644 --- a/libraries/ec2/lib/createNetworkAcl.mli +++ b/libraries/ec2/lib/createNetworkAcl.mli @@ -1,10 +1,7 @@ open Types - type input = CreateNetworkAclRequest.t - type output = CreateNetworkAclResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkAclEntry.ml b/libraries/ec2/lib/createNetworkAclEntry.ml index d9f07a204..b38b92297 100644 --- a/libraries/ec2/lib/createNetworkAclEntry.ml +++ b/libraries/ec2/lib/createNetworkAclEntry.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = CreateNetworkAclEntryRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateNetworkAclEntry" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateNetworkAclEntry"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateNetworkAclEntryRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkAclEntry.mli b/libraries/ec2/lib/createNetworkAclEntry.mli index 70a70fc1d..bc7067b27 100644 --- a/libraries/ec2/lib/createNetworkAclEntry.mli +++ b/libraries/ec2/lib/createNetworkAclEntry.mli @@ -1,10 +1,7 @@ open Types - type input = CreateNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkInterface.ml b/libraries/ec2/lib/createNetworkInterface.ml index 77817571a..339fedc56 100644 --- a/libraries/ec2/lib/createNetworkInterface.ml +++ b/libraries/ec2/lib/createNetworkInterface.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CreateNetworkInterfaceRequest.t - type output = CreateNetworkInterfaceResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateNetworkInterface" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateNetworkInterface"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateNetworkInterfaceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateNetworkInterfaceRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateNetworkInterfaceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateNetworkInterfaceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateNetworkInterfaceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateNetworkInterfaceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateNetworkInterfaceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createNetworkInterface.mli b/libraries/ec2/lib/createNetworkInterface.mli index 5229a1fad..520771188 100644 --- a/libraries/ec2/lib/createNetworkInterface.mli +++ b/libraries/ec2/lib/createNetworkInterface.mli @@ -1,10 +1,7 @@ open Types - type input = CreateNetworkInterfaceRequest.t - type output = CreateNetworkInterfaceResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createPlacementGroup.ml b/libraries/ec2/lib/createPlacementGroup.ml index c90ffdc50..84846c6c4 100644 --- a/libraries/ec2/lib/createPlacementGroup.ml +++ b/libraries/ec2/lib/createPlacementGroup.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = CreatePlacementGroupRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreatePlacementGroup" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreatePlacementGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreatePlacementGroupRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreatePlacementGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createPlacementGroup.mli b/libraries/ec2/lib/createPlacementGroup.mli index d2da694b7..6c712aef8 100644 --- a/libraries/ec2/lib/createPlacementGroup.mli +++ b/libraries/ec2/lib/createPlacementGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreatePlacementGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createReservedInstancesListing.ml b/libraries/ec2/lib/createReservedInstancesListing.ml index ef499e92b..3fd13b2e6 100644 --- a/libraries/ec2/lib/createReservedInstancesListing.ml +++ b/libraries/ec2/lib/createReservedInstancesListing.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = CreateReservedInstancesListingRequest.t - type output = CreateReservedInstancesListingResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateReservedInstancesListing" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateReservedInstancesListing"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateReservedInstancesListingRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateReservedInstancesListingRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateReservedInstancesListingResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateReservedInstancesListingResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateReservedInstancesListingResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateReservedInstancesListingResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateReservedInstancesListingResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createReservedInstancesListing.mli b/libraries/ec2/lib/createReservedInstancesListing.mli index fb30aaf97..668a99b02 100644 --- a/libraries/ec2/lib/createReservedInstancesListing.mli +++ b/libraries/ec2/lib/createReservedInstancesListing.mli @@ -1,10 +1,7 @@ open Types - type input = CreateReservedInstancesListingRequest.t - type output = CreateReservedInstancesListingResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createRoute.ml b/libraries/ec2/lib/createRoute.ml index 23efbcab1..b272efe11 100644 --- a/libraries/ec2/lib/createRoute.ml +++ b/libraries/ec2/lib/createRoute.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = CreateRouteRequest.t - type output = CreateRouteResult.t - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "CreateRoute" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateRoute"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateRouteRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateRouteRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateRouteResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateRouteResult.parse) + Util.or_error (Util.option_bind resp CreateRouteResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateRouteResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateRouteResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateRouteResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateRouteResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createRoute.mli b/libraries/ec2/lib/createRoute.mli index c86e9670a..5f9a8d8b0 100644 --- a/libraries/ec2/lib/createRoute.mli +++ b/libraries/ec2/lib/createRoute.mli @@ -1,10 +1,7 @@ open Types - type input = CreateRouteRequest.t - type output = CreateRouteResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createRouteTable.ml b/libraries/ec2/lib/createRouteTable.ml index d6fca21c2..f67c33d2f 100644 --- a/libraries/ec2/lib/createRouteTable.ml +++ b/libraries/ec2/lib/createRouteTable.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = CreateRouteTableRequest.t - type output = CreateRouteTableResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateRouteTable" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateRouteTable"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateRouteTableRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateRouteTableRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateRouteTableResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateRouteTableResult.parse) + Util.or_error (Util.option_bind resp CreateRouteTableResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateRouteTableResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateRouteTableResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateRouteTableResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateRouteTableResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createRouteTable.mli b/libraries/ec2/lib/createRouteTable.mli index cae12ee6e..29e577d66 100644 --- a/libraries/ec2/lib/createRouteTable.mli +++ b/libraries/ec2/lib/createRouteTable.mli @@ -1,10 +1,7 @@ open Types - type input = CreateRouteTableRequest.t - type output = CreateRouteTableResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSecurityGroup.ml b/libraries/ec2/lib/createSecurityGroup.ml index edcf372f1..4431ac55d 100644 --- a/libraries/ec2/lib/createSecurityGroup.ml +++ b/libraries/ec2/lib/createSecurityGroup.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = CreateSecurityGroupRequest.t - type output = CreateSecurityGroupResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateSecurityGroup" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateSecurityGroupRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateSecurityGroupRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateSecurityGroupResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateSecurityGroupResult.parse) + Util.or_error (Util.option_bind resp CreateSecurityGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateSecurityGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateSecurityGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateSecurityGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateSecurityGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSecurityGroup.mli b/libraries/ec2/lib/createSecurityGroup.mli index 25bb91724..e8f34742a 100644 --- a/libraries/ec2/lib/createSecurityGroup.mli +++ b/libraries/ec2/lib/createSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSecurityGroupRequest.t - type output = CreateSecurityGroupResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSnapshot.ml b/libraries/ec2/lib/createSnapshot.ml index b610434d2..852136e50 100644 --- a/libraries/ec2/lib/createSnapshot.ml +++ b/libraries/ec2/lib/createSnapshot.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = CreateSnapshotRequest.t - type output = Snapshot.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateSnapshot" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateSnapshotRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateSnapshotRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateSnapshotResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp Snapshot.parse) + Util.or_error (Util.option_bind resp Snapshot.parse) (let open Error in - BadResponse { body; message = "Could not find well formed Snapshot." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed Snapshot." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing Snapshot - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing Snapshot - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSnapshot.mli b/libraries/ec2/lib/createSnapshot.mli index e471cef73..d569ccc42 100644 --- a/libraries/ec2/lib/createSnapshot.mli +++ b/libraries/ec2/lib/createSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSnapshotRequest.t - type output = Snapshot.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSpotDatafeedSubscription.ml b/libraries/ec2/lib/createSpotDatafeedSubscription.ml index 45992764d..1ab6ddba1 100644 --- a/libraries/ec2/lib/createSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/createSpotDatafeedSubscription.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = CreateSpotDatafeedSubscriptionRequest.t - type output = CreateSpotDatafeedSubscriptionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateSpotDatafeedSubscription" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateSpotDatafeedSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateSpotDatafeedSubscriptionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateSpotDatafeedSubscriptionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateSpotDatafeedSubscriptionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateSpotDatafeedSubscriptionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateSpotDatafeedSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateSpotDatafeedSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateSpotDatafeedSubscriptionResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSpotDatafeedSubscription.mli b/libraries/ec2/lib/createSpotDatafeedSubscription.mli index 9935a450a..d613c7514 100644 --- a/libraries/ec2/lib/createSpotDatafeedSubscription.mli +++ b/libraries/ec2/lib/createSpotDatafeedSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSpotDatafeedSubscriptionRequest.t - type output = CreateSpotDatafeedSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSubnet.ml b/libraries/ec2/lib/createSubnet.ml index 09665692c..8b1cd3091 100644 --- a/libraries/ec2/lib/createSubnet.ml +++ b/libraries/ec2/lib/createSubnet.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = CreateSubnetRequest.t - type output = CreateSubnetResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateSubnet" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateSubnet"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateSubnetRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateSubnetRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateSubnetResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateSubnetResult.parse) + Util.or_error (Util.option_bind resp CreateSubnetResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateSubnetResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateSubnetResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateSubnetResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateSubnetResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createSubnet.mli b/libraries/ec2/lib/createSubnet.mli index 17f2d8cb4..924ee5bb8 100644 --- a/libraries/ec2/lib/createSubnet.mli +++ b/libraries/ec2/lib/createSubnet.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSubnetRequest.t - type output = CreateSubnetResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createTags.ml b/libraries/ec2/lib/createTags.ml index c87704089..7a43aae97 100644 --- a/libraries/ec2/lib/createTags.ml +++ b/libraries/ec2/lib/createTags.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = CreateTagsRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "CreateTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateTagsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateTagsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createTags.mli b/libraries/ec2/lib/createTags.mli index 8e2f024d1..dc54aa328 100644 --- a/libraries/ec2/lib/createTags.mli +++ b/libraries/ec2/lib/createTags.mli @@ -1,10 +1,7 @@ open Types - type input = CreateTagsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVolume.ml b/libraries/ec2/lib/createVolume.ml index 3055b005f..e5c579390 100644 --- a/libraries/ec2/lib/createVolume.ml +++ b/libraries/ec2/lib/createVolume.ml @@ -1,55 +1,54 @@ open Types open Aws - type input = CreateVolumeRequest.t - type output = Volume.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVolume" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateVolume"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateVolumeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateVolumeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateVolumeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp Volume.parse) + Util.or_error (Util.option_bind resp Volume.parse) (let open Error in - BadResponse { body; message = "Could not find well formed Volume." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed Volume." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing Volume - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = "Error parsing Volume - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVolume.mli b/libraries/ec2/lib/createVolume.mli index 2cd06cfc4..594a722fb 100644 --- a/libraries/ec2/lib/createVolume.mli +++ b/libraries/ec2/lib/createVolume.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVolumeRequest.t - type output = Volume.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpc.ml b/libraries/ec2/lib/createVpc.ml index 104cd0128..188503393 100644 --- a/libraries/ec2/lib/createVpc.ml +++ b/libraries/ec2/lib/createVpc.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = CreateVpcRequest.t - type output = CreateVpcResult.t - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "CreateVpc" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpc"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateVpcRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateVpcRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateVpcResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateVpcResult.parse) + Util.or_error (Util.option_bind resp CreateVpcResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateVpcResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed CreateVpcResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateVpcResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateVpcResult - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpc.mli b/libraries/ec2/lib/createVpc.mli index 720e4005c..e929a30f2 100644 --- a/libraries/ec2/lib/createVpc.mli +++ b/libraries/ec2/lib/createVpc.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpcRequest.t - type output = CreateVpcResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpcEndpoint.ml b/libraries/ec2/lib/createVpcEndpoint.ml index 277164bd5..d7d52ff62 100644 --- a/libraries/ec2/lib/createVpcEndpoint.ml +++ b/libraries/ec2/lib/createVpcEndpoint.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = CreateVpcEndpointRequest.t - type output = CreateVpcEndpointResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVpcEndpoint" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateVpcEndpoint"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateVpcEndpointRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateVpcEndpointRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateVpcEndpointResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateVpcEndpointResult.parse) + Util.or_error (Util.option_bind resp CreateVpcEndpointResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateVpcEndpointResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateVpcEndpointResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateVpcEndpointResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateVpcEndpointResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpcEndpoint.mli b/libraries/ec2/lib/createVpcEndpoint.mli index f1c3d089e..d1a5ebf2e 100644 --- a/libraries/ec2/lib/createVpcEndpoint.mli +++ b/libraries/ec2/lib/createVpcEndpoint.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpcEndpointRequest.t - type output = CreateVpcEndpointResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpcPeeringConnection.ml b/libraries/ec2/lib/createVpcPeeringConnection.ml index 908884521..9b00c84c5 100644 --- a/libraries/ec2/lib/createVpcPeeringConnection.ml +++ b/libraries/ec2/lib/createVpcPeeringConnection.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CreateVpcPeeringConnectionRequest.t - type output = CreateVpcPeeringConnectionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVpcPeeringConnection" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateVpcPeeringConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateVpcPeeringConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateVpcPeeringConnectionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateVpcPeeringConnectionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateVpcPeeringConnectionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateVpcPeeringConnectionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateVpcPeeringConnectionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateVpcPeeringConnectionResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpcPeeringConnection.mli b/libraries/ec2/lib/createVpcPeeringConnection.mli index 5e033a1c6..6def8e4a9 100644 --- a/libraries/ec2/lib/createVpcPeeringConnection.mli +++ b/libraries/ec2/lib/createVpcPeeringConnection.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpcPeeringConnectionRequest.t - type output = CreateVpcPeeringConnectionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnConnection.ml b/libraries/ec2/lib/createVpnConnection.ml index e213f0abc..2e74a791e 100644 --- a/libraries/ec2/lib/createVpnConnection.ml +++ b/libraries/ec2/lib/createVpnConnection.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = CreateVpnConnectionRequest.t - type output = CreateVpnConnectionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVpnConnection" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateVpnConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateVpnConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateVpnConnectionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateVpnConnectionResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateVpnConnectionResult.parse) + Util.or_error (Util.option_bind resp CreateVpnConnectionResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateVpnConnectionResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateVpnConnectionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateVpnConnectionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateVpnConnectionResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnConnection.mli b/libraries/ec2/lib/createVpnConnection.mli index ded888cae..790bd1fb0 100644 --- a/libraries/ec2/lib/createVpnConnection.mli +++ b/libraries/ec2/lib/createVpnConnection.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpnConnectionRequest.t - type output = CreateVpnConnectionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnConnectionRoute.ml b/libraries/ec2/lib/createVpnConnectionRoute.ml index b956a662c..307dd0e55 100644 --- a/libraries/ec2/lib/createVpnConnectionRoute.ml +++ b/libraries/ec2/lib/createVpnConnectionRoute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = CreateVpnConnectionRouteRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVpnConnectionRoute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["CreateVpnConnectionRoute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateVpnConnectionRouteRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateVpnConnectionRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnConnectionRoute.mli b/libraries/ec2/lib/createVpnConnectionRoute.mli index 312106da6..e1c8f7c42 100644 --- a/libraries/ec2/lib/createVpnConnectionRoute.mli +++ b/libraries/ec2/lib/createVpnConnectionRoute.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpnConnectionRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnGateway.ml b/libraries/ec2/lib/createVpnGateway.ml index 5d467ec3b..e713ae127 100644 --- a/libraries/ec2/lib/createVpnGateway.ml +++ b/libraries/ec2/lib/createVpnGateway.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = CreateVpnGatewayRequest.t - type output = CreateVpnGatewayResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "CreateVpnGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["CreateVpnGateway"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateVpnGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateVpnGatewayRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateVpnGatewayResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateVpnGatewayResult.parse) + Util.or_error (Util.option_bind resp CreateVpnGatewayResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateVpnGatewayResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateVpnGatewayResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateVpnGatewayResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateVpnGatewayResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/createVpnGateway.mli b/libraries/ec2/lib/createVpnGateway.mli index 9b9a97724..538a2b334 100644 --- a/libraries/ec2/lib/createVpnGateway.mli +++ b/libraries/ec2/lib/createVpnGateway.mli @@ -1,10 +1,7 @@ open Types - type input = CreateVpnGatewayRequest.t - type output = CreateVpnGatewayResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteCustomerGateway.ml b/libraries/ec2/lib/deleteCustomerGateway.ml index 22516dedb..8f3ca8aa3 100644 --- a/libraries/ec2/lib/deleteCustomerGateway.ml +++ b/libraries/ec2/lib/deleteCustomerGateway.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteCustomerGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteCustomerGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteCustomerGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteCustomerGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteCustomerGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteCustomerGateway.mli b/libraries/ec2/lib/deleteCustomerGateway.mli index 499deec94..8fcbb4999 100644 --- a/libraries/ec2/lib/deleteCustomerGateway.mli +++ b/libraries/ec2/lib/deleteCustomerGateway.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteCustomerGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteDhcpOptions.ml b/libraries/ec2/lib/deleteDhcpOptions.ml index 10471ab85..2c9f8cb23 100644 --- a/libraries/ec2/lib/deleteDhcpOptions.ml +++ b/libraries/ec2/lib/deleteDhcpOptions.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteDhcpOptionsRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteDhcpOptions" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteDhcpOptions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDhcpOptionsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDhcpOptionsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteDhcpOptions.mli b/libraries/ec2/lib/deleteDhcpOptions.mli index c437b601d..c752fbcb3 100644 --- a/libraries/ec2/lib/deleteDhcpOptions.mli +++ b/libraries/ec2/lib/deleteDhcpOptions.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDhcpOptionsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteFlowLogs.ml b/libraries/ec2/lib/deleteFlowLogs.ml index 352c2ecab..61507be46 100644 --- a/libraries/ec2/lib/deleteFlowLogs.ml +++ b/libraries/ec2/lib/deleteFlowLogs.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DeleteFlowLogsRequest.t - type output = DeleteFlowLogsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteFlowLogs" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteFlowLogs"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteFlowLogsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteFlowLogsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DeleteFlowLogsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DeleteFlowLogsResult.parse) + Util.or_error (Util.option_bind resp DeleteFlowLogsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DeleteFlowLogsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteFlowLogsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteFlowLogsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteFlowLogsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteFlowLogs.mli b/libraries/ec2/lib/deleteFlowLogs.mli index fbdd7b7e0..2b5c542c1 100644 --- a/libraries/ec2/lib/deleteFlowLogs.mli +++ b/libraries/ec2/lib/deleteFlowLogs.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteFlowLogsRequest.t - type output = DeleteFlowLogsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteInternetGateway.ml b/libraries/ec2/lib/deleteInternetGateway.ml index 2e658b935..272023508 100644 --- a/libraries/ec2/lib/deleteInternetGateway.ml +++ b/libraries/ec2/lib/deleteInternetGateway.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteInternetGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteInternetGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteInternetGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteInternetGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteInternetGateway.mli b/libraries/ec2/lib/deleteInternetGateway.mli index 544eec942..a19cc16cd 100644 --- a/libraries/ec2/lib/deleteInternetGateway.mli +++ b/libraries/ec2/lib/deleteInternetGateway.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteKeyPair.ml b/libraries/ec2/lib/deleteKeyPair.ml index 9e5d360f7..f8a51d2cb 100644 --- a/libraries/ec2/lib/deleteKeyPair.ml +++ b/libraries/ec2/lib/deleteKeyPair.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteKeyPairRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteKeyPair" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteKeyPair"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteKeyPairRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteKeyPairRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteKeyPair.mli b/libraries/ec2/lib/deleteKeyPair.mli index bf76ec5e0..ccd8ccb43 100644 --- a/libraries/ec2/lib/deleteKeyPair.mli +++ b/libraries/ec2/lib/deleteKeyPair.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteKeyPairRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkAcl.ml b/libraries/ec2/lib/deleteNetworkAcl.ml index a022bc9a2..794be04e2 100644 --- a/libraries/ec2/lib/deleteNetworkAcl.ml +++ b/libraries/ec2/lib/deleteNetworkAcl.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteNetworkAclRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteNetworkAcl" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteNetworkAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteNetworkAclRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteNetworkAclRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkAcl.mli b/libraries/ec2/lib/deleteNetworkAcl.mli index 9022838a4..097edd537 100644 --- a/libraries/ec2/lib/deleteNetworkAcl.mli +++ b/libraries/ec2/lib/deleteNetworkAcl.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteNetworkAclRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkAclEntry.ml b/libraries/ec2/lib/deleteNetworkAclEntry.ml index 17a4575da..5eaac576b 100644 --- a/libraries/ec2/lib/deleteNetworkAclEntry.ml +++ b/libraries/ec2/lib/deleteNetworkAclEntry.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteNetworkAclEntryRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteNetworkAclEntry" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteNetworkAclEntry"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteNetworkAclEntryRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkAclEntry.mli b/libraries/ec2/lib/deleteNetworkAclEntry.mli index 579fe0d6f..c3823a7a6 100644 --- a/libraries/ec2/lib/deleteNetworkAclEntry.mli +++ b/libraries/ec2/lib/deleteNetworkAclEntry.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkInterface.ml b/libraries/ec2/lib/deleteNetworkInterface.ml index 85edccabd..15c00ec6f 100644 --- a/libraries/ec2/lib/deleteNetworkInterface.ml +++ b/libraries/ec2/lib/deleteNetworkInterface.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DeleteNetworkInterfaceRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteNetworkInterface" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DeleteNetworkInterface"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteNetworkInterfaceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteNetworkInterfaceRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteNetworkInterface.mli b/libraries/ec2/lib/deleteNetworkInterface.mli index 6b0b694df..16367f725 100644 --- a/libraries/ec2/lib/deleteNetworkInterface.mli +++ b/libraries/ec2/lib/deleteNetworkInterface.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteNetworkInterfaceRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deletePlacementGroup.ml b/libraries/ec2/lib/deletePlacementGroup.ml index a005996ee..9fd413ad4 100644 --- a/libraries/ec2/lib/deletePlacementGroup.ml +++ b/libraries/ec2/lib/deletePlacementGroup.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeletePlacementGroupRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeletePlacementGroup" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeletePlacementGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeletePlacementGroupRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeletePlacementGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deletePlacementGroup.mli b/libraries/ec2/lib/deletePlacementGroup.mli index 07eb6eb44..81aeb2ec9 100644 --- a/libraries/ec2/lib/deletePlacementGroup.mli +++ b/libraries/ec2/lib/deletePlacementGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeletePlacementGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteRoute.ml b/libraries/ec2/lib/deleteRoute.ml index 3e11ad1c3..4fd0ad97b 100644 --- a/libraries/ec2/lib/deleteRoute.ml +++ b/libraries/ec2/lib/deleteRoute.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteRouteRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "DeleteRoute" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteRoute"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteRouteRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteRoute.mli b/libraries/ec2/lib/deleteRoute.mli index 1fd11ab11..87e72e7b4 100644 --- a/libraries/ec2/lib/deleteRoute.mli +++ b/libraries/ec2/lib/deleteRoute.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteRouteTable.ml b/libraries/ec2/lib/deleteRouteTable.ml index 590aa7ca5..dfc5bcfe4 100644 --- a/libraries/ec2/lib/deleteRouteTable.ml +++ b/libraries/ec2/lib/deleteRouteTable.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteRouteTableRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteRouteTable" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteRouteTable"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteRouteTableRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteRouteTableRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteRouteTable.mli b/libraries/ec2/lib/deleteRouteTable.mli index 797fe9af4..a9b2687f7 100644 --- a/libraries/ec2/lib/deleteRouteTable.mli +++ b/libraries/ec2/lib/deleteRouteTable.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteRouteTableRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSecurityGroup.ml b/libraries/ec2/lib/deleteSecurityGroup.ml index 0a44e51d2..c451c62f8 100644 --- a/libraries/ec2/lib/deleteSecurityGroup.ml +++ b/libraries/ec2/lib/deleteSecurityGroup.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteSecurityGroupRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteSecurityGroup" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteSecurityGroupRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteSecurityGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSecurityGroup.mli b/libraries/ec2/lib/deleteSecurityGroup.mli index 56f679fdd..b940786ac 100644 --- a/libraries/ec2/lib/deleteSecurityGroup.mli +++ b/libraries/ec2/lib/deleteSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSecurityGroupRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSnapshot.ml b/libraries/ec2/lib/deleteSnapshot.ml index 1d9da45e3..c47dbdd78 100644 --- a/libraries/ec2/lib/deleteSnapshot.ml +++ b/libraries/ec2/lib/deleteSnapshot.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteSnapshotRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteSnapshot" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteSnapshotRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteSnapshotRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSnapshot.mli b/libraries/ec2/lib/deleteSnapshot.mli index 0a3cf61f7..6bc3ce035 100644 --- a/libraries/ec2/lib/deleteSnapshot.mli +++ b/libraries/ec2/lib/deleteSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSnapshotRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml b/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml index 2d0ee8cf4..82de60a6a 100644 --- a/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = DeleteSpotDatafeedSubscriptionRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteSpotDatafeedSubscription" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DeleteSpotDatafeedSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteSpotDatafeedSubscriptionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DeleteSpotDatafeedSubscriptionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSpotDatafeedSubscription.mli b/libraries/ec2/lib/deleteSpotDatafeedSubscription.mli index c659ec311..4bbd0b9be 100644 --- a/libraries/ec2/lib/deleteSpotDatafeedSubscription.mli +++ b/libraries/ec2/lib/deleteSpotDatafeedSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSpotDatafeedSubscriptionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSubnet.ml b/libraries/ec2/lib/deleteSubnet.ml index 913ab8c97..a1e5a3e32 100644 --- a/libraries/ec2/lib/deleteSubnet.ml +++ b/libraries/ec2/lib/deleteSubnet.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteSubnetRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteSubnet" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteSubnet"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteSubnetRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteSubnetRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteSubnet.mli b/libraries/ec2/lib/deleteSubnet.mli index 0879e4cff..63a6663c2 100644 --- a/libraries/ec2/lib/deleteSubnet.mli +++ b/libraries/ec2/lib/deleteSubnet.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSubnetRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteTags.ml b/libraries/ec2/lib/deleteTags.ml index 3f9f5881e..340185d51 100644 --- a/libraries/ec2/lib/deleteTags.ml +++ b/libraries/ec2/lib/deleteTags.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteTagsRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "DeleteTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteTagsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteTagsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteTags.mli b/libraries/ec2/lib/deleteTags.mli index 020853807..b93a60837 100644 --- a/libraries/ec2/lib/deleteTags.mli +++ b/libraries/ec2/lib/deleteTags.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteTagsRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVolume.ml b/libraries/ec2/lib/deleteVolume.ml index b8928d223..2ea49d05f 100644 --- a/libraries/ec2/lib/deleteVolume.ml +++ b/libraries/ec2/lib/deleteVolume.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteVolumeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVolume" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteVolume"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteVolumeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteVolumeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVolume.mli b/libraries/ec2/lib/deleteVolume.mli index 61bf8c6f1..4bd3c2efa 100644 --- a/libraries/ec2/lib/deleteVolume.mli +++ b/libraries/ec2/lib/deleteVolume.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVolumeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpc.ml b/libraries/ec2/lib/deleteVpc.ml index f7fb5e21b..931ebd127 100644 --- a/libraries/ec2/lib/deleteVpc.ml +++ b/libraries/ec2/lib/deleteVpc.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteVpcRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "DeleteVpc" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpc"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteVpcRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteVpcRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpc.mli b/libraries/ec2/lib/deleteVpc.mli index 0cd6c05d9..4dbe0b1cf 100644 --- a/libraries/ec2/lib/deleteVpc.mli +++ b/libraries/ec2/lib/deleteVpc.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpcRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpcEndpoints.ml b/libraries/ec2/lib/deleteVpcEndpoints.ml index d1c73d048..8a266e4b6 100644 --- a/libraries/ec2/lib/deleteVpcEndpoints.ml +++ b/libraries/ec2/lib/deleteVpcEndpoints.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = DeleteVpcEndpointsRequest.t - type output = DeleteVpcEndpointsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVpcEndpoints" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteVpcEndpoints"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteVpcEndpointsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteVpcEndpointsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DeleteVpcEndpointsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DeleteVpcEndpointsResult.parse) + Util.or_error (Util.option_bind resp DeleteVpcEndpointsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteVpcEndpointsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteVpcEndpointsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteVpcEndpointsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteVpcEndpointsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpcEndpoints.mli b/libraries/ec2/lib/deleteVpcEndpoints.mli index 7aecd6823..b24219019 100644 --- a/libraries/ec2/lib/deleteVpcEndpoints.mli +++ b/libraries/ec2/lib/deleteVpcEndpoints.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpcEndpointsRequest.t - type output = DeleteVpcEndpointsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpcPeeringConnection.ml b/libraries/ec2/lib/deleteVpcPeeringConnection.ml index 91b91ec2f..564c7da66 100644 --- a/libraries/ec2/lib/deleteVpcPeeringConnection.ml +++ b/libraries/ec2/lib/deleteVpcPeeringConnection.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DeleteVpcPeeringConnectionRequest.t - type output = DeleteVpcPeeringConnectionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVpcPeeringConnection" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DeleteVpcPeeringConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteVpcPeeringConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteVpcPeeringConnectionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DeleteVpcPeeringConnectionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DeleteVpcPeeringConnectionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteVpcPeeringConnectionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteVpcPeeringConnectionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteVpcPeeringConnectionResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpcPeeringConnection.mli b/libraries/ec2/lib/deleteVpcPeeringConnection.mli index c1feda537..0b4042eb1 100644 --- a/libraries/ec2/lib/deleteVpcPeeringConnection.mli +++ b/libraries/ec2/lib/deleteVpcPeeringConnection.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpcPeeringConnectionRequest.t - type output = DeleteVpcPeeringConnectionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnConnection.ml b/libraries/ec2/lib/deleteVpnConnection.ml index 311756a5d..ed6521252 100644 --- a/libraries/ec2/lib/deleteVpnConnection.ml +++ b/libraries/ec2/lib/deleteVpnConnection.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteVpnConnectionRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVpnConnection" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteVpnConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteVpnConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteVpnConnectionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnConnection.mli b/libraries/ec2/lib/deleteVpnConnection.mli index 9010031cb..b3b2ec81c 100644 --- a/libraries/ec2/lib/deleteVpnConnection.mli +++ b/libraries/ec2/lib/deleteVpnConnection.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpnConnectionRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnConnectionRoute.ml b/libraries/ec2/lib/deleteVpnConnectionRoute.ml index 84eb61361..38a9fda20 100644 --- a/libraries/ec2/lib/deleteVpnConnectionRoute.ml +++ b/libraries/ec2/lib/deleteVpnConnectionRoute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DeleteVpnConnectionRouteRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVpnConnectionRoute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DeleteVpnConnectionRoute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteVpnConnectionRouteRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteVpnConnectionRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnConnectionRoute.mli b/libraries/ec2/lib/deleteVpnConnectionRoute.mli index 9f2c54b3e..ca1b7c469 100644 --- a/libraries/ec2/lib/deleteVpnConnectionRoute.mli +++ b/libraries/ec2/lib/deleteVpnConnectionRoute.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpnConnectionRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnGateway.ml b/libraries/ec2/lib/deleteVpnGateway.ml index 26ca900fc..d9d91e567 100644 --- a/libraries/ec2/lib/deleteVpnGateway.ml +++ b/libraries/ec2/lib/deleteVpnGateway.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteVpnGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeleteVpnGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeleteVpnGateway"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteVpnGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteVpnGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deleteVpnGateway.mli b/libraries/ec2/lib/deleteVpnGateway.mli index 08c23718e..37f77d9e5 100644 --- a/libraries/ec2/lib/deleteVpnGateway.mli +++ b/libraries/ec2/lib/deleteVpnGateway.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteVpnGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deregisterImage.ml b/libraries/ec2/lib/deregisterImage.ml index 9ab61eec4..209fd28c1 100644 --- a/libraries/ec2/lib/deregisterImage.ml +++ b/libraries/ec2/lib/deregisterImage.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeregisterImageRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DeregisterImage" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DeregisterImage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeregisterImageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeregisterImageRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/deregisterImage.mli b/libraries/ec2/lib/deregisterImage.mli index 45ed16fed..7ab6f39e8 100644 --- a/libraries/ec2/lib/deregisterImage.mli +++ b/libraries/ec2/lib/deregisterImage.mli @@ -1,10 +1,7 @@ open Types - type input = DeregisterImageRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAccountAttributes.ml b/libraries/ec2/lib/describeAccountAttributes.ml index c67d8a18f..2dbeff97e 100644 --- a/libraries/ec2/lib/describeAccountAttributes.ml +++ b/libraries/ec2/lib/describeAccountAttributes.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeAccountAttributesRequest.t - type output = DescribeAccountAttributesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeAccountAttributes" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeAccountAttributes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeAccountAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeAccountAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeAccountAttributesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeAccountAttributesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAccountAttributesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAccountAttributesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAccountAttributesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAccountAttributes.mli b/libraries/ec2/lib/describeAccountAttributes.mli index cfbfade2e..b57f7512c 100644 --- a/libraries/ec2/lib/describeAccountAttributes.mli +++ b/libraries/ec2/lib/describeAccountAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAccountAttributesRequest.t - type output = DescribeAccountAttributesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAddresses.ml b/libraries/ec2/lib/describeAddresses.ml index d70fa3b2e..a2c87511d 100644 --- a/libraries/ec2/lib/describeAddresses.ml +++ b/libraries/ec2/lib/describeAddresses.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = DescribeAddressesRequest.t - type output = DescribeAddressesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeAddresses" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeAddresses"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeAddressesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeAddressesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeAddressesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeAddressesResult.parse) + Util.or_error (Util.option_bind resp DescribeAddressesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAddressesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAddressesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAddressesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAddressesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAddresses.mli b/libraries/ec2/lib/describeAddresses.mli index 16706aa79..bd153cb63 100644 --- a/libraries/ec2/lib/describeAddresses.mli +++ b/libraries/ec2/lib/describeAddresses.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAddressesRequest.t - type output = DescribeAddressesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAvailabilityZones.ml b/libraries/ec2/lib/describeAvailabilityZones.ml index 7a0e664de..a4e6fa743 100644 --- a/libraries/ec2/lib/describeAvailabilityZones.ml +++ b/libraries/ec2/lib/describeAvailabilityZones.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeAvailabilityZonesRequest.t - type output = DescribeAvailabilityZonesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeAvailabilityZones" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeAvailabilityZones"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeAvailabilityZonesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeAvailabilityZonesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeAvailabilityZonesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeAvailabilityZonesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAvailabilityZonesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAvailabilityZonesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAvailabilityZonesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeAvailabilityZones.mli b/libraries/ec2/lib/describeAvailabilityZones.mli index 9fefcad04..74874a257 100644 --- a/libraries/ec2/lib/describeAvailabilityZones.mli +++ b/libraries/ec2/lib/describeAvailabilityZones.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAvailabilityZonesRequest.t - type output = DescribeAvailabilityZonesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeBundleTasks.ml b/libraries/ec2/lib/describeBundleTasks.ml index eacb67364..7e00a10cf 100644 --- a/libraries/ec2/lib/describeBundleTasks.ml +++ b/libraries/ec2/lib/describeBundleTasks.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeBundleTasksRequest.t - type output = DescribeBundleTasksResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeBundleTasks" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeBundleTasks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeBundleTasksRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeBundleTasksRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeBundleTasksResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeBundleTasksResult.parse) + Util.or_error (Util.option_bind resp DescribeBundleTasksResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeBundleTasksResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeBundleTasksResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeBundleTasksResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeBundleTasksResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeBundleTasks.mli b/libraries/ec2/lib/describeBundleTasks.mli index e70cce4b3..e932bc701 100644 --- a/libraries/ec2/lib/describeBundleTasks.mli +++ b/libraries/ec2/lib/describeBundleTasks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeBundleTasksRequest.t - type output = DescribeBundleTasksResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeClassicLinkInstances.ml b/libraries/ec2/lib/describeClassicLinkInstances.ml index b23568b70..99bc0e300 100644 --- a/libraries/ec2/lib/describeClassicLinkInstances.ml +++ b/libraries/ec2/lib/describeClassicLinkInstances.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeClassicLinkInstancesRequest.t - type output = DescribeClassicLinkInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeClassicLinkInstances" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeClassicLinkInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeClassicLinkInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeClassicLinkInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeClassicLinkInstancesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeClassicLinkInstancesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeClassicLinkInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeClassicLinkInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeClassicLinkInstancesResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeClassicLinkInstances.mli b/libraries/ec2/lib/describeClassicLinkInstances.mli index 046db1b18..ab3f1738f 100644 --- a/libraries/ec2/lib/describeClassicLinkInstances.mli +++ b/libraries/ec2/lib/describeClassicLinkInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeClassicLinkInstancesRequest.t - type output = DescribeClassicLinkInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeConversionTasks.ml b/libraries/ec2/lib/describeConversionTasks.ml index d26efe233..dc40506e9 100644 --- a/libraries/ec2/lib/describeConversionTasks.ml +++ b/libraries/ec2/lib/describeConversionTasks.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeConversionTasksRequest.t - type output = DescribeConversionTasksResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeConversionTasks" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeConversionTasks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeConversionTasksRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeConversionTasksRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeConversionTasksResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeConversionTasksResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeConversionTasksResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeConversionTasksResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeConversionTasksResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeConversionTasks.mli b/libraries/ec2/lib/describeConversionTasks.mli index ebe1ac60f..26b8f5a3e 100644 --- a/libraries/ec2/lib/describeConversionTasks.mli +++ b/libraries/ec2/lib/describeConversionTasks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeConversionTasksRequest.t - type output = DescribeConversionTasksResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeCustomerGateways.ml b/libraries/ec2/lib/describeCustomerGateways.ml index 82dfdd06b..01cea0af3 100644 --- a/libraries/ec2/lib/describeCustomerGateways.ml +++ b/libraries/ec2/lib/describeCustomerGateways.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeCustomerGatewaysRequest.t - type output = DescribeCustomerGatewaysResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeCustomerGateways" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeCustomerGateways"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCustomerGatewaysRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeCustomerGatewaysRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeCustomerGatewaysResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeCustomerGatewaysResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeCustomerGatewaysResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeCustomerGatewaysResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeCustomerGatewaysResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeCustomerGateways.mli b/libraries/ec2/lib/describeCustomerGateways.mli index 47d90b42d..c607be94e 100644 --- a/libraries/ec2/lib/describeCustomerGateways.mli +++ b/libraries/ec2/lib/describeCustomerGateways.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCustomerGatewaysRequest.t - type output = DescribeCustomerGatewaysResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeDhcpOptions.ml b/libraries/ec2/lib/describeDhcpOptions.ml index f34213f86..c8c6bd715 100644 --- a/libraries/ec2/lib/describeDhcpOptions.ml +++ b/libraries/ec2/lib/describeDhcpOptions.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeDhcpOptionsRequest.t - type output = DescribeDhcpOptionsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeDhcpOptions" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeDhcpOptions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDhcpOptionsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDhcpOptionsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeDhcpOptionsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeDhcpOptionsResult.parse) + Util.or_error (Util.option_bind resp DescribeDhcpOptionsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeDhcpOptionsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeDhcpOptionsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeDhcpOptionsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeDhcpOptionsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeDhcpOptions.mli b/libraries/ec2/lib/describeDhcpOptions.mli index c5b9fd071..7d02b6b37 100644 --- a/libraries/ec2/lib/describeDhcpOptions.mli +++ b/libraries/ec2/lib/describeDhcpOptions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDhcpOptionsRequest.t - type output = DescribeDhcpOptionsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeExportTasks.ml b/libraries/ec2/lib/describeExportTasks.ml index 727383b4b..d714b50c4 100644 --- a/libraries/ec2/lib/describeExportTasks.ml +++ b/libraries/ec2/lib/describeExportTasks.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeExportTasksRequest.t - type output = DescribeExportTasksResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeExportTasks" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeExportTasks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeExportTasksRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeExportTasksRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeExportTasksResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeExportTasksResult.parse) + Util.or_error (Util.option_bind resp DescribeExportTasksResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeExportTasksResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeExportTasksResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeExportTasksResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeExportTasksResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeExportTasks.mli b/libraries/ec2/lib/describeExportTasks.mli index 020416f7b..d4d2c37d9 100644 --- a/libraries/ec2/lib/describeExportTasks.mli +++ b/libraries/ec2/lib/describeExportTasks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeExportTasksRequest.t - type output = DescribeExportTasksResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeFlowLogs.ml b/libraries/ec2/lib/describeFlowLogs.ml index 72b971686..1b6c887ef 100644 --- a/libraries/ec2/lib/describeFlowLogs.ml +++ b/libraries/ec2/lib/describeFlowLogs.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = DescribeFlowLogsRequest.t - type output = DescribeFlowLogsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeFlowLogs" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeFlowLogs"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeFlowLogsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeFlowLogsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeFlowLogsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeFlowLogsResult.parse) + Util.or_error (Util.option_bind resp DescribeFlowLogsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeFlowLogsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeFlowLogsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeFlowLogsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeFlowLogsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeFlowLogs.mli b/libraries/ec2/lib/describeFlowLogs.mli index b00dbe0c4..d53c68ead 100644 --- a/libraries/ec2/lib/describeFlowLogs.mli +++ b/libraries/ec2/lib/describeFlowLogs.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeFlowLogsRequest.t - type output = DescribeFlowLogsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImageAttribute.ml b/libraries/ec2/lib/describeImageAttribute.ml index 7c25b88eb..6ede1ae81 100644 --- a/libraries/ec2/lib/describeImageAttribute.ml +++ b/libraries/ec2/lib/describeImageAttribute.ml @@ -1,57 +1,55 @@ open Types open Aws - type input = DescribeImageAttributeRequest.t - type output = ImageAttribute.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeImageAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeImageAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeImageAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeImageAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeImageAttributeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImageAttribute.parse) + Util.or_error (Util.option_bind resp ImageAttribute.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImageAttribute." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ImageAttribute." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImageAttribute - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImageAttribute - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImageAttribute.mli b/libraries/ec2/lib/describeImageAttribute.mli index 5c287a2ef..149c51ab0 100644 --- a/libraries/ec2/lib/describeImageAttribute.mli +++ b/libraries/ec2/lib/describeImageAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeImageAttributeRequest.t - type output = ImageAttribute.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImages.ml b/libraries/ec2/lib/describeImages.ml index 97e78ff10..f0db82ba6 100644 --- a/libraries/ec2/lib/describeImages.ml +++ b/libraries/ec2/lib/describeImages.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DescribeImagesRequest.t - type output = DescribeImagesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeImages" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeImages"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeImagesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeImagesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeImagesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeImagesResult.parse) + Util.or_error (Util.option_bind resp DescribeImagesResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeImagesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeImagesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeImagesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeImagesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImages.mli b/libraries/ec2/lib/describeImages.mli index 30f6f9bad..b431f2af0 100644 --- a/libraries/ec2/lib/describeImages.mli +++ b/libraries/ec2/lib/describeImages.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeImagesRequest.t - type output = DescribeImagesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImportImageTasks.ml b/libraries/ec2/lib/describeImportImageTasks.ml index be4de6a2d..adb6bcef2 100644 --- a/libraries/ec2/lib/describeImportImageTasks.ml +++ b/libraries/ec2/lib/describeImportImageTasks.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeImportImageTasksRequest.t - type output = DescribeImportImageTasksResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeImportImageTasks" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeImportImageTasks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeImportImageTasksRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeImportImageTasksRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeImportImageTasksResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeImportImageTasksResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeImportImageTasksResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeImportImageTasksResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeImportImageTasksResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImportImageTasks.mli b/libraries/ec2/lib/describeImportImageTasks.mli index b3dc41aa3..996142028 100644 --- a/libraries/ec2/lib/describeImportImageTasks.mli +++ b/libraries/ec2/lib/describeImportImageTasks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeImportImageTasksRequest.t - type output = DescribeImportImageTasksResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImportSnapshotTasks.ml b/libraries/ec2/lib/describeImportSnapshotTasks.ml index a6efcaffb..8f13ba0a1 100644 --- a/libraries/ec2/lib/describeImportSnapshotTasks.ml +++ b/libraries/ec2/lib/describeImportSnapshotTasks.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeImportSnapshotTasksRequest.t - type output = DescribeImportSnapshotTasksResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeImportSnapshotTasks" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeImportSnapshotTasks"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeImportSnapshotTasksRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeImportSnapshotTasksRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeImportSnapshotTasksResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeImportSnapshotTasksResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeImportSnapshotTasksResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeImportSnapshotTasksResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeImportSnapshotTasksResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeImportSnapshotTasks.mli b/libraries/ec2/lib/describeImportSnapshotTasks.mli index c3da89f29..1e992408b 100644 --- a/libraries/ec2/lib/describeImportSnapshotTasks.mli +++ b/libraries/ec2/lib/describeImportSnapshotTasks.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeImportSnapshotTasksRequest.t - type output = DescribeImportSnapshotTasksResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstanceAttribute.ml b/libraries/ec2/lib/describeInstanceAttribute.ml index a389d77a7..e3ae08de8 100644 --- a/libraries/ec2/lib/describeInstanceAttribute.ml +++ b/libraries/ec2/lib/describeInstanceAttribute.ml @@ -1,58 +1,58 @@ open Types open Aws - type input = DescribeInstanceAttributeRequest.t - type output = InstanceAttribute.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeInstanceAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeInstanceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeInstanceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeInstanceAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeInstanceAttributeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp InstanceAttribute.parse) + Util.or_error (Util.option_bind resp InstanceAttribute.parse) (let open Error in - BadResponse { body; message = "Could not find well formed InstanceAttribute." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed InstanceAttribute." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing InstanceAttribute - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing InstanceAttribute - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstanceAttribute.mli b/libraries/ec2/lib/describeInstanceAttribute.mli index 94eb0265c..c07108f2d 100644 --- a/libraries/ec2/lib/describeInstanceAttribute.mli +++ b/libraries/ec2/lib/describeInstanceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeInstanceAttributeRequest.t - type output = InstanceAttribute.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstanceStatus.ml b/libraries/ec2/lib/describeInstanceStatus.ml index cf32d68eb..2917bc5ec 100644 --- a/libraries/ec2/lib/describeInstanceStatus.ml +++ b/libraries/ec2/lib/describeInstanceStatus.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeInstanceStatusRequest.t - type output = DescribeInstanceStatusResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeInstanceStatus" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeInstanceStatus"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeInstanceStatusRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeInstanceStatusRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeInstanceStatusResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeInstanceStatusResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeInstanceStatusResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeInstanceStatusResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeInstanceStatusResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstanceStatus.mli b/libraries/ec2/lib/describeInstanceStatus.mli index 54ad47e17..cf94a950a 100644 --- a/libraries/ec2/lib/describeInstanceStatus.mli +++ b/libraries/ec2/lib/describeInstanceStatus.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeInstanceStatusRequest.t - type output = DescribeInstanceStatusResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstances.ml b/libraries/ec2/lib/describeInstances.ml index 96a3ff2ab..f5afdecf4 100644 --- a/libraries/ec2/lib/describeInstances.ml +++ b/libraries/ec2/lib/describeInstances.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = DescribeInstancesRequest.t - type output = DescribeInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeInstancesResult.parse) + Util.or_error (Util.option_bind resp DescribeInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInstances.mli b/libraries/ec2/lib/describeInstances.mli index 88cb7a105..8a63eb05e 100644 --- a/libraries/ec2/lib/describeInstances.mli +++ b/libraries/ec2/lib/describeInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeInstancesRequest.t - type output = DescribeInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInternetGateways.ml b/libraries/ec2/lib/describeInternetGateways.ml index 95317d64d..ce4a5edd3 100644 --- a/libraries/ec2/lib/describeInternetGateways.ml +++ b/libraries/ec2/lib/describeInternetGateways.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeInternetGatewaysRequest.t - type output = DescribeInternetGatewaysResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeInternetGateways" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeInternetGateways"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeInternetGatewaysRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeInternetGatewaysRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeInternetGatewaysResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeInternetGatewaysResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeInternetGatewaysResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeInternetGatewaysResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeInternetGatewaysResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeInternetGateways.mli b/libraries/ec2/lib/describeInternetGateways.mli index aae648d9b..fdd9e715a 100644 --- a/libraries/ec2/lib/describeInternetGateways.mli +++ b/libraries/ec2/lib/describeInternetGateways.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeInternetGatewaysRequest.t - type output = DescribeInternetGatewaysResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeKeyPairs.ml b/libraries/ec2/lib/describeKeyPairs.ml index 417338c2b..0b7f43604 100644 --- a/libraries/ec2/lib/describeKeyPairs.ml +++ b/libraries/ec2/lib/describeKeyPairs.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = DescribeKeyPairsRequest.t - type output = DescribeKeyPairsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeKeyPairs" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeKeyPairs"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeKeyPairsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeKeyPairsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeKeyPairsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeKeyPairsResult.parse) + Util.or_error (Util.option_bind resp DescribeKeyPairsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeKeyPairsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeKeyPairsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeKeyPairsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeKeyPairsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeKeyPairs.mli b/libraries/ec2/lib/describeKeyPairs.mli index 61f9ca099..eb4d75834 100644 --- a/libraries/ec2/lib/describeKeyPairs.mli +++ b/libraries/ec2/lib/describeKeyPairs.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeKeyPairsRequest.t - type output = DescribeKeyPairsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeMovingAddresses.ml b/libraries/ec2/lib/describeMovingAddresses.ml index 84a83488f..d3dda9749 100644 --- a/libraries/ec2/lib/describeMovingAddresses.ml +++ b/libraries/ec2/lib/describeMovingAddresses.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeMovingAddressesRequest.t - type output = DescribeMovingAddressesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeMovingAddresses" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeMovingAddresses"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeMovingAddressesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeMovingAddressesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeMovingAddressesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeMovingAddressesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeMovingAddressesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeMovingAddressesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeMovingAddressesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeMovingAddresses.mli b/libraries/ec2/lib/describeMovingAddresses.mli index 516c5ca1b..15351c682 100644 --- a/libraries/ec2/lib/describeMovingAddresses.mli +++ b/libraries/ec2/lib/describeMovingAddresses.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeMovingAddressesRequest.t - type output = DescribeMovingAddressesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkAcls.ml b/libraries/ec2/lib/describeNetworkAcls.ml index ab6994625..f8205811b 100644 --- a/libraries/ec2/lib/describeNetworkAcls.ml +++ b/libraries/ec2/lib/describeNetworkAcls.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeNetworkAclsRequest.t - type output = DescribeNetworkAclsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeNetworkAcls" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeNetworkAcls"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeNetworkAclsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeNetworkAclsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeNetworkAclsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeNetworkAclsResult.parse) + Util.or_error (Util.option_bind resp DescribeNetworkAclsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeNetworkAclsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeNetworkAclsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeNetworkAclsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeNetworkAclsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkAcls.mli b/libraries/ec2/lib/describeNetworkAcls.mli index f87e4bf15..cc186ef0b 100644 --- a/libraries/ec2/lib/describeNetworkAcls.mli +++ b/libraries/ec2/lib/describeNetworkAcls.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeNetworkAclsRequest.t - type output = DescribeNetworkAclsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml b/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml index 35969fc8a..297616794 100644 --- a/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml @@ -1,65 +1,62 @@ open Types open Aws - type input = DescribeNetworkInterfaceAttributeRequest.t - type output = DescribeNetworkInterfaceAttributeResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ] - ; "Action", [ "DescribeNetworkInterfaceAttribute" ] - ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeNetworkInterfaceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeNetworkInterfaceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeNetworkInterfaceAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "DescribeNetworkInterfaceAttributeResponse" (snd xml) in + let resp = + Xml.member "DescribeNetworkInterfaceAttributeResponse" (snd xml) in try Util.or_error (Util.option_bind resp DescribeNetworkInterfaceAttributeResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeNetworkInterfaceAttributeResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeNetworkInterfaceAttributeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeNetworkInterfaceAttributeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeNetworkInterfaceAttributeResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkInterfaceAttribute.mli b/libraries/ec2/lib/describeNetworkInterfaceAttribute.mli index 47fe221e5..767191a3f 100644 --- a/libraries/ec2/lib/describeNetworkInterfaceAttribute.mli +++ b/libraries/ec2/lib/describeNetworkInterfaceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeNetworkInterfaceAttributeRequest.t - type output = DescribeNetworkInterfaceAttributeResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkInterfaces.ml b/libraries/ec2/lib/describeNetworkInterfaces.ml index f4af1fea2..3033c3c6a 100644 --- a/libraries/ec2/lib/describeNetworkInterfaces.ml +++ b/libraries/ec2/lib/describeNetworkInterfaces.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeNetworkInterfacesRequest.t - type output = DescribeNetworkInterfacesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeNetworkInterfaces" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeNetworkInterfaces"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeNetworkInterfacesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeNetworkInterfacesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeNetworkInterfacesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeNetworkInterfacesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeNetworkInterfacesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeNetworkInterfacesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeNetworkInterfacesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeNetworkInterfaces.mli b/libraries/ec2/lib/describeNetworkInterfaces.mli index 10a79fbce..4cc84be9c 100644 --- a/libraries/ec2/lib/describeNetworkInterfaces.mli +++ b/libraries/ec2/lib/describeNetworkInterfaces.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeNetworkInterfacesRequest.t - type output = DescribeNetworkInterfacesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describePlacementGroups.ml b/libraries/ec2/lib/describePlacementGroups.ml index 040814621..ded15ab1d 100644 --- a/libraries/ec2/lib/describePlacementGroups.ml +++ b/libraries/ec2/lib/describePlacementGroups.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribePlacementGroupsRequest.t - type output = DescribePlacementGroupsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribePlacementGroups" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribePlacementGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribePlacementGroupsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribePlacementGroupsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribePlacementGroupsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribePlacementGroupsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribePlacementGroupsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribePlacementGroupsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribePlacementGroupsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describePlacementGroups.mli b/libraries/ec2/lib/describePlacementGroups.mli index f0bec7f2d..64cd5d5a1 100644 --- a/libraries/ec2/lib/describePlacementGroups.mli +++ b/libraries/ec2/lib/describePlacementGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribePlacementGroupsRequest.t - type output = DescribePlacementGroupsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describePrefixLists.ml b/libraries/ec2/lib/describePrefixLists.ml index 12209dc3f..bc42ed158 100644 --- a/libraries/ec2/lib/describePrefixLists.ml +++ b/libraries/ec2/lib/describePrefixLists.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribePrefixListsRequest.t - type output = DescribePrefixListsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribePrefixLists" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribePrefixLists"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribePrefixListsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribePrefixListsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribePrefixListsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribePrefixListsResult.parse) + Util.or_error (Util.option_bind resp DescribePrefixListsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribePrefixListsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribePrefixListsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribePrefixListsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribePrefixListsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describePrefixLists.mli b/libraries/ec2/lib/describePrefixLists.mli index d259d6ebd..0db73f436 100644 --- a/libraries/ec2/lib/describePrefixLists.mli +++ b/libraries/ec2/lib/describePrefixLists.mli @@ -1,10 +1,7 @@ open Types - type input = DescribePrefixListsRequest.t - type output = DescribePrefixListsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeRegions.ml b/libraries/ec2/lib/describeRegions.ml index dd6ef1706..7c85f870b 100644 --- a/libraries/ec2/lib/describeRegions.ml +++ b/libraries/ec2/lib/describeRegions.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = DescribeRegionsRequest.t - type output = DescribeRegionsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeRegions" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeRegions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeRegionsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeRegionsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeRegionsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeRegionsResult.parse) + Util.or_error (Util.option_bind resp DescribeRegionsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeRegionsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeRegionsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeRegionsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeRegionsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeRegions.mli b/libraries/ec2/lib/describeRegions.mli index 9906ee0f5..f58adc260 100644 --- a/libraries/ec2/lib/describeRegions.mli +++ b/libraries/ec2/lib/describeRegions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeRegionsRequest.t - type output = DescribeRegionsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstances.ml b/libraries/ec2/lib/describeReservedInstances.ml index 9f140b258..16052843b 100644 --- a/libraries/ec2/lib/describeReservedInstances.ml +++ b/libraries/ec2/lib/describeReservedInstances.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeReservedInstancesRequest.t - type output = DescribeReservedInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeReservedInstances" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeReservedInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeReservedInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeReservedInstancesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeReservedInstancesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeReservedInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeReservedInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeReservedInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstances.mli b/libraries/ec2/lib/describeReservedInstances.mli index f373a4657..71c4e599d 100644 --- a/libraries/ec2/lib/describeReservedInstances.mli +++ b/libraries/ec2/lib/describeReservedInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedInstancesRequest.t - type output = DescribeReservedInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesListings.ml b/libraries/ec2/lib/describeReservedInstancesListings.ml index 9309ba801..86326511d 100644 --- a/libraries/ec2/lib/describeReservedInstancesListings.ml +++ b/libraries/ec2/lib/describeReservedInstancesListings.ml @@ -1,65 +1,62 @@ open Types open Aws - type input = DescribeReservedInstancesListingsRequest.t - type output = DescribeReservedInstancesListingsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ] - ; "Action", [ "DescribeReservedInstancesListings" ] - ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeReservedInstancesListings"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedInstancesListingsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedInstancesListingsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "DescribeReservedInstancesListingsResponse" (snd xml) in + let resp = + Xml.member "DescribeReservedInstancesListingsResponse" (snd xml) in try Util.or_error (Util.option_bind resp DescribeReservedInstancesListingsResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeReservedInstancesListingsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeReservedInstancesListingsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeReservedInstancesListingsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeReservedInstancesListingsResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesListings.mli b/libraries/ec2/lib/describeReservedInstancesListings.mli index b89b1d445..bf3ad9da8 100644 --- a/libraries/ec2/lib/describeReservedInstancesListings.mli +++ b/libraries/ec2/lib/describeReservedInstancesListings.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedInstancesListingsRequest.t - type output = DescribeReservedInstancesListingsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesModifications.ml b/libraries/ec2/lib/describeReservedInstancesModifications.ml index b15b1fbc8..f97c85419 100644 --- a/libraries/ec2/lib/describeReservedInstancesModifications.ml +++ b/libraries/ec2/lib/describeReservedInstancesModifications.ml @@ -1,65 +1,63 @@ open Types open Aws - type input = DescribeReservedInstancesModificationsRequest.t - type output = DescribeReservedInstancesModificationsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ] - ; "Action", [ "DescribeReservedInstancesModifications" ] - ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeReservedInstancesModifications"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedInstancesModificationsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedInstancesModificationsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "DescribeReservedInstancesModificationsResponse" (snd xml) in + let resp = + Xml.member "DescribeReservedInstancesModificationsResponse" (snd xml) in try Util.or_error - (Util.option_bind resp DescribeReservedInstancesModificationsResult.parse) + (Util.option_bind resp + DescribeReservedInstancesModificationsResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeReservedInstancesModificationsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeReservedInstancesModificationsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeReservedInstancesModificationsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeReservedInstancesModificationsResult - missing \ - field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesModifications.mli b/libraries/ec2/lib/describeReservedInstancesModifications.mli index 7e1e7d9d0..b9bc50f7d 100644 --- a/libraries/ec2/lib/describeReservedInstancesModifications.mli +++ b/libraries/ec2/lib/describeReservedInstancesModifications.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedInstancesModificationsRequest.t - type output = DescribeReservedInstancesModificationsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesOfferings.ml b/libraries/ec2/lib/describeReservedInstancesOfferings.ml index f1931dd61..28778e806 100644 --- a/libraries/ec2/lib/describeReservedInstancesOfferings.ml +++ b/libraries/ec2/lib/describeReservedInstancesOfferings.ml @@ -1,65 +1,62 @@ open Types open Aws - type input = DescribeReservedInstancesOfferingsRequest.t - type output = DescribeReservedInstancesOfferingsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ] - ; "Action", [ "DescribeReservedInstancesOfferings" ] - ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeReservedInstancesOfferings"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedInstancesOfferingsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedInstancesOfferingsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "DescribeReservedInstancesOfferingsResponse" (snd xml) in + let resp = + Xml.member "DescribeReservedInstancesOfferingsResponse" (snd xml) in try Util.or_error (Util.option_bind resp DescribeReservedInstancesOfferingsResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeReservedInstancesOfferingsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeReservedInstancesOfferingsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeReservedInstancesOfferingsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeReservedInstancesOfferingsResult - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeReservedInstancesOfferings.mli b/libraries/ec2/lib/describeReservedInstancesOfferings.mli index d0674ae7e..3f6013705 100644 --- a/libraries/ec2/lib/describeReservedInstancesOfferings.mli +++ b/libraries/ec2/lib/describeReservedInstancesOfferings.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedInstancesOfferingsRequest.t - type output = DescribeReservedInstancesOfferingsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeRouteTables.ml b/libraries/ec2/lib/describeRouteTables.ml index 0026b6091..4715ebca2 100644 --- a/libraries/ec2/lib/describeRouteTables.ml +++ b/libraries/ec2/lib/describeRouteTables.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeRouteTablesRequest.t - type output = DescribeRouteTablesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeRouteTables" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeRouteTables"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeRouteTablesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeRouteTablesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeRouteTablesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeRouteTablesResult.parse) + Util.or_error (Util.option_bind resp DescribeRouteTablesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeRouteTablesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeRouteTablesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeRouteTablesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeRouteTablesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeRouteTables.mli b/libraries/ec2/lib/describeRouteTables.mli index 365d93e41..53aca4ef0 100644 --- a/libraries/ec2/lib/describeRouteTables.mli +++ b/libraries/ec2/lib/describeRouteTables.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeRouteTablesRequest.t - type output = DescribeRouteTablesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSecurityGroups.ml b/libraries/ec2/lib/describeSecurityGroups.ml index 3c0f1a84e..72ee8d445 100644 --- a/libraries/ec2/lib/describeSecurityGroups.ml +++ b/libraries/ec2/lib/describeSecurityGroups.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeSecurityGroupsRequest.t - type output = DescribeSecurityGroupsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSecurityGroups" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSecurityGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSecurityGroupsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeSecurityGroupsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSecurityGroupsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeSecurityGroupsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSecurityGroupsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSecurityGroupsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSecurityGroupsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSecurityGroups.mli b/libraries/ec2/lib/describeSecurityGroups.mli index 349d4c1b6..e9f028c7c 100644 --- a/libraries/ec2/lib/describeSecurityGroups.mli +++ b/libraries/ec2/lib/describeSecurityGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSecurityGroupsRequest.t - type output = DescribeSecurityGroupsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSnapshotAttribute.ml b/libraries/ec2/lib/describeSnapshotAttribute.ml index 660e6b052..c16e881b1 100644 --- a/libraries/ec2/lib/describeSnapshotAttribute.ml +++ b/libraries/ec2/lib/describeSnapshotAttribute.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeSnapshotAttributeRequest.t - type output = DescribeSnapshotAttributeResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSnapshotAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSnapshotAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSnapshotAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeSnapshotAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSnapshotAttributeResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSnapshotAttributeResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSnapshotAttributeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSnapshotAttributeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSnapshotAttributeResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSnapshotAttribute.mli b/libraries/ec2/lib/describeSnapshotAttribute.mli index efd65beb3..e357b61f2 100644 --- a/libraries/ec2/lib/describeSnapshotAttribute.mli +++ b/libraries/ec2/lib/describeSnapshotAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSnapshotAttributeRequest.t - type output = DescribeSnapshotAttributeResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSnapshots.ml b/libraries/ec2/lib/describeSnapshots.ml index 4afa457ac..f3242ea37 100644 --- a/libraries/ec2/lib/describeSnapshots.ml +++ b/libraries/ec2/lib/describeSnapshots.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = DescribeSnapshotsRequest.t - type output = DescribeSnapshotsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSnapshots" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeSnapshots"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeSnapshotsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeSnapshotsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeSnapshotsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeSnapshotsResult.parse) + Util.or_error (Util.option_bind resp DescribeSnapshotsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeSnapshotsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSnapshotsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSnapshotsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSnapshotsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSnapshots.mli b/libraries/ec2/lib/describeSnapshots.mli index 6348e2a30..e925c47f1 100644 --- a/libraries/ec2/lib/describeSnapshots.mli +++ b/libraries/ec2/lib/describeSnapshots.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSnapshotsRequest.t - type output = DescribeSnapshotsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotDatafeedSubscription.ml b/libraries/ec2/lib/describeSpotDatafeedSubscription.ml index 38bccf26b..39da7fb56 100644 --- a/libraries/ec2/lib/describeSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/describeSpotDatafeedSubscription.ml @@ -1,62 +1,62 @@ open Types open Aws - type input = DescribeSpotDatafeedSubscriptionRequest.t - type output = DescribeSpotDatafeedSubscriptionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotDatafeedSubscription" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotDatafeedSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotDatafeedSubscriptionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeSpotDatafeedSubscriptionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "DescribeSpotDatafeedSubscriptionResponse" (snd xml) in + let resp = + Xml.member "DescribeSpotDatafeedSubscriptionResponse" (snd xml) in try Util.or_error (Util.option_bind resp DescribeSpotDatafeedSubscriptionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSpotDatafeedSubscriptionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotDatafeedSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotDatafeedSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotDatafeedSubscriptionResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotDatafeedSubscription.mli b/libraries/ec2/lib/describeSpotDatafeedSubscription.mli index e0d9738d8..97b016e81 100644 --- a/libraries/ec2/lib/describeSpotDatafeedSubscription.mli +++ b/libraries/ec2/lib/describeSpotDatafeedSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotDatafeedSubscriptionRequest.t - type output = DescribeSpotDatafeedSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetInstances.ml b/libraries/ec2/lib/describeSpotFleetInstances.ml index adc9284cc..855d7ecee 100644 --- a/libraries/ec2/lib/describeSpotFleetInstances.ml +++ b/libraries/ec2/lib/describeSpotFleetInstances.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeSpotFleetInstancesRequest.t - type output = DescribeSpotFleetInstancesResponse.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotFleetInstances" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotFleetInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotFleetInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeSpotFleetInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSpotFleetInstancesResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSpotFleetInstancesResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotFleetInstancesResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotFleetInstancesResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotFleetInstancesResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetInstances.mli b/libraries/ec2/lib/describeSpotFleetInstances.mli index c163cbfba..fc0d32b89 100644 --- a/libraries/ec2/lib/describeSpotFleetInstances.mli +++ b/libraries/ec2/lib/describeSpotFleetInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotFleetInstancesRequest.t - type output = DescribeSpotFleetInstancesResponse.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetRequestHistory.ml b/libraries/ec2/lib/describeSpotFleetRequestHistory.ml index 72cc4edec..6e88c4f40 100644 --- a/libraries/ec2/lib/describeSpotFleetRequestHistory.ml +++ b/libraries/ec2/lib/describeSpotFleetRequestHistory.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeSpotFleetRequestHistoryRequest.t - type output = DescribeSpotFleetRequestHistoryResponse.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotFleetRequestHistory" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotFleetRequestHistory"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotFleetRequestHistoryRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeSpotFleetRequestHistoryRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,35 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSpotFleetRequestHistoryResponse.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeSpotFleetRequestHistoryResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotFleetRequestHistoryResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotFleetRequestHistoryResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotFleetRequestHistoryResponse - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetRequestHistory.mli b/libraries/ec2/lib/describeSpotFleetRequestHistory.mli index 9ba4f473e..29fa434cf 100644 --- a/libraries/ec2/lib/describeSpotFleetRequestHistory.mli +++ b/libraries/ec2/lib/describeSpotFleetRequestHistory.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotFleetRequestHistoryRequest.t - type output = DescribeSpotFleetRequestHistoryResponse.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetRequests.ml b/libraries/ec2/lib/describeSpotFleetRequests.ml index 8027ab32a..c74020a4f 100644 --- a/libraries/ec2/lib/describeSpotFleetRequests.ml +++ b/libraries/ec2/lib/describeSpotFleetRequests.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeSpotFleetRequestsRequest.t - type output = DescribeSpotFleetRequestsResponse.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotFleetRequests" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotFleetRequests"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotFleetRequestsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeSpotFleetRequestsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSpotFleetRequestsResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSpotFleetRequestsResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotFleetRequestsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotFleetRequestsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotFleetRequestsResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotFleetRequests.mli b/libraries/ec2/lib/describeSpotFleetRequests.mli index bb6ccdd69..5a42de334 100644 --- a/libraries/ec2/lib/describeSpotFleetRequests.mli +++ b/libraries/ec2/lib/describeSpotFleetRequests.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotFleetRequestsRequest.t - type output = DescribeSpotFleetRequestsResponse.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotInstanceRequests.ml b/libraries/ec2/lib/describeSpotInstanceRequests.ml index 3a990aed1..155c5570e 100644 --- a/libraries/ec2/lib/describeSpotInstanceRequests.ml +++ b/libraries/ec2/lib/describeSpotInstanceRequests.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeSpotInstanceRequestsRequest.t - type output = DescribeSpotInstanceRequestsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotInstanceRequests" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotInstanceRequests"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotInstanceRequestsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeSpotInstanceRequestsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSpotInstanceRequestsResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSpotInstanceRequestsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotInstanceRequestsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotInstanceRequestsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotInstanceRequestsResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotInstanceRequests.mli b/libraries/ec2/lib/describeSpotInstanceRequests.mli index 91221f0b4..8ef6d5946 100644 --- a/libraries/ec2/lib/describeSpotInstanceRequests.mli +++ b/libraries/ec2/lib/describeSpotInstanceRequests.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotInstanceRequestsRequest.t - type output = DescribeSpotInstanceRequestsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotPriceHistory.ml b/libraries/ec2/lib/describeSpotPriceHistory.ml index 5919a345d..d149e737a 100644 --- a/libraries/ec2/lib/describeSpotPriceHistory.ml +++ b/libraries/ec2/lib/describeSpotPriceHistory.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeSpotPriceHistoryRequest.t - type output = DescribeSpotPriceHistoryResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSpotPriceHistory" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeSpotPriceHistory"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSpotPriceHistoryRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeSpotPriceHistoryRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSpotPriceHistoryResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeSpotPriceHistoryResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSpotPriceHistoryResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSpotPriceHistoryResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSpotPriceHistoryResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSpotPriceHistory.mli b/libraries/ec2/lib/describeSpotPriceHistory.mli index 6c04eaa55..0114fb004 100644 --- a/libraries/ec2/lib/describeSpotPriceHistory.mli +++ b/libraries/ec2/lib/describeSpotPriceHistory.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSpotPriceHistoryRequest.t - type output = DescribeSpotPriceHistoryResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSubnets.ml b/libraries/ec2/lib/describeSubnets.ml index 9ba7f6be7..6ce879499 100644 --- a/libraries/ec2/lib/describeSubnets.ml +++ b/libraries/ec2/lib/describeSubnets.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = DescribeSubnetsRequest.t - type output = DescribeSubnetsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeSubnets" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeSubnets"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeSubnetsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeSubnetsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeSubnetsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeSubnetsResult.parse) + Util.or_error (Util.option_bind resp DescribeSubnetsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeSubnetsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeSubnetsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSubnetsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSubnetsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeSubnets.mli b/libraries/ec2/lib/describeSubnets.mli index 558d634a4..e64f7aa94 100644 --- a/libraries/ec2/lib/describeSubnets.mli +++ b/libraries/ec2/lib/describeSubnets.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSubnetsRequest.t - type output = DescribeSubnetsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeTags.ml b/libraries/ec2/lib/describeTags.ml index d78a3ae3e..7496c40cb 100644 --- a/libraries/ec2/lib/describeTags.ml +++ b/libraries/ec2/lib/describeTags.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DescribeTagsRequest.t - type output = DescribeTagsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeTags" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeTagsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeTagsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeTagsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeTagsResult.parse) + Util.or_error (Util.option_bind resp DescribeTagsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeTagsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeTagsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeTagsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeTagsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeTags.mli b/libraries/ec2/lib/describeTags.mli index 68d6ab61f..a89aa7a0e 100644 --- a/libraries/ec2/lib/describeTags.mli +++ b/libraries/ec2/lib/describeTags.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeTagsRequest.t - type output = DescribeTagsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumeAttribute.ml b/libraries/ec2/lib/describeVolumeAttribute.ml index 1fdf6f94c..fbca3162d 100644 --- a/libraries/ec2/lib/describeVolumeAttribute.ml +++ b/libraries/ec2/lib/describeVolumeAttribute.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeVolumeAttributeRequest.t - type output = DescribeVolumeAttributeResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVolumeAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeVolumeAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVolumeAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVolumeAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeVolumeAttributeResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVolumeAttributeResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVolumeAttributeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVolumeAttributeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVolumeAttributeResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumeAttribute.mli b/libraries/ec2/lib/describeVolumeAttribute.mli index 913bc544c..3ea3f9cd9 100644 --- a/libraries/ec2/lib/describeVolumeAttribute.mli +++ b/libraries/ec2/lib/describeVolumeAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVolumeAttributeRequest.t - type output = DescribeVolumeAttributeResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumeStatus.ml b/libraries/ec2/lib/describeVolumeStatus.ml index c6207e64c..9735c9160 100644 --- a/libraries/ec2/lib/describeVolumeStatus.ml +++ b/libraries/ec2/lib/describeVolumeStatus.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeVolumeStatusRequest.t - type output = DescribeVolumeStatusResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVolumeStatus" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVolumeStatus"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVolumeStatusRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVolumeStatusRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVolumeStatusResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVolumeStatusResult.parse) + Util.or_error (Util.option_bind resp DescribeVolumeStatusResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVolumeStatusResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVolumeStatusResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVolumeStatusResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVolumeStatusResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumeStatus.mli b/libraries/ec2/lib/describeVolumeStatus.mli index 6dc356734..c52d5236f 100644 --- a/libraries/ec2/lib/describeVolumeStatus.mli +++ b/libraries/ec2/lib/describeVolumeStatus.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVolumeStatusRequest.t - type output = DescribeVolumeStatusResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumes.ml b/libraries/ec2/lib/describeVolumes.ml index d4338b23e..4a9cf3639 100644 --- a/libraries/ec2/lib/describeVolumes.ml +++ b/libraries/ec2/lib/describeVolumes.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = DescribeVolumesRequest.t - type output = DescribeVolumesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVolumes" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVolumes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeVolumesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeVolumesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVolumesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVolumesResult.parse) + Util.or_error (Util.option_bind resp DescribeVolumesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVolumesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeVolumesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVolumesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVolumesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVolumes.mli b/libraries/ec2/lib/describeVolumes.mli index fb5b1098e..94dc92775 100644 --- a/libraries/ec2/lib/describeVolumes.mli +++ b/libraries/ec2/lib/describeVolumes.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVolumesRequest.t - type output = DescribeVolumesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcAttribute.ml b/libraries/ec2/lib/describeVpcAttribute.ml index 85f80dd9c..527121b55 100644 --- a/libraries/ec2/lib/describeVpcAttribute.ml +++ b/libraries/ec2/lib/describeVpcAttribute.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeVpcAttributeRequest.t - type output = DescribeVpcAttributeResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpcAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVpcAttributeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVpcAttributeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVpcAttributeResult.parse) + Util.or_error (Util.option_bind resp DescribeVpcAttributeResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVpcAttributeResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpcAttributeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcAttributeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcAttributeResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcAttribute.mli b/libraries/ec2/lib/describeVpcAttribute.mli index 9ef10b1e2..8346dfcc2 100644 --- a/libraries/ec2/lib/describeVpcAttribute.mli +++ b/libraries/ec2/lib/describeVpcAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcAttributeRequest.t - type output = DescribeVpcAttributeResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcClassicLink.ml b/libraries/ec2/lib/describeVpcClassicLink.ml index 0663ea9a9..b679e986f 100644 --- a/libraries/ec2/lib/describeVpcClassicLink.ml +++ b/libraries/ec2/lib/describeVpcClassicLink.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeVpcClassicLinkRequest.t - type output = DescribeVpcClassicLinkResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcClassicLink" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeVpcClassicLink"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpcClassicLinkRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVpcClassicLinkRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeVpcClassicLinkResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVpcClassicLinkResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpcClassicLinkResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcClassicLinkResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcClassicLinkResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcClassicLink.mli b/libraries/ec2/lib/describeVpcClassicLink.mli index b23449d21..d3ae309b9 100644 --- a/libraries/ec2/lib/describeVpcClassicLink.mli +++ b/libraries/ec2/lib/describeVpcClassicLink.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcClassicLinkRequest.t - type output = DescribeVpcClassicLinkResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcEndpointServices.ml b/libraries/ec2/lib/describeVpcEndpointServices.ml index d0ceb21d3..e11bcd693 100644 --- a/libraries/ec2/lib/describeVpcEndpointServices.ml +++ b/libraries/ec2/lib/describeVpcEndpointServices.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeVpcEndpointServicesRequest.t - type output = DescribeVpcEndpointServicesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcEndpointServices" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeVpcEndpointServices"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpcEndpointServicesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeVpcEndpointServicesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeVpcEndpointServicesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeVpcEndpointServicesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpcEndpointServicesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcEndpointServicesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcEndpointServicesResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcEndpointServices.mli b/libraries/ec2/lib/describeVpcEndpointServices.mli index 570ecafb1..01b47112c 100644 --- a/libraries/ec2/lib/describeVpcEndpointServices.mli +++ b/libraries/ec2/lib/describeVpcEndpointServices.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcEndpointServicesRequest.t - type output = DescribeVpcEndpointServicesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcEndpoints.ml b/libraries/ec2/lib/describeVpcEndpoints.ml index 4a9daa936..0a51355e3 100644 --- a/libraries/ec2/lib/describeVpcEndpoints.ml +++ b/libraries/ec2/lib/describeVpcEndpoints.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeVpcEndpointsRequest.t - type output = DescribeVpcEndpointsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcEndpoints" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcEndpoints"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpcEndpointsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVpcEndpointsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVpcEndpointsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVpcEndpointsResult.parse) + Util.or_error (Util.option_bind resp DescribeVpcEndpointsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVpcEndpointsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpcEndpointsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcEndpointsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcEndpointsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcEndpoints.mli b/libraries/ec2/lib/describeVpcEndpoints.mli index 146618dc2..c503e9d3c 100644 --- a/libraries/ec2/lib/describeVpcEndpoints.mli +++ b/libraries/ec2/lib/describeVpcEndpoints.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcEndpointsRequest.t - type output = DescribeVpcEndpointsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcPeeringConnections.ml b/libraries/ec2/lib/describeVpcPeeringConnections.ml index e3a0c17d2..f55664591 100644 --- a/libraries/ec2/lib/describeVpcPeeringConnections.ml +++ b/libraries/ec2/lib/describeVpcPeeringConnections.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeVpcPeeringConnectionsRequest.t - type output = DescribeVpcPeeringConnectionsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcPeeringConnections" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeVpcPeeringConnections"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpcPeeringConnectionsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeVpcPeeringConnectionsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeVpcPeeringConnectionsResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeVpcPeeringConnectionsResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpcPeeringConnectionsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcPeeringConnectionsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcPeeringConnectionsResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcPeeringConnections.mli b/libraries/ec2/lib/describeVpcPeeringConnections.mli index 2a49968c9..789cf2506 100644 --- a/libraries/ec2/lib/describeVpcPeeringConnections.mli +++ b/libraries/ec2/lib/describeVpcPeeringConnections.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcPeeringConnectionsRequest.t - type output = DescribeVpcPeeringConnectionsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcs.ml b/libraries/ec2/lib/describeVpcs.ml index c449de468..f1d5f4b6f 100644 --- a/libraries/ec2/lib/describeVpcs.ml +++ b/libraries/ec2/lib/describeVpcs.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DescribeVpcsRequest.t - type output = DescribeVpcsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpcs" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcs"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeVpcsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeVpcsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVpcsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVpcsResult.parse) + Util.or_error (Util.option_bind resp DescribeVpcsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeVpcsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeVpcsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpcsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpcsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpcs.mli b/libraries/ec2/lib/describeVpcs.mli index 63aa34725..714d73db1 100644 --- a/libraries/ec2/lib/describeVpcs.mli +++ b/libraries/ec2/lib/describeVpcs.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpcsRequest.t - type output = DescribeVpcsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpnConnections.ml b/libraries/ec2/lib/describeVpnConnections.ml index 8e9cece6d..54790dee3 100644 --- a/libraries/ec2/lib/describeVpnConnections.ml +++ b/libraries/ec2/lib/describeVpnConnections.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = DescribeVpnConnectionsRequest.t - type output = DescribeVpnConnectionsResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpnConnections" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DescribeVpnConnections"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpnConnectionsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVpnConnectionsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeVpnConnectionsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVpnConnectionsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpnConnectionsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpnConnectionsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpnConnectionsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpnConnections.mli b/libraries/ec2/lib/describeVpnConnections.mli index 0fd38d392..adb15f3bd 100644 --- a/libraries/ec2/lib/describeVpnConnections.mli +++ b/libraries/ec2/lib/describeVpnConnections.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpnConnectionsRequest.t - type output = DescribeVpnConnectionsResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpnGateways.ml b/libraries/ec2/lib/describeVpnGateways.ml index 0e8d3f461..2d4e99941 100644 --- a/libraries/ec2/lib/describeVpnGateways.ml +++ b/libraries/ec2/lib/describeVpnGateways.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DescribeVpnGatewaysRequest.t - type output = DescribeVpnGatewaysResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DescribeVpnGateways" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DescribeVpnGateways"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeVpnGatewaysRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeVpnGatewaysRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeVpnGatewaysResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeVpnGatewaysResult.parse) + Util.or_error (Util.option_bind resp DescribeVpnGatewaysResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeVpnGatewaysResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeVpnGatewaysResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeVpnGatewaysResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeVpnGatewaysResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/describeVpnGateways.mli b/libraries/ec2/lib/describeVpnGateways.mli index 0249d8d7f..e57ba0d91 100644 --- a/libraries/ec2/lib/describeVpnGateways.mli +++ b/libraries/ec2/lib/describeVpnGateways.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeVpnGatewaysRequest.t - type output = DescribeVpnGatewaysResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachClassicLinkVpc.ml b/libraries/ec2/lib/detachClassicLinkVpc.ml index 5bcf8b305..daf6bef34 100644 --- a/libraries/ec2/lib/detachClassicLinkVpc.ml +++ b/libraries/ec2/lib/detachClassicLinkVpc.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DetachClassicLinkVpcRequest.t - type output = DetachClassicLinkVpcResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DetachClassicLinkVpc" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DetachClassicLinkVpc"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DetachClassicLinkVpcRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DetachClassicLinkVpcRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DetachClassicLinkVpcResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DetachClassicLinkVpcResult.parse) + Util.or_error (Util.option_bind resp DetachClassicLinkVpcResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DetachClassicLinkVpcResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DetachClassicLinkVpcResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DetachClassicLinkVpcResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DetachClassicLinkVpcResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachClassicLinkVpc.mli b/libraries/ec2/lib/detachClassicLinkVpc.mli index 1ed38222a..ba6276a91 100644 --- a/libraries/ec2/lib/detachClassicLinkVpc.mli +++ b/libraries/ec2/lib/detachClassicLinkVpc.mli @@ -1,10 +1,7 @@ open Types - type input = DetachClassicLinkVpcRequest.t - type output = DetachClassicLinkVpcResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachInternetGateway.ml b/libraries/ec2/lib/detachInternetGateway.ml index 394056b40..94f75f704 100644 --- a/libraries/ec2/lib/detachInternetGateway.ml +++ b/libraries/ec2/lib/detachInternetGateway.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DetachInternetGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DetachInternetGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DetachInternetGateway"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DetachInternetGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DetachInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachInternetGateway.mli b/libraries/ec2/lib/detachInternetGateway.mli index a58a197b9..2974f7008 100644 --- a/libraries/ec2/lib/detachInternetGateway.mli +++ b/libraries/ec2/lib/detachInternetGateway.mli @@ -1,10 +1,7 @@ open Types - type input = DetachInternetGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachNetworkInterface.ml b/libraries/ec2/lib/detachNetworkInterface.ml index 575608695..17c5fd155 100644 --- a/libraries/ec2/lib/detachNetworkInterface.ml +++ b/libraries/ec2/lib/detachNetworkInterface.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DetachNetworkInterfaceRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DetachNetworkInterface" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DetachNetworkInterface"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DetachNetworkInterfaceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DetachNetworkInterfaceRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachNetworkInterface.mli b/libraries/ec2/lib/detachNetworkInterface.mli index 27ed9fc0a..108b97bad 100644 --- a/libraries/ec2/lib/detachNetworkInterface.mli +++ b/libraries/ec2/lib/detachNetworkInterface.mli @@ -1,10 +1,7 @@ open Types - type input = DetachNetworkInterfaceRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachVolume.ml b/libraries/ec2/lib/detachVolume.ml index 00368a920..5eeba994a 100644 --- a/libraries/ec2/lib/detachVolume.ml +++ b/libraries/ec2/lib/detachVolume.ml @@ -1,57 +1,55 @@ open Types open Aws - type input = DetachVolumeRequest.t - type output = VolumeAttachment.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DetachVolume" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DetachVolume"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DetachVolumeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DetachVolumeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DetachVolumeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp VolumeAttachment.parse) + Util.or_error (Util.option_bind resp VolumeAttachment.parse) (let open Error in - BadResponse { body; message = "Could not find well formed VolumeAttachment." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed VolumeAttachment." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing VolumeAttachment - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing VolumeAttachment - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachVolume.mli b/libraries/ec2/lib/detachVolume.mli index 0ed3807ac..c24192774 100644 --- a/libraries/ec2/lib/detachVolume.mli +++ b/libraries/ec2/lib/detachVolume.mli @@ -1,10 +1,7 @@ open Types - type input = DetachVolumeRequest.t - type output = VolumeAttachment.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachVpnGateway.ml b/libraries/ec2/lib/detachVpnGateway.ml index 1f55b2b24..ce4bf1e11 100644 --- a/libraries/ec2/lib/detachVpnGateway.ml +++ b/libraries/ec2/lib/detachVpnGateway.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DetachVpnGatewayRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DetachVpnGateway" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DetachVpnGateway"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DetachVpnGatewayRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DetachVpnGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/detachVpnGateway.mli b/libraries/ec2/lib/detachVpnGateway.mli index 21d2ccb31..c3eb11bac 100644 --- a/libraries/ec2/lib/detachVpnGateway.mli +++ b/libraries/ec2/lib/detachVpnGateway.mli @@ -1,10 +1,7 @@ open Types - type input = DetachVpnGatewayRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disableVgwRoutePropagation.ml b/libraries/ec2/lib/disableVgwRoutePropagation.ml index 060c038e2..e241df55e 100644 --- a/libraries/ec2/lib/disableVgwRoutePropagation.ml +++ b/libraries/ec2/lib/disableVgwRoutePropagation.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DisableVgwRoutePropagationRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DisableVgwRoutePropagation" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DisableVgwRoutePropagation"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisableVgwRoutePropagationRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DisableVgwRoutePropagationRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disableVgwRoutePropagation.mli b/libraries/ec2/lib/disableVgwRoutePropagation.mli index c99812907..d4c9806aa 100644 --- a/libraries/ec2/lib/disableVgwRoutePropagation.mli +++ b/libraries/ec2/lib/disableVgwRoutePropagation.mli @@ -1,10 +1,7 @@ open Types - type input = DisableVgwRoutePropagationRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disableVpcClassicLink.ml b/libraries/ec2/lib/disableVpcClassicLink.ml index 6db472b15..6e281b991 100644 --- a/libraries/ec2/lib/disableVpcClassicLink.ml +++ b/libraries/ec2/lib/disableVpcClassicLink.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = DisableVpcClassicLinkRequest.t - type output = DisableVpcClassicLinkResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DisableVpcClassicLink" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DisableVpcClassicLink"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisableVpcClassicLinkRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DisableVpcClassicLinkRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DisableVpcClassicLinkResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DisableVpcClassicLinkResult.parse) + Util.or_error (Util.option_bind resp DisableVpcClassicLinkResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DisableVpcClassicLinkResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DisableVpcClassicLinkResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DisableVpcClassicLinkResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DisableVpcClassicLinkResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/disableVpcClassicLink.mli b/libraries/ec2/lib/disableVpcClassicLink.mli index f482d4b8d..f35edc8a9 100644 --- a/libraries/ec2/lib/disableVpcClassicLink.mli +++ b/libraries/ec2/lib/disableVpcClassicLink.mli @@ -1,10 +1,7 @@ open Types - type input = DisableVpcClassicLinkRequest.t - type output = DisableVpcClassicLinkResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disassociateAddress.ml b/libraries/ec2/lib/disassociateAddress.ml index bff51f2ce..968258ef3 100644 --- a/libraries/ec2/lib/disassociateAddress.ml +++ b/libraries/ec2/lib/disassociateAddress.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DisassociateAddressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DisassociateAddress" ] ] + [("Version", ["2015-04-15"]); ("Action", ["DisassociateAddress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisassociateAddressRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DisassociateAddressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disassociateAddress.mli b/libraries/ec2/lib/disassociateAddress.mli index df9c10dec..50800204e 100644 --- a/libraries/ec2/lib/disassociateAddress.mli +++ b/libraries/ec2/lib/disassociateAddress.mli @@ -1,10 +1,7 @@ open Types - type input = DisassociateAddressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disassociateRouteTable.ml b/libraries/ec2/lib/disassociateRouteTable.ml index d4719f454..a8c692715 100644 --- a/libraries/ec2/lib/disassociateRouteTable.ml +++ b/libraries/ec2/lib/disassociateRouteTable.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DisassociateRouteTableRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "DisassociateRouteTable" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["DisassociateRouteTable"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisassociateRouteTableRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DisassociateRouteTableRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/disassociateRouteTable.mli b/libraries/ec2/lib/disassociateRouteTable.mli index e343f0430..861d4e100 100644 --- a/libraries/ec2/lib/disassociateRouteTable.mli +++ b/libraries/ec2/lib/disassociateRouteTable.mli @@ -1,10 +1,7 @@ open Types - type input = DisassociateRouteTableRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/dune b/libraries/ec2/lib/dune index 933a9ec6f..b9292a6dc 100644 --- a/libraries/ec2/lib/dune +++ b/libraries/ec2/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_ec2) + (name aws_ec2) (public_name aws-ec2) (synopsis "aws-Amazon Elastic Compute Cloud") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/ec2/lib/enableVgwRoutePropagation.ml b/libraries/ec2/lib/enableVgwRoutePropagation.ml index 772586a7c..4f2e77f18 100644 --- a/libraries/ec2/lib/enableVgwRoutePropagation.ml +++ b/libraries/ec2/lib/enableVgwRoutePropagation.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = EnableVgwRoutePropagationRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "EnableVgwRoutePropagation" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["EnableVgwRoutePropagation"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (EnableVgwRoutePropagationRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (EnableVgwRoutePropagationRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/enableVgwRoutePropagation.mli b/libraries/ec2/lib/enableVgwRoutePropagation.mli index 573dbdb42..5191b91e9 100644 --- a/libraries/ec2/lib/enableVgwRoutePropagation.mli +++ b/libraries/ec2/lib/enableVgwRoutePropagation.mli @@ -1,10 +1,7 @@ open Types - type input = EnableVgwRoutePropagationRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/enableVolumeIO.ml b/libraries/ec2/lib/enableVolumeIO.ml index 15cfa0927..0d416c943 100644 --- a/libraries/ec2/lib/enableVolumeIO.ml +++ b/libraries/ec2/lib/enableVolumeIO.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = EnableVolumeIORequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "EnableVolumeIO" ] ] + [("Version", ["2015-04-15"]); ("Action", ["EnableVolumeIO"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (EnableVolumeIORequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (EnableVolumeIORequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/enableVolumeIO.mli b/libraries/ec2/lib/enableVolumeIO.mli index 5d82d11b7..300d74a42 100644 --- a/libraries/ec2/lib/enableVolumeIO.mli +++ b/libraries/ec2/lib/enableVolumeIO.mli @@ -1,10 +1,7 @@ open Types - type input = EnableVolumeIORequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/enableVpcClassicLink.ml b/libraries/ec2/lib/enableVpcClassicLink.ml index 4f3b580f7..3e904a408 100644 --- a/libraries/ec2/lib/enableVpcClassicLink.ml +++ b/libraries/ec2/lib/enableVpcClassicLink.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = EnableVpcClassicLinkRequest.t - type output = EnableVpcClassicLinkResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "EnableVpcClassicLink" ] ] + [("Version", ["2015-04-15"]); ("Action", ["EnableVpcClassicLink"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (EnableVpcClassicLinkRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (EnableVpcClassicLinkRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "EnableVpcClassicLinkResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp EnableVpcClassicLinkResult.parse) + Util.or_error (Util.option_bind resp EnableVpcClassicLinkResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed EnableVpcClassicLinkResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed EnableVpcClassicLinkResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EnableVpcClassicLinkResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EnableVpcClassicLinkResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/enableVpcClassicLink.mli b/libraries/ec2/lib/enableVpcClassicLink.mli index 9e04a88b9..a5770cad6 100644 --- a/libraries/ec2/lib/enableVpcClassicLink.mli +++ b/libraries/ec2/lib/enableVpcClassicLink.mli @@ -1,10 +1,7 @@ open Types - type input = EnableVpcClassicLinkRequest.t - type output = EnableVpcClassicLinkResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/errors_internal.ml b/libraries/ec2/lib/errors_internal.ml index f46c472e1..802e0ec94 100644 --- a/libraries/ec2/lib/errors_internal.ml +++ b/libraries/ec2/lib/errors_internal.ml @@ -1,379 +1,376 @@ type t = - | ActiveVpcPeeringConnectionPerVpcLimitExceeded - | AddressLimitExceeded - | AttachmentLimitExceeded - | AuthFailure - | Blocked - | BundlingInProgress - | CannotDelete - | ConcurrentSnapshotLimitExceeded - | ConcurrentTagAccess - | CustomerGatewayLimitExceeded - | DependencyViolation - | DiskImageSizeTooLarge - | DryRunOperation - | EncryptedVolumesNotSupported - | FilterLimitExceeded - | Gateway_NotAttached - | IdempotentParameterMismatch - | IncompleteSignature - | IncorrectInstanceState - | IncorrectState - | InstanceAlreadyLinked - | InstanceLimitExceeded - | InsufficientFreeAddressesInSubnet - | InsufficientReservedInstancesCapacity - | InternalFailure - | InternetGatewayLimitExceeded - | InvalidAMIAttributeItemValue - | InvalidAMIID_Malformed - | InvalidAMIID_NotFound - | InvalidAMIID_Unavailable - | InvalidAMIName_Duplicate - | InvalidAMIName_Malformed - | InvalidAction - | InvalidAddress_NotFound - | InvalidAddressID_NotFound - | InvalidAllocationID_NotFound - | InvalidAssociationID_NotFound - | InvalidAttachment_NotFound - | InvalidAttachmentID_NotFound - | InvalidBlockDeviceMapping - | InvalidBundleID_NotFound - | InvalidClientTokenId - | InvalidConversionTaskId - | InvalidCustomerGateway_DuplicateIpAddress - | InvalidCustomerGatewayID_NotFound - | InvalidCustomerGatewayId_Malformed - | InvalidDevice_InUse - | InvalidDhcpOptionID_NotFound - | InvalidDhcpOptionsID_NotFound - | InvalidDhcpOptionsId_Malformed - | InvalidExportTaskID_NotFound - | InvalidFilter - | InvalidFormat - | InvalidGatewayID_NotFound - | InvalidGroup_Duplicate - | InvalidGroup_InUse - | InvalidGroup_NotFound - | InvalidGroup_Reserved - | InvalidGroupId_Malformed - | InvalidID - | InvalidIPAddress_InUse - | InvalidInput - | InvalidInstanceAttributeValue - | InvalidInstanceID - | InvalidInstanceID_Malformed - | InvalidInstanceID_NotFound - | InvalidInstanceID_NotLinkable - | InvalidInstanceType - | InvalidInterface_IpAddressLimitExceeded - | InvalidInternetGatewayID_NotFound - | InvalidKey_Format - | InvalidKeyPair_Duplicate - | InvalidKeyPair_Format - | InvalidKeyPair_NotFound - | InvalidManifest - | InvalidNetworkAclEntry_NotFound - | InvalidNetworkAclID_NotFound - | InvalidNetworkInterface_InUse - | InvalidNetworkInterfaceAttachmentID_Malformed - | InvalidNetworkInterfaceID_NotFound - | InvalidNetworkInterfaceId_Malformed - | InvalidOption_Conflict - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidPermission_Duplicate - | InvalidPermission_Malformed - | InvalidPermission_NotFound - | InvalidPlacementGroup_Duplicate - | InvalidPlacementGroup_InUse - | InvalidPlacementGroup_Unknown - | InvalidQueryParameter - | InvalidRequest - | InvalidReservationID_Malformed - | InvalidReservationID_NotFound - | InvalidReservedInstancesId - | InvalidReservedInstancesOfferingId - | InvalidRoute_Malformed - | InvalidRoute_NotFound - | InvalidRouteTableID_NotFound - | InvalidRouteTableId_Malformed - | InvalidSecurity_RequestHasExpired - | InvalidSecurityGroupID_NotFound - | InvalidSnapshot_InUse - | InvalidSnapshot_NotFound - | InvalidSnapshotID_Malformed - | InvalidSpotDatafeed_NotFound - | InvalidSpotInstanceRequestID_Malformed - | InvalidSpotInstanceRequestID_NotFound - | InvalidState - | InvalidStateTransition - | InvalidSubnet_Conflict - | InvalidSubnetID_NotFound - | InvalidUserID_Malformed - | InvalidVolume_NotFound - | InvalidVolume_ZoneMismatch - | InvalidVolumeID_Duplicate - | InvalidVolumeID_Malformed - | InvalidVolumeID_ZoneMismatch - | InvalidVpcID_NotFound - | InvalidVpcPeeringConnectionID_NotFound - | InvalidVpcPeeringConnectionId_Malformed - | InvalidVpcRange - | InvalidVpcState - | InvalidVpnConnectionID - | InvalidVpnConnectionID_NotFound - | InvalidVpnGatewayAttachment_NotFound - | InvalidVpnGatewayID_NotFound - | InvalidZone_NotFound - | LegacySecurityGroup - | MalformedQueryString - | MaxIOPSLimitExceeded - | MaxSpotInstanceCountExceeded - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | NetworkAclEntryAlreadyExists - | NetworkAclEntryLimitExceeded - | NetworkAclLimitExceeded - | NonEBSInstance - | NotExportable - | OperationNotPermitted - | OptInRequired - | OutstandingVpcPeeringConnectionLimitExceeded - | PendingSnapshotLimitExceeded - | PendingVerification - | PrivateIpAddressLimitExceeded - | RequestExpired - | RequestLimitExceeded - | RequestResourceCountExceeded - | ReservedInstancesLimitExceeded - | Resource_AlreadyAssociated - | ResourceCountExceeded - | ResourceLimitExceeded - | RouteAlreadyExists - | RouteLimitExceeded - | RouteTableLimitExceeded - | RulesPerSecurityGroupLimitExceeded - | SecurityGroupLimitExceeded - | SecurityGroupsPerInstanceLimitExceeded - | SecurityGroupsPerInterfaceLimitExceeded - | ServiceUnavailable - | SignatureDoesNotMatch - | SnapshotLimitExceeded - | SubnetLimitExceeded - | TagLimitExceeded - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnknownVolumeType - | Unsupported - | UnsupportedOperation - | UnsupportedProtocol - | VPCIdNotSpecified - | VPCResourceNotSpecified - | ValidationError - | VolumeInUse - | VolumeLimitExceeded - | VolumeTypeNotAvailableInZone - | VpcCidrConflict - | VpcLimitExceeded - | VpcPeeringConnectionAlreadyExists - | VpnConnectionLimitExceeded - | VpnGatewayAttachmentLimitExceeded - | VpnGatewayLimitExceeded - | Uninhabited - + | ActiveVpcPeeringConnectionPerVpcLimitExceeded + | AddressLimitExceeded + | AttachmentLimitExceeded + | AuthFailure + | Blocked + | BundlingInProgress + | CannotDelete + | ConcurrentSnapshotLimitExceeded + | ConcurrentTagAccess + | CustomerGatewayLimitExceeded + | DependencyViolation + | DiskImageSizeTooLarge + | DryRunOperation + | EncryptedVolumesNotSupported + | FilterLimitExceeded + | Gateway_NotAttached + | IdempotentParameterMismatch + | IncompleteSignature + | IncorrectInstanceState + | IncorrectState + | InstanceAlreadyLinked + | InstanceLimitExceeded + | InsufficientFreeAddressesInSubnet + | InsufficientReservedInstancesCapacity + | InternalFailure + | InternetGatewayLimitExceeded + | InvalidAMIAttributeItemValue + | InvalidAMIID_Malformed + | InvalidAMIID_NotFound + | InvalidAMIID_Unavailable + | InvalidAMIName_Duplicate + | InvalidAMIName_Malformed + | InvalidAction + | InvalidAddress_NotFound + | InvalidAddressID_NotFound + | InvalidAllocationID_NotFound + | InvalidAssociationID_NotFound + | InvalidAttachment_NotFound + | InvalidAttachmentID_NotFound + | InvalidBlockDeviceMapping + | InvalidBundleID_NotFound + | InvalidClientTokenId + | InvalidConversionTaskId + | InvalidCustomerGateway_DuplicateIpAddress + | InvalidCustomerGatewayID_NotFound + | InvalidCustomerGatewayId_Malformed + | InvalidDevice_InUse + | InvalidDhcpOptionID_NotFound + | InvalidDhcpOptionsID_NotFound + | InvalidDhcpOptionsId_Malformed + | InvalidExportTaskID_NotFound + | InvalidFilter + | InvalidFormat + | InvalidGatewayID_NotFound + | InvalidGroup_Duplicate + | InvalidGroup_InUse + | InvalidGroup_NotFound + | InvalidGroup_Reserved + | InvalidGroupId_Malformed + | InvalidID + | InvalidIPAddress_InUse + | InvalidInput + | InvalidInstanceAttributeValue + | InvalidInstanceID + | InvalidInstanceID_Malformed + | InvalidInstanceID_NotFound + | InvalidInstanceID_NotLinkable + | InvalidInstanceType + | InvalidInterface_IpAddressLimitExceeded + | InvalidInternetGatewayID_NotFound + | InvalidKey_Format + | InvalidKeyPair_Duplicate + | InvalidKeyPair_Format + | InvalidKeyPair_NotFound + | InvalidManifest + | InvalidNetworkAclEntry_NotFound + | InvalidNetworkAclID_NotFound + | InvalidNetworkInterface_InUse + | InvalidNetworkInterfaceAttachmentID_Malformed + | InvalidNetworkInterfaceID_NotFound + | InvalidNetworkInterfaceId_Malformed + | InvalidOption_Conflict + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidPermission_Duplicate + | InvalidPermission_Malformed + | InvalidPermission_NotFound + | InvalidPlacementGroup_Duplicate + | InvalidPlacementGroup_InUse + | InvalidPlacementGroup_Unknown + | InvalidQueryParameter + | InvalidRequest + | InvalidReservationID_Malformed + | InvalidReservationID_NotFound + | InvalidReservedInstancesId + | InvalidReservedInstancesOfferingId + | InvalidRoute_Malformed + | InvalidRoute_NotFound + | InvalidRouteTableID_NotFound + | InvalidRouteTableId_Malformed + | InvalidSecurity_RequestHasExpired + | InvalidSecurityGroupID_NotFound + | InvalidSnapshot_InUse + | InvalidSnapshot_NotFound + | InvalidSnapshotID_Malformed + | InvalidSpotDatafeed_NotFound + | InvalidSpotInstanceRequestID_Malformed + | InvalidSpotInstanceRequestID_NotFound + | InvalidState + | InvalidStateTransition + | InvalidSubnet_Conflict + | InvalidSubnetID_NotFound + | InvalidUserID_Malformed + | InvalidVolume_NotFound + | InvalidVolume_ZoneMismatch + | InvalidVolumeID_Duplicate + | InvalidVolumeID_Malformed + | InvalidVolumeID_ZoneMismatch + | InvalidVpcID_NotFound + | InvalidVpcPeeringConnectionID_NotFound + | InvalidVpcPeeringConnectionId_Malformed + | InvalidVpcRange + | InvalidVpcState + | InvalidVpnConnectionID + | InvalidVpnConnectionID_NotFound + | InvalidVpnGatewayAttachment_NotFound + | InvalidVpnGatewayID_NotFound + | InvalidZone_NotFound + | LegacySecurityGroup + | MalformedQueryString + | MaxIOPSLimitExceeded + | MaxSpotInstanceCountExceeded + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | NetworkAclEntryAlreadyExists + | NetworkAclEntryLimitExceeded + | NetworkAclLimitExceeded + | NonEBSInstance + | NotExportable + | OperationNotPermitted + | OptInRequired + | OutstandingVpcPeeringConnectionLimitExceeded + | PendingSnapshotLimitExceeded + | PendingVerification + | PrivateIpAddressLimitExceeded + | RequestExpired + | RequestLimitExceeded + | RequestResourceCountExceeded + | ReservedInstancesLimitExceeded + | Resource_AlreadyAssociated + | ResourceCountExceeded + | ResourceLimitExceeded + | RouteAlreadyExists + | RouteLimitExceeded + | RouteTableLimitExceeded + | RulesPerSecurityGroupLimitExceeded + | SecurityGroupLimitExceeded + | SecurityGroupsPerInstanceLimitExceeded + | SecurityGroupsPerInterfaceLimitExceeded + | ServiceUnavailable + | SignatureDoesNotMatch + | SnapshotLimitExceeded + | SubnetLimitExceeded + | TagLimitExceeded + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnknownVolumeType + | Unsupported + | UnsupportedOperation + | UnsupportedProtocol + | VPCIdNotSpecified + | VPCResourceNotSpecified + | ValidationError + | VolumeInUse + | VolumeLimitExceeded + | VolumeTypeNotAvailableInZone + | VpcCidrConflict + | VpcLimitExceeded + | VpcPeeringConnectionAlreadyExists + | VpnConnectionLimitExceeded + | VpnGatewayAttachmentLimitExceeded + | VpnGatewayLimitExceeded + | Uninhabited let common = - [ VpnGatewayLimitExceeded - ; VpnGatewayAttachmentLimitExceeded - ; VpnConnectionLimitExceeded - ; VPCResourceNotSpecified - ; VpcPeeringConnectionAlreadyExists - ; VpcLimitExceeded - ; VPCIdNotSpecified - ; VpcCidrConflict - ; VolumeTypeNotAvailableInZone - ; VolumeLimitExceeded - ; VolumeInUse - ; UnsupportedOperation - ; Unsupported - ; UnknownVolumeType - ; TagLimitExceeded - ; SubnetLimitExceeded - ; SnapshotLimitExceeded - ; SignatureDoesNotMatch - ; SecurityGroupsPerInterfaceLimitExceeded - ; SecurityGroupsPerInstanceLimitExceeded - ; SecurityGroupLimitExceeded - ; RulesPerSecurityGroupLimitExceeded - ; RouteTableLimitExceeded - ; RouteLimitExceeded - ; RouteAlreadyExists - ; ResourceLimitExceeded - ; ResourceCountExceeded - ; Resource_AlreadyAssociated - ; ReservedInstancesLimitExceeded - ; RequestResourceCountExceeded - ; PrivateIpAddressLimitExceeded - ; PendingSnapshotLimitExceeded - ; OutstandingVpcPeeringConnectionLimitExceeded - ; OperationNotPermitted - ; NotExportable - ; NonEBSInstance - ; NetworkAclLimitExceeded - ; NetworkAclEntryLimitExceeded - ; NetworkAclEntryAlreadyExists - ; MaxSpotInstanceCountExceeded - ; MaxIOPSLimitExceeded - ; LegacySecurityGroup - ; InvalidZone_NotFound - ; InvalidVpnGatewayID_NotFound - ; InvalidVpnGatewayAttachment_NotFound - ; InvalidVpnConnectionID_NotFound - ; InvalidVpnConnectionID - ; InvalidVpcState - ; InvalidVpcRange - ; InvalidVpcPeeringConnectionID_NotFound - ; InvalidVpcPeeringConnectionId_Malformed - ; InvalidVpcID_NotFound - ; InvalidVolume_ZoneMismatch - ; InvalidVolume_NotFound - ; InvalidVolumeID_ZoneMismatch - ; InvalidVolumeID_Malformed - ; InvalidVolumeID_Duplicate - ; InvalidUserID_Malformed - ; InvalidSubnetID_NotFound - ; InvalidSubnet_Conflict - ; InvalidStateTransition - ; InvalidState - ; InvalidSpotInstanceRequestID_NotFound - ; InvalidSpotInstanceRequestID_Malformed - ; InvalidSpotDatafeed_NotFound - ; InvalidSnapshot_NotFound - ; InvalidSnapshot_InUse - ; InvalidSnapshotID_Malformed - ; InvalidSecurity_RequestHasExpired - ; InvalidSecurityGroupID_NotFound - ; InvalidRouteTableID_NotFound - ; InvalidRouteTableId_Malformed - ; InvalidRoute_NotFound - ; InvalidRoute_Malformed - ; InvalidReservedInstancesOfferingId - ; InvalidReservedInstancesId - ; InvalidReservationID_NotFound - ; InvalidReservationID_Malformed - ; InvalidRequest - ; InvalidPlacementGroup_Unknown - ; InvalidPlacementGroup_InUse - ; InvalidPlacementGroup_Duplicate - ; InvalidPermission_NotFound - ; InvalidPermission_Malformed - ; InvalidPermission_Duplicate - ; InvalidOption_Conflict - ; InvalidNetworkInterfaceID_NotFound - ; InvalidNetworkInterfaceId_Malformed - ; InvalidNetworkInterface_InUse - ; InvalidNetworkInterfaceAttachmentID_Malformed - ; InvalidNetworkAclID_NotFound - ; InvalidNetworkAclEntry_NotFound - ; InvalidManifest - ; InvalidKeyPair_NotFound - ; InvalidKeyPair_Format - ; InvalidKeyPair_Duplicate - ; InvalidKey_Format - ; InvalidIPAddress_InUse - ; InvalidInternetGatewayID_NotFound - ; InvalidInterface_IpAddressLimitExceeded - ; InvalidInstanceType - ; InvalidInstanceID_NotLinkable - ; InvalidInstanceID_NotFound - ; InvalidInstanceID_Malformed - ; InvalidInstanceID - ; InvalidInstanceAttributeValue - ; InvalidInput - ; InvalidID - ; InvalidGroup_Reserved - ; InvalidGroup_NotFound - ; InvalidGroup_InUse - ; InvalidGroupId_Malformed - ; InvalidGroup_Duplicate - ; InvalidGatewayID_NotFound - ; InvalidFormat - ; InvalidFilter - ; InvalidExportTaskID_NotFound - ; InvalidDhcpOptionsId_Malformed - ; InvalidDhcpOptionsID_NotFound - ; InvalidDhcpOptionID_NotFound - ; InvalidDevice_InUse - ; InvalidCustomerGatewayID_NotFound - ; InvalidCustomerGatewayId_Malformed - ; InvalidCustomerGateway_DuplicateIpAddress - ; InvalidConversionTaskId - ; InvalidBundleID_NotFound - ; InvalidBlockDeviceMapping - ; InvalidAttachmentID_NotFound - ; InvalidAttachment_NotFound - ; InvalidAssociationID_NotFound - ; InvalidAMIName_Malformed - ; InvalidAMIName_Duplicate - ; InvalidAMIID_Unavailable - ; InvalidAMIID_NotFound - ; InvalidAMIID_Malformed - ; InvalidAMIAttributeItemValue - ; InvalidAllocationID_NotFound - ; InvalidAddressID_NotFound - ; InvalidAddress_NotFound - ; InternetGatewayLimitExceeded - ; InsufficientReservedInstancesCapacity - ; InsufficientFreeAddressesInSubnet - ; InstanceLimitExceeded - ; InstanceAlreadyLinked - ; IncorrectState - ; IncorrectInstanceState - ; Gateway_NotAttached - ; FilterLimitExceeded - ; EncryptedVolumesNotSupported - ; DiskImageSizeTooLarge - ; DependencyViolation - ; CustomerGatewayLimitExceeded - ; ConcurrentTagAccess - ; ConcurrentSnapshotLimitExceeded - ; CannotDelete - ; BundlingInProgress - ; AttachmentLimitExceeded - ; AddressLimitExceeded - ; ActiveVpcPeeringConnectionPerVpcLimitExceeded - ; UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [VpnGatewayLimitExceeded; + VpnGatewayAttachmentLimitExceeded; + VpnConnectionLimitExceeded; + VPCResourceNotSpecified; + VpcPeeringConnectionAlreadyExists; + VpcLimitExceeded; + VPCIdNotSpecified; + VpcCidrConflict; + VolumeTypeNotAvailableInZone; + VolumeLimitExceeded; + VolumeInUse; + UnsupportedOperation; + Unsupported; + UnknownVolumeType; + TagLimitExceeded; + SubnetLimitExceeded; + SnapshotLimitExceeded; + SignatureDoesNotMatch; + SecurityGroupsPerInterfaceLimitExceeded; + SecurityGroupsPerInstanceLimitExceeded; + SecurityGroupLimitExceeded; + RulesPerSecurityGroupLimitExceeded; + RouteTableLimitExceeded; + RouteLimitExceeded; + RouteAlreadyExists; + ResourceLimitExceeded; + ResourceCountExceeded; + Resource_AlreadyAssociated; + ReservedInstancesLimitExceeded; + RequestResourceCountExceeded; + PrivateIpAddressLimitExceeded; + PendingSnapshotLimitExceeded; + OutstandingVpcPeeringConnectionLimitExceeded; + OperationNotPermitted; + NotExportable; + NonEBSInstance; + NetworkAclLimitExceeded; + NetworkAclEntryLimitExceeded; + NetworkAclEntryAlreadyExists; + MaxSpotInstanceCountExceeded; + MaxIOPSLimitExceeded; + LegacySecurityGroup; + InvalidZone_NotFound; + InvalidVpnGatewayID_NotFound; + InvalidVpnGatewayAttachment_NotFound; + InvalidVpnConnectionID_NotFound; + InvalidVpnConnectionID; + InvalidVpcState; + InvalidVpcRange; + InvalidVpcPeeringConnectionID_NotFound; + InvalidVpcPeeringConnectionId_Malformed; + InvalidVpcID_NotFound; + InvalidVolume_ZoneMismatch; + InvalidVolume_NotFound; + InvalidVolumeID_ZoneMismatch; + InvalidVolumeID_Malformed; + InvalidVolumeID_Duplicate; + InvalidUserID_Malformed; + InvalidSubnetID_NotFound; + InvalidSubnet_Conflict; + InvalidStateTransition; + InvalidState; + InvalidSpotInstanceRequestID_NotFound; + InvalidSpotInstanceRequestID_Malformed; + InvalidSpotDatafeed_NotFound; + InvalidSnapshot_NotFound; + InvalidSnapshot_InUse; + InvalidSnapshotID_Malformed; + InvalidSecurity_RequestHasExpired; + InvalidSecurityGroupID_NotFound; + InvalidRouteTableID_NotFound; + InvalidRouteTableId_Malformed; + InvalidRoute_NotFound; + InvalidRoute_Malformed; + InvalidReservedInstancesOfferingId; + InvalidReservedInstancesId; + InvalidReservationID_NotFound; + InvalidReservationID_Malformed; + InvalidRequest; + InvalidPlacementGroup_Unknown; + InvalidPlacementGroup_InUse; + InvalidPlacementGroup_Duplicate; + InvalidPermission_NotFound; + InvalidPermission_Malformed; + InvalidPermission_Duplicate; + InvalidOption_Conflict; + InvalidNetworkInterfaceID_NotFound; + InvalidNetworkInterfaceId_Malformed; + InvalidNetworkInterface_InUse; + InvalidNetworkInterfaceAttachmentID_Malformed; + InvalidNetworkAclID_NotFound; + InvalidNetworkAclEntry_NotFound; + InvalidManifest; + InvalidKeyPair_NotFound; + InvalidKeyPair_Format; + InvalidKeyPair_Duplicate; + InvalidKey_Format; + InvalidIPAddress_InUse; + InvalidInternetGatewayID_NotFound; + InvalidInterface_IpAddressLimitExceeded; + InvalidInstanceType; + InvalidInstanceID_NotLinkable; + InvalidInstanceID_NotFound; + InvalidInstanceID_Malformed; + InvalidInstanceID; + InvalidInstanceAttributeValue; + InvalidInput; + InvalidID; + InvalidGroup_Reserved; + InvalidGroup_NotFound; + InvalidGroup_InUse; + InvalidGroupId_Malformed; + InvalidGroup_Duplicate; + InvalidGatewayID_NotFound; + InvalidFormat; + InvalidFilter; + InvalidExportTaskID_NotFound; + InvalidDhcpOptionsId_Malformed; + InvalidDhcpOptionsID_NotFound; + InvalidDhcpOptionID_NotFound; + InvalidDevice_InUse; + InvalidCustomerGatewayID_NotFound; + InvalidCustomerGatewayId_Malformed; + InvalidCustomerGateway_DuplicateIpAddress; + InvalidConversionTaskId; + InvalidBundleID_NotFound; + InvalidBlockDeviceMapping; + InvalidAttachmentID_NotFound; + InvalidAttachment_NotFound; + InvalidAssociationID_NotFound; + InvalidAMIName_Malformed; + InvalidAMIName_Duplicate; + InvalidAMIID_Unavailable; + InvalidAMIID_NotFound; + InvalidAMIID_Malformed; + InvalidAMIAttributeItemValue; + InvalidAllocationID_NotFound; + InvalidAddressID_NotFound; + InvalidAddress_NotFound; + InternetGatewayLimitExceeded; + InsufficientReservedInstancesCapacity; + InsufficientFreeAddressesInSubnet; + InstanceLimitExceeded; + InstanceAlreadyLinked; + IncorrectState; + IncorrectInstanceState; + Gateway_NotAttached; + FilterLimitExceeded; + EncryptedVolumesNotSupported; + DiskImageSizeTooLarge; + DependencyViolation; + CustomerGatewayLimitExceeded; + ConcurrentTagAccess; + ConcurrentSnapshotLimitExceeded; + CannotDelete; + BundlingInProgress; + AttachmentLimitExceeded; + AddressLimitExceeded; + ActiveVpcPeeringConnectionPerVpcLimitExceeded; + UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | ActiveVpcPeeringConnectionPerVpcLimitExceeded -> None @@ -562,7 +559,6 @@ let to_http_code e = | VpnGatewayAttachmentLimitExceeded -> None | VpnGatewayLimitExceeded -> None | Uninhabited -> None - let to_string e = match e with | ActiveVpcPeeringConnectionPerVpcLimitExceeded -> @@ -589,7 +585,8 @@ let to_string e = | InstanceAlreadyLinked -> "InstanceAlreadyLinked" | InstanceLimitExceeded -> "InstanceLimitExceeded" | InsufficientFreeAddressesInSubnet -> "InsufficientFreeAddressesInSubnet" - | InsufficientReservedInstancesCapacity -> "InsufficientReservedInstancesCapacity" + | InsufficientReservedInstancesCapacity -> + "InsufficientReservedInstancesCapacity" | InternalFailure -> "InternalFailure" | InternetGatewayLimitExceeded -> "InternetGatewayLimitExceeded" | InvalidAMIAttributeItemValue -> "InvalidAMIAttributeItemValue" @@ -612,7 +609,8 @@ let to_string e = | InvalidCustomerGateway_DuplicateIpAddress -> "InvalidCustomerGateway.DuplicateIpAddress" | InvalidCustomerGatewayID_NotFound -> "InvalidCustomerGatewayID.NotFound" - | InvalidCustomerGatewayId_Malformed -> "InvalidCustomerGatewayId.Malformed" + | InvalidCustomerGatewayId_Malformed -> + "InvalidCustomerGatewayId.Malformed" | InvalidDevice_InUse -> "InvalidDevice.InUse" | InvalidDhcpOptionID_NotFound -> "InvalidDhcpOptionID.NotFound" | InvalidDhcpOptionsID_NotFound -> "InvalidDhcpOptionsID.NotFound" @@ -635,7 +633,8 @@ let to_string e = | InvalidInstanceID_NotFound -> "InvalidInstanceID.NotFound" | InvalidInstanceID_NotLinkable -> "InvalidInstanceID.NotLinkable" | InvalidInstanceType -> "InvalidInstanceType" - | InvalidInterface_IpAddressLimitExceeded -> "InvalidInterface.IpAddressLimitExceeded" + | InvalidInterface_IpAddressLimitExceeded -> + "InvalidInterface.IpAddressLimitExceeded" | InvalidInternetGatewayID_NotFound -> "InvalidInternetGatewayID.NotFound" | InvalidKey_Format -> "InvalidKey.Format" | InvalidKeyPair_Duplicate -> "InvalidKeyPair.Duplicate" @@ -647,8 +646,10 @@ let to_string e = | InvalidNetworkInterface_InUse -> "InvalidNetworkInterface.InUse" | InvalidNetworkInterfaceAttachmentID_Malformed -> "InvalidNetworkInterfaceAttachmentID.Malformed" - | InvalidNetworkInterfaceID_NotFound -> "InvalidNetworkInterfaceID.NotFound" - | InvalidNetworkInterfaceId_Malformed -> "InvalidNetworkInterfaceId.Malformed" + | InvalidNetworkInterfaceID_NotFound -> + "InvalidNetworkInterfaceID.NotFound" + | InvalidNetworkInterfaceId_Malformed -> + "InvalidNetworkInterfaceId.Malformed" | InvalidOption_Conflict -> "InvalidOption.Conflict" | InvalidParameter -> "InvalidParameter" | InvalidParameterCombination -> "InvalidParameterCombination" @@ -664,7 +665,8 @@ let to_string e = | InvalidReservationID_Malformed -> "InvalidReservationID.Malformed" | InvalidReservationID_NotFound -> "InvalidReservationID.NotFound" | InvalidReservedInstancesId -> "InvalidReservedInstancesId" - | InvalidReservedInstancesOfferingId -> "InvalidReservedInstancesOfferingId" + | InvalidReservedInstancesOfferingId -> + "InvalidReservedInstancesOfferingId" | InvalidRoute_Malformed -> "InvalidRoute.Malformed" | InvalidRoute_NotFound -> "InvalidRoute.NotFound" | InvalidRouteTableID_NotFound -> "InvalidRouteTableID.NotFound" @@ -675,8 +677,10 @@ let to_string e = | InvalidSnapshot_NotFound -> "InvalidSnapshot.NotFound" | InvalidSnapshotID_Malformed -> "InvalidSnapshotID.Malformed" | InvalidSpotDatafeed_NotFound -> "InvalidSpotDatafeed.NotFound" - | InvalidSpotInstanceRequestID_Malformed -> "InvalidSpotInstanceRequestID.Malformed" - | InvalidSpotInstanceRequestID_NotFound -> "InvalidSpotInstanceRequestID.NotFound" + | InvalidSpotInstanceRequestID_Malformed -> + "InvalidSpotInstanceRequestID.Malformed" + | InvalidSpotInstanceRequestID_NotFound -> + "InvalidSpotInstanceRequestID.NotFound" | InvalidState -> "InvalidState" | InvalidStateTransition -> "InvalidStateTransition" | InvalidSubnet_Conflict -> "InvalidSubnet.Conflict" @@ -688,13 +692,16 @@ let to_string e = | InvalidVolumeID_Malformed -> "InvalidVolumeID.Malformed" | InvalidVolumeID_ZoneMismatch -> "InvalidVolumeID.ZoneMismatch" | InvalidVpcID_NotFound -> "InvalidVpcID.NotFound" - | InvalidVpcPeeringConnectionID_NotFound -> "InvalidVpcPeeringConnectionID.NotFound" - | InvalidVpcPeeringConnectionId_Malformed -> "InvalidVpcPeeringConnectionId.Malformed" + | InvalidVpcPeeringConnectionID_NotFound -> + "InvalidVpcPeeringConnectionID.NotFound" + | InvalidVpcPeeringConnectionId_Malformed -> + "InvalidVpcPeeringConnectionId.Malformed" | InvalidVpcRange -> "InvalidVpcRange" | InvalidVpcState -> "InvalidVpcState" | InvalidVpnConnectionID -> "InvalidVpnConnectionID" | InvalidVpnConnectionID_NotFound -> "InvalidVpnConnectionID.NotFound" - | InvalidVpnGatewayAttachment_NotFound -> "InvalidVpnGatewayAttachment.NotFound" + | InvalidVpnGatewayAttachment_NotFound -> + "InvalidVpnGatewayAttachment.NotFound" | InvalidVpnGatewayID_NotFound -> "InvalidVpnGatewayID.NotFound" | InvalidZone_NotFound -> "InvalidZone.NotFound" | LegacySecurityGroup -> "LegacySecurityGroup" @@ -726,10 +733,13 @@ let to_string e = | RouteAlreadyExists -> "RouteAlreadyExists" | RouteLimitExceeded -> "RouteLimitExceeded" | RouteTableLimitExceeded -> "RouteTableLimitExceeded" - | RulesPerSecurityGroupLimitExceeded -> "RulesPerSecurityGroupLimitExceeded" + | RulesPerSecurityGroupLimitExceeded -> + "RulesPerSecurityGroupLimitExceeded" | SecurityGroupLimitExceeded -> "SecurityGroupLimitExceeded" - | SecurityGroupsPerInstanceLimitExceeded -> "SecurityGroupsPerInstanceLimitExceeded" - | SecurityGroupsPerInterfaceLimitExceeded -> "SecurityGroupsPerInterfaceLimitExceeded" + | SecurityGroupsPerInstanceLimitExceeded -> + "SecurityGroupsPerInstanceLimitExceeded" + | SecurityGroupsPerInterfaceLimitExceeded -> + "SecurityGroupsPerInterfaceLimitExceeded" | ServiceUnavailable -> "ServiceUnavailable" | SignatureDoesNotMatch -> "SignatureDoesNotMatch" | SnapshotLimitExceeded -> "SnapshotLimitExceeded" @@ -755,7 +765,6 @@ let to_string e = | VpnGatewayAttachmentLimitExceeded -> "VpnGatewayAttachmentLimitExceeded" | VpnGatewayLimitExceeded -> "VpnGatewayLimitExceeded" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "ActiveVpcPeeringConnectionPerVpcLimitExceeded" -> @@ -781,8 +790,10 @@ let of_string e = | "IncorrectState" -> Some IncorrectState | "InstanceAlreadyLinked" -> Some InstanceAlreadyLinked | "InstanceLimitExceeded" -> Some InstanceLimitExceeded - | "InsufficientFreeAddressesInSubnet" -> Some InsufficientFreeAddressesInSubnet - | "InsufficientReservedInstancesCapacity" -> Some InsufficientReservedInstancesCapacity + | "InsufficientFreeAddressesInSubnet" -> + Some InsufficientFreeAddressesInSubnet + | "InsufficientReservedInstancesCapacity" -> + Some InsufficientReservedInstancesCapacity | "InternalFailure" -> Some InternalFailure | "InternetGatewayLimitExceeded" -> Some InternetGatewayLimitExceeded | "InvalidAMIAttributeItemValue" -> Some InvalidAMIAttributeItemValue @@ -804,8 +815,10 @@ let of_string e = | "InvalidConversionTaskId" -> Some InvalidConversionTaskId | "InvalidCustomerGateway.DuplicateIpAddress" -> Some InvalidCustomerGateway_DuplicateIpAddress - | "InvalidCustomerGatewayID.NotFound" -> Some InvalidCustomerGatewayID_NotFound - | "InvalidCustomerGatewayId.Malformed" -> Some InvalidCustomerGatewayId_Malformed + | "InvalidCustomerGatewayID.NotFound" -> + Some InvalidCustomerGatewayID_NotFound + | "InvalidCustomerGatewayId.Malformed" -> + Some InvalidCustomerGatewayId_Malformed | "InvalidDevice.InUse" -> Some InvalidDevice_InUse | "InvalidDhcpOptionID.NotFound" -> Some InvalidDhcpOptionID_NotFound | "InvalidDhcpOptionsID.NotFound" -> Some InvalidDhcpOptionsID_NotFound @@ -830,7 +843,8 @@ let of_string e = | "InvalidInstanceType" -> Some InvalidInstanceType | "InvalidInterface.IpAddressLimitExceeded" -> Some InvalidInterface_IpAddressLimitExceeded - | "InvalidInternetGatewayID.NotFound" -> Some InvalidInternetGatewayID_NotFound + | "InvalidInternetGatewayID.NotFound" -> + Some InvalidInternetGatewayID_NotFound | "InvalidKey.Format" -> Some InvalidKey_Format | "InvalidKeyPair.Duplicate" -> Some InvalidKeyPair_Duplicate | "InvalidKeyPair.Format" -> Some InvalidKeyPair_Format @@ -841,8 +855,10 @@ let of_string e = | "InvalidNetworkInterface.InUse" -> Some InvalidNetworkInterface_InUse | "InvalidNetworkInterfaceAttachmentID.Malformed" -> Some InvalidNetworkInterfaceAttachmentID_Malformed - | "InvalidNetworkInterfaceID.NotFound" -> Some InvalidNetworkInterfaceID_NotFound - | "InvalidNetworkInterfaceId.Malformed" -> Some InvalidNetworkInterfaceId_Malformed + | "InvalidNetworkInterfaceID.NotFound" -> + Some InvalidNetworkInterfaceID_NotFound + | "InvalidNetworkInterfaceId.Malformed" -> + Some InvalidNetworkInterfaceId_Malformed | "InvalidOption.Conflict" -> Some InvalidOption_Conflict | "InvalidParameter" -> Some InvalidParameter | "InvalidParameterCombination" -> Some InvalidParameterCombination @@ -858,12 +874,14 @@ let of_string e = | "InvalidReservationID.Malformed" -> Some InvalidReservationID_Malformed | "InvalidReservationID.NotFound" -> Some InvalidReservationID_NotFound | "InvalidReservedInstancesId" -> Some InvalidReservedInstancesId - | "InvalidReservedInstancesOfferingId" -> Some InvalidReservedInstancesOfferingId + | "InvalidReservedInstancesOfferingId" -> + Some InvalidReservedInstancesOfferingId | "InvalidRoute.Malformed" -> Some InvalidRoute_Malformed | "InvalidRoute.NotFound" -> Some InvalidRoute_NotFound | "InvalidRouteTableID.NotFound" -> Some InvalidRouteTableID_NotFound | "InvalidRouteTableId.Malformed" -> Some InvalidRouteTableId_Malformed - | "InvalidSecurity.RequestHasExpired" -> Some InvalidSecurity_RequestHasExpired + | "InvalidSecurity.RequestHasExpired" -> + Some InvalidSecurity_RequestHasExpired | "InvalidSecurityGroupID.NotFound" -> Some InvalidSecurityGroupID_NotFound | "InvalidSnapshot.InUse" -> Some InvalidSnapshot_InUse | "InvalidSnapshot.NotFound" -> Some InvalidSnapshot_NotFound @@ -871,7 +889,8 @@ let of_string e = | "InvalidSpotDatafeed.NotFound" -> Some InvalidSpotDatafeed_NotFound | "InvalidSpotInstanceRequestID.Malformed" -> Some InvalidSpotInstanceRequestID_Malformed - | "InvalidSpotInstanceRequestID.NotFound" -> Some InvalidSpotInstanceRequestID_NotFound + | "InvalidSpotInstanceRequestID.NotFound" -> + Some InvalidSpotInstanceRequestID_NotFound | "InvalidState" -> Some InvalidState | "InvalidStateTransition" -> Some InvalidStateTransition | "InvalidSubnet.Conflict" -> Some InvalidSubnet_Conflict @@ -891,7 +910,8 @@ let of_string e = | "InvalidVpcState" -> Some InvalidVpcState | "InvalidVpnConnectionID" -> Some InvalidVpnConnectionID | "InvalidVpnConnectionID.NotFound" -> Some InvalidVpnConnectionID_NotFound - | "InvalidVpnGatewayAttachment.NotFound" -> Some InvalidVpnGatewayAttachment_NotFound + | "InvalidVpnGatewayAttachment.NotFound" -> + Some InvalidVpnGatewayAttachment_NotFound | "InvalidVpnGatewayID.NotFound" -> Some InvalidVpnGatewayID_NotFound | "InvalidZone.NotFound" -> Some InvalidZone_NotFound | "LegacySecurityGroup" -> Some LegacySecurityGroup @@ -923,7 +943,8 @@ let of_string e = | "RouteAlreadyExists" -> Some RouteAlreadyExists | "RouteLimitExceeded" -> Some RouteLimitExceeded | "RouteTableLimitExceeded" -> Some RouteTableLimitExceeded - | "RulesPerSecurityGroupLimitExceeded" -> Some RulesPerSecurityGroupLimitExceeded + | "RulesPerSecurityGroupLimitExceeded" -> + Some RulesPerSecurityGroupLimitExceeded | "SecurityGroupLimitExceeded" -> Some SecurityGroupLimitExceeded | "SecurityGroupsPerInstanceLimitExceeded" -> Some SecurityGroupsPerInstanceLimitExceeded @@ -949,9 +970,11 @@ let of_string e = | "VolumeTypeNotAvailableInZone" -> Some VolumeTypeNotAvailableInZone | "VpcCidrConflict" -> Some VpcCidrConflict | "VpcLimitExceeded" -> Some VpcLimitExceeded - | "VpcPeeringConnectionAlreadyExists" -> Some VpcPeeringConnectionAlreadyExists + | "VpcPeeringConnectionAlreadyExists" -> + Some VpcPeeringConnectionAlreadyExists | "VpnConnectionLimitExceeded" -> Some VpnConnectionLimitExceeded - | "VpnGatewayAttachmentLimitExceeded" -> Some VpnGatewayAttachmentLimitExceeded + | "VpnGatewayAttachmentLimitExceeded" -> + Some VpnGatewayAttachmentLimitExceeded | "VpnGatewayLimitExceeded" -> Some VpnGatewayLimitExceeded | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/ec2/lib/getConsoleOutput.ml b/libraries/ec2/lib/getConsoleOutput.ml index f54a06e2c..a2eb51c96 100644 --- a/libraries/ec2/lib/getConsoleOutput.ml +++ b/libraries/ec2/lib/getConsoleOutput.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetConsoleOutputRequest.t - type output = GetConsoleOutputResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "GetConsoleOutput" ] ] + [("Version", ["2015-04-15"]); ("Action", ["GetConsoleOutput"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetConsoleOutputRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetConsoleOutputRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetConsoleOutputResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetConsoleOutputResult.parse) + Util.or_error (Util.option_bind resp GetConsoleOutputResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetConsoleOutputResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetConsoleOutputResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetConsoleOutputResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetConsoleOutputResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/getConsoleOutput.mli b/libraries/ec2/lib/getConsoleOutput.mli index 28a39500e..128114ce1 100644 --- a/libraries/ec2/lib/getConsoleOutput.mli +++ b/libraries/ec2/lib/getConsoleOutput.mli @@ -1,10 +1,7 @@ open Types - type input = GetConsoleOutputRequest.t - type output = GetConsoleOutputResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/getPasswordData.ml b/libraries/ec2/lib/getPasswordData.ml index 925d0bc8d..ae74b9892 100644 --- a/libraries/ec2/lib/getPasswordData.ml +++ b/libraries/ec2/lib/getPasswordData.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = GetPasswordDataRequest.t - type output = GetPasswordDataResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "GetPasswordData" ] ] + [("Version", ["2015-04-15"]); ("Action", ["GetPasswordData"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetPasswordDataRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetPasswordDataRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetPasswordDataResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetPasswordDataResult.parse) + Util.or_error (Util.option_bind resp GetPasswordDataResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetPasswordDataResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetPasswordDataResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetPasswordDataResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetPasswordDataResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/getPasswordData.mli b/libraries/ec2/lib/getPasswordData.mli index c05f09c19..3184bc5ef 100644 --- a/libraries/ec2/lib/getPasswordData.mli +++ b/libraries/ec2/lib/getPasswordData.mli @@ -1,10 +1,7 @@ open Types - type input = GetPasswordDataRequest.t - type output = GetPasswordDataResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/importImage.ml b/libraries/ec2/lib/importImage.ml index 11fcfddb0..ae8209ac5 100644 --- a/libraries/ec2/lib/importImage.ml +++ b/libraries/ec2/lib/importImage.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = ImportImageRequest.t - type output = ImportImageResult.t - type error = Errors_internal.t - let service = "ec2" - 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-04-15" ]; "Action", [ "ImportImage" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportImage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ImportImageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ImportImageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ImportImageResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImportImageResult.parse) + Util.or_error (Util.option_bind resp ImportImageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImportImageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ImportImageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImportImageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImportImageResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/importImage.mli b/libraries/ec2/lib/importImage.mli index 11dcc7973..27e0a2a99 100644 --- a/libraries/ec2/lib/importImage.mli +++ b/libraries/ec2/lib/importImage.mli @@ -1,10 +1,7 @@ open Types - type input = ImportImageRequest.t - type output = ImportImageResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/importInstance.ml b/libraries/ec2/lib/importInstance.ml index 0ce25904f..bb88a6d23 100644 --- a/libraries/ec2/lib/importInstance.ml +++ b/libraries/ec2/lib/importInstance.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ImportInstanceRequest.t - type output = ImportInstanceResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ImportInstance" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ImportInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ImportInstanceRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ImportInstanceRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ImportInstanceResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImportInstanceResult.parse) + Util.or_error (Util.option_bind resp ImportInstanceResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImportInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ImportInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImportInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImportInstanceResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/importInstance.mli b/libraries/ec2/lib/importInstance.mli index 7691d3e3e..6491c7431 100644 --- a/libraries/ec2/lib/importInstance.mli +++ b/libraries/ec2/lib/importInstance.mli @@ -1,10 +1,7 @@ open Types - type input = ImportInstanceRequest.t - type output = ImportInstanceResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/importKeyPair.ml b/libraries/ec2/lib/importKeyPair.ml index 55b4eb4b4..72c39c3d6 100644 --- a/libraries/ec2/lib/importKeyPair.ml +++ b/libraries/ec2/lib/importKeyPair.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ImportKeyPairRequest.t - type output = ImportKeyPairResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ImportKeyPair" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ImportKeyPair"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ImportKeyPairRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ImportKeyPairRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ImportKeyPairResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImportKeyPairResult.parse) + Util.or_error (Util.option_bind resp ImportKeyPairResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImportKeyPairResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ImportKeyPairResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImportKeyPairResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImportKeyPairResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/importKeyPair.mli b/libraries/ec2/lib/importKeyPair.mli index ae9e6603e..5f7b44d9c 100644 --- a/libraries/ec2/lib/importKeyPair.mli +++ b/libraries/ec2/lib/importKeyPair.mli @@ -1,10 +1,7 @@ open Types - type input = ImportKeyPairRequest.t - type output = ImportKeyPairResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/importSnapshot.ml b/libraries/ec2/lib/importSnapshot.ml index 2b609b6ee..833cf123f 100644 --- a/libraries/ec2/lib/importSnapshot.ml +++ b/libraries/ec2/lib/importSnapshot.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ImportSnapshotRequest.t - type output = ImportSnapshotResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ImportSnapshot" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ImportSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ImportSnapshotRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ImportSnapshotRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ImportSnapshotResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImportSnapshotResult.parse) + Util.or_error (Util.option_bind resp ImportSnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImportSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ImportSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImportSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImportSnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/importSnapshot.mli b/libraries/ec2/lib/importSnapshot.mli index c3744a5dc..14f77d8ac 100644 --- a/libraries/ec2/lib/importSnapshot.mli +++ b/libraries/ec2/lib/importSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = ImportSnapshotRequest.t - type output = ImportSnapshotResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/importVolume.ml b/libraries/ec2/lib/importVolume.ml index 6d6ab814d..6b04c59ed 100644 --- a/libraries/ec2/lib/importVolume.ml +++ b/libraries/ec2/lib/importVolume.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ImportVolumeRequest.t - type output = ImportVolumeResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ImportVolume" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ImportVolume"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ImportVolumeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ImportVolumeRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ImportVolumeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ImportVolumeResult.parse) + Util.or_error (Util.option_bind resp ImportVolumeResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ImportVolumeResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ImportVolumeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ImportVolumeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ImportVolumeResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/importVolume.mli b/libraries/ec2/lib/importVolume.mli index 728b2ce34..65d253b6d 100644 --- a/libraries/ec2/lib/importVolume.mli +++ b/libraries/ec2/lib/importVolume.mli @@ -1,10 +1,7 @@ open Types - type input = ImportVolumeRequest.t - type output = ImportVolumeResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyImageAttribute.ml b/libraries/ec2/lib/modifyImageAttribute.ml index a55d3966b..fac38a3ad 100644 --- a/libraries/ec2/lib/modifyImageAttribute.ml +++ b/libraries/ec2/lib/modifyImageAttribute.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ModifyImageAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyImageAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ModifyImageAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyImageAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyImageAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyImageAttribute.mli b/libraries/ec2/lib/modifyImageAttribute.mli index 4e169469d..09d6f1c1e 100644 --- a/libraries/ec2/lib/modifyImageAttribute.mli +++ b/libraries/ec2/lib/modifyImageAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyImageAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyInstanceAttribute.ml b/libraries/ec2/lib/modifyInstanceAttribute.ml index d054a10d1..9d7e9dd56 100644 --- a/libraries/ec2/lib/modifyInstanceAttribute.ml +++ b/libraries/ec2/lib/modifyInstanceAttribute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = ModifyInstanceAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyInstanceAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ModifyInstanceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyInstanceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyInstanceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyInstanceAttribute.mli b/libraries/ec2/lib/modifyInstanceAttribute.mli index f39b22c6d..4430a5d60 100644 --- a/libraries/ec2/lib/modifyInstanceAttribute.mli +++ b/libraries/ec2/lib/modifyInstanceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyInstanceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml index d2d5a980d..ad1f6bc10 100644 --- a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = ModifyNetworkInterfaceAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyNetworkInterfaceAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ModifyNetworkInterfaceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyNetworkInterfaceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ModifyNetworkInterfaceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.mli b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.mli index 533c2776b..7401acb39 100644 --- a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.mli +++ b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyNetworkInterfaceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyReservedInstances.ml b/libraries/ec2/lib/modifyReservedInstances.ml index 809003459..376487523 100644 --- a/libraries/ec2/lib/modifyReservedInstances.ml +++ b/libraries/ec2/lib/modifyReservedInstances.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ModifyReservedInstancesRequest.t - type output = ModifyReservedInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyReservedInstances" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ModifyReservedInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyReservedInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyReservedInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ModifyReservedInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyReservedInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyReservedInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyReservedInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyReservedInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyReservedInstances.mli b/libraries/ec2/lib/modifyReservedInstances.mli index 4616b39e0..5c04bd313 100644 --- a/libraries/ec2/lib/modifyReservedInstances.mli +++ b/libraries/ec2/lib/modifyReservedInstances.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyReservedInstancesRequest.t - type output = ModifyReservedInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifySnapshotAttribute.ml b/libraries/ec2/lib/modifySnapshotAttribute.ml index 6dcd14702..052582ca9 100644 --- a/libraries/ec2/lib/modifySnapshotAttribute.ml +++ b/libraries/ec2/lib/modifySnapshotAttribute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = ModifySnapshotAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifySnapshotAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ModifySnapshotAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifySnapshotAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifySnapshotAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifySnapshotAttribute.mli b/libraries/ec2/lib/modifySnapshotAttribute.mli index 6fc1edf24..f701040cb 100644 --- a/libraries/ec2/lib/modifySnapshotAttribute.mli +++ b/libraries/ec2/lib/modifySnapshotAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifySnapshotAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifySubnetAttribute.ml b/libraries/ec2/lib/modifySubnetAttribute.ml index 6c06fc2fa..edf610a91 100644 --- a/libraries/ec2/lib/modifySubnetAttribute.ml +++ b/libraries/ec2/lib/modifySubnetAttribute.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ModifySubnetAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifySubnetAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ModifySubnetAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifySubnetAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifySubnetAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifySubnetAttribute.mli b/libraries/ec2/lib/modifySubnetAttribute.mli index e2d05fd96..735e107ea 100644 --- a/libraries/ec2/lib/modifySubnetAttribute.mli +++ b/libraries/ec2/lib/modifySubnetAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifySubnetAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVolumeAttribute.ml b/libraries/ec2/lib/modifyVolumeAttribute.ml index e5163a3dd..355d37428 100644 --- a/libraries/ec2/lib/modifyVolumeAttribute.ml +++ b/libraries/ec2/lib/modifyVolumeAttribute.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ModifyVolumeAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyVolumeAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ModifyVolumeAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyVolumeAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyVolumeAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVolumeAttribute.mli b/libraries/ec2/lib/modifyVolumeAttribute.mli index 9dc804ca0..6ea7df3dd 100644 --- a/libraries/ec2/lib/modifyVolumeAttribute.mli +++ b/libraries/ec2/lib/modifyVolumeAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyVolumeAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVpcAttribute.ml b/libraries/ec2/lib/modifyVpcAttribute.ml index 2759acc41..81eb4ccdb 100644 --- a/libraries/ec2/lib/modifyVpcAttribute.ml +++ b/libraries/ec2/lib/modifyVpcAttribute.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = ModifyVpcAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyVpcAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ModifyVpcAttribute"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyVpcAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyVpcAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVpcAttribute.mli b/libraries/ec2/lib/modifyVpcAttribute.mli index 35daeca21..7088c9a0e 100644 --- a/libraries/ec2/lib/modifyVpcAttribute.mli +++ b/libraries/ec2/lib/modifyVpcAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyVpcAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVpcEndpoint.ml b/libraries/ec2/lib/modifyVpcEndpoint.ml index 935fe0f52..ddecb465a 100644 --- a/libraries/ec2/lib/modifyVpcEndpoint.ml +++ b/libraries/ec2/lib/modifyVpcEndpoint.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ModifyVpcEndpointRequest.t - type output = ModifyVpcEndpointResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ModifyVpcEndpoint" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ModifyVpcEndpoint"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyVpcEndpointRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyVpcEndpointRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ModifyVpcEndpointResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ModifyVpcEndpointResult.parse) + Util.or_error (Util.option_bind resp ModifyVpcEndpointResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyVpcEndpointResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyVpcEndpointResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyVpcEndpointResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyVpcEndpointResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/modifyVpcEndpoint.mli b/libraries/ec2/lib/modifyVpcEndpoint.mli index 855463b62..3202a8e57 100644 --- a/libraries/ec2/lib/modifyVpcEndpoint.mli +++ b/libraries/ec2/lib/modifyVpcEndpoint.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyVpcEndpointRequest.t - type output = ModifyVpcEndpointResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/monitorInstances.ml b/libraries/ec2/lib/monitorInstances.ml index b53cd73fc..be411dee9 100644 --- a/libraries/ec2/lib/monitorInstances.ml +++ b/libraries/ec2/lib/monitorInstances.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = MonitorInstancesRequest.t - type output = MonitorInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "MonitorInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["MonitorInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (MonitorInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (MonitorInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "MonitorInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp MonitorInstancesResult.parse) + Util.or_error (Util.option_bind resp MonitorInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed MonitorInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed MonitorInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing MonitorInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing MonitorInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/monitorInstances.mli b/libraries/ec2/lib/monitorInstances.mli index 3a7848d9f..90cfaeb5d 100644 --- a/libraries/ec2/lib/monitorInstances.mli +++ b/libraries/ec2/lib/monitorInstances.mli @@ -1,10 +1,7 @@ open Types - type input = MonitorInstancesRequest.t - type output = MonitorInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/moveAddressToVpc.ml b/libraries/ec2/lib/moveAddressToVpc.ml index ddd89e0cc..32cfc1b32 100644 --- a/libraries/ec2/lib/moveAddressToVpc.ml +++ b/libraries/ec2/lib/moveAddressToVpc.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = MoveAddressToVpcRequest.t - type output = MoveAddressToVpcResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "MoveAddressToVpc" ] ] + [("Version", ["2015-04-15"]); ("Action", ["MoveAddressToVpc"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (MoveAddressToVpcRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (MoveAddressToVpcRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "MoveAddressToVpcResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp MoveAddressToVpcResult.parse) + Util.or_error (Util.option_bind resp MoveAddressToVpcResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed MoveAddressToVpcResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed MoveAddressToVpcResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing MoveAddressToVpcResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing MoveAddressToVpcResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/moveAddressToVpc.mli b/libraries/ec2/lib/moveAddressToVpc.mli index 1335fa510..3f1891d9a 100644 --- a/libraries/ec2/lib/moveAddressToVpc.mli +++ b/libraries/ec2/lib/moveAddressToVpc.mli @@ -1,10 +1,7 @@ open Types - type input = MoveAddressToVpcRequest.t - type output = MoveAddressToVpcResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/purchaseReservedInstancesOffering.ml b/libraries/ec2/lib/purchaseReservedInstancesOffering.ml index 4c546dd16..8846faafb 100644 --- a/libraries/ec2/lib/purchaseReservedInstancesOffering.ml +++ b/libraries/ec2/lib/purchaseReservedInstancesOffering.ml @@ -1,65 +1,62 @@ open Types open Aws - type input = PurchaseReservedInstancesOfferingRequest.t - type output = PurchaseReservedInstancesOfferingResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ] - ; "Action", [ "PurchaseReservedInstancesOffering" ] - ] + [("Version", ["2015-04-15"]); + ("Action", ["PurchaseReservedInstancesOffering"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PurchaseReservedInstancesOfferingRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (PurchaseReservedInstancesOfferingRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "PurchaseReservedInstancesOfferingResponse" (snd xml) in + let resp = + Xml.member "PurchaseReservedInstancesOfferingResponse" (snd xml) in try Util.or_error (Util.option_bind resp PurchaseReservedInstancesOfferingResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed PurchaseReservedInstancesOfferingResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PurchaseReservedInstancesOfferingResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PurchaseReservedInstancesOfferingResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PurchaseReservedInstancesOfferingResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/purchaseReservedInstancesOffering.mli b/libraries/ec2/lib/purchaseReservedInstancesOffering.mli index cf55d40cf..265aa52b7 100644 --- a/libraries/ec2/lib/purchaseReservedInstancesOffering.mli +++ b/libraries/ec2/lib/purchaseReservedInstancesOffering.mli @@ -1,10 +1,7 @@ open Types - type input = PurchaseReservedInstancesOfferingRequest.t - type output = PurchaseReservedInstancesOfferingResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/rebootInstances.ml b/libraries/ec2/lib/rebootInstances.ml index 457fb4bcd..846ca18c8 100644 --- a/libraries/ec2/lib/rebootInstances.ml +++ b/libraries/ec2/lib/rebootInstances.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = RebootInstancesRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RebootInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["RebootInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RebootInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RebootInstancesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/rebootInstances.mli b/libraries/ec2/lib/rebootInstances.mli index c8e4585f8..7384ca62d 100644 --- a/libraries/ec2/lib/rebootInstances.mli +++ b/libraries/ec2/lib/rebootInstances.mli @@ -1,10 +1,7 @@ open Types - type input = RebootInstancesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/registerImage.ml b/libraries/ec2/lib/registerImage.ml index 6b85a3f02..442fe2cf9 100644 --- a/libraries/ec2/lib/registerImage.ml +++ b/libraries/ec2/lib/registerImage.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = RegisterImageRequest.t - type output = RegisterImageResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RegisterImage" ] ] + [("Version", ["2015-04-15"]); ("Action", ["RegisterImage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RegisterImageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RegisterImageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RegisterImageResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp RegisterImageResult.parse) + Util.or_error (Util.option_bind resp RegisterImageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed RegisterImageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed RegisterImageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RegisterImageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RegisterImageResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/registerImage.mli b/libraries/ec2/lib/registerImage.mli index b74e1deee..c7dbbc13a 100644 --- a/libraries/ec2/lib/registerImage.mli +++ b/libraries/ec2/lib/registerImage.mli @@ -1,10 +1,7 @@ open Types - type input = RegisterImageRequest.t - type output = RegisterImageResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/rejectVpcPeeringConnection.ml b/libraries/ec2/lib/rejectVpcPeeringConnection.ml index 6ceb702cb..785d9fa13 100644 --- a/libraries/ec2/lib/rejectVpcPeeringConnection.ml +++ b/libraries/ec2/lib/rejectVpcPeeringConnection.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = RejectVpcPeeringConnectionRequest.t - type output = RejectVpcPeeringConnectionResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RejectVpcPeeringConnection" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["RejectVpcPeeringConnection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RejectVpcPeeringConnectionRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (RejectVpcPeeringConnectionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp RejectVpcPeeringConnectionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RejectVpcPeeringConnectionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RejectVpcPeeringConnectionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RejectVpcPeeringConnectionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RejectVpcPeeringConnectionResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/rejectVpcPeeringConnection.mli b/libraries/ec2/lib/rejectVpcPeeringConnection.mli index 7a172dc0f..86b3c09af 100644 --- a/libraries/ec2/lib/rejectVpcPeeringConnection.mli +++ b/libraries/ec2/lib/rejectVpcPeeringConnection.mli @@ -1,10 +1,7 @@ open Types - type input = RejectVpcPeeringConnectionRequest.t - type output = RejectVpcPeeringConnectionResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/releaseAddress.ml b/libraries/ec2/lib/releaseAddress.ml index 619ca60e3..de4fea142 100644 --- a/libraries/ec2/lib/releaseAddress.ml +++ b/libraries/ec2/lib/releaseAddress.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = ReleaseAddressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReleaseAddress" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ReleaseAddress"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ReleaseAddressRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ReleaseAddressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/releaseAddress.mli b/libraries/ec2/lib/releaseAddress.mli index b40fbb3c2..c4cd9580f 100644 --- a/libraries/ec2/lib/releaseAddress.mli +++ b/libraries/ec2/lib/releaseAddress.mli @@ -1,10 +1,7 @@ open Types - type input = ReleaseAddressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceNetworkAclAssociation.ml b/libraries/ec2/lib/replaceNetworkAclAssociation.ml index f58202241..e05d0a0fb 100644 --- a/libraries/ec2/lib/replaceNetworkAclAssociation.ml +++ b/libraries/ec2/lib/replaceNetworkAclAssociation.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = ReplaceNetworkAclAssociationRequest.t - type output = ReplaceNetworkAclAssociationResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReplaceNetworkAclAssociation" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ReplaceNetworkAclAssociation"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ReplaceNetworkAclAssociationRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ReplaceNetworkAclAssociationRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp ReplaceNetworkAclAssociationResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ReplaceNetworkAclAssociationResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReplaceNetworkAclAssociationResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReplaceNetworkAclAssociationResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReplaceNetworkAclAssociationResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceNetworkAclAssociation.mli b/libraries/ec2/lib/replaceNetworkAclAssociation.mli index 7d0cc215d..8abf4c108 100644 --- a/libraries/ec2/lib/replaceNetworkAclAssociation.mli +++ b/libraries/ec2/lib/replaceNetworkAclAssociation.mli @@ -1,10 +1,7 @@ open Types - type input = ReplaceNetworkAclAssociationRequest.t - type output = ReplaceNetworkAclAssociationResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceNetworkAclEntry.ml b/libraries/ec2/lib/replaceNetworkAclEntry.ml index 2706e6a47..021d435d9 100644 --- a/libraries/ec2/lib/replaceNetworkAclEntry.ml +++ b/libraries/ec2/lib/replaceNetworkAclEntry.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = ReplaceNetworkAclEntryRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReplaceNetworkAclEntry" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ReplaceNetworkAclEntry"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ReplaceNetworkAclEntryRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ReplaceNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceNetworkAclEntry.mli b/libraries/ec2/lib/replaceNetworkAclEntry.mli index e981cecbd..ec5f71946 100644 --- a/libraries/ec2/lib/replaceNetworkAclEntry.mli +++ b/libraries/ec2/lib/replaceNetworkAclEntry.mli @@ -1,10 +1,7 @@ open Types - type input = ReplaceNetworkAclEntryRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceRoute.ml b/libraries/ec2/lib/replaceRoute.ml index 2d9676d7e..161761224 100644 --- a/libraries/ec2/lib/replaceRoute.ml +++ b/libraries/ec2/lib/replaceRoute.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = ReplaceRouteRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReplaceRoute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ReplaceRoute"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ReplaceRouteRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ReplaceRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceRoute.mli b/libraries/ec2/lib/replaceRoute.mli index 35a31a3d4..9b018df81 100644 --- a/libraries/ec2/lib/replaceRoute.mli +++ b/libraries/ec2/lib/replaceRoute.mli @@ -1,10 +1,7 @@ open Types - type input = ReplaceRouteRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceRouteTableAssociation.ml b/libraries/ec2/lib/replaceRouteTableAssociation.ml index 0ae01f0aa..99ce855ae 100644 --- a/libraries/ec2/lib/replaceRouteTableAssociation.ml +++ b/libraries/ec2/lib/replaceRouteTableAssociation.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = ReplaceRouteTableAssociationRequest.t - type output = ReplaceRouteTableAssociationResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReplaceRouteTableAssociation" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ReplaceRouteTableAssociation"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ReplaceRouteTableAssociationRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ReplaceRouteTableAssociationRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp ReplaceRouteTableAssociationResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ReplaceRouteTableAssociationResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReplaceRouteTableAssociationResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReplaceRouteTableAssociationResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReplaceRouteTableAssociationResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/replaceRouteTableAssociation.mli b/libraries/ec2/lib/replaceRouteTableAssociation.mli index 71bfc8dfa..a46cd3e89 100644 --- a/libraries/ec2/lib/replaceRouteTableAssociation.mli +++ b/libraries/ec2/lib/replaceRouteTableAssociation.mli @@ -1,10 +1,7 @@ open Types - type input = ReplaceRouteTableAssociationRequest.t - type output = ReplaceRouteTableAssociationResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/reportInstanceStatus.ml b/libraries/ec2/lib/reportInstanceStatus.ml index e101e9141..037081392 100644 --- a/libraries/ec2/lib/reportInstanceStatus.ml +++ b/libraries/ec2/lib/reportInstanceStatus.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ReportInstanceStatusRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ReportInstanceStatus" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ReportInstanceStatus"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ReportInstanceStatusRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ReportInstanceStatusRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/reportInstanceStatus.mli b/libraries/ec2/lib/reportInstanceStatus.mli index 163090896..5f49dc31d 100644 --- a/libraries/ec2/lib/reportInstanceStatus.mli +++ b/libraries/ec2/lib/reportInstanceStatus.mli @@ -1,10 +1,7 @@ open Types - type input = ReportInstanceStatusRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/requestSpotFleet.ml b/libraries/ec2/lib/requestSpotFleet.ml index 620221ef8..1589175bb 100644 --- a/libraries/ec2/lib/requestSpotFleet.ml +++ b/libraries/ec2/lib/requestSpotFleet.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = RequestSpotFleetRequest.t - type output = RequestSpotFleetResponse.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RequestSpotFleet" ] ] + [("Version", ["2015-04-15"]); ("Action", ["RequestSpotFleet"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RequestSpotFleetRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RequestSpotFleetRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RequestSpotFleetResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp RequestSpotFleetResponse.parse) + Util.or_error (Util.option_bind resp RequestSpotFleetResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RequestSpotFleetResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RequestSpotFleetResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RequestSpotFleetResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RequestSpotFleetResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/requestSpotFleet.mli b/libraries/ec2/lib/requestSpotFleet.mli index c54ff6d0f..7ead22989 100644 --- a/libraries/ec2/lib/requestSpotFleet.mli +++ b/libraries/ec2/lib/requestSpotFleet.mli @@ -1,10 +1,7 @@ open Types - type input = RequestSpotFleetRequest.t - type output = RequestSpotFleetResponse.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 \ No newline at end of file diff --git a/libraries/ec2/lib/requestSpotInstances.ml b/libraries/ec2/lib/requestSpotInstances.ml index c14a6d272..94e81c2f9 100644 --- a/libraries/ec2/lib/requestSpotInstances.ml +++ b/libraries/ec2/lib/requestSpotInstances.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = RequestSpotInstancesRequest.t - type output = RequestSpotInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RequestSpotInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["RequestSpotInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RequestSpotInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (RequestSpotInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RequestSpotInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp RequestSpotInstancesResult.parse) + Util.or_error (Util.option_bind resp RequestSpotInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RequestSpotInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RequestSpotInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RequestSpotInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RequestSpotInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/requestSpotInstances.mli b/libraries/ec2/lib/requestSpotInstances.mli index a043fa317..b0d171ff4 100644 --- a/libraries/ec2/lib/requestSpotInstances.mli +++ b/libraries/ec2/lib/requestSpotInstances.mli @@ -1,10 +1,7 @@ open Types - type input = RequestSpotInstancesRequest.t - type output = RequestSpotInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetImageAttribute.ml b/libraries/ec2/lib/resetImageAttribute.ml index f339decd9..054cf94ae 100644 --- a/libraries/ec2/lib/resetImageAttribute.ml +++ b/libraries/ec2/lib/resetImageAttribute.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ResetImageAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ResetImageAttribute" ] ] + [("Version", ["2015-04-15"]); ("Action", ["ResetImageAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetImageAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ResetImageAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetImageAttribute.mli b/libraries/ec2/lib/resetImageAttribute.mli index fa3f7cdee..9fec04801 100644 --- a/libraries/ec2/lib/resetImageAttribute.mli +++ b/libraries/ec2/lib/resetImageAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ResetImageAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetInstanceAttribute.ml b/libraries/ec2/lib/resetInstanceAttribute.ml index 972b09f50..e3054d51e 100644 --- a/libraries/ec2/lib/resetInstanceAttribute.ml +++ b/libraries/ec2/lib/resetInstanceAttribute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = ResetInstanceAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ResetInstanceAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ResetInstanceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetInstanceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ResetInstanceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetInstanceAttribute.mli b/libraries/ec2/lib/resetInstanceAttribute.mli index 84f51933a..6f4674cc0 100644 --- a/libraries/ec2/lib/resetInstanceAttribute.mli +++ b/libraries/ec2/lib/resetInstanceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ResetInstanceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml b/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml index 005f3afec..e2175ae27 100644 --- a/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = ResetNetworkInterfaceAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ResetNetworkInterfaceAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ResetNetworkInterfaceAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetNetworkInterfaceAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ResetNetworkInterfaceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetNetworkInterfaceAttribute.mli b/libraries/ec2/lib/resetNetworkInterfaceAttribute.mli index 25bee536d..251179ea3 100644 --- a/libraries/ec2/lib/resetNetworkInterfaceAttribute.mli +++ b/libraries/ec2/lib/resetNetworkInterfaceAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ResetNetworkInterfaceAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetSnapshotAttribute.ml b/libraries/ec2/lib/resetSnapshotAttribute.ml index ebe5a0b9d..c9b1c80f9 100644 --- a/libraries/ec2/lib/resetSnapshotAttribute.ml +++ b/libraries/ec2/lib/resetSnapshotAttribute.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = ResetSnapshotAttributeRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "ResetSnapshotAttribute" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["ResetSnapshotAttribute"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetSnapshotAttributeRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ResetSnapshotAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/resetSnapshotAttribute.mli b/libraries/ec2/lib/resetSnapshotAttribute.mli index 954960a1f..8bd1c8947 100644 --- a/libraries/ec2/lib/resetSnapshotAttribute.mli +++ b/libraries/ec2/lib/resetSnapshotAttribute.mli @@ -1,10 +1,7 @@ open Types - type input = ResetSnapshotAttributeRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/restoreAddressToClassic.ml b/libraries/ec2/lib/restoreAddressToClassic.ml index 71b3f5e6f..2f967e374 100644 --- a/libraries/ec2/lib/restoreAddressToClassic.ml +++ b/libraries/ec2/lib/restoreAddressToClassic.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = RestoreAddressToClassicRequest.t - type output = RestoreAddressToClassicResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RestoreAddressToClassic" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["RestoreAddressToClassic"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RestoreAddressToClassicRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (RestoreAddressToClassicRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp RestoreAddressToClassicResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RestoreAddressToClassicResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RestoreAddressToClassicResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreAddressToClassicResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreAddressToClassicResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/restoreAddressToClassic.mli b/libraries/ec2/lib/restoreAddressToClassic.mli index 5ec5848e3..71770b0ae 100644 --- a/libraries/ec2/lib/restoreAddressToClassic.mli +++ b/libraries/ec2/lib/restoreAddressToClassic.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreAddressToClassicRequest.t - type output = RestoreAddressToClassicResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/revokeSecurityGroupEgress.ml b/libraries/ec2/lib/revokeSecurityGroupEgress.ml index 065365cb8..af6c5e4bc 100644 --- a/libraries/ec2/lib/revokeSecurityGroupEgress.ml +++ b/libraries/ec2/lib/revokeSecurityGroupEgress.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = RevokeSecurityGroupEgressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RevokeSecurityGroupEgress" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["RevokeSecurityGroupEgress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RevokeSecurityGroupEgressRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (RevokeSecurityGroupEgressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/revokeSecurityGroupEgress.mli b/libraries/ec2/lib/revokeSecurityGroupEgress.mli index c2288b8cc..d98c83478 100644 --- a/libraries/ec2/lib/revokeSecurityGroupEgress.mli +++ b/libraries/ec2/lib/revokeSecurityGroupEgress.mli @@ -1,10 +1,7 @@ open Types - type input = RevokeSecurityGroupEgressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/revokeSecurityGroupIngress.ml b/libraries/ec2/lib/revokeSecurityGroupIngress.ml index 2e16e14c9..eeb2176c4 100644 --- a/libraries/ec2/lib/revokeSecurityGroupIngress.ml +++ b/libraries/ec2/lib/revokeSecurityGroupIngress.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = RevokeSecurityGroupIngressRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RevokeSecurityGroupIngress" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["RevokeSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RevokeSecurityGroupIngressRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (RevokeSecurityGroupIngressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/revokeSecurityGroupIngress.mli b/libraries/ec2/lib/revokeSecurityGroupIngress.mli index 1f85e987e..31728118e 100644 --- a/libraries/ec2/lib/revokeSecurityGroupIngress.mli +++ b/libraries/ec2/lib/revokeSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = RevokeSecurityGroupIngressRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/runInstances.ml b/libraries/ec2/lib/runInstances.ml index cfcc3fd00..9abe1d949 100644 --- a/libraries/ec2/lib/runInstances.ml +++ b/libraries/ec2/lib/runInstances.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = RunInstancesRequest.t - type output = Reservation.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "RunInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["RunInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RunInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RunInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RunInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp Reservation.parse) + Util.or_error (Util.option_bind resp Reservation.parse) (let open Error in - BadResponse { body; message = "Could not find well formed Reservation." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed Reservation." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing Reservation - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing Reservation - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/runInstances.mli b/libraries/ec2/lib/runInstances.mli index 373122e02..f1c9a0dab 100644 --- a/libraries/ec2/lib/runInstances.mli +++ b/libraries/ec2/lib/runInstances.mli @@ -1,10 +1,7 @@ open Types - type input = RunInstancesRequest.t - type output = Reservation.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 \ No newline at end of file diff --git a/libraries/ec2/lib/startInstances.ml b/libraries/ec2/lib/startInstances.ml index 4029c59ff..c111c0e37 100644 --- a/libraries/ec2/lib/startInstances.ml +++ b/libraries/ec2/lib/startInstances.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = StartInstancesRequest.t - type output = StartInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "StartInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["StartInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (StartInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (StartInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "StartInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp StartInstancesResult.parse) + Util.or_error (Util.option_bind resp StartInstancesResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed StartInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed StartInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing StartInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing StartInstancesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/startInstances.mli b/libraries/ec2/lib/startInstances.mli index 1c6525aa0..114407cfe 100644 --- a/libraries/ec2/lib/startInstances.mli +++ b/libraries/ec2/lib/startInstances.mli @@ -1,10 +1,7 @@ open Types - type input = StartInstancesRequest.t - type output = StartInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/stopInstances.ml b/libraries/ec2/lib/stopInstances.ml index 3e444daae..fc75776ce 100644 --- a/libraries/ec2/lib/stopInstances.ml +++ b/libraries/ec2/lib/stopInstances.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = StopInstancesRequest.t - type output = StopInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "StopInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["StopInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (StopInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (StopInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "StopInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp StopInstancesResult.parse) + Util.or_error (Util.option_bind resp StopInstancesResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed StopInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed StopInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing StopInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing StopInstancesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/stopInstances.mli b/libraries/ec2/lib/stopInstances.mli index b9dd73b94..f1630a3cc 100644 --- a/libraries/ec2/lib/stopInstances.mli +++ b/libraries/ec2/lib/stopInstances.mli @@ -1,10 +1,7 @@ open Types - type input = StopInstancesRequest.t - type output = StopInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/terminateInstances.ml b/libraries/ec2/lib/terminateInstances.ml index 71764b72f..28a63d0fb 100644 --- a/libraries/ec2/lib/terminateInstances.ml +++ b/libraries/ec2/lib/terminateInstances.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = TerminateInstancesRequest.t - type output = TerminateInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "TerminateInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["TerminateInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (TerminateInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (TerminateInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "TerminateInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp TerminateInstancesResult.parse) + Util.or_error (Util.option_bind resp TerminateInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed TerminateInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed TerminateInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TerminateInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TerminateInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/terminateInstances.mli b/libraries/ec2/lib/terminateInstances.mli index 2f8ebd1cb..cae6927ad 100644 --- a/libraries/ec2/lib/terminateInstances.mli +++ b/libraries/ec2/lib/terminateInstances.mli @@ -1,10 +1,7 @@ open Types - type input = TerminateInstancesRequest.t - type output = TerminateInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib/types.ml b/libraries/ec2/lib/types.ml index 35a885c8b..24879e64b 100644 --- a/libraries/ec2/lib/types.ml +++ b/libraries/ec2/lib/types.ml @@ -1,29879 +1,30728 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module VolumeType = struct - type t = - | Standard - | Io1 - | Gp2 - - let str_to_t = [ "gp2", Gp2; "io1", Io1; "standard", Standard ] - - let t_to_str = [ Gp2, "gp2"; Io1, "io1"; Standard, "standard" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module PrivateIpAddressSpecification = struct - type t = - { private_ip_address : String.t - ; primary : Boolean.t option - } - - let make ~private_ip_address ?primary () = { private_ip_address; primary } - - let parse xml = - Some - { private_ip_address = - Xml.required - "privateIpAddress" - (Util.option_bind (Xml.member "privateIpAddress" xml) String.parse) - ; primary = Util.option_bind (Xml.member "primary" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.primary (fun f -> Query.Pair ("Primary", Boolean.to_query f)) - ; Some (Query.Pair ("PrivateIpAddress", String.to_query v.private_ip_address)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.primary (fun f -> "primary", Boolean.to_json f) - ; Some ("private_ip_address", String.to_json v.private_ip_address) - ]) - - let of_json j = - { private_ip_address = - String.of_json (Util.of_option_exn (Json.lookup j "private_ip_address")) - ; primary = Util.option_map (Json.lookup j "primary") Boolean.of_json - } -end - -module InstanceNetworkInterfaceAssociation = struct - type t = - { public_ip : String.t option - ; public_dns_name : String.t option - ; ip_owner_id : String.t option - } - - let make ?public_ip ?public_dns_name ?ip_owner_id () = - { public_ip; public_dns_name; ip_owner_id } - - let parse xml = - Some - { public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - ; public_dns_name = Util.option_bind (Xml.member "publicDnsName" xml) String.parse - ; ip_owner_id = Util.option_bind (Xml.member "ipOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.ip_owner_id (fun f -> - Query.Pair ("IpOwnerId", String.to_query f)) - ; Util.option_map v.public_dns_name (fun f -> - Query.Pair ("PublicDnsName", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.ip_owner_id (fun f -> "ip_owner_id", String.to_json f) - ; Util.option_map v.public_dns_name (fun f -> - "public_dns_name", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ]) - - let of_json j = - { public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; public_dns_name = Util.option_map (Json.lookup j "public_dns_name") String.of_json - ; ip_owner_id = Util.option_map (Json.lookup j "ip_owner_id") String.of_json - } -end - -module EbsBlockDevice = struct - type t = - { snapshot_id : String.t option - ; volume_size : Integer.t option - ; delete_on_termination : Boolean.t option - ; volume_type : VolumeType.t option - ; iops : Integer.t option - ; encrypted : Boolean.t option - } - - let make - ?snapshot_id - ?volume_size - ?delete_on_termination - ?volume_type - ?iops - ?encrypted - () = - { snapshot_id; volume_size; delete_on_termination; volume_type; iops; encrypted } - - let parse xml = - Some - { snapshot_id = Util.option_bind (Xml.member "snapshotId" xml) String.parse - ; volume_size = Util.option_bind (Xml.member "volumeSize" xml) Integer.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - ; volume_type = Util.option_bind (Xml.member "volumeType" xml) VolumeType.parse - ; iops = Util.option_bind (Xml.member "iops" xml) Integer.parse - ; encrypted = Util.option_bind (Xml.member "encrypted" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.encrypted (fun f -> - Query.Pair ("Encrypted", Boolean.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.volume_type (fun f -> - Query.Pair ("VolumeType", VolumeType.to_query f)) - ; Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.volume_size (fun f -> - Query.Pair ("VolumeSize", Integer.to_query f)) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.encrypted (fun f -> "encrypted", Boolean.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.volume_type (fun f -> "volume_type", VolumeType.to_json f) - ; Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.volume_size (fun f -> "volume_size", Integer.to_json f) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ]) - - let of_json j = - { snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; volume_size = Util.option_map (Json.lookup j "volume_size") Integer.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - ; volume_type = Util.option_map (Json.lookup j "volume_type") VolumeType.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; encrypted = Util.option_map (Json.lookup j "encrypted") Boolean.of_json - } -end - -module PrivateIpAddressSpecificationList = struct - type t = PrivateIpAddressSpecification.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map PrivateIpAddressSpecification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PrivateIpAddressSpecification.to_query v - - let to_json v = `List (List.map PrivateIpAddressSpecification.to_json v) - - let of_json j = Json.to_list PrivateIpAddressSpecification.of_json j -end - -module SecurityGroupIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SecurityGroupId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AttachmentStatus = struct - type t = - | Attaching - | Attached - | Detaching - | Detached - - let str_to_t = - [ "detached", Detached - ; "detaching", Detaching - ; "attached", Attached - ; "attaching", Attaching - ] - - let t_to_str = - [ Detached, "detached" - ; Detaching, "detaching" - ; Attached, "attached" - ; Attaching, "attaching" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module GroupIdentifier = struct - type t = - { group_name : String.t option - ; group_id : String.t option - } - - let make ?group_name ?group_id () = { group_name; group_id } - - let parse xml = - Some - { group_name = Util.option_bind (Xml.member "groupName" xml) String.parse - ; group_id = Util.option_bind (Xml.member "groupId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> Query.Pair ("GroupId", String.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> "group_id", String.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ]) - - let of_json j = - { group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; group_id = Util.option_map (Json.lookup j "group_id") String.of_json - } -end - -module InstancePrivateIpAddress = struct - type t = - { private_ip_address : String.t option - ; private_dns_name : String.t option - ; primary : Boolean.t option - ; association : InstanceNetworkInterfaceAssociation.t option - } - - let make ?private_ip_address ?private_dns_name ?primary ?association () = - { private_ip_address; private_dns_name; primary; association } - - let parse xml = - Some - { private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; private_dns_name = Util.option_bind (Xml.member "privateDnsName" xml) String.parse - ; primary = Util.option_bind (Xml.member "primary" xml) Boolean.parse - ; association = - Util.option_bind - (Xml.member "association" xml) - InstanceNetworkInterfaceAssociation.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association (fun f -> - Query.Pair ("Association", InstanceNetworkInterfaceAssociation.to_query f)) - ; Util.option_map v.primary (fun f -> Query.Pair ("Primary", Boolean.to_query f)) - ; Util.option_map v.private_dns_name (fun f -> - Query.Pair ("PrivateDnsName", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association (fun f -> - "association", InstanceNetworkInterfaceAssociation.to_json f) - ; Util.option_map v.primary (fun f -> "primary", Boolean.to_json f) - ; Util.option_map v.private_dns_name (fun f -> - "private_dns_name", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ]) - - let of_json j = - { private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json - ; primary = Util.option_map (Json.lookup j "primary") Boolean.of_json - ; association = - Util.option_map - (Json.lookup j "association") - InstanceNetworkInterfaceAssociation.of_json - } -end - -module DiskImageFormat = struct - type t = - | VMDK - | RAW - | VHD - - let str_to_t = [ "VHD", VHD; "RAW", RAW; "VMDK", VMDK ] - - let t_to_str = [ VHD, "VHD"; RAW, "RAW"; VMDK, "VMDK" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BlockDeviceMapping = struct - type t = - { virtual_name : String.t option - ; device_name : String.t - ; ebs : EbsBlockDevice.t option - ; no_device : String.t option - } - - let make ?virtual_name ~device_name ?ebs ?no_device () = - { virtual_name; device_name; ebs; no_device } - - let parse xml = - Some - { virtual_name = Util.option_bind (Xml.member "virtualName" xml) String.parse - ; device_name = - Xml.required - "deviceName" - (Util.option_bind (Xml.member "deviceName" xml) String.parse) - ; ebs = Util.option_bind (Xml.member "ebs" xml) EbsBlockDevice.parse - ; no_device = Util.option_bind (Xml.member "noDevice" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> - Query.Pair ("NoDevice", String.to_query f)) - ; Util.option_map v.ebs (fun f -> Query.Pair ("Ebs", EbsBlockDevice.to_query f)) - ; Some (Query.Pair ("DeviceName", String.to_query v.device_name)) - ; Util.option_map v.virtual_name (fun f -> - Query.Pair ("VirtualName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> "no_device", String.to_json f) - ; Util.option_map v.ebs (fun f -> "ebs", EbsBlockDevice.to_json f) - ; Some ("device_name", String.to_json v.device_name) - ; Util.option_map v.virtual_name (fun f -> "virtual_name", String.to_json f) - ]) - - let of_json j = - { virtual_name = Util.option_map (Json.lookup j "virtual_name") String.of_json - ; device_name = String.of_json (Util.of_option_exn (Json.lookup j "device_name")) - ; ebs = Util.option_map (Json.lookup j "ebs") EbsBlockDevice.of_json - ; no_device = Util.option_map (Json.lookup j "no_device") String.of_json - } -end - -module InstanceNetworkInterfaceSpecification = struct - type t = - { network_interface_id : String.t option - ; device_index : Integer.t option - ; subnet_id : String.t option - ; description : String.t option - ; private_ip_address : String.t option - ; groups : SecurityGroupIdStringList.t - ; delete_on_termination : Boolean.t option - ; private_ip_addresses : PrivateIpAddressSpecificationList.t - ; secondary_private_ip_address_count : Integer.t option - ; associate_public_ip_address : Boolean.t option - } - - let make - ?network_interface_id - ?device_index - ?subnet_id - ?description - ?private_ip_address - ?(groups = []) - ?delete_on_termination - ?(private_ip_addresses = []) - ?secondary_private_ip_address_count - ?associate_public_ip_address - () = - { network_interface_id - ; device_index - ; subnet_id - ; description - ; private_ip_address - ; groups - ; delete_on_termination - ; private_ip_addresses - ; secondary_private_ip_address_count - ; associate_public_ip_address - } - - let parse xml = - Some - { network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; device_index = Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupId" xml) - SecurityGroupIdStringList.parse) - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - ; private_ip_addresses = - Util.of_option - [] - (Util.option_bind - (Xml.member "privateIpAddressesSet" xml) - PrivateIpAddressSpecificationList.parse) - ; secondary_private_ip_address_count = - Util.option_bind (Xml.member "secondaryPrivateIpAddressCount" xml) Integer.parse - ; associate_public_ip_address = - Util.option_bind (Xml.member "associatePublicIpAddress" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.associate_public_ip_address (fun f -> - Query.Pair ("AssociatePublicIpAddress", Boolean.to_query f)) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - Query.Pair ("SecondaryPrivateIpAddressCount", Integer.to_query f)) - ; Some +module VolumeType = + struct + type t = + | Standard + | Io1 + | Gp2 + let str_to_t = [("gp2", Gp2); ("io1", Io1); ("standard", Standard)] + let t_to_str = [(Gp2, "gp2"); (Io1, "io1"); (Standard, "standard")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module PrivateIpAddressSpecification = + struct + type t = { + private_ip_address: String.t ; + primary: Boolean.t option } + let make ~private_ip_address ?primary () = + { private_ip_address; primary } + let parse xml = + Some + { + private_ip_address = + (Xml.required "privateIpAddress" + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse)); + primary = + (Util.option_bind (Xml.member "primary" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.primary + (fun f -> Query.Pair ("Primary", (Boolean.to_query f))); + Some (Query.Pair - ( "PrivateIpAddressesSet" - , PrivateIpAddressSpecificationList.to_query v.private_ip_addresses )) - ; Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Some - (Query.Pair ("SecurityGroupId", SecurityGroupIdStringList.to_query v.groups)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.device_index (fun f -> - Query.Pair ("DeviceIndex", Integer.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.associate_public_ip_address (fun f -> - "associate_public_ip_address", Boolean.to_json f) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - "secondary_private_ip_address_count", Integer.to_json f) - ; Some - ( "private_ip_addresses" - , PrivateIpAddressSpecificationList.to_json v.private_ip_addresses ) - ; Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Some ("groups", SecurityGroupIdStringList.to_json v.groups) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.device_index (fun f -> "device_index", Integer.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ]) - - let of_json j = - { network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; device_index = Util.option_map (Json.lookup j "device_index") Integer.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; groups = - SecurityGroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - ; private_ip_addresses = - PrivateIpAddressSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - ; secondary_private_ip_address_count = - Util.option_map - (Json.lookup j "secondary_private_ip_address_count") - Integer.of_json - ; associate_public_ip_address = - Util.option_map (Json.lookup j "associate_public_ip_address") Boolean.of_json - } -end - -module EbsInstanceBlockDevice = struct - type t = - { volume_id : String.t option - ; status : AttachmentStatus.t option - ; attach_time : DateTime.t option - ; delete_on_termination : Boolean.t option - } - - let make ?volume_id ?status ?attach_time ?delete_on_termination () = - { volume_id; status; attach_time; delete_on_termination } - - let parse xml = - Some - { volume_id = Util.option_bind (Xml.member "volumeId" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) AttachmentStatus.parse - ; attach_time = Util.option_bind (Xml.member "attachTime" xml) DateTime.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.attach_time (fun f -> - Query.Pair ("AttachTime", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", AttachmentStatus.to_query f)) - ; Util.option_map v.volume_id (fun f -> - Query.Pair ("VolumeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.attach_time (fun f -> "attach_time", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", AttachmentStatus.to_json f) - ; Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) - ]) - - let of_json j = - { volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") AttachmentStatus.of_json - ; attach_time = Util.option_map (Json.lookup j "attach_time") DateTime.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module GroupIdentifierList = struct - type t = GroupIdentifier.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map GroupIdentifier.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list GroupIdentifier.to_query v - - let to_json v = `List (List.map GroupIdentifier.to_json v) - - let of_json j = Json.to_list GroupIdentifier.of_json j -end - -module InstanceNetworkInterfaceAttachment = struct - type t = - { attachment_id : String.t option - ; device_index : Integer.t option - ; status : AttachmentStatus.t option - ; attach_time : DateTime.t option - ; delete_on_termination : Boolean.t option - } - - let make ?attachment_id ?device_index ?status ?attach_time ?delete_on_termination () = - { attachment_id; device_index; status; attach_time; delete_on_termination } - - let parse xml = - Some - { attachment_id = Util.option_bind (Xml.member "attachmentId" xml) String.parse - ; device_index = Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse - ; status = Util.option_bind (Xml.member "status" xml) AttachmentStatus.parse - ; attach_time = Util.option_bind (Xml.member "attachTime" xml) DateTime.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.attach_time (fun f -> - Query.Pair ("AttachTime", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", AttachmentStatus.to_query f)) - ; Util.option_map v.device_index (fun f -> - Query.Pair ("DeviceIndex", Integer.to_query f)) - ; Util.option_map v.attachment_id (fun f -> - Query.Pair ("AttachmentId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.attach_time (fun f -> "attach_time", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", AttachmentStatus.to_json f) - ; Util.option_map v.device_index (fun f -> "device_index", Integer.to_json f) - ; Util.option_map v.attachment_id (fun f -> "attachment_id", String.to_json f) - ]) - - let of_json j = - { attachment_id = Util.option_map (Json.lookup j "attachment_id") String.of_json - ; device_index = Util.option_map (Json.lookup j "device_index") Integer.of_json - ; status = Util.option_map (Json.lookup j "status") AttachmentStatus.of_json - ; attach_time = Util.option_map (Json.lookup j "attach_time") DateTime.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module InstancePrivateIpAddressList = struct - type t = InstancePrivateIpAddress.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstancePrivateIpAddress.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstancePrivateIpAddress.to_query v - - let to_json v = `List (List.map InstancePrivateIpAddress.to_json v) - - let of_json j = Json.to_list InstancePrivateIpAddress.of_json j -end - -module NetworkInterfaceStatus = struct - type t = - | Available - | Attaching - | In_use - | Detaching - - let str_to_t = - [ "detaching", Detaching - ; "in-use", In_use - ; "attaching", Attaching - ; "available", Available - ] - - let t_to_str = - [ Detaching, "detaching" - ; In_use, "in-use" - ; Attaching, "attaching" - ; Available, "available" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ProductCodeValues = struct - type t = - | Devpay - | Marketplace - - let str_to_t = [ "marketplace", Marketplace; "devpay", Devpay ] - - let t_to_str = [ Marketplace, "marketplace"; Devpay, "devpay" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AttributeValue = struct - type t = { value : String.t option } - - let make ?value () = { value } - - let parse xml = Some { value = Util.option_bind (Xml.member "value" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) ]) - - let of_json j = { value = Util.option_map (Json.lookup j "value") String.of_json } -end - -module InstanceType = struct - type t = - | T1_micro - | M1_small - | M1_medium - | M1_large - | M1_xlarge - | M3_medium - | M3_large - | M3_xlarge - | M3_2xlarge - | M4_large - | M4_xlarge - | M4_2xlarge - | M4_4xlarge - | M4_10xlarge - | T2_micro - | T2_small - | T2_medium - | T2_large - | M2_xlarge - | M2_2xlarge - | M2_4xlarge - | Cr1_8xlarge - | I2_xlarge - | I2_2xlarge - | I2_4xlarge - | I2_8xlarge - | Hi1_4xlarge - | Hs1_8xlarge - | C1_medium - | C1_xlarge - | C3_large - | C3_xlarge - | C3_2xlarge - | C3_4xlarge - | C3_8xlarge - | C4_large - | C4_xlarge - | C4_2xlarge - | C4_4xlarge - | C4_8xlarge - | Cc1_4xlarge - | Cc2_8xlarge - | G2_2xlarge - | Cg1_4xlarge - | R3_large - | R3_xlarge - | R3_2xlarge - | R3_4xlarge - | R3_8xlarge - | D2_xlarge - | D2_2xlarge - | D2_4xlarge - | D2_8xlarge - - let str_to_t = - [ "d2.8xlarge", D2_8xlarge - ; "d2.4xlarge", D2_4xlarge - ; "d2.2xlarge", D2_2xlarge - ; "d2.xlarge", D2_xlarge - ; "r3.8xlarge", R3_8xlarge - ; "r3.4xlarge", R3_4xlarge - ; "r3.2xlarge", R3_2xlarge - ; "r3.xlarge", R3_xlarge - ; "r3.large", R3_large - ; "cg1.4xlarge", Cg1_4xlarge - ; "g2.2xlarge", G2_2xlarge - ; "cc2.8xlarge", Cc2_8xlarge - ; "cc1.4xlarge", Cc1_4xlarge - ; "c4.8xlarge", C4_8xlarge - ; "c4.4xlarge", C4_4xlarge - ; "c4.2xlarge", C4_2xlarge - ; "c4.xlarge", C4_xlarge - ; "c4.large", C4_large - ; "c3.8xlarge", C3_8xlarge - ; "c3.4xlarge", C3_4xlarge - ; "c3.2xlarge", C3_2xlarge - ; "c3.xlarge", C3_xlarge - ; "c3.large", C3_large - ; "c1.xlarge", C1_xlarge - ; "c1.medium", C1_medium - ; "hs1.8xlarge", Hs1_8xlarge - ; "hi1.4xlarge", Hi1_4xlarge - ; "i2.8xlarge", I2_8xlarge - ; "i2.4xlarge", I2_4xlarge - ; "i2.2xlarge", I2_2xlarge - ; "i2.xlarge", I2_xlarge - ; "cr1.8xlarge", Cr1_8xlarge - ; "m2.4xlarge", M2_4xlarge - ; "m2.2xlarge", M2_2xlarge - ; "m2.xlarge", M2_xlarge - ; "t2.large", T2_large - ; "t2.medium", T2_medium - ; "t2.small", T2_small - ; "t2.micro", T2_micro - ; "m4.10xlarge", M4_10xlarge - ; "m4.4xlarge", M4_4xlarge - ; "m4.2xlarge", M4_2xlarge - ; "m4.xlarge", M4_xlarge - ; "m4.large", M4_large - ; "m3.2xlarge", M3_2xlarge - ; "m3.xlarge", M3_xlarge - ; "m3.large", M3_large - ; "m3.medium", M3_medium - ; "m1.xlarge", M1_xlarge - ; "m1.large", M1_large - ; "m1.medium", M1_medium - ; "m1.small", M1_small - ; "t1.micro", T1_micro - ] - - let t_to_str = - [ D2_8xlarge, "d2.8xlarge" - ; D2_4xlarge, "d2.4xlarge" - ; D2_2xlarge, "d2.2xlarge" - ; D2_xlarge, "d2.xlarge" - ; R3_8xlarge, "r3.8xlarge" - ; R3_4xlarge, "r3.4xlarge" - ; R3_2xlarge, "r3.2xlarge" - ; R3_xlarge, "r3.xlarge" - ; R3_large, "r3.large" - ; Cg1_4xlarge, "cg1.4xlarge" - ; G2_2xlarge, "g2.2xlarge" - ; Cc2_8xlarge, "cc2.8xlarge" - ; Cc1_4xlarge, "cc1.4xlarge" - ; C4_8xlarge, "c4.8xlarge" - ; C4_4xlarge, "c4.4xlarge" - ; C4_2xlarge, "c4.2xlarge" - ; C4_xlarge, "c4.xlarge" - ; C4_large, "c4.large" - ; C3_8xlarge, "c3.8xlarge" - ; C3_4xlarge, "c3.4xlarge" - ; C3_2xlarge, "c3.2xlarge" - ; C3_xlarge, "c3.xlarge" - ; C3_large, "c3.large" - ; C1_xlarge, "c1.xlarge" - ; C1_medium, "c1.medium" - ; Hs1_8xlarge, "hs1.8xlarge" - ; Hi1_4xlarge, "hi1.4xlarge" - ; I2_8xlarge, "i2.8xlarge" - ; I2_4xlarge, "i2.4xlarge" - ; I2_2xlarge, "i2.2xlarge" - ; I2_xlarge, "i2.xlarge" - ; Cr1_8xlarge, "cr1.8xlarge" - ; M2_4xlarge, "m2.4xlarge" - ; M2_2xlarge, "m2.2xlarge" - ; M2_xlarge, "m2.xlarge" - ; T2_large, "t2.large" - ; T2_medium, "t2.medium" - ; T2_small, "t2.small" - ; T2_micro, "t2.micro" - ; M4_10xlarge, "m4.10xlarge" - ; M4_4xlarge, "m4.4xlarge" - ; M4_2xlarge, "m4.2xlarge" - ; M4_xlarge, "m4.xlarge" - ; M4_large, "m4.large" - ; M3_2xlarge, "m3.2xlarge" - ; M3_xlarge, "m3.xlarge" - ; M3_large, "m3.large" - ; M3_medium, "m3.medium" - ; M1_xlarge, "m1.xlarge" - ; M1_large, "m1.large" - ; M1_medium, "m1.medium" - ; M1_small, "m1.small" - ; T1_micro, "t1.micro" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DiskImageDescription = struct - type t = - { format : DiskImageFormat.t - ; size : Long.t - ; import_manifest_url : String.t - ; checksum : String.t option - } - - let make ~format ~size ~import_manifest_url ?checksum () = - { format; size; import_manifest_url; checksum } - - let parse xml = - Some - { format = - Xml.required - "format" - (Util.option_bind (Xml.member "format" xml) DiskImageFormat.parse) - ; size = Xml.required "size" (Util.option_bind (Xml.member "size" xml) Long.parse) - ; import_manifest_url = - Xml.required - "importManifestUrl" - (Util.option_bind (Xml.member "importManifestUrl" xml) String.parse) - ; checksum = Util.option_bind (Xml.member "checksum" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.checksum (fun f -> - Query.Pair ("Checksum", String.to_query f)) - ; Some (Query.Pair ("ImportManifestUrl", String.to_query v.import_manifest_url)) - ; Some (Query.Pair ("Size", Long.to_query v.size)) - ; Some (Query.Pair ("Format", DiskImageFormat.to_query v.format)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.checksum (fun f -> "checksum", String.to_json f) - ; Some ("import_manifest_url", String.to_json v.import_manifest_url) - ; Some ("size", Long.to_json v.size) - ; Some ("format", DiskImageFormat.to_json v.format) - ]) - - let of_json j = - { format = DiskImageFormat.of_json (Util.of_option_exn (Json.lookup j "format")) - ; size = Long.of_json (Util.of_option_exn (Json.lookup j "size")) - ; import_manifest_url = - String.of_json (Util.of_option_exn (Json.lookup j "import_manifest_url")) - ; checksum = Util.option_map (Json.lookup j "checksum") String.of_json - } -end - -module DiskImageVolumeDescription = struct - type t = - { size : Long.t option - ; id : String.t - } - - let make ?size ~id () = { size; id } - - let parse xml = - Some - { size = Util.option_bind (Xml.member "size" xml) Long.parse - ; id = Xml.required "id" (Util.option_bind (Xml.member "id" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Id", String.to_query v.id)) - ; Util.option_map v.size (fun f -> Query.Pair ("Size", Long.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("id", String.to_json v.id) - ; Util.option_map v.size (fun f -> "size", Long.to_json f) - ]) - - let of_json j = - { size = Util.option_map (Json.lookup j "size") Long.of_json - ; id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - } -end - -module StatusName = struct - type t = Reachability - - let str_to_t = [ "reachability", Reachability ] - - let t_to_str = [ Reachability, "reachability" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module StatusType = struct - type t = - | Passed - | Failed - | Insufficient_data - | Initializing - - let str_to_t = - [ "initializing", Initializing - ; "insufficient-data", Insufficient_data - ; "failed", Failed - ; "passed", Passed - ] - - let t_to_str = - [ Initializing, "initializing" - ; Insufficient_data, "insufficient-data" - ; Failed, "failed" - ; Passed, "passed" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module IpRange = struct - type t = { cidr_ip : String.t } - - let make ~cidr_ip () = { cidr_ip } - - let parse xml = - Some - { cidr_ip = - Xml.required "cidrIp" (Util.option_bind (Xml.member "cidrIp" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("CidrIp", String.to_query v.cidr_ip)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("cidr_ip", String.to_json v.cidr_ip) ]) - - let of_json j = - { cidr_ip = String.of_json (Util.of_option_exn (Json.lookup j "cidr_ip")) } -end - -module PrefixListId = struct - type t = { prefix_list_id : String.t option } - - let make ?prefix_list_id () = { prefix_list_id } - - let parse xml = - Some - { prefix_list_id = Util.option_bind (Xml.member "prefixListId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.prefix_list_id (fun f -> - Query.Pair ("PrefixListId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.prefix_list_id (fun f -> "prefix_list_id", String.to_json f) - ]) - - let of_json j = - { prefix_list_id = Util.option_map (Json.lookup j "prefix_list_id") String.of_json } -end - -module UserIdGroupPair = struct - type t = - { user_id : String.t option - ; group_name : String.t option - ; group_id : String.t option - } - - let make ?user_id ?group_name ?group_id () = { user_id; group_name; group_id } - - let parse xml = - Some - { user_id = Util.option_bind (Xml.member "userId" xml) String.parse - ; group_name = Util.option_bind (Xml.member "groupName" xml) String.parse - ; group_id = Util.option_bind (Xml.member "groupId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> Query.Pair ("GroupId", String.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.user_id (fun f -> Query.Pair ("UserId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> "group_id", String.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.user_id (fun f -> "user_id", String.to_json f) - ]) - - let of_json j = - { user_id = Util.option_map (Json.lookup j "user_id") String.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; group_id = Util.option_map (Json.lookup j "group_id") String.of_json - } -end - -module BlockDeviceMappingList = struct - type t = BlockDeviceMapping.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map BlockDeviceMapping.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list BlockDeviceMapping.to_query v - - let to_json v = `List (List.map BlockDeviceMapping.to_json v) - - let of_json j = Json.to_list BlockDeviceMapping.of_json j -end - -module IamInstanceProfileSpecification = struct - type t = - { arn : String.t option - ; name : String.t option - } - - let make ?arn ?name () = { arn; name } - - let parse xml = - Some - { arn = Util.option_bind (Xml.member "arn" xml) String.parse - ; name = Util.option_bind (Xml.member "name" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ; Util.option_map v.arn (fun f -> Query.Pair ("Arn", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> "name", String.to_json f) - ; Util.option_map v.arn (fun f -> "arn", String.to_json f) - ]) - - let of_json j = - { arn = Util.option_map (Json.lookup j "arn") String.of_json - ; name = Util.option_map (Json.lookup j "name") String.of_json - } -end - -module InstanceNetworkInterfaceSpecificationList = struct - type t = InstanceNetworkInterfaceSpecification.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map InstanceNetworkInterfaceSpecification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceNetworkInterfaceSpecification.to_query v - - let to_json v = `List (List.map InstanceNetworkInterfaceSpecification.to_json v) - - let of_json j = Json.to_list InstanceNetworkInterfaceSpecification.of_json j -end - -module SpotFleetMonitoring = struct - type t = { enabled : Boolean.t option } - - let make ?enabled () = { enabled } - - let parse xml = - Some { enabled = Util.option_bind (Xml.member "enabled" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> Query.Pair ("Enabled", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> "enabled", Boolean.to_json f) ]) - - let of_json j = { enabled = Util.option_map (Json.lookup j "enabled") Boolean.of_json } -end - -module SpotPlacement = struct - type t = - { availability_zone : String.t option - ; group_name : String.t option - } - - let make ?availability_zone ?group_name () = { availability_zone; group_name } - - let parse xml = - Some - { availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; group_name = Util.option_bind (Xml.member "groupName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ]) - - let of_json j = - { availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - } -end - -module VolumeStatusName = struct - type t = - | Io_enabled - | Io_performance - - let str_to_t = [ "io-performance", Io_performance; "io-enabled", Io_enabled ] - - let t_to_str = [ Io_performance, "io-performance"; Io_enabled, "io-enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module InstanceBlockDeviceMapping = struct - type t = - { device_name : String.t option - ; ebs : EbsInstanceBlockDevice.t option - } - - let make ?device_name ?ebs () = { device_name; ebs } - - let parse xml = - Some - { device_name = Util.option_bind (Xml.member "deviceName" xml) String.parse - ; ebs = Util.option_bind (Xml.member "ebs" xml) EbsInstanceBlockDevice.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.ebs (fun f -> - Query.Pair ("Ebs", EbsInstanceBlockDevice.to_query f)) - ; Util.option_map v.device_name (fun f -> - Query.Pair ("DeviceName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.ebs (fun f -> "ebs", EbsInstanceBlockDevice.to_json f) - ; Util.option_map v.device_name (fun f -> "device_name", String.to_json f) - ]) - - let of_json j = - { device_name = Util.option_map (Json.lookup j "device_name") String.of_json - ; ebs = Util.option_map (Json.lookup j "ebs") EbsInstanceBlockDevice.of_json - } -end - -module InstanceNetworkInterface = struct - type t = - { network_interface_id : String.t option - ; subnet_id : String.t option - ; vpc_id : String.t option - ; description : String.t option - ; owner_id : String.t option - ; status : NetworkInterfaceStatus.t option - ; mac_address : String.t option - ; private_ip_address : String.t option - ; private_dns_name : String.t option - ; source_dest_check : Boolean.t option - ; groups : GroupIdentifierList.t - ; attachment : InstanceNetworkInterfaceAttachment.t option - ; association : InstanceNetworkInterfaceAssociation.t option - ; private_ip_addresses : InstancePrivateIpAddressList.t - } - - let make - ?network_interface_id - ?subnet_id - ?vpc_id - ?description - ?owner_id - ?status - ?mac_address - ?private_ip_address - ?private_dns_name - ?source_dest_check - ?(groups = []) - ?attachment - ?association - ?(private_ip_addresses = []) - () = - { network_interface_id - ; subnet_id - ; vpc_id - ; description - ; owner_id - ; status - ; mac_address - ; private_ip_address - ; private_dns_name - ; source_dest_check - ; groups - ; attachment - ; association - ; private_ip_addresses - } - - let parse xml = - Some - { network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; owner_id = Util.option_bind (Xml.member "ownerId" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) NetworkInterfaceStatus.parse - ; mac_address = Util.option_bind (Xml.member "macAddress" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; private_dns_name = Util.option_bind (Xml.member "privateDnsName" xml) String.parse - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) Boolean.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; attachment = - Util.option_bind - (Xml.member "attachment" xml) - InstanceNetworkInterfaceAttachment.parse - ; association = - Util.option_bind - (Xml.member "association" xml) - InstanceNetworkInterfaceAssociation.parse - ; private_ip_addresses = - Util.of_option - [] + ("PrivateIpAddress", (String.to_query v.private_ip_address)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.primary + (fun f -> ("primary", (Boolean.to_json f))); + Some ("private_ip_address", (String.to_json v.private_ip_address))]) + let of_json j = + { + private_ip_address = + (String.of_json + (Util.of_option_exn (Json.lookup j "private_ip_address"))); + primary = (Util.option_map (Json.lookup j "primary") Boolean.of_json) + } + end +module InstanceNetworkInterfaceAssociation = + struct + type t = + { + public_ip: String.t option ; + public_dns_name: String.t option ; + ip_owner_id: String.t option } + let make ?public_ip ?public_dns_name ?ip_owner_id () = + { public_ip; public_dns_name; ip_owner_id } + let parse xml = + Some + { + public_ip = + (Util.option_bind (Xml.member "publicIp" xml) String.parse); + public_dns_name = + (Util.option_bind (Xml.member "publicDnsName" xml) String.parse); + ip_owner_id = + (Util.option_bind (Xml.member "ipOwnerId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.ip_owner_id + (fun f -> Query.Pair ("IpOwnerId", (String.to_query f))); + Util.option_map v.public_dns_name + (fun f -> Query.Pair ("PublicDnsName", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.ip_owner_id + (fun f -> ("ip_owner_id", (String.to_json f))); + Util.option_map v.public_dns_name + (fun f -> ("public_dns_name", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f)))]) + let of_json j = + { + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + public_dns_name = + (Util.option_map (Json.lookup j "public_dns_name") String.of_json); + ip_owner_id = + (Util.option_map (Json.lookup j "ip_owner_id") String.of_json) + } + end +module EbsBlockDevice = + struct + type t = + { + snapshot_id: String.t option ; + volume_size: Integer.t option ; + delete_on_termination: Boolean.t option ; + volume_type: VolumeType.t option ; + iops: Integer.t option ; + encrypted: Boolean.t option } + let make ?snapshot_id ?volume_size ?delete_on_termination ?volume_type + ?iops ?encrypted () = + { + snapshot_id; + volume_size; + delete_on_termination; + volume_type; + iops; + encrypted + } + let parse xml = + Some + { + snapshot_id = + (Util.option_bind (Xml.member "snapshotId" xml) String.parse); + volume_size = + (Util.option_bind (Xml.member "volumeSize" xml) Integer.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse); + volume_type = + (Util.option_bind (Xml.member "volumeType" xml) VolumeType.parse); + iops = (Util.option_bind (Xml.member "iops" xml) Integer.parse); + encrypted = + (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.encrypted + (fun f -> Query.Pair ("Encrypted", (Boolean.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.volume_type + (fun f -> Query.Pair ("VolumeType", (VolumeType.to_query f))); + Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.volume_size + (fun f -> Query.Pair ("VolumeSize", (Integer.to_query f))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.encrypted + (fun f -> ("encrypted", (Boolean.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.volume_type + (fun f -> ("volume_type", (VolumeType.to_json f))); + Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.volume_size + (fun f -> ("volume_size", (Integer.to_json f))); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f)))]) + let of_json j = + { + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + volume_size = + (Util.option_map (Json.lookup j "volume_size") Integer.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json); + volume_type = + (Util.option_map (Json.lookup j "volume_type") VolumeType.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + encrypted = + (Util.option_map (Json.lookup j "encrypted") Boolean.of_json) + } + end +module PrivateIpAddressSpecificationList = + struct + type t = PrivateIpAddressSpecification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PrivateIpAddressSpecification.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list PrivateIpAddressSpecification.to_query v + let to_json v = `List (List.map PrivateIpAddressSpecification.to_json v) + let of_json j = Json.to_list PrivateIpAddressSpecification.of_json j + end +module SecurityGroupIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SecurityGroupId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AttachmentStatus = + struct + type t = + | Attaching + | Attached + | Detaching + | Detached + let str_to_t = + [("detached", Detached); + ("detaching", Detaching); + ("attached", Attached); + ("attaching", Attaching)] + let t_to_str = + [(Detached, "detached"); + (Detaching, "detaching"); + (Attached, "attached"); + (Attaching, "attaching")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module GroupIdentifier = + struct + type t = { + group_name: String.t option ; + group_id: String.t option } + let make ?group_name ?group_id () = { group_name; group_id } + let parse xml = + Some + { + group_name = + (Util.option_bind (Xml.member "groupName" xml) String.parse); + group_id = + (Util.option_bind (Xml.member "groupId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> Query.Pair ("GroupId", (String.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> ("group_id", (String.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f)))]) + let of_json j = + { + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + group_id = + (Util.option_map (Json.lookup j "group_id") String.of_json) + } + end +module InstancePrivateIpAddress = + struct + type t = + { + private_ip_address: String.t option ; + private_dns_name: String.t option ; + primary: Boolean.t option ; + association: InstanceNetworkInterfaceAssociation.t option } + let make ?private_ip_address ?private_dns_name ?primary ?association + () = { private_ip_address; private_dns_name; primary; association } + let parse xml = + Some + { + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + private_dns_name = + (Util.option_bind (Xml.member "privateDnsName" xml) String.parse); + primary = + (Util.option_bind (Xml.member "primary" xml) Boolean.parse); + association = + (Util.option_bind (Xml.member "association" xml) + InstanceNetworkInterfaceAssociation.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association + (fun f -> + Query.Pair + ("Association", + (InstanceNetworkInterfaceAssociation.to_query f))); + Util.option_map v.primary + (fun f -> Query.Pair ("Primary", (Boolean.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association + (fun f -> + ("association", + (InstanceNetworkInterfaceAssociation.to_json f))); + Util.option_map v.primary + (fun f -> ("primary", (Boolean.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f)))]) + let of_json j = + { + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + primary = (Util.option_map (Json.lookup j "primary") Boolean.of_json); + association = + (Util.option_map (Json.lookup j "association") + InstanceNetworkInterfaceAssociation.of_json) + } + end +module DiskImageFormat = + struct + type t = + | VMDK + | RAW + | VHD + let str_to_t = [("VHD", VHD); ("RAW", RAW); ("VMDK", VMDK)] + let t_to_str = [(VHD, "VHD"); (RAW, "RAW"); (VMDK, "VMDK")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BlockDeviceMapping = + struct + type t = + { + virtual_name: String.t option ; + device_name: String.t ; + ebs: EbsBlockDevice.t option ; + no_device: String.t option } + let make ?virtual_name ~device_name ?ebs ?no_device () = + { virtual_name; device_name; ebs; no_device } + let parse xml = + Some + { + virtual_name = + (Util.option_bind (Xml.member "virtualName" xml) String.parse); + device_name = + (Xml.required "deviceName" + (Util.option_bind (Xml.member "deviceName" xml) String.parse)); + ebs = + (Util.option_bind (Xml.member "ebs" xml) EbsBlockDevice.parse); + no_device = + (Util.option_bind (Xml.member "noDevice" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> Query.Pair ("NoDevice", (String.to_query f))); + Util.option_map v.ebs + (fun f -> Query.Pair ("Ebs", (EbsBlockDevice.to_query f))); + Some (Query.Pair ("DeviceName", (String.to_query v.device_name))); + Util.option_map v.virtual_name + (fun f -> Query.Pair ("VirtualName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> ("no_device", (String.to_json f))); + Util.option_map v.ebs + (fun f -> ("ebs", (EbsBlockDevice.to_json f))); + Some ("device_name", (String.to_json v.device_name)); + Util.option_map v.virtual_name + (fun f -> ("virtual_name", (String.to_json f)))]) + let of_json j = + { + virtual_name = + (Util.option_map (Json.lookup j "virtual_name") String.of_json); + device_name = + (String.of_json (Util.of_option_exn (Json.lookup j "device_name"))); + ebs = (Util.option_map (Json.lookup j "ebs") EbsBlockDevice.of_json); + no_device = + (Util.option_map (Json.lookup j "no_device") String.of_json) + } + end +module InstanceNetworkInterfaceSpecification = + struct + type t = + { + network_interface_id: String.t option ; + device_index: Integer.t option ; + subnet_id: String.t option ; + description: String.t option ; + private_ip_address: String.t option ; + groups: SecurityGroupIdStringList.t ; + delete_on_termination: Boolean.t option ; + private_ip_addresses: PrivateIpAddressSpecificationList.t ; + secondary_private_ip_address_count: Integer.t option ; + associate_public_ip_address: Boolean.t option } + let make ?network_interface_id ?device_index ?subnet_id ?description + ?private_ip_address ?(groups= []) ?delete_on_termination + ?(private_ip_addresses= []) ?secondary_private_ip_address_count + ?associate_public_ip_address () = + { + network_interface_id; + device_index; + subnet_id; + description; + private_ip_address; + groups; + delete_on_termination; + private_ip_addresses; + secondary_private_ip_address_count; + associate_public_ip_address + } + let parse xml = + Some + { + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + device_index = + (Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupId" xml) + SecurityGroupIdStringList.parse)); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse); + private_ip_addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "privateIpAddressesSet" xml) + PrivateIpAddressSpecificationList.parse)); + secondary_private_ip_address_count = (Util.option_bind - (Xml.member "privateIpAddressesSet" xml) - InstancePrivateIpAddressList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "secondaryPrivateIpAddressCount" xml) + Integer.parse); + associate_public_ip_address = + (Util.option_bind (Xml.member "associatePublicIpAddress" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.associate_public_ip_address + (fun f -> + Query.Pair + ("AssociatePublicIpAddress", (Boolean.to_query f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + Query.Pair + ("SecondaryPrivateIpAddressCount", (Integer.to_query f))); + Some (Query.Pair - ( "PrivateIpAddressesSet" - , InstancePrivateIpAddressList.to_query v.private_ip_addresses )) - ; Util.option_map v.association (fun f -> - Query.Pair ("Association", InstanceNetworkInterfaceAssociation.to_query f)) - ; Util.option_map v.attachment (fun f -> - Query.Pair ("Attachment", InstanceNetworkInterfaceAttachment.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", Boolean.to_query f)) - ; Util.option_map v.private_dns_name (fun f -> - Query.Pair ("PrivateDnsName", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.mac_address (fun f -> - Query.Pair ("MacAddress", String.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", NetworkInterfaceStatus.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "private_ip_addresses" - , InstancePrivateIpAddressList.to_json v.private_ip_addresses ) - ; Util.option_map v.association (fun f -> - "association", InstanceNetworkInterfaceAssociation.to_json f) - ; Util.option_map v.attachment (fun f -> - "attachment", InstanceNetworkInterfaceAttachment.to_json f) - ; Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", Boolean.to_json f) - ; Util.option_map v.private_dns_name (fun f -> - "private_dns_name", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.mac_address (fun f -> "mac_address", String.to_json f) - ; Util.option_map v.status (fun f -> "status", NetworkInterfaceStatus.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ]) - - let of_json j = - { network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") NetworkInterfaceStatus.of_json - ; mac_address = Util.option_map (Json.lookup j "mac_address") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") Boolean.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; attachment = - Util.option_map - (Json.lookup j "attachment") - InstanceNetworkInterfaceAttachment.of_json - ; association = - Util.option_map - (Json.lookup j "association") - InstanceNetworkInterfaceAssociation.of_json - ; private_ip_addresses = - InstancePrivateIpAddressList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - } -end - -module InstanceStateName = struct - type t = - | Pending - | Running - | Shutting_down - | Terminated - | Stopping - | Stopped - - let str_to_t = - [ "stopped", Stopped - ; "stopping", Stopping - ; "terminated", Terminated - ; "shutting-down", Shutting_down - ; "running", Running - ; "pending", Pending - ] - - let t_to_str = - [ Stopped, "stopped" - ; Stopping, "stopping" - ; Terminated, "terminated" - ; Shutting_down, "shutting-down" - ; Running, "running" - ; Pending, "pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module MonitoringState = struct - type t = - | Disabled - | Disabling - | Enabled - | Pending - - let str_to_t = - [ "pending", Pending - ; "enabled", Enabled - ; "disabling", Disabling - ; "disabled", Disabled - ] - - let t_to_str = - [ Pending, "pending" - ; Enabled, "enabled" - ; Disabling, "disabling" - ; Disabled, "disabled" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Tenancy = struct - type t = - | Default - | Dedicated - - let str_to_t = [ "dedicated", Dedicated; "default", Default ] - - let t_to_str = [ Dedicated, "dedicated"; Default, "default" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ProductCode = struct - type t = - { product_code_id : String.t option - ; product_code_type : ProductCodeValues.t option - } - - let make ?product_code_id ?product_code_type () = { product_code_id; product_code_type } - - let parse xml = - Some - { product_code_id = Util.option_bind (Xml.member "productCode" xml) String.parse - ; product_code_type = - Util.option_bind (Xml.member "type" xml) ProductCodeValues.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.product_code_type (fun f -> - Query.Pair ("Type", ProductCodeValues.to_query f)) - ; Util.option_map v.product_code_id (fun f -> - Query.Pair ("ProductCode", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.product_code_type (fun f -> - "product_code_type", ProductCodeValues.to_json f) - ; Util.option_map v.product_code_id (fun f -> - "product_code_id", String.to_json f) - ]) - - let of_json j = - { product_code_id = Util.option_map (Json.lookup j "product_code_id") String.of_json - ; product_code_type = - Util.option_map (Json.lookup j "product_code_type") ProductCodeValues.of_json - } -end - -module Tag = struct - type t = - { key : String.t - ; value : String.t - } - - let make ~key ~value () = { key; value } - - let parse xml = - Some - { key = Xml.required "key" (Util.option_bind (Xml.member "key" xml) String.parse) - ; value = - Xml.required "value" (Util.option_bind (Xml.member "value" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value); Some ("key", String.to_json v.key) ]) - - let of_json j = - { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module NetworkInterfaceAssociation = struct - type t = - { public_ip : String.t option - ; public_dns_name : String.t option - ; ip_owner_id : String.t option - ; allocation_id : String.t option - ; association_id : String.t option - } - - let make ?public_ip ?public_dns_name ?ip_owner_id ?allocation_id ?association_id () = - { public_ip; public_dns_name; ip_owner_id; allocation_id; association_id } - - let parse xml = - Some - { public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - ; public_dns_name = Util.option_bind (Xml.member "publicDnsName" xml) String.parse - ; ip_owner_id = Util.option_bind (Xml.member "ipOwnerId" xml) String.parse - ; allocation_id = Util.option_bind (Xml.member "allocationId" xml) String.parse - ; association_id = Util.option_bind (Xml.member "associationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> - Query.Pair ("AssociationId", String.to_query f)) - ; Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ; Util.option_map v.ip_owner_id (fun f -> - Query.Pair ("IpOwnerId", String.to_query f)) - ; Util.option_map v.public_dns_name (fun f -> - Query.Pair ("PublicDnsName", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> "association_id", String.to_json f) - ; Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ; Util.option_map v.ip_owner_id (fun f -> "ip_owner_id", String.to_json f) - ; Util.option_map v.public_dns_name (fun f -> - "public_dns_name", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ]) - - let of_json j = - { public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; public_dns_name = Util.option_map (Json.lookup j "public_dns_name") String.of_json - ; ip_owner_id = Util.option_map (Json.lookup j "ip_owner_id") String.of_json - ; allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - ; association_id = Util.option_map (Json.lookup j "association_id") String.of_json - } -end - -module DhcpConfigurationValueList = struct - type t = AttributeValue.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map AttributeValue.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list AttributeValue.to_query v - - let to_json v = `List (List.map AttributeValue.to_json v) - - let of_json j = Json.to_list AttributeValue.of_json j -end - -module ReservedInstancesConfiguration = struct - type t = - { availability_zone : String.t option - ; platform : String.t option - ; instance_count : Integer.t option - ; instance_type : InstanceType.t option - } - - let make ?availability_zone ?platform ?instance_count ?instance_type () = - { availability_zone; platform; instance_count; instance_type } - - let parse xml = - Some - { availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) String.parse - ; instance_count = Util.option_bind (Xml.member "instanceCount" xml) Integer.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.instance_count (fun f -> - Query.Pair ("InstanceCount", Integer.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) - ; Util.option_map v.platform (fun f -> "platform", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ]) - - let of_json j = - { availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") String.of_json - ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - } -end - -module RecurringChargeFrequency = struct - type t = Hourly - - let str_to_t = [ "Hourly", Hourly ] - - let t_to_str = [ Hourly, "Hourly" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ImportInstanceVolumeDetailItem = struct - type t = - { bytes_converted : Long.t - ; availability_zone : String.t - ; image : DiskImageDescription.t - ; volume : DiskImageVolumeDescription.t - ; status : String.t - ; status_message : String.t option - ; description : String.t option - } - - let make - ~bytes_converted - ~availability_zone - ~image - ~volume - ~status - ?status_message - ?description - () = - { bytes_converted - ; availability_zone - ; image - ; volume - ; status - ; status_message - ; description - } - - let parse xml = - Some - { bytes_converted = - Xml.required - "bytesConverted" - (Util.option_bind (Xml.member "bytesConverted" xml) Long.parse) - ; availability_zone = - Xml.required - "availabilityZone" - (Util.option_bind (Xml.member "availabilityZone" xml) String.parse) - ; image = - Xml.required - "image" - (Util.option_bind (Xml.member "image" xml) DiskImageDescription.parse) - ; volume = - Xml.required - "volume" - (Util.option_bind (Xml.member "volume" xml) DiskImageVolumeDescription.parse) - ; status = - Xml.required "status" (Util.option_bind (Xml.member "status" xml) String.parse) - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Some (Query.Pair ("Status", String.to_query v.status)) - ; Some (Query.Pair ("Volume", DiskImageVolumeDescription.to_query v.volume)) - ; Some (Query.Pair ("Image", DiskImageDescription.to_query v.image)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some (Query.Pair ("BytesConverted", Long.to_query v.bytes_converted)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Some ("status", String.to_json v.status) - ; Some ("volume", DiskImageVolumeDescription.to_json v.volume) - ; Some ("image", DiskImageDescription.to_json v.image) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some ("bytes_converted", Long.to_json v.bytes_converted) - ]) - - let of_json j = - { bytes_converted = - Long.of_json (Util.of_option_exn (Json.lookup j "bytes_converted")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; image = DiskImageDescription.of_json (Util.of_option_exn (Json.lookup j "image")) - ; volume = - DiskImageVolumeDescription.of_json (Util.of_option_exn (Json.lookup j "volume")) - ; status = String.of_json (Util.of_option_exn (Json.lookup j "status")) - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module RouteOrigin = struct - type t = - | CreateRouteTable - | CreateRoute - | EnableVgwRoutePropagation - - let str_to_t = - [ "EnableVgwRoutePropagation", EnableVgwRoutePropagation - ; "CreateRoute", CreateRoute - ; "CreateRouteTable", CreateRouteTable - ] - - let t_to_str = - [ EnableVgwRoutePropagation, "EnableVgwRoutePropagation" - ; CreateRoute, "CreateRoute" - ; CreateRouteTable, "CreateRouteTable" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RouteState = struct - type t = - | Active - | Blackhole - - let str_to_t = [ "blackhole", Blackhole; "active", Active ] - - let t_to_str = [ Blackhole, "blackhole"; Active, "active" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ListingState = struct - type t = - | Available - | Sold - | Cancelled - | Pending - - let str_to_t = - [ "pending", Pending; "cancelled", Cancelled; "sold", Sold; "available", Available ] - - let t_to_str = - [ Pending, "pending"; Cancelled, "cancelled"; Sold, "sold"; Available, "available" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module CurrencyCodeValues = struct - type t = USD - - let str_to_t = [ "USD", USD ] - - let t_to_str = [ USD, "USD" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module EventCode = struct - type t = - | Instance_reboot - | System_reboot - | System_maintenance - | Instance_retirement - | Instance_stop - - let str_to_t = - [ "instance-stop", Instance_stop - ; "instance-retirement", Instance_retirement - ; "system-maintenance", System_maintenance - ; "system-reboot", System_reboot - ; "instance-reboot", Instance_reboot - ] - - let t_to_str = - [ Instance_stop, "instance-stop" - ; Instance_retirement, "instance-retirement" - ; System_maintenance, "system-maintenance" - ; System_reboot, "system-reboot" - ; Instance_reboot, "instance-reboot" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module InstanceStatusDetails = struct - type t = - { name : StatusName.t option - ; status : StatusType.t option - ; impaired_since : DateTime.t option - } - - let make ?name ?status ?impaired_since () = { name; status; impaired_since } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "name" xml) StatusName.parse - ; status = Util.option_bind (Xml.member "status" xml) StatusType.parse - ; impaired_since = Util.option_bind (Xml.member "impairedSince" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.impaired_since (fun f -> - Query.Pair ("ImpairedSince", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", StatusType.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", StatusName.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.impaired_since (fun f -> - "impaired_since", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", StatusType.to_json f) - ; Util.option_map v.name (fun f -> "name", StatusName.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") StatusName.of_json - ; status = Util.option_map (Json.lookup j "status") StatusType.of_json - ; impaired_since = Util.option_map (Json.lookup j "impaired_since") DateTime.of_json - } -end - -module IpRangeList = struct - type t = IpRange.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map IpRange.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list IpRange.to_query v - - let to_json v = `List (List.map IpRange.to_json v) - - let of_json j = Json.to_list IpRange.of_json j -end - -module PrefixListIdList = struct - type t = PrefixListId.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PrefixListId.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PrefixListId.to_query v - - let to_json v = `List (List.map PrefixListId.to_json v) - - let of_json j = Json.to_list PrefixListId.of_json j -end - -module UserIdGroupPairList = struct - type t = UserIdGroupPair.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map UserIdGroupPair.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list UserIdGroupPair.to_query v - - let to_json v = `List (List.map UserIdGroupPair.to_json v) - - let of_json j = Json.to_list UserIdGroupPair.of_json j -end - -module SpotFleetLaunchSpecification = struct - type t = - { image_id : String.t option - ; key_name : String.t option - ; security_groups : GroupIdentifierList.t - ; user_data : String.t option - ; addressing_type : String.t option - ; instance_type : InstanceType.t option - ; placement : SpotPlacement.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappingList.t - ; monitoring : SpotFleetMonitoring.t option - ; subnet_id : String.t option - ; network_interfaces : InstanceNetworkInterfaceSpecificationList.t - ; iam_instance_profile : IamInstanceProfileSpecification.t option - ; ebs_optimized : Boolean.t option - ; weighted_capacity : Double.t option - ; spot_price : String.t option - } - - let make - ?image_id - ?key_name - ?(security_groups = []) - ?user_data - ?addressing_type - ?instance_type - ?placement - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?monitoring - ?subnet_id - ?(network_interfaces = []) - ?iam_instance_profile - ?ebs_optimized - ?weighted_capacity - ?spot_price - () = - { image_id - ; key_name - ; security_groups - ; user_data - ; addressing_type - ; instance_type - ; placement - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; monitoring - ; subnet_id - ; network_interfaces - ; iam_instance_profile - ; ebs_optimized - ; weighted_capacity - ; spot_price - } - - let parse xml = - Some - { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; user_data = Util.option_bind (Xml.member "userData" xml) String.parse - ; addressing_type = Util.option_bind (Xml.member "addressingType" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; placement = Util.option_bind (Xml.member "placement" xml) SpotPlacement.parse - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingList.parse) - ; monitoring = - Util.option_bind (Xml.member "monitoring" xml) SpotFleetMonitoring.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "networkInterfaceSet" xml) - InstanceNetworkInterfaceSpecificationList.parse) - ; iam_instance_profile = - Util.option_bind - (Xml.member "iamInstanceProfile" xml) - IamInstanceProfileSpecification.parse - ; ebs_optimized = Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse - ; weighted_capacity = - Util.option_bind (Xml.member "weightedCapacity" xml) Double.parse - ; spot_price = Util.option_bind (Xml.member "spotPrice" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.spot_price (fun f -> - Query.Pair ("SpotPrice", String.to_query f)) - ; Util.option_map v.weighted_capacity (fun f -> - Query.Pair ("WeightedCapacity", Double.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair - ("IamInstanceProfile", IamInstanceProfileSpecification.to_query f)) - ; Some + ("PrivateIpAddressesSet", + (PrivateIpAddressSpecificationList.to_query + v.private_ip_addresses))); + Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Some (Query.Pair - ( "NetworkInterfaceSet" - , InstanceNetworkInterfaceSpecificationList.to_query v.network_interfaces - )) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", SpotFleetMonitoring.to_query f)) - ; Some + ("SecurityGroupId", + (SecurityGroupIdStringList.to_query v.groups))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.device_index + (fun f -> Query.Pair ("DeviceIndex", (Integer.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.associate_public_ip_address + (fun f -> ("associate_public_ip_address", (Boolean.to_json f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + ("secondary_private_ip_address_count", (Integer.to_json f))); + Some + ("private_ip_addresses", + (PrivateIpAddressSpecificationList.to_json + v.private_ip_addresses)); + Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Some ("groups", (SecurityGroupIdStringList.to_json v.groups)); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.device_index + (fun f -> ("device_index", (Integer.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f)))]) + let of_json j = + { + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + device_index = + (Util.option_map (Json.lookup j "device_index") Integer.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + groups = + (SecurityGroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json); + private_ip_addresses = + (PrivateIpAddressSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))); + secondary_private_ip_address_count = + (Util.option_map + (Json.lookup j "secondary_private_ip_address_count") + Integer.of_json); + associate_public_ip_address = + (Util.option_map (Json.lookup j "associate_public_ip_address") + Boolean.of_json) + } + end +module EbsInstanceBlockDevice = + struct + type t = + { + volume_id: String.t option ; + status: AttachmentStatus.t option ; + attach_time: DateTime.t option ; + delete_on_termination: Boolean.t option } + let make ?volume_id ?status ?attach_time ?delete_on_termination () = + { volume_id; status; attach_time; delete_on_termination } + let parse xml = + Some + { + volume_id = + (Util.option_bind (Xml.member "volumeId" xml) String.parse); + status = + (Util.option_bind (Xml.member "status" xml) + AttachmentStatus.parse); + attach_time = + (Util.option_bind (Xml.member "attachTime" xml) DateTime.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.attach_time + (fun f -> Query.Pair ("AttachTime", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (AttachmentStatus.to_query f))); + Util.option_map v.volume_id + (fun f -> Query.Pair ("VolumeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.attach_time + (fun f -> ("attach_time", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (AttachmentStatus.to_json f))); + Util.option_map v.volume_id + (fun f -> ("volume_id", (String.to_json f)))]) + let of_json j = + { + volume_id = + (Util.option_map (Json.lookup j "volume_id") String.of_json); + status = + (Util.option_map (Json.lookup j "status") AttachmentStatus.of_json); + attach_time = + (Util.option_map (Json.lookup j "attach_time") DateTime.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module GroupIdentifierList = + struct + type t = GroupIdentifier.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map GroupIdentifier.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list GroupIdentifier.to_query v + let to_json v = `List (List.map GroupIdentifier.to_json v) + let of_json j = Json.to_list GroupIdentifier.of_json j + end +module InstanceNetworkInterfaceAttachment = + struct + type t = + { + attachment_id: String.t option ; + device_index: Integer.t option ; + status: AttachmentStatus.t option ; + attach_time: DateTime.t option ; + delete_on_termination: Boolean.t option } + let make ?attachment_id ?device_index ?status ?attach_time + ?delete_on_termination () = + { + attachment_id; + device_index; + status; + attach_time; + delete_on_termination + } + let parse xml = + Some + { + attachment_id = + (Util.option_bind (Xml.member "attachmentId" xml) String.parse); + device_index = + (Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse); + status = + (Util.option_bind (Xml.member "status" xml) + AttachmentStatus.parse); + attach_time = + (Util.option_bind (Xml.member "attachTime" xml) DateTime.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.attach_time + (fun f -> Query.Pair ("AttachTime", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (AttachmentStatus.to_query f))); + Util.option_map v.device_index + (fun f -> Query.Pair ("DeviceIndex", (Integer.to_query f))); + Util.option_map v.attachment_id + (fun f -> Query.Pair ("AttachmentId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.attach_time + (fun f -> ("attach_time", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (AttachmentStatus.to_json f))); + Util.option_map v.device_index + (fun f -> ("device_index", (Integer.to_json f))); + Util.option_map v.attachment_id + (fun f -> ("attachment_id", (String.to_json f)))]) + let of_json j = + { + attachment_id = + (Util.option_map (Json.lookup j "attachment_id") String.of_json); + device_index = + (Util.option_map (Json.lookup j "device_index") Integer.of_json); + status = + (Util.option_map (Json.lookup j "status") AttachmentStatus.of_json); + attach_time = + (Util.option_map (Json.lookup j "attach_time") DateTime.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module InstancePrivateIpAddressList = + struct + type t = InstancePrivateIpAddress.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstancePrivateIpAddress.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstancePrivateIpAddress.to_query v + let to_json v = `List (List.map InstancePrivateIpAddress.to_json v) + let of_json j = Json.to_list InstancePrivateIpAddress.of_json j + end +module NetworkInterfaceStatus = + struct + type t = + | Available + | Attaching + | In_use + | Detaching + let str_to_t = + [("detaching", Detaching); + ("in-use", In_use); + ("attaching", Attaching); + ("available", Available)] + let t_to_str = + [(Detaching, "detaching"); + (In_use, "in-use"); + (Attaching, "attaching"); + (Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ProductCodeValues = + struct + type t = + | Devpay + | Marketplace + let str_to_t = [("marketplace", Marketplace); ("devpay", Devpay)] + let t_to_str = [(Marketplace, "marketplace"); (Devpay, "devpay")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AttributeValue = + struct + type t = { + value: String.t option } + let make ?value () = { value } + let parse xml = + Some + { value = (Util.option_bind (Xml.member "value" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f)))]) + let of_json j = + { value = (Util.option_map (Json.lookup j "value") String.of_json) } + end +module InstanceType = + struct + type t = + | T1_micro + | M1_small + | M1_medium + | M1_large + | M1_xlarge + | M3_medium + | M3_large + | M3_xlarge + | M3_2xlarge + | M4_large + | M4_xlarge + | M4_2xlarge + | M4_4xlarge + | M4_10xlarge + | T2_micro + | T2_small + | T2_medium + | T2_large + | M2_xlarge + | M2_2xlarge + | M2_4xlarge + | Cr1_8xlarge + | I2_xlarge + | I2_2xlarge + | I2_4xlarge + | I2_8xlarge + | Hi1_4xlarge + | Hs1_8xlarge + | C1_medium + | C1_xlarge + | C3_large + | C3_xlarge + | C3_2xlarge + | C3_4xlarge + | C3_8xlarge + | C4_large + | C4_xlarge + | C4_2xlarge + | C4_4xlarge + | C4_8xlarge + | Cc1_4xlarge + | Cc2_8xlarge + | G2_2xlarge + | Cg1_4xlarge + | R3_large + | R3_xlarge + | R3_2xlarge + | R3_4xlarge + | R3_8xlarge + | D2_xlarge + | D2_2xlarge + | D2_4xlarge + | D2_8xlarge + let str_to_t = + [("d2.8xlarge", D2_8xlarge); + ("d2.4xlarge", D2_4xlarge); + ("d2.2xlarge", D2_2xlarge); + ("d2.xlarge", D2_xlarge); + ("r3.8xlarge", R3_8xlarge); + ("r3.4xlarge", R3_4xlarge); + ("r3.2xlarge", R3_2xlarge); + ("r3.xlarge", R3_xlarge); + ("r3.large", R3_large); + ("cg1.4xlarge", Cg1_4xlarge); + ("g2.2xlarge", G2_2xlarge); + ("cc2.8xlarge", Cc2_8xlarge); + ("cc1.4xlarge", Cc1_4xlarge); + ("c4.8xlarge", C4_8xlarge); + ("c4.4xlarge", C4_4xlarge); + ("c4.2xlarge", C4_2xlarge); + ("c4.xlarge", C4_xlarge); + ("c4.large", C4_large); + ("c3.8xlarge", C3_8xlarge); + ("c3.4xlarge", C3_4xlarge); + ("c3.2xlarge", C3_2xlarge); + ("c3.xlarge", C3_xlarge); + ("c3.large", C3_large); + ("c1.xlarge", C1_xlarge); + ("c1.medium", C1_medium); + ("hs1.8xlarge", Hs1_8xlarge); + ("hi1.4xlarge", Hi1_4xlarge); + ("i2.8xlarge", I2_8xlarge); + ("i2.4xlarge", I2_4xlarge); + ("i2.2xlarge", I2_2xlarge); + ("i2.xlarge", I2_xlarge); + ("cr1.8xlarge", Cr1_8xlarge); + ("m2.4xlarge", M2_4xlarge); + ("m2.2xlarge", M2_2xlarge); + ("m2.xlarge", M2_xlarge); + ("t2.large", T2_large); + ("t2.medium", T2_medium); + ("t2.small", T2_small); + ("t2.micro", T2_micro); + ("m4.10xlarge", M4_10xlarge); + ("m4.4xlarge", M4_4xlarge); + ("m4.2xlarge", M4_2xlarge); + ("m4.xlarge", M4_xlarge); + ("m4.large", M4_large); + ("m3.2xlarge", M3_2xlarge); + ("m3.xlarge", M3_xlarge); + ("m3.large", M3_large); + ("m3.medium", M3_medium); + ("m1.xlarge", M1_xlarge); + ("m1.large", M1_large); + ("m1.medium", M1_medium); + ("m1.small", M1_small); + ("t1.micro", T1_micro)] + let t_to_str = + [(D2_8xlarge, "d2.8xlarge"); + (D2_4xlarge, "d2.4xlarge"); + (D2_2xlarge, "d2.2xlarge"); + (D2_xlarge, "d2.xlarge"); + (R3_8xlarge, "r3.8xlarge"); + (R3_4xlarge, "r3.4xlarge"); + (R3_2xlarge, "r3.2xlarge"); + (R3_xlarge, "r3.xlarge"); + (R3_large, "r3.large"); + (Cg1_4xlarge, "cg1.4xlarge"); + (G2_2xlarge, "g2.2xlarge"); + (Cc2_8xlarge, "cc2.8xlarge"); + (Cc1_4xlarge, "cc1.4xlarge"); + (C4_8xlarge, "c4.8xlarge"); + (C4_4xlarge, "c4.4xlarge"); + (C4_2xlarge, "c4.2xlarge"); + (C4_xlarge, "c4.xlarge"); + (C4_large, "c4.large"); + (C3_8xlarge, "c3.8xlarge"); + (C3_4xlarge, "c3.4xlarge"); + (C3_2xlarge, "c3.2xlarge"); + (C3_xlarge, "c3.xlarge"); + (C3_large, "c3.large"); + (C1_xlarge, "c1.xlarge"); + (C1_medium, "c1.medium"); + (Hs1_8xlarge, "hs1.8xlarge"); + (Hi1_4xlarge, "hi1.4xlarge"); + (I2_8xlarge, "i2.8xlarge"); + (I2_4xlarge, "i2.4xlarge"); + (I2_2xlarge, "i2.2xlarge"); + (I2_xlarge, "i2.xlarge"); + (Cr1_8xlarge, "cr1.8xlarge"); + (M2_4xlarge, "m2.4xlarge"); + (M2_2xlarge, "m2.2xlarge"); + (M2_xlarge, "m2.xlarge"); + (T2_large, "t2.large"); + (T2_medium, "t2.medium"); + (T2_small, "t2.small"); + (T2_micro, "t2.micro"); + (M4_10xlarge, "m4.10xlarge"); + (M4_4xlarge, "m4.4xlarge"); + (M4_2xlarge, "m4.2xlarge"); + (M4_xlarge, "m4.xlarge"); + (M4_large, "m4.large"); + (M3_2xlarge, "m3.2xlarge"); + (M3_xlarge, "m3.xlarge"); + (M3_large, "m3.large"); + (M3_medium, "m3.medium"); + (M1_xlarge, "m1.xlarge"); + (M1_large, "m1.large"); + (M1_medium, "m1.medium"); + (M1_small, "m1.small"); + (T1_micro, "t1.micro")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DiskImageDescription = + struct + type t = + { + format: DiskImageFormat.t ; + size: Long.t ; + import_manifest_url: String.t ; + checksum: String.t option } + let make ~format ~size ~import_manifest_url ?checksum () = + { format; size; import_manifest_url; checksum } + let parse xml = + Some + { + format = + (Xml.required "format" + (Util.option_bind (Xml.member "format" xml) + DiskImageFormat.parse)); + size = + (Xml.required "size" + (Util.option_bind (Xml.member "size" xml) Long.parse)); + import_manifest_url = + (Xml.required "importManifestUrl" + (Util.option_bind (Xml.member "importManifestUrl" xml) + String.parse)); + checksum = + (Util.option_bind (Xml.member "checksum" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.checksum + (fun f -> Query.Pair ("Checksum", (String.to_query f))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.placement (fun f -> - Query.Pair ("Placement", SpotPlacement.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.addressing_type (fun f -> - Query.Pair ("AddressingType", String.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.spot_price (fun f -> "spot_price", String.to_json f) - ; Util.option_map v.weighted_capacity (fun f -> - "weighted_capacity", Double.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", IamInstanceProfileSpecification.to_json f) - ; Some - ( "network_interfaces" - , InstanceNetworkInterfaceSpecificationList.to_json v.network_interfaces ) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.monitoring (fun f -> - "monitoring", SpotFleetMonitoring.to_json f) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.placement (fun f -> "placement", SpotPlacement.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.addressing_type (fun f -> - "addressing_type", String.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some ("security_groups", GroupIdentifierList.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ]) - - let of_json j = - { image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; addressing_type = Util.option_map (Json.lookup j "addressing_type") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; placement = Util.option_map (Json.lookup j "placement") SpotPlacement.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; monitoring = - Util.option_map (Json.lookup j "monitoring") SpotFleetMonitoring.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; network_interfaces = - InstanceNetworkInterfaceSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - ; iam_instance_profile = - Util.option_map - (Json.lookup j "iam_instance_profile") - IamInstanceProfileSpecification.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; weighted_capacity = - Util.option_map (Json.lookup j "weighted_capacity") Double.of_json - ; spot_price = Util.option_map (Json.lookup j "spot_price") String.of_json - } -end - -module VolumeStatusDetails = struct - type t = - { name : VolumeStatusName.t option - ; status : String.t option - } - - let make ?name ?status () = { name; status } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "name" xml) VolumeStatusName.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.name (fun f -> - Query.Pair ("Name", VolumeStatusName.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.name (fun f -> "name", VolumeStatusName.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") VolumeStatusName.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module VolumeAttachmentState = struct - type t = - | Attaching - | Attached - | Detaching - | Detached - - let str_to_t = - [ "detached", Detached - ; "detaching", Detaching - ; "attached", Attached - ; "attaching", Attaching - ] - - let t_to_str = - [ Detached, "detached" - ; Detaching, "detaching" - ; Attached, "attached" - ; Attaching, "attaching" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module TelemetryStatus = struct - type t = - | UP - | DOWN - - let str_to_t = [ "DOWN", DOWN; "UP", UP ] - - let t_to_str = [ DOWN, "DOWN"; UP, "UP" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VpnState = struct - type t = - | Pending - | Available - | Deleting - | Deleted - - let str_to_t = - [ "deleted", Deleted - ; "deleting", Deleting - ; "available", Available - ; "pending", Pending - ] - - let t_to_str = - [ Deleted, "deleted" - ; Deleting, "deleting" - ; Available, "available" - ; Pending, "pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VpnStaticRouteSource = struct - type t = Static - - let str_to_t = [ "Static", Static ] - - let t_to_str = [ Static, "Static" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ArchitectureValues = struct - type t = - | I386 - | X86_64 - - let str_to_t = [ "x86_64", X86_64; "i386", I386 ] - - let t_to_str = [ X86_64, "x86_64"; I386, "i386" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DeviceType = struct - type t = - | Ebs - | Instance_store - - let str_to_t = [ "instance-store", Instance_store; "ebs", Ebs ] - - let t_to_str = [ Instance_store, "instance-store"; Ebs, "ebs" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module HypervisorType = struct - type t = - | Ovm - | Xen - - let str_to_t = [ "xen", Xen; "ovm", Ovm ] - - let t_to_str = [ Xen, "xen"; Ovm, "ovm" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module IamInstanceProfile = struct - type t = - { arn : String.t option - ; id : String.t option - } - - let make ?arn ?id () = { arn; id } - - let parse xml = - Some - { arn = Util.option_bind (Xml.member "arn" xml) String.parse - ; id = Util.option_bind (Xml.member "id" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ; Util.option_map v.arn (fun f -> Query.Pair ("Arn", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.id (fun f -> "id", String.to_json f) - ; Util.option_map v.arn (fun f -> "arn", String.to_json f) - ]) - - let of_json j = - { arn = Util.option_map (Json.lookup j "arn") String.of_json - ; id = Util.option_map (Json.lookup j "id") String.of_json - } -end - -module InstanceBlockDeviceMappingList = struct - type t = InstanceBlockDeviceMapping.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceBlockDeviceMapping.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceBlockDeviceMapping.to_query v - - let to_json v = `List (List.map InstanceBlockDeviceMapping.to_json v) - - let of_json j = Json.to_list InstanceBlockDeviceMapping.of_json j -end - -module InstanceLifecycleType = struct - type t = Spot - - let str_to_t = [ "spot", Spot ] - - let t_to_str = [ Spot, "spot" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module InstanceNetworkInterfaceList = struct - type t = InstanceNetworkInterface.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceNetworkInterface.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceNetworkInterface.to_query v - - let to_json v = `List (List.map InstanceNetworkInterface.to_json v) - - let of_json j = Json.to_list InstanceNetworkInterface.of_json j -end - -module InstanceState = struct - type t = - { code : Integer.t - ; name : InstanceStateName.t - } - - let make ~code ~name () = { code; name } - - let parse xml = - Some - { code = - Xml.required "code" (Util.option_bind (Xml.member "code" xml) Integer.parse) - ; name = - Xml.required - "name" - (Util.option_bind (Xml.member "name" xml) InstanceStateName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Name", InstanceStateName.to_query v.name)) - ; Some (Query.Pair ("Code", Integer.to_query v.code)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("name", InstanceStateName.to_json v.name) - ; Some ("code", Integer.to_json v.code) - ]) - - let of_json j = - { code = Integer.of_json (Util.of_option_exn (Json.lookup j "code")) - ; name = InstanceStateName.of_json (Util.of_option_exn (Json.lookup j "name")) - } -end - -module Monitoring = struct - type t = { state : MonitoringState.t option } - - let make ?state () = { state } - - let parse xml = - Some { state = Util.option_bind (Xml.member "state" xml) MonitoringState.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> - Query.Pair ("State", MonitoringState.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> "state", MonitoringState.to_json f) ]) - - let of_json j = - { state = Util.option_map (Json.lookup j "state") MonitoringState.of_json } -end - -module Placement = struct - type t = - { availability_zone : String.t option - ; group_name : String.t option - ; tenancy : Tenancy.t option - } - - let make ?availability_zone ?group_name ?tenancy () = - { availability_zone; group_name; tenancy } - - let parse xml = - Some - { availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; group_name = Util.option_bind (Xml.member "groupName" xml) String.parse - ; tenancy = Util.option_bind (Xml.member "tenancy" xml) Tenancy.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.tenancy (fun f -> Query.Pair ("Tenancy", Tenancy.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.tenancy (fun f -> "tenancy", Tenancy.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ]) - - let of_json j = - { availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; tenancy = Util.option_map (Json.lookup j "tenancy") Tenancy.of_json - } -end - -module PlatformValues = struct - type t = Windows - - let str_to_t = [ "Windows", Windows ] - - let t_to_str = [ Windows, "Windows" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ProductCodeList = struct - type t = ProductCode.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map ProductCode.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ProductCode.to_query v - - let to_json v = `List (List.map ProductCode.to_json v) - - let of_json j = Json.to_list ProductCode.of_json j -end - -module StateReason = struct - type t = - { code : String.t option - ; message : String.t option - } - - let make ?code ?message () = { code; message } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) String.parse - ; message = Util.option_bind (Xml.member "message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") String.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module TagList = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module VirtualizationType = struct - type t = - | Hvm - | Paravirtual - - let str_to_t = [ "paravirtual", Paravirtual; "hvm", Hvm ] - - let t_to_str = [ Paravirtual, "paravirtual"; Hvm, "hvm" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module IcmpTypeCode = struct - type t = - { type_ : Integer.t option - ; code : Integer.t option - } - - let make ?type_ ?code () = { type_; code } - - let parse xml = - Some - { type_ = Util.option_bind (Xml.member "type" xml) Integer.parse - ; code = Util.option_bind (Xml.member "code" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.code (fun f -> Query.Pair ("Code", Integer.to_query f)) - ; Util.option_map v.type_ (fun f -> Query.Pair ("Type", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.code (fun f -> "code", Integer.to_json f) - ; Util.option_map v.type_ (fun f -> "type_", Integer.to_json f) - ]) - - let of_json j = - { type_ = Util.option_map (Json.lookup j "type_") Integer.of_json - ; code = Util.option_map (Json.lookup j "code") Integer.of_json - } -end - -module PortRange = struct - type t = - { from : Integer.t option - ; to_ : Integer.t option - } - - let make ?from ?to_ () = { from; to_ } - - let parse xml = - Some - { from = Util.option_bind (Xml.member "from" xml) Integer.parse - ; to_ = Util.option_bind (Xml.member "to" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.to_ (fun f -> Query.Pair ("To", Integer.to_query f)) - ; Util.option_map v.from (fun f -> Query.Pair ("From", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.to_ (fun f -> "to_", Integer.to_json f) - ; Util.option_map v.from (fun f -> "from", Integer.to_json f) - ]) - - let of_json j = - { from = Util.option_map (Json.lookup j "from") Integer.of_json - ; to_ = Util.option_map (Json.lookup j "to_") Integer.of_json - } -end - -module RuleAction = struct - type t = - | Allow - | Deny - - let str_to_t = [ "deny", Deny; "allow", Allow ] - - let t_to_str = [ Deny, "deny"; Allow, "allow" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module UserBucketDetails = struct - type t = - { s3_bucket : String.t option - ; s3_key : String.t option - } - - let make ?s3_bucket ?s3_key () = { s3_bucket; s3_key } - - let parse xml = - Some - { s3_bucket = Util.option_bind (Xml.member "s3Bucket" xml) String.parse - ; s3_key = Util.option_bind (Xml.member "s3Key" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> Query.Pair ("S3Key", String.to_query f)) - ; Util.option_map v.s3_bucket (fun f -> - Query.Pair ("S3Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> "s3_key", String.to_json f) - ; Util.option_map v.s3_bucket (fun f -> "s3_bucket", String.to_json f) - ]) - - let of_json j = - { s3_bucket = Util.option_map (Json.lookup j "s3_bucket") String.of_json - ; s3_key = Util.option_map (Json.lookup j "s3_key") String.of_json - } -end - -module NetworkInterfacePrivateIpAddress = struct - type t = - { private_ip_address : String.t option - ; private_dns_name : String.t option - ; primary : Boolean.t option - ; association : NetworkInterfaceAssociation.t option - } - - let make ?private_ip_address ?private_dns_name ?primary ?association () = - { private_ip_address; private_dns_name; primary; association } - - let parse xml = - Some - { private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; private_dns_name = Util.option_bind (Xml.member "privateDnsName" xml) String.parse - ; primary = Util.option_bind (Xml.member "primary" xml) Boolean.parse - ; association = - Util.option_bind - (Xml.member "association" xml) - NetworkInterfaceAssociation.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association (fun f -> - Query.Pair ("Association", NetworkInterfaceAssociation.to_query f)) - ; Util.option_map v.primary (fun f -> Query.Pair ("Primary", Boolean.to_query f)) - ; Util.option_map v.private_dns_name (fun f -> - Query.Pair ("PrivateDnsName", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association (fun f -> - "association", NetworkInterfaceAssociation.to_json f) - ; Util.option_map v.primary (fun f -> "primary", Boolean.to_json f) - ; Util.option_map v.private_dns_name (fun f -> - "private_dns_name", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ]) - - let of_json j = - { private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json - ; primary = Util.option_map (Json.lookup j "primary") Boolean.of_json - ; association = - Util.option_map (Json.lookup j "association") NetworkInterfaceAssociation.of_json - } -end - -module DhcpConfiguration = struct - type t = - { key : String.t option - ; values : DhcpConfigurationValueList.t - } - - let make ?key ?(values = []) () = { key; values } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "key" xml) String.parse - ; values = - Util.of_option - [] - (Util.option_bind - (Xml.member "valueSet" xml) - DhcpConfigurationValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ValueSet", DhcpConfigurationValueList.to_query v.values)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("values", DhcpConfigurationValueList.to_json v.values) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; values = - DhcpConfigurationValueList.of_json (Util.of_option_exn (Json.lookup j "values")) - } -end - -module VpcAttachment = struct - type t = - { vpc_id : String.t option - ; state : AttachmentStatus.t option - } - - let make ?vpc_id ?state () = { vpc_id; state } - - let parse xml = - Some - { vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) AttachmentStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> - Query.Pair ("State", AttachmentStatus.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> "state", AttachmentStatus.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ]) - - let of_json j = - { vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; state = Util.option_map (Json.lookup j "state") AttachmentStatus.of_json - } -end - -module ReservedInstancesModificationResult = struct - type t = - { reserved_instances_id : String.t option - ; target_configuration : ReservedInstancesConfiguration.t option - } - - let make ?reserved_instances_id ?target_configuration () = - { reserved_instances_id; target_configuration } - - let parse xml = - Some - { reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - ; target_configuration = - Util.option_bind - (Xml.member "targetConfiguration" xml) - ReservedInstancesConfiguration.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.target_configuration (fun f -> - Query.Pair - ("TargetConfiguration", ReservedInstancesConfiguration.to_query f)) - ; Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.target_configuration (fun f -> - "target_configuration", ReservedInstancesConfiguration.to_json f) - ; Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - ; target_configuration = - Util.option_map - (Json.lookup j "target_configuration") - ReservedInstancesConfiguration.of_json - } -end - -module ReservedInstancesId = struct - type t = { reserved_instances_id : String.t option } - - let make ?reserved_instances_id () = { reserved_instances_id } - - let parse xml = - Some - { reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - } -end - -module RecurringCharge = struct - type t = - { frequency : RecurringChargeFrequency.t option - ; amount : Double.t option - } - - let make ?frequency ?amount () = { frequency; amount } - - let parse xml = - Some - { frequency = - Util.option_bind (Xml.member "frequency" xml) RecurringChargeFrequency.parse - ; amount = Util.option_bind (Xml.member "amount" xml) Double.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.amount (fun f -> Query.Pair ("Amount", Double.to_query f)) - ; Util.option_map v.frequency (fun f -> - Query.Pair ("Frequency", RecurringChargeFrequency.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.amount (fun f -> "amount", Double.to_json f) - ; Util.option_map v.frequency (fun f -> - "frequency", RecurringChargeFrequency.to_json f) - ]) - - let of_json j = - { frequency = - Util.option_map (Json.lookup j "frequency") RecurringChargeFrequency.of_json - ; amount = Util.option_map (Json.lookup j "amount") Double.of_json - } -end - -module PermissionGroup = struct - type t = All - - let str_to_t = [ "all", All ] - - let t_to_str = [ All, "all" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ImportInstanceVolumeDetailSet = struct - type t = ImportInstanceVolumeDetailItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ImportInstanceVolumeDetailItem.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ImportInstanceVolumeDetailItem.to_query v - - let to_json v = `List (List.map ImportInstanceVolumeDetailItem.to_json v) - - let of_json j = Json.to_list ImportInstanceVolumeDetailItem.of_json j -end - -module PropagatingVgw = struct - type t = { gateway_id : String.t option } - - let make ?gateway_id () = { gateway_id } - - let parse xml = - Some { gateway_id = Util.option_bind (Xml.member "gatewayId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.gateway_id (fun f -> - Query.Pair ("GatewayId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.gateway_id (fun f -> "gateway_id", String.to_json f) ]) - - let of_json j = - { gateway_id = Util.option_map (Json.lookup j "gateway_id") String.of_json } -end - -module Route = struct - type t = - { destination_cidr_block : String.t option - ; destination_prefix_list_id : String.t option - ; gateway_id : String.t option - ; instance_id : String.t option - ; instance_owner_id : String.t option - ; network_interface_id : String.t option - ; vpc_peering_connection_id : String.t option - ; state : RouteState.t option - ; origin : RouteOrigin.t option - } - - let make - ?destination_cidr_block - ?destination_prefix_list_id - ?gateway_id - ?instance_id - ?instance_owner_id - ?network_interface_id - ?vpc_peering_connection_id - ?state - ?origin - () = - { destination_cidr_block - ; destination_prefix_list_id - ; gateway_id - ; instance_id - ; instance_owner_id - ; network_interface_id - ; vpc_peering_connection_id - ; state - ; origin - } - - let parse xml = - Some - { destination_cidr_block = - Util.option_bind (Xml.member "destinationCidrBlock" xml) String.parse - ; destination_prefix_list_id = - Util.option_bind (Xml.member "destinationPrefixListId" xml) String.parse - ; gateway_id = Util.option_bind (Xml.member "gatewayId" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; instance_owner_id = - Util.option_bind (Xml.member "instanceOwnerId" xml) String.parse - ; network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; vpc_peering_connection_id = - Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) RouteState.parse - ; origin = Util.option_bind (Xml.member "origin" xml) RouteOrigin.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.origin (fun f -> - Query.Pair ("Origin", RouteOrigin.to_query f)) - ; Util.option_map v.state (fun f -> Query.Pair ("State", RouteState.to_query f)) - ; Util.option_map v.vpc_peering_connection_id (fun f -> - Query.Pair ("VpcPeeringConnectionId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ; Util.option_map v.instance_owner_id (fun f -> - Query.Pair ("InstanceOwnerId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.gateway_id (fun f -> - Query.Pair ("GatewayId", String.to_query f)) - ; Util.option_map v.destination_prefix_list_id (fun f -> - Query.Pair ("DestinationPrefixListId", String.to_query f)) - ; Util.option_map v.destination_cidr_block (fun f -> - Query.Pair ("DestinationCidrBlock", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.origin (fun f -> "origin", RouteOrigin.to_json f) - ; Util.option_map v.state (fun f -> "state", RouteState.to_json f) - ; Util.option_map v.vpc_peering_connection_id (fun f -> - "vpc_peering_connection_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ; Util.option_map v.instance_owner_id (fun f -> - "instance_owner_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.gateway_id (fun f -> "gateway_id", String.to_json f) - ; Util.option_map v.destination_prefix_list_id (fun f -> - "destination_prefix_list_id", String.to_json f) - ; Util.option_map v.destination_cidr_block (fun f -> - "destination_cidr_block", String.to_json f) - ]) - - let of_json j = - { destination_cidr_block = - Util.option_map (Json.lookup j "destination_cidr_block") String.of_json - ; destination_prefix_list_id = - Util.option_map (Json.lookup j "destination_prefix_list_id") String.of_json - ; gateway_id = Util.option_map (Json.lookup j "gateway_id") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; instance_owner_id = - Util.option_map (Json.lookup j "instance_owner_id") String.of_json - ; network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; vpc_peering_connection_id = - Util.option_map (Json.lookup j "vpc_peering_connection_id") String.of_json - ; state = Util.option_map (Json.lookup j "state") RouteState.of_json - ; origin = Util.option_map (Json.lookup j "origin") RouteOrigin.of_json - } -end - -module RouteTableAssociation = struct - type t = - { route_table_association_id : String.t option - ; route_table_id : String.t option - ; subnet_id : String.t option - ; main : Boolean.t option - } - - let make ?route_table_association_id ?route_table_id ?subnet_id ?main () = - { route_table_association_id; route_table_id; subnet_id; main } - - let parse xml = - Some - { route_table_association_id = - Util.option_bind (Xml.member "routeTableAssociationId" xml) String.parse - ; route_table_id = Util.option_bind (Xml.member "routeTableId" xml) String.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; main = Util.option_bind (Xml.member "main" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.main (fun f -> Query.Pair ("Main", Boolean.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.route_table_id (fun f -> - Query.Pair ("RouteTableId", String.to_query f)) - ; Util.option_map v.route_table_association_id (fun f -> - Query.Pair ("RouteTableAssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.main (fun f -> "main", Boolean.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.route_table_id (fun f -> "route_table_id", String.to_json f) - ; Util.option_map v.route_table_association_id (fun f -> - "route_table_association_id", String.to_json f) - ]) - - let of_json j = - { route_table_association_id = - Util.option_map (Json.lookup j "route_table_association_id") String.of_json - ; route_table_id = Util.option_map (Json.lookup j "route_table_id") String.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; main = Util.option_map (Json.lookup j "main") Boolean.of_json - } -end - -module InstanceCount = struct - type t = - { state : ListingState.t option - ; instance_count : Integer.t option - } - - let make ?state ?instance_count () = { state; instance_count } - - let parse xml = - Some - { state = Util.option_bind (Xml.member "state" xml) ListingState.parse - ; instance_count = Util.option_bind (Xml.member "instanceCount" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_count (fun f -> - Query.Pair ("InstanceCount", Integer.to_query f)) - ; Util.option_map v.state (fun f -> - Query.Pair ("State", ListingState.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) - ; Util.option_map v.state (fun f -> "state", ListingState.to_json f) - ]) - - let of_json j = - { state = Util.option_map (Json.lookup j "state") ListingState.of_json - ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json - } -end - -module PriceSchedule = struct - type t = - { term : Long.t option - ; price : Double.t option - ; currency_code : CurrencyCodeValues.t option - ; active : Boolean.t option - } - - let make ?term ?price ?currency_code ?active () = { term; price; currency_code; active } - - let parse xml = - Some - { term = Util.option_bind (Xml.member "term" xml) Long.parse - ; price = Util.option_bind (Xml.member "price" xml) Double.parse - ; currency_code = - Util.option_bind (Xml.member "currencyCode" xml) CurrencyCodeValues.parse - ; active = Util.option_bind (Xml.member "active" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.active (fun f -> Query.Pair ("Active", Boolean.to_query f)) - ; Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", CurrencyCodeValues.to_query f)) - ; Util.option_map v.price (fun f -> Query.Pair ("Price", Double.to_query f)) - ; Util.option_map v.term (fun f -> Query.Pair ("Term", Long.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.active (fun f -> "active", Boolean.to_json f) - ; Util.option_map v.currency_code (fun f -> - "currency_code", CurrencyCodeValues.to_json f) - ; Util.option_map v.price (fun f -> "price", Double.to_json f) - ; Util.option_map v.term (fun f -> "term", Long.to_json f) - ]) - - let of_json j = - { term = Util.option_map (Json.lookup j "term") Long.of_json - ; price = Util.option_map (Json.lookup j "price") Double.of_json - ; currency_code = - Util.option_map (Json.lookup j "currency_code") CurrencyCodeValues.of_json - ; active = Util.option_map (Json.lookup j "active") Boolean.of_json - } -end - -module InstanceStatusEvent = struct - type t = - { code : EventCode.t option - ; description : String.t option - ; not_before : DateTime.t option - ; not_after : DateTime.t option - } - - let make ?code ?description ?not_before ?not_after () = - { code; description; not_before; not_after } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) EventCode.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; not_before = Util.option_bind (Xml.member "notBefore" xml) DateTime.parse - ; not_after = Util.option_bind (Xml.member "notAfter" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.not_after (fun f -> - Query.Pair ("NotAfter", DateTime.to_query f)) - ; Util.option_map v.not_before (fun f -> - Query.Pair ("NotBefore", DateTime.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", EventCode.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.not_after (fun f -> "not_after", DateTime.to_json f) - ; Util.option_map v.not_before (fun f -> "not_before", DateTime.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.code (fun f -> "code", EventCode.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") EventCode.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; not_before = Util.option_map (Json.lookup j "not_before") DateTime.of_json - ; not_after = Util.option_map (Json.lookup j "not_after") DateTime.of_json - } -end - -module InstanceStatusDetailsList = struct - type t = InstanceStatusDetails.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceStatusDetails.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceStatusDetails.to_query v - - let to_json v = `List (List.map InstanceStatusDetails.to_json v) - - let of_json j = Json.to_list InstanceStatusDetails.of_json j -end - -module SummaryStatus = struct - type t = - | Ok - | Impaired - | Insufficient_data - | Not_applicable - | Initializing - - let str_to_t = - [ "initializing", Initializing - ; "not-applicable", Not_applicable - ; "insufficient-data", Insufficient_data - ; "impaired", Impaired - ; "ok", Ok - ] - - let t_to_str = - [ Initializing, "initializing" - ; Not_applicable, "not-applicable" - ; Insufficient_data, "insufficient-data" - ; Impaired, "impaired" - ; Ok, "ok" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RunInstancesMonitoringEnabled = struct - type t = { enabled : Boolean.t } - - let make ~enabled () = { enabled } - - let parse xml = - Some - { enabled = - Xml.required - "enabled" + ("ImportManifestUrl", + (String.to_query v.import_manifest_url))); + Some (Query.Pair ("Size", (Long.to_query v.size))); + Some (Query.Pair ("Format", (DiskImageFormat.to_query v.format)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.checksum + (fun f -> ("checksum", (String.to_json f))); + Some + ("import_manifest_url", (String.to_json v.import_manifest_url)); + Some ("size", (Long.to_json v.size)); + Some ("format", (DiskImageFormat.to_json v.format))]) + let of_json j = + { + format = + (DiskImageFormat.of_json + (Util.of_option_exn (Json.lookup j "format"))); + size = (Long.of_json (Util.of_option_exn (Json.lookup j "size"))); + import_manifest_url = + (String.of_json + (Util.of_option_exn (Json.lookup j "import_manifest_url"))); + checksum = + (Util.option_map (Json.lookup j "checksum") String.of_json) + } + end +module DiskImageVolumeDescription = + struct + type t = { + size: Long.t option ; + id: String.t } + let make ?size ~id () = { size; id } + let parse xml = + Some + { + size = (Util.option_bind (Xml.member "size" xml) Long.parse); + id = + (Xml.required "id" + (Util.option_bind (Xml.member "id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id))); + Util.option_map v.size + (fun f -> Query.Pair ("Size", (Long.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("id", (String.to_json v.id)); + Util.option_map v.size (fun f -> ("size", (Long.to_json f)))]) + let of_json j = + { + size = (Util.option_map (Json.lookup j "size") Long.of_json); + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) + } + end +module StatusName = + struct + type t = + | Reachability + let str_to_t = [("reachability", Reachability)] + let t_to_str = [(Reachability, "reachability")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module StatusType = + struct + type t = + | Passed + | Failed + | Insufficient_data + | Initializing + let str_to_t = + [("initializing", Initializing); + ("insufficient-data", Insufficient_data); + ("failed", Failed); + ("passed", Passed)] + let t_to_str = + [(Initializing, "initializing"); + (Insufficient_data, "insufficient-data"); + (Failed, "failed"); + (Passed, "passed")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module IpRange = + struct + type t = { + cidr_ip: String.t } + let make ~cidr_ip () = { cidr_ip } + let parse xml = + Some + { + cidr_ip = + (Xml.required "cidrIp" + (Util.option_bind (Xml.member "cidrIp" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("CidrIp", (String.to_query v.cidr_ip)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("cidr_ip", (String.to_json v.cidr_ip))]) + let of_json j = + { + cidr_ip = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_ip"))) + } + end +module PrefixListId = + struct + type t = { + prefix_list_id: String.t option } + let make ?prefix_list_id () = { prefix_list_id } + let parse xml = + Some + { + prefix_list_id = + (Util.option_bind (Xml.member "prefixListId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.prefix_list_id + (fun f -> Query.Pair ("PrefixListId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.prefix_list_id + (fun f -> ("prefix_list_id", (String.to_json f)))]) + let of_json j = + { + prefix_list_id = + (Util.option_map (Json.lookup j "prefix_list_id") String.of_json) + } + end +module UserIdGroupPair = + struct + type t = + { + user_id: String.t option ; + group_name: String.t option ; + group_id: String.t option } + let make ?user_id ?group_name ?group_id () = + { user_id; group_name; group_id } + let parse xml = + Some + { + user_id = (Util.option_bind (Xml.member "userId" xml) String.parse); + group_name = + (Util.option_bind (Xml.member "groupName" xml) String.parse); + group_id = + (Util.option_bind (Xml.member "groupId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> Query.Pair ("GroupId", (String.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.user_id + (fun f -> Query.Pair ("UserId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> ("group_id", (String.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.user_id + (fun f -> ("user_id", (String.to_json f)))]) + let of_json j = + { + user_id = (Util.option_map (Json.lookup j "user_id") String.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + group_id = + (Util.option_map (Json.lookup j "group_id") String.of_json) + } + end +module BlockDeviceMappingList = + struct + type t = BlockDeviceMapping.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BlockDeviceMapping.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list BlockDeviceMapping.to_query v + let to_json v = `List (List.map BlockDeviceMapping.to_json v) + let of_json j = Json.to_list BlockDeviceMapping.of_json j + end +module IamInstanceProfileSpecification = + struct + type t = { + arn: String.t option ; + name: String.t option } + let make ?arn ?name () = { arn; name } + let parse xml = + Some + { + arn = (Util.option_bind (Xml.member "arn" xml) String.parse); + name = (Util.option_bind (Xml.member "name" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.arn + (fun f -> Query.Pair ("Arn", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.arn (fun f -> ("arn", (String.to_json f)))]) + let of_json j = + { + arn = (Util.option_map (Json.lookup j "arn") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json) + } + end +module InstanceNetworkInterfaceSpecificationList = + struct + type t = InstanceNetworkInterfaceSpecification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceNetworkInterfaceSpecification.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list InstanceNetworkInterfaceSpecification.to_query v + let to_json v = + `List (List.map InstanceNetworkInterfaceSpecification.to_json v) + let of_json j = + Json.to_list InstanceNetworkInterfaceSpecification.of_json j + end +module SpotFleetMonitoring = + struct + type t = { + enabled: Boolean.t option } + let make ?enabled () = { enabled } + let parse xml = + Some + { + enabled = (Util.option_bind (Xml.member "enabled" xml) Boolean.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Enabled", Boolean.to_query v.enabled)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("enabled", Boolean.to_json v.enabled) ]) - - let of_json j = - { enabled = Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled")) } -end - -module ContainerFormat = struct - type t = Ova - - let str_to_t = [ "ova", Ova ] - - let t_to_str = [ Ova, "ova" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ExportEnvironment = struct - type t = - | Citrix - | Vmware - | Microsoft - - let str_to_t = [ "microsoft", Microsoft; "vmware", Vmware; "citrix", Citrix ] - - let t_to_str = [ Microsoft, "microsoft"; Vmware, "vmware"; Citrix, "citrix" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module IpPermission = struct - type t = - { ip_protocol : String.t - ; from_port : Integer.t option - ; to_port : Integer.t option - ; user_id_group_pairs : UserIdGroupPairList.t - ; ip_ranges : IpRangeList.t - ; prefix_list_ids : PrefixListIdList.t - } - - let make - ~ip_protocol - ?from_port - ?to_port - ?(user_id_group_pairs = []) - ?(ip_ranges = []) - ?(prefix_list_ids = []) - () = - { ip_protocol; from_port; to_port; user_id_group_pairs; ip_ranges; prefix_list_ids } - - let parse xml = - Some - { ip_protocol = - Xml.required - "ipProtocol" - (Util.option_bind (Xml.member "ipProtocol" xml) String.parse) - ; from_port = Util.option_bind (Xml.member "fromPort" xml) Integer.parse - ; to_port = Util.option_bind (Xml.member "toPort" xml) Integer.parse - ; user_id_group_pairs = - Util.of_option - [] - (Util.option_bind (Xml.member "groups" xml) UserIdGroupPairList.parse) - ; ip_ranges = - Util.of_option - [] - (Util.option_bind (Xml.member "ipRanges" xml) IpRangeList.parse) - ; prefix_list_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "prefixListIds" xml) PrefixListIdList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("PrefixListIds", PrefixListIdList.to_query v.prefix_list_ids)) - ; Some (Query.Pair ("IpRanges", IpRangeList.to_query v.ip_ranges)) - ; Some - (Query.Pair ("Groups", UserIdGroupPairList.to_query v.user_id_group_pairs)) - ; Util.option_map v.to_port (fun f -> Query.Pair ("ToPort", Integer.to_query f)) - ; Util.option_map v.from_port (fun f -> - Query.Pair ("FromPort", Integer.to_query f)) - ; Some (Query.Pair ("IpProtocol", String.to_query v.ip_protocol)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("prefix_list_ids", PrefixListIdList.to_json v.prefix_list_ids) - ; Some ("ip_ranges", IpRangeList.to_json v.ip_ranges) - ; Some ("user_id_group_pairs", UserIdGroupPairList.to_json v.user_id_group_pairs) - ; Util.option_map v.to_port (fun f -> "to_port", Integer.to_json f) - ; Util.option_map v.from_port (fun f -> "from_port", Integer.to_json f) - ; Some ("ip_protocol", String.to_json v.ip_protocol) - ]) - - let of_json j = - { ip_protocol = String.of_json (Util.of_option_exn (Json.lookup j "ip_protocol")) - ; from_port = Util.option_map (Json.lookup j "from_port") Integer.of_json - ; to_port = Util.option_map (Json.lookup j "to_port") Integer.of_json - ; user_id_group_pairs = - UserIdGroupPairList.of_json - (Util.of_option_exn (Json.lookup j "user_id_group_pairs")) - ; ip_ranges = IpRangeList.of_json (Util.of_option_exn (Json.lookup j "ip_ranges")) - ; prefix_list_ids = - PrefixListIdList.of_json (Util.of_option_exn (Json.lookup j "prefix_list_ids")) - } -end - -module InternetGatewayAttachment = struct - type t = - { vpc_id : String.t - ; state : AttachmentStatus.t - } - - let make ~vpc_id ~state () = { vpc_id; state } - - let parse xml = - Some - { vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - ; state = - Xml.required - "state" - (Util.option_bind (Xml.member "state" xml) AttachmentStatus.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("State", AttachmentStatus.to_query v.state)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("state", AttachmentStatus.to_json v.state) - ; Some ("vpc_id", String.to_json v.vpc_id) - ]) - - let of_json j = - { vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; state = AttachmentStatus.of_json (Util.of_option_exn (Json.lookup j "state")) - } -end - -module LaunchSpecsList = struct - type t = SpotFleetLaunchSpecification.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map SpotFleetLaunchSpecification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SpotFleetLaunchSpecification.to_query v - - let to_json v = `List (List.map SpotFleetLaunchSpecification.to_json v) - - let of_json j = Json.to_list SpotFleetLaunchSpecification.of_json j -end - -module AvailabilityZoneMessage = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module S3Storage = struct - type t = - { bucket : String.t option - ; prefix : String.t option - ; a_w_s_access_key_id : String.t option - ; upload_policy : Blob.t option - ; upload_policy_signature : String.t option - } - - let make ?bucket ?prefix ?a_w_s_access_key_id ?upload_policy ?upload_policy_signature () - = - { bucket; prefix; a_w_s_access_key_id; upload_policy; upload_policy_signature } - - let parse xml = - Some - { bucket = Util.option_bind (Xml.member "bucket" xml) String.parse - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - ; a_w_s_access_key_id = - Util.option_bind (Xml.member "AWSAccessKeyId" xml) String.parse - ; upload_policy = Util.option_bind (Xml.member "uploadPolicy" xml) Blob.parse - ; upload_policy_signature = - Util.option_bind (Xml.member "uploadPolicySignature" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.upload_policy_signature (fun f -> - Query.Pair ("UploadPolicySignature", String.to_query f)) - ; Util.option_map v.upload_policy (fun f -> - Query.Pair ("UploadPolicy", Blob.to_query f)) - ; Util.option_map v.a_w_s_access_key_id (fun f -> - Query.Pair ("AWSAccessKeyId", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.upload_policy_signature (fun f -> - "upload_policy_signature", String.to_json f) - ; Util.option_map v.upload_policy (fun f -> "upload_policy", Blob.to_json f) - ; Util.option_map v.a_w_s_access_key_id (fun f -> - "a_w_s_access_key_id", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ]) - - let of_json j = - { bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; a_w_s_access_key_id = - Util.option_map (Json.lookup j "a_w_s_access_key_id") String.of_json - ; upload_policy = Util.option_map (Json.lookup j "upload_policy") Blob.of_json - ; upload_policy_signature = - Util.option_map (Json.lookup j "upload_policy_signature") String.of_json - } -end - -module VolumeStatusAction = struct - type t = - { code : String.t option - ; description : String.t option - ; event_type : String.t option - ; event_id : String.t option - } - - let make ?code ?description ?event_type ?event_id () = - { code; description; event_type; event_id } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; event_type = Util.option_bind (Xml.member "eventType" xml) String.parse - ; event_id = Util.option_bind (Xml.member "eventId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_id (fun f -> Query.Pair ("EventId", String.to_query f)) - ; Util.option_map v.event_type (fun f -> - Query.Pair ("EventType", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_id (fun f -> "event_id", String.to_json f) - ; Util.option_map v.event_type (fun f -> "event_type", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; event_type = Util.option_map (Json.lookup j "event_type") String.of_json - ; event_id = Util.option_map (Json.lookup j "event_id") String.of_json - } -end - -module VolumeStatusEvent = struct - type t = - { event_type : String.t option - ; description : String.t option - ; not_before : DateTime.t option - ; not_after : DateTime.t option - ; event_id : String.t option - } - - let make ?event_type ?description ?not_before ?not_after ?event_id () = - { event_type; description; not_before; not_after; event_id } - - let parse xml = - Some - { event_type = Util.option_bind (Xml.member "eventType" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; not_before = Util.option_bind (Xml.member "notBefore" xml) DateTime.parse - ; not_after = Util.option_bind (Xml.member "notAfter" xml) DateTime.parse - ; event_id = Util.option_bind (Xml.member "eventId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_id (fun f -> Query.Pair ("EventId", String.to_query f)) - ; Util.option_map v.not_after (fun f -> - Query.Pair ("NotAfter", DateTime.to_query f)) - ; Util.option_map v.not_before (fun f -> - Query.Pair ("NotBefore", DateTime.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.event_type (fun f -> - Query.Pair ("EventType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_id (fun f -> "event_id", String.to_json f) - ; Util.option_map v.not_after (fun f -> "not_after", DateTime.to_json f) - ; Util.option_map v.not_before (fun f -> "not_before", DateTime.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.event_type (fun f -> "event_type", String.to_json f) - ]) - - let of_json j = - { event_type = Util.option_map (Json.lookup j "event_type") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; not_before = Util.option_map (Json.lookup j "not_before") DateTime.of_json - ; not_after = Util.option_map (Json.lookup j "not_after") DateTime.of_json - ; event_id = Util.option_map (Json.lookup j "event_id") String.of_json - } -end - -module VolumeStatusDetailsList = struct - type t = VolumeStatusDetails.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VolumeStatusDetails.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VolumeStatusDetails.to_query v - - let to_json v = `List (List.map VolumeStatusDetails.to_json v) - - let of_json j = Json.to_list VolumeStatusDetails.of_json j -end - -module VolumeStatusInfoStatus = struct - type t = - | Ok - | Impaired - | Insufficient_data - - let str_to_t = - [ "insufficient-data", Insufficient_data; "impaired", Impaired; "ok", Ok ] - - let t_to_str = - [ Insufficient_data, "insufficient-data"; Impaired, "impaired"; Ok, "ok" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VolumeAttachment = struct - type t = - { volume_id : String.t option - ; instance_id : String.t option - ; device : String.t option - ; state : VolumeAttachmentState.t option - ; attach_time : DateTime.t option - ; delete_on_termination : Boolean.t option - } - - let make ?volume_id ?instance_id ?device ?state ?attach_time ?delete_on_termination () = - { volume_id; instance_id; device; state; attach_time; delete_on_termination } - - let parse xml = - Some - { volume_id = Util.option_bind (Xml.member "volumeId" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; device = Util.option_bind (Xml.member "device" xml) String.parse - ; state = Util.option_bind (Xml.member "status" xml) VolumeAttachmentState.parse - ; attach_time = Util.option_bind (Xml.member "attachTime" xml) DateTime.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.attach_time (fun f -> - Query.Pair ("AttachTime", DateTime.to_query f)) - ; Util.option_map v.state (fun f -> - Query.Pair ("Status", VolumeAttachmentState.to_query f)) - ; Util.option_map v.device (fun f -> Query.Pair ("Device", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.volume_id (fun f -> - Query.Pair ("VolumeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.attach_time (fun f -> "attach_time", DateTime.to_json f) - ; Util.option_map v.state (fun f -> "state", VolumeAttachmentState.to_json f) - ; Util.option_map v.device (fun f -> "device", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) - ]) - - let of_json j = - { volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; device = Util.option_map (Json.lookup j "device") String.of_json - ; state = Util.option_map (Json.lookup j "state") VolumeAttachmentState.of_json - ; attach_time = Util.option_map (Json.lookup j "attach_time") DateTime.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module VgwTelemetry = struct - type t = - { outside_ip_address : String.t option - ; status : TelemetryStatus.t option - ; last_status_change : DateTime.t option - ; status_message : String.t option - ; accepted_route_count : Integer.t option - } - - let make - ?outside_ip_address - ?status - ?last_status_change - ?status_message - ?accepted_route_count - () = - { outside_ip_address - ; status - ; last_status_change - ; status_message - ; accepted_route_count - } - - let parse xml = - Some - { outside_ip_address = - Util.option_bind (Xml.member "outsideIpAddress" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) TelemetryStatus.parse - ; last_status_change = - Util.option_bind (Xml.member "lastStatusChange" xml) DateTime.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; accepted_route_count = - Util.option_bind (Xml.member "acceptedRouteCount" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.accepted_route_count (fun f -> - Query.Pair ("AcceptedRouteCount", Integer.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.last_status_change (fun f -> - Query.Pair ("LastStatusChange", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", TelemetryStatus.to_query f)) - ; Util.option_map v.outside_ip_address (fun f -> - Query.Pair ("OutsideIpAddress", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.accepted_route_count (fun f -> - "accepted_route_count", Integer.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.last_status_change (fun f -> - "last_status_change", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", TelemetryStatus.to_json f) - ; Util.option_map v.outside_ip_address (fun f -> - "outside_ip_address", String.to_json f) - ]) - - let of_json j = - { outside_ip_address = - Util.option_map (Json.lookup j "outside_ip_address") String.of_json - ; status = Util.option_map (Json.lookup j "status") TelemetryStatus.of_json - ; last_status_change = - Util.option_map (Json.lookup j "last_status_change") DateTime.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; accepted_route_count = - Util.option_map (Json.lookup j "accepted_route_count") Integer.of_json - } -end - -module VpnStaticRoute = struct - type t = - { destination_cidr_block : String.t option - ; source : VpnStaticRouteSource.t option - ; state : VpnState.t option - } - - let make ?destination_cidr_block ?source ?state () = - { destination_cidr_block; source; state } - - let parse xml = - Some - { destination_cidr_block = - Util.option_bind (Xml.member "destinationCidrBlock" xml) String.parse - ; source = Util.option_bind (Xml.member "source" xml) VpnStaticRouteSource.parse - ; state = Util.option_bind (Xml.member "state" xml) VpnState.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> Query.Pair ("State", VpnState.to_query f)) - ; Util.option_map v.source (fun f -> - Query.Pair ("Source", VpnStaticRouteSource.to_query f)) - ; Util.option_map v.destination_cidr_block (fun f -> - Query.Pair ("DestinationCidrBlock", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> "state", VpnState.to_json f) - ; Util.option_map v.source (fun f -> "source", VpnStaticRouteSource.to_json f) - ; Util.option_map v.destination_cidr_block (fun f -> - "destination_cidr_block", String.to_json f) - ]) - - let of_json j = - { destination_cidr_block = - Util.option_map (Json.lookup j "destination_cidr_block") String.of_json - ; source = Util.option_map (Json.lookup j "source") VpnStaticRouteSource.of_json - ; state = Util.option_map (Json.lookup j "state") VpnState.of_json - } -end - -module PricingDetail = struct - type t = - { price : Double.t option - ; count : Integer.t option - } - - let make ?price ?count () = { price; count } - - let parse xml = - Some - { price = Util.option_bind (Xml.member "price" xml) Double.parse - ; count = Util.option_bind (Xml.member "count" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.count (fun f -> Query.Pair ("Count", Integer.to_query f)) - ; Util.option_map v.price (fun f -> Query.Pair ("Price", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.count (fun f -> "count", Integer.to_json f) - ; Util.option_map v.price (fun f -> "price", Double.to_json f) - ]) - - let of_json j = - { price = Util.option_map (Json.lookup j "price") Double.of_json - ; count = Util.option_map (Json.lookup j "count") Integer.of_json - } -end - -module Instance = struct - type t = - { instance_id : String.t - ; image_id : String.t - ; state : InstanceState.t - ; private_dns_name : String.t option - ; public_dns_name : String.t option - ; state_transition_reason : String.t option - ; key_name : String.t option - ; ami_launch_index : Integer.t - ; product_codes : ProductCodeList.t - ; instance_type : InstanceType.t - ; launch_time : DateTime.t - ; placement : Placement.t - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; platform : PlatformValues.t option - ; monitoring : Monitoring.t - ; subnet_id : String.t option - ; vpc_id : String.t option - ; private_ip_address : String.t option - ; public_ip_address : String.t option - ; state_reason : StateReason.t option - ; architecture : ArchitectureValues.t - ; root_device_type : DeviceType.t - ; root_device_name : String.t option - ; block_device_mappings : InstanceBlockDeviceMappingList.t - ; virtualization_type : VirtualizationType.t - ; instance_lifecycle : InstanceLifecycleType.t option - ; spot_instance_request_id : String.t option - ; client_token : String.t option - ; tags : TagList.t - ; security_groups : GroupIdentifierList.t - ; source_dest_check : Boolean.t option - ; hypervisor : HypervisorType.t - ; network_interfaces : InstanceNetworkInterfaceList.t - ; iam_instance_profile : IamInstanceProfile.t option - ; ebs_optimized : Boolean.t option - ; sriov_net_support : String.t option - } - - let make - ~instance_id - ~image_id - ~state - ?private_dns_name - ?public_dns_name - ?state_transition_reason - ?key_name - ~ami_launch_index - ?(product_codes = []) - ~instance_type - ~launch_time - ~placement - ?kernel_id - ?ramdisk_id - ?platform - ~monitoring - ?subnet_id - ?vpc_id - ?private_ip_address - ?public_ip_address - ?state_reason - ~architecture - ~root_device_type - ?root_device_name - ?(block_device_mappings = []) - ~virtualization_type - ?instance_lifecycle - ?spot_instance_request_id - ?client_token - ?(tags = []) - ?(security_groups = []) - ?source_dest_check - ~hypervisor - ?(network_interfaces = []) - ?iam_instance_profile - ?ebs_optimized - ?sriov_net_support - () = - { instance_id - ; image_id - ; state - ; private_dns_name - ; public_dns_name - ; state_transition_reason - ; key_name - ; ami_launch_index - ; product_codes - ; instance_type - ; launch_time - ; placement - ; kernel_id - ; ramdisk_id - ; platform - ; monitoring - ; subnet_id - ; vpc_id - ; private_ip_address - ; public_ip_address - ; state_reason - ; architecture - ; root_device_type - ; root_device_name - ; block_device_mappings - ; virtualization_type - ; instance_lifecycle - ; spot_instance_request_id - ; client_token - ; tags - ; security_groups - ; source_dest_check - ; hypervisor - ; network_interfaces - ; iam_instance_profile - ; ebs_optimized - ; sriov_net_support - } - - let parse xml = - Some - { instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; image_id = - Xml.required - "imageId" - (Util.option_bind (Xml.member "imageId" xml) String.parse) - ; state = - Xml.required - "instanceState" - (Util.option_bind (Xml.member "instanceState" xml) InstanceState.parse) - ; private_dns_name = Util.option_bind (Xml.member "privateDnsName" xml) String.parse - ; public_dns_name = Util.option_bind (Xml.member "dnsName" xml) String.parse - ; state_transition_reason = Util.option_bind (Xml.member "reason" xml) String.parse - ; key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; ami_launch_index = - Xml.required - "amiLaunchIndex" - (Util.option_bind (Xml.member "amiLaunchIndex" xml) Integer.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - ; instance_type = - Xml.required - "instanceType" - (Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse) - ; launch_time = - Xml.required - "launchTime" - (Util.option_bind (Xml.member "launchTime" xml) DateTime.parse) - ; placement = - Xml.required - "placement" - (Util.option_bind (Xml.member "placement" xml) Placement.parse) - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) PlatformValues.parse - ; monitoring = - Xml.required - "monitoring" - (Util.option_bind (Xml.member "monitoring" xml) Monitoring.parse) - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; public_ip_address = Util.option_bind (Xml.member "ipAddress" xml) String.parse - ; state_reason = Util.option_bind (Xml.member "stateReason" xml) StateReason.parse - ; architecture = - Xml.required - "architecture" - (Util.option_bind (Xml.member "architecture" xml) ArchitectureValues.parse) - ; root_device_type = - Xml.required - "rootDeviceType" - (Util.option_bind (Xml.member "rootDeviceType" xml) DeviceType.parse) - ; root_device_name = Util.option_bind (Xml.member "rootDeviceName" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - InstanceBlockDeviceMappingList.parse) - ; virtualization_type = - Xml.required - "virtualizationType" - (Util.option_bind - (Xml.member "virtualizationType" xml) - VirtualizationType.parse) - ; instance_lifecycle = - Util.option_bind - (Xml.member "instanceLifecycle" xml) - InstanceLifecycleType.parse - ; spot_instance_request_id = - Util.option_bind (Xml.member "spotInstanceRequestId" xml) String.parse - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) Boolean.parse - ; hypervisor = - Xml.required - "hypervisor" - (Util.option_bind (Xml.member "hypervisor" xml) HypervisorType.parse) - ; network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "networkInterfaceSet" xml) - InstanceNetworkInterfaceList.parse) - ; iam_instance_profile = - Util.option_bind (Xml.member "iamInstanceProfile" xml) IamInstanceProfile.parse - ; ebs_optimized = Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", String.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair ("IamInstanceProfile", IamInstanceProfile.to_query f)) - ; Some - (Query.Pair - ( "NetworkInterfaceSet" - , InstanceNetworkInterfaceList.to_query v.network_interfaces )) - ; Some (Query.Pair ("Hypervisor", HypervisorType.to_query v.hypervisor)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", Boolean.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.security_groups)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.spot_instance_request_id (fun f -> - Query.Pair ("SpotInstanceRequestId", String.to_query f)) - ; Util.option_map v.instance_lifecycle (fun f -> - Query.Pair ("InstanceLifecycle", InstanceLifecycleType.to_query f)) - ; Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> Query.Pair ("Enabled", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> ("enabled", (Boolean.to_json f)))]) + let of_json j = + { enabled = (Util.option_map (Json.lookup j "enabled") Boolean.of_json) + } + end +module SpotPlacement = + struct + type t = + { + availability_zone: String.t option ; + group_name: String.t option } + let make ?availability_zone ?group_name () = + { availability_zone; group_name } + let parse xml = + Some + { + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + group_name = + (Util.option_bind (Xml.member "groupName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f)))]) + let of_json j = + { + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json) + } + end +module VolumeStatusName = + struct + type t = + | Io_enabled + | Io_performance + let str_to_t = + [("io-performance", Io_performance); ("io-enabled", Io_enabled)] + let t_to_str = + [(Io_performance, "io-performance"); (Io_enabled, "io-enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceBlockDeviceMapping = + struct + type t = + { + device_name: String.t option ; + ebs: EbsInstanceBlockDevice.t option } + let make ?device_name ?ebs () = { device_name; ebs } + let parse xml = + Some + { + device_name = + (Util.option_bind (Xml.member "deviceName" xml) String.parse); + ebs = + (Util.option_bind (Xml.member "ebs" xml) + EbsInstanceBlockDevice.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.ebs + (fun f -> + Query.Pair ("Ebs", (EbsInstanceBlockDevice.to_query f))); + Util.option_map v.device_name + (fun f -> Query.Pair ("DeviceName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.ebs + (fun f -> ("ebs", (EbsInstanceBlockDevice.to_json f))); + Util.option_map v.device_name + (fun f -> ("device_name", (String.to_json f)))]) + let of_json j = + { + device_name = + (Util.option_map (Json.lookup j "device_name") String.of_json); + ebs = + (Util.option_map (Json.lookup j "ebs") + EbsInstanceBlockDevice.of_json) + } + end +module InstanceNetworkInterface = + struct + type t = + { + network_interface_id: String.t option ; + subnet_id: String.t option ; + vpc_id: String.t option ; + description: String.t option ; + owner_id: String.t option ; + status: NetworkInterfaceStatus.t option ; + mac_address: String.t option ; + private_ip_address: String.t option ; + private_dns_name: String.t option ; + source_dest_check: Boolean.t option ; + groups: GroupIdentifierList.t ; + attachment: InstanceNetworkInterfaceAttachment.t option ; + association: InstanceNetworkInterfaceAssociation.t option ; + private_ip_addresses: InstancePrivateIpAddressList.t } + let make ?network_interface_id ?subnet_id ?vpc_id ?description + ?owner_id ?status ?mac_address ?private_ip_address + ?private_dns_name ?source_dest_check ?(groups= []) ?attachment + ?association ?(private_ip_addresses= []) () = + { + network_interface_id; + subnet_id; + vpc_id; + description; + owner_id; + status; + mac_address; + private_ip_address; + private_dns_name; + source_dest_check; + groups; + attachment; + association; + private_ip_addresses + } + let parse xml = + Some + { + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + owner_id = + (Util.option_bind (Xml.member "ownerId" xml) String.parse); + status = + (Util.option_bind (Xml.member "status" xml) + NetworkInterfaceStatus.parse); + mac_address = + (Util.option_bind (Xml.member "macAddress" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + private_dns_name = + (Util.option_bind (Xml.member "privateDnsName" xml) String.parse); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + Boolean.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + attachment = + (Util.option_bind (Xml.member "attachment" xml) + InstanceNetworkInterfaceAttachment.parse); + association = + (Util.option_bind (Xml.member "association" xml) + InstanceNetworkInterfaceAssociation.parse); + private_ip_addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "privateIpAddressesSet" xml) + InstancePrivateIpAddressList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PrivateIpAddressesSet", + (InstancePrivateIpAddressList.to_query + v.private_ip_addresses))); + Util.option_map v.association + (fun f -> + Query.Pair + ("Association", + (InstanceNetworkInterfaceAssociation.to_query f))); + Util.option_map v.attachment + (fun f -> + Query.Pair + ("Attachment", + (InstanceNetworkInterfaceAttachment.to_query f))); + Some (Query.Pair - ("VirtualizationType", VirtualizationType.to_query v.virtualization_type)) - ; Some + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.source_dest_check + (fun f -> Query.Pair ("SourceDestCheck", (Boolean.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.mac_address + (fun f -> Query.Pair ("MacAddress", (String.to_query f))); + Util.option_map v.status + (fun f -> + Query.Pair ("Status", (NetworkInterfaceStatus.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("private_ip_addresses", + (InstancePrivateIpAddressList.to_json v.private_ip_addresses)); + Util.option_map v.association + (fun f -> + ("association", + (InstanceNetworkInterfaceAssociation.to_json f))); + Util.option_map v.attachment + (fun f -> + ("attachment", + (InstanceNetworkInterfaceAttachment.to_json f))); + Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.source_dest_check + (fun f -> ("source_dest_check", (Boolean.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.mac_address + (fun f -> ("mac_address", (String.to_json f))); + Util.option_map v.status + (fun f -> ("status", (NetworkInterfaceStatus.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f)))]) + let of_json j = + { + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + status = + (Util.option_map (Json.lookup j "status") + NetworkInterfaceStatus.of_json); + mac_address = + (Util.option_map (Json.lookup j "mac_address") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + Boolean.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + attachment = + (Util.option_map (Json.lookup j "attachment") + InstanceNetworkInterfaceAttachment.of_json); + association = + (Util.option_map (Json.lookup j "association") + InstanceNetworkInterfaceAssociation.of_json); + private_ip_addresses = + (InstancePrivateIpAddressList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))) + } + end +module InstanceStateName = + struct + type t = + | Pending + | Running + | Shutting_down + | Terminated + | Stopping + | Stopped + let str_to_t = + [("stopped", Stopped); + ("stopping", Stopping); + ("terminated", Terminated); + ("shutting-down", Shutting_down); + ("running", Running); + ("pending", Pending)] + let t_to_str = + [(Stopped, "stopped"); + (Stopping, "stopping"); + (Terminated, "terminated"); + (Shutting_down, "shutting-down"); + (Running, "running"); + (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MonitoringState = + struct + type t = + | Disabled + | Disabling + | Enabled + | Pending + let str_to_t = + [("pending", Pending); + ("enabled", Enabled); + ("disabling", Disabling); + ("disabled", Disabled)] + let t_to_str = + [(Pending, "pending"); + (Enabled, "enabled"); + (Disabling, "disabling"); + (Disabled, "disabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Tenancy = + struct + type t = + | Default + | Dedicated + let str_to_t = [("dedicated", Dedicated); ("default", Default)] + let t_to_str = [(Dedicated, "dedicated"); (Default, "default")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ProductCode = + struct + type t = + { + product_code_id: String.t option ; + product_code_type: ProductCodeValues.t option } + let make ?product_code_id ?product_code_type () = + { product_code_id; product_code_type } + let parse xml = + Some + { + product_code_id = + (Util.option_bind (Xml.member "productCode" xml) String.parse); + product_code_type = + (Util.option_bind (Xml.member "type" xml) ProductCodeValues.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.product_code_type + (fun f -> Query.Pair ("Type", (ProductCodeValues.to_query f))); + Util.option_map v.product_code_id + (fun f -> Query.Pair ("ProductCode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.product_code_type + (fun f -> ("product_code_type", (ProductCodeValues.to_json f))); + Util.option_map v.product_code_id + (fun f -> ("product_code_id", (String.to_json f)))]) + let of_json j = + { + product_code_id = + (Util.option_map (Json.lookup j "product_code_id") String.of_json); + product_code_type = + (Util.option_map (Json.lookup j "product_code_type") + ProductCodeValues.of_json) + } + end +module Tag = + struct + type t = { + key: String.t ; + value: String.t } + let make ~key ~value () = { key; value } + let parse xml = + Some + { + key = + (Xml.required "key" + (Util.option_bind (Xml.member "key" xml) String.parse)); + value = + (Xml.required "value" + (Util.option_bind (Xml.member "value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("key", (String.to_json v.key))]) + let of_json j = + { + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) + } + end +module NetworkInterfaceAssociation = + struct + type t = + { + public_ip: String.t option ; + public_dns_name: String.t option ; + ip_owner_id: String.t option ; + allocation_id: String.t option ; + association_id: String.t option } + let make ?public_ip ?public_dns_name ?ip_owner_id ?allocation_id + ?association_id () = + { + public_ip; + public_dns_name; + ip_owner_id; + allocation_id; + association_id + } + let parse xml = + Some + { + public_ip = + (Util.option_bind (Xml.member "publicIp" xml) String.parse); + public_dns_name = + (Util.option_bind (Xml.member "publicDnsName" xml) String.parse); + ip_owner_id = + (Util.option_bind (Xml.member "ipOwnerId" xml) String.parse); + allocation_id = + (Util.option_bind (Xml.member "allocationId" xml) String.parse); + association_id = + (Util.option_bind (Xml.member "associationId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> Query.Pair ("AssociationId", (String.to_query f))); + Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f))); + Util.option_map v.ip_owner_id + (fun f -> Query.Pair ("IpOwnerId", (String.to_query f))); + Util.option_map v.public_dns_name + (fun f -> Query.Pair ("PublicDnsName", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> ("association_id", (String.to_json f))); + Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f))); + Util.option_map v.ip_owner_id + (fun f -> ("ip_owner_id", (String.to_json f))); + Util.option_map v.public_dns_name + (fun f -> ("public_dns_name", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f)))]) + let of_json j = + { + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + public_dns_name = + (Util.option_map (Json.lookup j "public_dns_name") String.of_json); + ip_owner_id = + (Util.option_map (Json.lookup j "ip_owner_id") String.of_json); + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json); + association_id = + (Util.option_map (Json.lookup j "association_id") String.of_json) + } + end +module DhcpConfigurationValueList = + struct + type t = AttributeValue.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AttributeValue.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list AttributeValue.to_query v + let to_json v = `List (List.map AttributeValue.to_json v) + let of_json j = Json.to_list AttributeValue.of_json j + end +module ReservedInstancesConfiguration = + struct + type t = + { + availability_zone: String.t option ; + platform: String.t option ; + instance_count: Integer.t option ; + instance_type: InstanceType.t option } + let make ?availability_zone ?platform ?instance_count ?instance_type + () = { availability_zone; platform; instance_count; instance_type } + let parse xml = + Some + { + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) String.parse); + instance_count = + (Util.option_bind (Xml.member "instanceCount" xml) Integer.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_type + (fun f -> + Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f)))]) + let of_json j = + { + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") String.of_json); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json) + } + end +module RecurringChargeFrequency = + struct + type t = + | Hourly + let str_to_t = [("Hourly", Hourly)] + let t_to_str = [(Hourly, "Hourly")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ImportInstanceVolumeDetailItem = + struct + type t = + { + bytes_converted: Long.t ; + availability_zone: String.t ; + image: DiskImageDescription.t ; + volume: DiskImageVolumeDescription.t ; + status: String.t ; + status_message: String.t option ; + description: String.t option } + let make ~bytes_converted ~availability_zone ~image ~volume ~status + ?status_message ?description () = + { + bytes_converted; + availability_zone; + image; + volume; + status; + status_message; + description + } + let parse xml = + Some + { + bytes_converted = + (Xml.required "bytesConverted" + (Util.option_bind (Xml.member "bytesConverted" xml) Long.parse)); + availability_zone = + (Xml.required "availabilityZone" + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse)); + image = + (Xml.required "image" + (Util.option_bind (Xml.member "image" xml) + DiskImageDescription.parse)); + volume = + (Xml.required "volume" + (Util.option_bind (Xml.member "volume" xml) + DiskImageVolumeDescription.parse)); + status = + (Xml.required "status" + (Util.option_bind (Xml.member "status" xml) String.parse)); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Some (Query.Pair ("Status", (String.to_query v.status))); + Some (Query.Pair - ( "BlockDeviceMapping" - , InstanceBlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.root_device_name (fun f -> - Query.Pair ("RootDeviceName", String.to_query f)) - ; Some (Query.Pair ("RootDeviceType", DeviceType.to_query v.root_device_type)) - ; Some (Query.Pair ("Architecture", ArchitectureValues.to_query v.architecture)) - ; Util.option_map v.state_reason (fun f -> - Query.Pair ("StateReason", StateReason.to_query f)) - ; Util.option_map v.public_ip_address (fun f -> - Query.Pair ("IpAddress", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Some (Query.Pair ("Monitoring", Monitoring.to_query v.monitoring)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", PlatformValues.to_query f)) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Some (Query.Pair ("Placement", Placement.to_query v.placement)) - ; Some (Query.Pair ("LaunchTime", DateTime.to_query v.launch_time)) - ; Some (Query.Pair ("InstanceType", InstanceType.to_query v.instance_type)) - ; Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Some (Query.Pair ("AmiLaunchIndex", Integer.to_query v.ami_launch_index)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Util.option_map v.state_transition_reason (fun f -> - Query.Pair ("Reason", String.to_query f)) - ; Util.option_map v.public_dns_name (fun f -> - Query.Pair ("DnsName", String.to_query f)) - ; Util.option_map v.private_dns_name (fun f -> - Query.Pair ("PrivateDnsName", String.to_query f)) - ; Some (Query.Pair ("InstanceState", InstanceState.to_query v.state)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", String.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", IamInstanceProfile.to_json f) - ; Some - ( "network_interfaces" - , InstanceNetworkInterfaceList.to_json v.network_interfaces ) - ; Some ("hypervisor", HypervisorType.to_json v.hypervisor) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", Boolean.to_json f) - ; Some ("security_groups", GroupIdentifierList.to_json v.security_groups) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.spot_instance_request_id (fun f -> - "spot_instance_request_id", String.to_json f) - ; Util.option_map v.instance_lifecycle (fun f -> - "instance_lifecycle", InstanceLifecycleType.to_json f) - ; Some ("virtualization_type", VirtualizationType.to_json v.virtualization_type) - ; Some - ( "block_device_mappings" - , InstanceBlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.root_device_name (fun f -> - "root_device_name", String.to_json f) - ; Some ("root_device_type", DeviceType.to_json v.root_device_type) - ; Some ("architecture", ArchitectureValues.to_json v.architecture) - ; Util.option_map v.state_reason (fun f -> "state_reason", StateReason.to_json f) - ; Util.option_map v.public_ip_address (fun f -> - "public_ip_address", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Some ("monitoring", Monitoring.to_json v.monitoring) - ; Util.option_map v.platform (fun f -> "platform", PlatformValues.to_json f) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Some ("placement", Placement.to_json v.placement) - ; Some ("launch_time", DateTime.to_json v.launch_time) - ; Some ("instance_type", InstanceType.to_json v.instance_type) - ; Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Some ("ami_launch_index", Integer.to_json v.ami_launch_index) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Util.option_map v.state_transition_reason (fun f -> - "state_transition_reason", String.to_json f) - ; Util.option_map v.public_dns_name (fun f -> - "public_dns_name", String.to_json f) - ; Util.option_map v.private_dns_name (fun f -> - "private_dns_name", String.to_json f) - ; Some ("state", InstanceState.to_json v.state) - ; Some ("image_id", String.to_json v.image_id) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; state = InstanceState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json - ; public_dns_name = Util.option_map (Json.lookup j "public_dns_name") String.of_json - ; state_transition_reason = - Util.option_map (Json.lookup j "state_transition_reason") String.of_json - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; ami_launch_index = - Integer.of_json (Util.of_option_exn (Json.lookup j "ami_launch_index")) - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - ; instance_type = - InstanceType.of_json (Util.of_option_exn (Json.lookup j "instance_type")) - ; launch_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "launch_time")) - ; placement = Placement.of_json (Util.of_option_exn (Json.lookup j "placement")) - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") PlatformValues.of_json - ; monitoring = Monitoring.of_json (Util.of_option_exn (Json.lookup j "monitoring")) - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; public_ip_address = - Util.option_map (Json.lookup j "public_ip_address") String.of_json - ; state_reason = Util.option_map (Json.lookup j "state_reason") StateReason.of_json - ; architecture = - ArchitectureValues.of_json (Util.of_option_exn (Json.lookup j "architecture")) - ; root_device_type = - DeviceType.of_json (Util.of_option_exn (Json.lookup j "root_device_type")) - ; root_device_name = Util.option_map (Json.lookup j "root_device_name") String.of_json - ; block_device_mappings = - InstanceBlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; virtualization_type = - VirtualizationType.of_json - (Util.of_option_exn (Json.lookup j "virtualization_type")) - ; instance_lifecycle = - Util.option_map (Json.lookup j "instance_lifecycle") InstanceLifecycleType.of_json - ; spot_instance_request_id = - Util.option_map (Json.lookup j "spot_instance_request_id") String.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; security_groups = - GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") Boolean.of_json - ; hypervisor = - HypervisorType.of_json (Util.of_option_exn (Json.lookup j "hypervisor")) - ; network_interfaces = - InstanceNetworkInterfaceList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - ; iam_instance_profile = - Util.option_map (Json.lookup j "iam_instance_profile") IamInstanceProfile.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") String.of_json - } -end - -module VpcPeeringConnectionStateReasonCode = struct - type t = - | Initiating_request - | Pending_acceptance - | Active - | Deleted - | Rejected - | Failed - | Expired - | Provisioning - | Deleting - - let str_to_t = - [ "deleting", Deleting - ; "provisioning", Provisioning - ; "expired", Expired - ; "failed", Failed - ; "rejected", Rejected - ; "deleted", Deleted - ; "active", Active - ; "pending-acceptance", Pending_acceptance - ; "initiating-request", Initiating_request - ] - - let t_to_str = - [ Deleting, "deleting" - ; Provisioning, "provisioning" - ; Expired, "expired" - ; Failed, "failed" - ; Rejected, "rejected" - ; Deleted, "deleted" - ; Active, "active" - ; Pending_acceptance, "pending-acceptance" - ; Initiating_request, "initiating-request" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module NetworkAclAssociation = struct - type t = - { network_acl_association_id : String.t option - ; network_acl_id : String.t option - ; subnet_id : String.t option - } - - let make ?network_acl_association_id ?network_acl_id ?subnet_id () = - { network_acl_association_id; network_acl_id; subnet_id } - - let parse xml = - Some - { network_acl_association_id = - Util.option_bind (Xml.member "networkAclAssociationId" xml) String.parse - ; network_acl_id = Util.option_bind (Xml.member "networkAclId" xml) String.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.network_acl_id (fun f -> - Query.Pair ("NetworkAclId", String.to_query f)) - ; Util.option_map v.network_acl_association_id (fun f -> - Query.Pair ("NetworkAclAssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.network_acl_id (fun f -> "network_acl_id", String.to_json f) - ; Util.option_map v.network_acl_association_id (fun f -> - "network_acl_association_id", String.to_json f) - ]) - - let of_json j = - { network_acl_association_id = - Util.option_map (Json.lookup j "network_acl_association_id") String.of_json - ; network_acl_id = Util.option_map (Json.lookup j "network_acl_id") String.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - } -end - -module NetworkAclEntry = struct - type t = - { rule_number : Integer.t option - ; protocol : String.t option - ; rule_action : RuleAction.t option - ; egress : Boolean.t option - ; cidr_block : String.t option - ; icmp_type_code : IcmpTypeCode.t option - ; port_range : PortRange.t option - } - - let make - ?rule_number - ?protocol - ?rule_action - ?egress - ?cidr_block - ?icmp_type_code - ?port_range - () = - { rule_number; protocol; rule_action; egress; cidr_block; icmp_type_code; port_range } - - let parse xml = - Some - { rule_number = Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse - ; protocol = Util.option_bind (Xml.member "protocol" xml) String.parse - ; rule_action = Util.option_bind (Xml.member "ruleAction" xml) RuleAction.parse - ; egress = Util.option_bind (Xml.member "egress" xml) Boolean.parse - ; cidr_block = Util.option_bind (Xml.member "cidrBlock" xml) String.parse - ; icmp_type_code = - Util.option_bind (Xml.member "icmpTypeCode" xml) IcmpTypeCode.parse - ; port_range = Util.option_bind (Xml.member "portRange" xml) PortRange.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> - Query.Pair ("PortRange", PortRange.to_query f)) - ; Util.option_map v.icmp_type_code (fun f -> - Query.Pair ("IcmpTypeCode", IcmpTypeCode.to_query f)) - ; Util.option_map v.cidr_block (fun f -> - Query.Pair ("CidrBlock", String.to_query f)) - ; Util.option_map v.egress (fun f -> Query.Pair ("Egress", Boolean.to_query f)) - ; Util.option_map v.rule_action (fun f -> - Query.Pair ("RuleAction", RuleAction.to_query f)) - ; Util.option_map v.protocol (fun f -> - Query.Pair ("Protocol", String.to_query f)) - ; Util.option_map v.rule_number (fun f -> - Query.Pair ("RuleNumber", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> "port_range", PortRange.to_json f) - ; Util.option_map v.icmp_type_code (fun f -> - "icmp_type_code", IcmpTypeCode.to_json f) - ; Util.option_map v.cidr_block (fun f -> "cidr_block", String.to_json f) - ; Util.option_map v.egress (fun f -> "egress", Boolean.to_json f) - ; Util.option_map v.rule_action (fun f -> "rule_action", RuleAction.to_json f) - ; Util.option_map v.protocol (fun f -> "protocol", String.to_json f) - ; Util.option_map v.rule_number (fun f -> "rule_number", Integer.to_json f) - ]) - - let of_json j = - { rule_number = Util.option_map (Json.lookup j "rule_number") Integer.of_json - ; protocol = Util.option_map (Json.lookup j "protocol") String.of_json - ; rule_action = Util.option_map (Json.lookup j "rule_action") RuleAction.of_json - ; egress = Util.option_map (Json.lookup j "egress") Boolean.of_json - ; cidr_block = Util.option_map (Json.lookup j "cidr_block") String.of_json - ; icmp_type_code = - Util.option_map (Json.lookup j "icmp_type_code") IcmpTypeCode.of_json - ; port_range = Util.option_map (Json.lookup j "port_range") PortRange.of_json - } -end - -module SnapshotDetail = struct - type t = - { disk_image_size : Double.t option - ; description : String.t option - ; format : String.t option - ; url : String.t option - ; user_bucket : UserBucketDetails.t option - ; device_name : String.t option - ; snapshot_id : String.t option - ; progress : String.t option - ; status_message : String.t option - ; status : String.t option - } - - let make - ?disk_image_size - ?description - ?format - ?url - ?user_bucket - ?device_name - ?snapshot_id - ?progress - ?status_message - ?status - () = - { disk_image_size - ; description - ; format - ; url - ; user_bucket - ; device_name - ; snapshot_id - ; progress - ; status_message - ; status - } - - let parse xml = - Some - { disk_image_size = Util.option_bind (Xml.member "diskImageSize" xml) Double.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; format = Util.option_bind (Xml.member "format" xml) String.parse - ; url = Util.option_bind (Xml.member "url" xml) String.parse - ; user_bucket = - Util.option_bind (Xml.member "userBucket" xml) UserBucketDetails.parse - ; device_name = Util.option_bind (Xml.member "deviceName" xml) String.parse - ; snapshot_id = Util.option_bind (Xml.member "snapshotId" xml) String.parse - ; progress = Util.option_bind (Xml.member "progress" xml) String.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.progress (fun f -> - Query.Pair ("Progress", String.to_query f)) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ; Util.option_map v.device_name (fun f -> - Query.Pair ("DeviceName", String.to_query f)) - ; Util.option_map v.user_bucket (fun f -> - Query.Pair ("UserBucket", UserBucketDetails.to_query f)) - ; Util.option_map v.url (fun f -> Query.Pair ("Url", String.to_query f)) - ; Util.option_map v.format (fun f -> Query.Pair ("Format", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.disk_image_size (fun f -> - Query.Pair ("DiskImageSize", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.progress (fun f -> "progress", String.to_json f) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ; Util.option_map v.device_name (fun f -> "device_name", String.to_json f) - ; Util.option_map v.user_bucket (fun f -> - "user_bucket", UserBucketDetails.to_json f) - ; Util.option_map v.url (fun f -> "url", String.to_json f) - ; Util.option_map v.format (fun f -> "format", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.disk_image_size (fun f -> - "disk_image_size", Double.to_json f) - ]) - - let of_json j = - { disk_image_size = Util.option_map (Json.lookup j "disk_image_size") Double.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; format = Util.option_map (Json.lookup j "format") String.of_json - ; url = Util.option_map (Json.lookup j "url") String.of_json - ; user_bucket = - Util.option_map (Json.lookup j "user_bucket") UserBucketDetails.of_json - ; device_name = Util.option_map (Json.lookup j "device_name") String.of_json - ; snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; progress = Util.option_map (Json.lookup j "progress") String.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module CancelBatchErrorCode = struct - type t = - | FleetRequestIdDoesNotExist - | FleetRequestIdMalformed - | FleetRequestNotInCancellableState - | UnexpectedError - - let str_to_t = - [ "unexpectedError", UnexpectedError - ; "fleetRequestNotInCancellableState", FleetRequestNotInCancellableState - ; "fleetRequestIdMalformed", FleetRequestIdMalformed - ; "fleetRequestIdDoesNotExist", FleetRequestIdDoesNotExist - ] - - let t_to_str = - [ UnexpectedError, "unexpectedError" - ; FleetRequestNotInCancellableState, "fleetRequestNotInCancellableState" - ; FleetRequestIdMalformed, "fleetRequestIdMalformed" - ; FleetRequestIdDoesNotExist, "fleetRequestIdDoesNotExist" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AccountAttributeValue = struct - type t = { attribute_value : String.t option } - - let make ?attribute_value () = { attribute_value } - - let parse xml = - Some - { attribute_value = Util.option_bind (Xml.member "attributeValue" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - Query.Pair ("AttributeValue", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - "attribute_value", String.to_json f) - ]) - - let of_json j = - { attribute_value = Util.option_map (Json.lookup j "attribute_value") String.of_json } -end - -module NetworkInterfaceAttachment = struct - type t = - { attachment_id : String.t option - ; instance_id : String.t option - ; instance_owner_id : String.t option - ; device_index : Integer.t option - ; status : AttachmentStatus.t option - ; attach_time : DateTime.t option - ; delete_on_termination : Boolean.t option - } - - let make - ?attachment_id - ?instance_id - ?instance_owner_id - ?device_index - ?status - ?attach_time - ?delete_on_termination - () = - { attachment_id - ; instance_id - ; instance_owner_id - ; device_index - ; status - ; attach_time - ; delete_on_termination - } - - let parse xml = - Some - { attachment_id = Util.option_bind (Xml.member "attachmentId" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; instance_owner_id = - Util.option_bind (Xml.member "instanceOwnerId" xml) String.parse - ; device_index = Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse - ; status = Util.option_bind (Xml.member "status" xml) AttachmentStatus.parse - ; attach_time = Util.option_bind (Xml.member "attachTime" xml) DateTime.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.attach_time (fun f -> - Query.Pair ("AttachTime", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", AttachmentStatus.to_query f)) - ; Util.option_map v.device_index (fun f -> - Query.Pair ("DeviceIndex", Integer.to_query f)) - ; Util.option_map v.instance_owner_id (fun f -> - Query.Pair ("InstanceOwnerId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.attachment_id (fun f -> - Query.Pair ("AttachmentId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.attach_time (fun f -> "attach_time", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", AttachmentStatus.to_json f) - ; Util.option_map v.device_index (fun f -> "device_index", Integer.to_json f) - ; Util.option_map v.instance_owner_id (fun f -> - "instance_owner_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.attachment_id (fun f -> "attachment_id", String.to_json f) - ]) - - let of_json j = - { attachment_id = Util.option_map (Json.lookup j "attachment_id") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; instance_owner_id = - Util.option_map (Json.lookup j "instance_owner_id") String.of_json - ; device_index = Util.option_map (Json.lookup j "device_index") Integer.of_json - ; status = Util.option_map (Json.lookup j "status") AttachmentStatus.of_json - ; attach_time = Util.option_map (Json.lookup j "attach_time") DateTime.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module NetworkInterfacePrivateIpAddressList = struct - type t = NetworkInterfacePrivateIpAddress.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map NetworkInterfacePrivateIpAddress.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NetworkInterfacePrivateIpAddress.to_query v - - let to_json v = `List (List.map NetworkInterfacePrivateIpAddress.to_json v) - - let of_json j = Json.to_list NetworkInterfacePrivateIpAddress.of_json j -end - -module ResourceType = struct - type t = - | Customer_gateway - | Dhcp_options - | Image - | Instance - | Internet_gateway - | Network_acl - | Network_interface - | Reserved_instances - | Route_table - | Snapshot - | Spot_instances_request - | Subnet - | Security_group - | Volume - | Vpc - | Vpn_connection - | Vpn_gateway - - let str_to_t = - [ "vpn-gateway", Vpn_gateway - ; "vpn-connection", Vpn_connection - ; "vpc", Vpc - ; "volume", Volume - ; "security-group", Security_group - ; "subnet", Subnet - ; "spot-instances-request", Spot_instances_request - ; "snapshot", Snapshot - ; "route-table", Route_table - ; "reserved-instances", Reserved_instances - ; "network-interface", Network_interface - ; "network-acl", Network_acl - ; "internet-gateway", Internet_gateway - ; "instance", Instance - ; "image", Image - ; "dhcp-options", Dhcp_options - ; "customer-gateway", Customer_gateway - ] - - let t_to_str = - [ Vpn_gateway, "vpn-gateway" - ; Vpn_connection, "vpn-connection" - ; Vpc, "vpc" - ; Volume, "volume" - ; Security_group, "security-group" - ; Subnet, "subnet" - ; Spot_instances_request, "spot-instances-request" - ; Snapshot, "snapshot" - ; Route_table, "route-table" - ; Reserved_instances, "reserved-instances" - ; Network_interface, "network-interface" - ; Network_acl, "network-acl" - ; Internet_gateway, "internet-gateway" - ; Instance, "instance" - ; Image, "image" - ; Dhcp_options, "dhcp-options" - ; Customer_gateway, "customer-gateway" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DhcpConfigurationList = struct - type t = DhcpConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DhcpConfiguration.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list DhcpConfiguration.to_query v - - let to_json v = `List (List.map DhcpConfiguration.to_json v) - - let of_json j = Json.to_list DhcpConfiguration.of_json j -end - -module GatewayType = struct - type t = Ipsec_1 - - let str_to_t = [ "ipsec.1", Ipsec_1 ] - - let t_to_str = [ Ipsec_1, "ipsec.1" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VpcAttachmentList = struct - type t = VpcAttachment.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpcAttachment.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpcAttachment.to_query v - - let to_json v = `List (List.map VpcAttachment.to_json v) - - let of_json j = Json.to_list VpcAttachment.of_json j -end - -module ReservedInstancesModificationResultList = struct - type t = ReservedInstancesModificationResult.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ReservedInstancesModificationResult.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesModificationResult.to_query v - - let to_json v = `List (List.map ReservedInstancesModificationResult.to_json v) - - let of_json j = Json.to_list ReservedInstancesModificationResult.of_json j -end - -module ReservedIntancesIds = struct - type t = ReservedInstancesId.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReservedInstancesId.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesId.to_query v - - let to_json v = `List (List.map ReservedInstancesId.to_json v) - - let of_json j = Json.to_list ReservedInstancesId.of_json j -end - -module OfferingTypeValues = struct - type t = - | Heavy_Utilization - | Medium_Utilization - | Light_Utilization - | No_Upfront - | Partial_Upfront - | All_Upfront - - let str_to_t = - [ "All Upfront", All_Upfront - ; "Partial Upfront", Partial_Upfront - ; "No Upfront", No_Upfront - ; "Light Utilization", Light_Utilization - ; "Medium Utilization", Medium_Utilization - ; "Heavy Utilization", Heavy_Utilization - ] - - let t_to_str = - [ All_Upfront, "All Upfront" - ; Partial_Upfront, "Partial Upfront" - ; No_Upfront, "No Upfront" - ; Light_Utilization, "Light Utilization" - ; Medium_Utilization, "Medium Utilization" - ; Heavy_Utilization, "Heavy Utilization" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RIProductDescription = struct - type t = - | Linux_UNIX - | Linux_UNIX__Amazon_VPC_ - | Windows - | Windows__Amazon_VPC_ - - let str_to_t = - [ "Windows (Amazon VPC)", Windows__Amazon_VPC_ - ; "Windows", Windows - ; "Linux/UNIX (Amazon VPC)", Linux_UNIX__Amazon_VPC_ - ; "Linux/UNIX", Linux_UNIX - ] - - let t_to_str = - [ Windows__Amazon_VPC_, "Windows (Amazon VPC)" - ; Windows, "Windows" - ; Linux_UNIX__Amazon_VPC_, "Linux/UNIX (Amazon VPC)" - ; Linux_UNIX, "Linux/UNIX" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RecurringChargesList = struct - type t = RecurringCharge.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map RecurringCharge.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list RecurringCharge.to_query v - - let to_json v = `List (List.map RecurringCharge.to_json v) - - let of_json j = Json.to_list RecurringCharge.of_json j -end - -module ReservedInstanceState = struct - type t = - | Payment_pending - | Active - | Payment_failed - | Retired - - let str_to_t = - [ "retired", Retired - ; "payment-failed", Payment_failed - ; "active", Active - ; "payment-pending", Payment_pending - ] - - let t_to_str = - [ Retired, "retired" - ; Payment_failed, "payment-failed" - ; Active, "active" - ; Payment_pending, "payment-pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ValueStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module PlacementGroupState = struct - type t = - | Pending - | Available - | Deleting - | Deleted - - let str_to_t = - [ "deleted", Deleted - ; "deleting", Deleting - ; "available", Available - ; "pending", Pending - ] - - let t_to_str = - [ Deleted, "deleted" - ; Deleting, "deleting" - ; Available, "available" - ; Pending, "pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module PlacementStrategy = struct - type t = Cluster - - let str_to_t = [ "cluster", Cluster ] - - let t_to_str = [ Cluster, "cluster" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module CancelSpotInstanceRequestState = struct - type t = - | Active - | Open - | Closed - | Cancelled - | Completed - - let str_to_t = - [ "completed", Completed - ; "cancelled", Cancelled - ; "closed", Closed - ; "open", Open - ; "active", Active - ] - - let t_to_str = - [ Completed, "completed" - ; Cancelled, "cancelled" - ; Closed, "closed" - ; Open, "open" - ; Active, "active" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module LaunchPermission = struct - type t = - { user_id : String.t option - ; group : PermissionGroup.t option - } - - let make ?user_id ?group () = { user_id; group } - - let parse xml = - Some - { user_id = Util.option_bind (Xml.member "userId" xml) String.parse - ; group = Util.option_bind (Xml.member "group" xml) PermissionGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group (fun f -> - Query.Pair ("Group", PermissionGroup.to_query f)) - ; Util.option_map v.user_id (fun f -> Query.Pair ("UserId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group (fun f -> "group", PermissionGroup.to_json f) - ; Util.option_map v.user_id (fun f -> "user_id", String.to_json f) - ]) - - let of_json j = - { user_id = Util.option_map (Json.lookup j "user_id") String.of_json - ; group = Util.option_map (Json.lookup j "group") PermissionGroup.of_json - } -end - -module ConversionTaskState = struct - type t = - | Active - | Cancelling - | Cancelled - | Completed - - let str_to_t = - [ "completed", Completed - ; "cancelled", Cancelled - ; "cancelling", Cancelling - ; "active", Active - ] - - let t_to_str = - [ Completed, "completed" - ; Cancelled, "cancelled" - ; Cancelling, "cancelling" - ; Active, "active" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ImportInstanceTaskDetails = struct - type t = - { volumes : ImportInstanceVolumeDetailSet.t - ; instance_id : String.t option - ; platform : PlatformValues.t option - ; description : String.t option - } - - let make ~volumes ?instance_id ?platform ?description () = - { volumes; instance_id; platform; description } - - let parse xml = - Some - { volumes = - Xml.required - "volumes" - (Util.option_bind - (Xml.member "volumes" xml) - ImportInstanceVolumeDetailSet.parse) - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) PlatformValues.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", PlatformValues.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Some (Query.Pair ("Volumes", ImportInstanceVolumeDetailSet.to_query v.volumes)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.platform (fun f -> "platform", PlatformValues.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Some ("volumes", ImportInstanceVolumeDetailSet.to_json v.volumes) - ]) - - let of_json j = - { volumes = - ImportInstanceVolumeDetailSet.of_json - (Util.of_option_exn (Json.lookup j "volumes")) - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") PlatformValues.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module ImportVolumeTaskDetails = struct - type t = - { bytes_converted : Long.t - ; availability_zone : String.t - ; description : String.t option - ; image : DiskImageDescription.t - ; volume : DiskImageVolumeDescription.t - } - - let make ~bytes_converted ~availability_zone ?description ~image ~volume () = - { bytes_converted; availability_zone; description; image; volume } - - let parse xml = - Some - { bytes_converted = - Xml.required - "bytesConverted" - (Util.option_bind (Xml.member "bytesConverted" xml) Long.parse) - ; availability_zone = - Xml.required - "availabilityZone" - (Util.option_bind (Xml.member "availabilityZone" xml) String.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; image = - Xml.required - "image" - (Util.option_bind (Xml.member "image" xml) DiskImageDescription.parse) - ; volume = - Xml.required - "volume" - (Util.option_bind (Xml.member "volume" xml) DiskImageVolumeDescription.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Volume", DiskImageVolumeDescription.to_query v.volume)) - ; Some (Query.Pair ("Image", DiskImageDescription.to_query v.image)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some (Query.Pair ("BytesConverted", Long.to_query v.bytes_converted)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("volume", DiskImageVolumeDescription.to_json v.volume) - ; Some ("image", DiskImageDescription.to_json v.image) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some ("bytes_converted", Long.to_json v.bytes_converted) - ]) - - let of_json j = - { bytes_converted = - Long.of_json (Util.of_option_exn (Json.lookup j "bytes_converted")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; image = DiskImageDescription.of_json (Util.of_option_exn (Json.lookup j "image")) - ; volume = - DiskImageVolumeDescription.of_json (Util.of_option_exn (Json.lookup j "volume")) - } -end - -module EventInformation = struct - type t = - { instance_id : String.t option - ; event_sub_type : String.t option - ; event_description : String.t option - } - - let make ?instance_id ?event_sub_type ?event_description () = - { instance_id; event_sub_type; event_description } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; event_sub_type = Util.option_bind (Xml.member "eventSubType" xml) String.parse - ; event_description = - Util.option_bind (Xml.member "eventDescription" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_description (fun f -> - Query.Pair ("EventDescription", String.to_query f)) - ; Util.option_map v.event_sub_type (fun f -> - Query.Pair ("EventSubType", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_description (fun f -> - "event_description", String.to_json f) - ; Util.option_map v.event_sub_type (fun f -> "event_sub_type", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; event_sub_type = Util.option_map (Json.lookup j "event_sub_type") String.of_json - ; event_description = - Util.option_map (Json.lookup j "event_description") String.of_json - } -end - -module EventType = struct - type t = - | InstanceChange - | FleetRequestChange - | Error - - let str_to_t = - [ "error", Error - ; "fleetRequestChange", FleetRequestChange - ; "instanceChange", InstanceChange - ] - - let t_to_str = - [ Error, "error" - ; FleetRequestChange, "fleetRequestChange" - ; InstanceChange, "instanceChange" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module UnsuccessfulItemError = struct - type t = - { code : String.t - ; message : String.t - } - - let make ~code ~message () = { code; message } - - let parse xml = - Some - { code = Xml.required "code" (Util.option_bind (Xml.member "code" xml) String.parse) - ; message = - Xml.required - "message" - (Util.option_bind (Xml.member "message" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Message", String.to_query v.message)) - ; Some (Query.Pair ("Code", String.to_query v.code)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("message", String.to_json v.message) - ; Some ("code", String.to_json v.code) - ]) - - let of_json j = - { code = String.of_json (Util.of_option_exn (Json.lookup j "code")) - ; message = String.of_json (Util.of_option_exn (Json.lookup j "message")) - } -end - -module PropagatingVgwList = struct - type t = PropagatingVgw.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PropagatingVgw.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PropagatingVgw.to_query v - - let to_json v = `List (List.map PropagatingVgw.to_json v) - - let of_json j = Json.to_list PropagatingVgw.of_json j -end - -module RouteList = struct - type t = Route.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Route.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Route.to_query v - - let to_json v = `List (List.map Route.to_json v) - - let of_json j = Json.to_list Route.of_json j -end - -module RouteTableAssociationList = struct - type t = RouteTableAssociation.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map RouteTableAssociation.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list RouteTableAssociation.to_query v - - let to_json v = `List (List.map RouteTableAssociation.to_json v) - - let of_json j = Json.to_list RouteTableAssociation.of_json j -end - -module InstanceCountList = struct - type t = InstanceCount.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map InstanceCount.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceCount.to_query v - - let to_json v = `List (List.map InstanceCount.to_json v) - - let of_json j = Json.to_list InstanceCount.of_json j -end - -module ListingStatus = struct - type t = - | Active - | Pending - | Cancelled - | Closed - - let str_to_t = - [ "closed", Closed; "cancelled", Cancelled; "pending", Pending; "active", Active ] - - let t_to_str = - [ Closed, "closed"; Cancelled, "cancelled"; Pending, "pending"; Active, "active" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module PriceScheduleList = struct - type t = PriceSchedule.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PriceSchedule.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PriceSchedule.to_query v - - let to_json v = `List (List.map PriceSchedule.to_json v) - - let of_json j = Json.to_list PriceSchedule.of_json j -end - -module MoveStatus = struct - type t = - | MovingToVpc - | RestoringToClassic - - let str_to_t = [ "restoringToClassic", RestoringToClassic; "movingToVpc", MovingToVpc ] - - let t_to_str = [ RestoringToClassic, "restoringToClassic"; MovingToVpc, "movingToVpc" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module InstanceStatusEventList = struct - type t = InstanceStatusEvent.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceStatusEvent.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceStatusEvent.to_query v - - let to_json v = `List (List.map InstanceStatusEvent.to_json v) - - let of_json j = Json.to_list InstanceStatusEvent.of_json j -end - -module InstanceStatusSummary = struct - type t = - { status : SummaryStatus.t - ; details : InstanceStatusDetailsList.t - } - - let make ~status ?(details = []) () = { status; details } - - let parse xml = - Some - { status = - Xml.required - "status" - (Util.option_bind (Xml.member "status" xml) SummaryStatus.parse) - ; details = - Util.of_option - [] - (Util.option_bind (Xml.member "details" xml) InstanceStatusDetailsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Details", InstanceStatusDetailsList.to_query v.details)) - ; Some (Query.Pair ("Status", SummaryStatus.to_query v.status)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("details", InstanceStatusDetailsList.to_json v.details) - ; Some ("status", SummaryStatus.to_json v.status) - ]) - - let of_json j = - { status = SummaryStatus.of_json (Util.of_option_exn (Json.lookup j "status")) - ; details = - InstanceStatusDetailsList.of_json (Util.of_option_exn (Json.lookup j "details")) - } -end - -module ImageState = struct - type t = - | Pending - | Available - | Invalid - | Deregistered - | Transient - | Failed - | Error - - let str_to_t = - [ "error", Error - ; "failed", Failed - ; "transient", Transient - ; "deregistered", Deregistered - ; "invalid", Invalid - ; "available", Available - ; "pending", Pending - ] - - let t_to_str = - [ Error, "error" - ; Failed, "failed" - ; Transient, "transient" - ; Deregistered, "deregistered" - ; Invalid, "invalid" - ; Available, "available" - ; Pending, "pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ImageTypeValues = struct - type t = - | Machine - | Kernel - | Ramdisk - - let str_to_t = [ "ramdisk", Ramdisk; "kernel", Kernel; "machine", Machine ] - - let t_to_str = [ Ramdisk, "ramdisk"; Kernel, "kernel"; Machine, "machine" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SnapshotTaskDetail = struct - type t = - { disk_image_size : Double.t option - ; description : String.t option - ; format : String.t option - ; url : String.t option - ; user_bucket : UserBucketDetails.t option - ; snapshot_id : String.t option - ; progress : String.t option - ; status_message : String.t option - ; status : String.t option - } - - let make - ?disk_image_size - ?description - ?format - ?url - ?user_bucket - ?snapshot_id - ?progress - ?status_message - ?status - () = - { disk_image_size - ; description - ; format - ; url - ; user_bucket - ; snapshot_id - ; progress - ; status_message - ; status - } - - let parse xml = - Some - { disk_image_size = Util.option_bind (Xml.member "diskImageSize" xml) Double.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; format = Util.option_bind (Xml.member "format" xml) String.parse - ; url = Util.option_bind (Xml.member "url" xml) String.parse - ; user_bucket = - Util.option_bind (Xml.member "userBucket" xml) UserBucketDetails.parse - ; snapshot_id = Util.option_bind (Xml.member "snapshotId" xml) String.parse - ; progress = Util.option_bind (Xml.member "progress" xml) String.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.progress (fun f -> - Query.Pair ("Progress", String.to_query f)) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ; Util.option_map v.user_bucket (fun f -> - Query.Pair ("UserBucket", UserBucketDetails.to_query f)) - ; Util.option_map v.url (fun f -> Query.Pair ("Url", String.to_query f)) - ; Util.option_map v.format (fun f -> Query.Pair ("Format", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.disk_image_size (fun f -> - Query.Pair ("DiskImageSize", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.progress (fun f -> "progress", String.to_json f) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ; Util.option_map v.user_bucket (fun f -> - "user_bucket", UserBucketDetails.to_json f) - ; Util.option_map v.url (fun f -> "url", String.to_json f) - ; Util.option_map v.format (fun f -> "format", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.disk_image_size (fun f -> - "disk_image_size", Double.to_json f) - ]) - - let of_json j = - { disk_image_size = Util.option_map (Json.lookup j "disk_image_size") Double.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; format = Util.option_map (Json.lookup j "format") String.of_json - ; url = Util.option_map (Json.lookup j "url") String.of_json - ; user_bucket = - Util.option_map (Json.lookup j "user_bucket") UserBucketDetails.of_json - ; snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; progress = Util.option_map (Json.lookup j "progress") String.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module LaunchSpecification = struct - type t = - { image_id : String.t option - ; key_name : String.t option - ; security_groups : GroupIdentifierList.t - ; user_data : String.t option - ; addressing_type : String.t option - ; instance_type : InstanceType.t option - ; placement : SpotPlacement.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappingList.t - ; subnet_id : String.t option - ; network_interfaces : InstanceNetworkInterfaceSpecificationList.t - ; iam_instance_profile : IamInstanceProfileSpecification.t option - ; ebs_optimized : Boolean.t option - ; monitoring : RunInstancesMonitoringEnabled.t option - } - - let make - ?image_id - ?key_name - ?(security_groups = []) - ?user_data - ?addressing_type - ?instance_type - ?placement - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?subnet_id - ?(network_interfaces = []) - ?iam_instance_profile - ?ebs_optimized - ?monitoring - () = - { image_id - ; key_name - ; security_groups - ; user_data - ; addressing_type - ; instance_type - ; placement - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; subnet_id - ; network_interfaces - ; iam_instance_profile - ; ebs_optimized - ; monitoring - } - - let parse xml = - Some - { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; user_data = Util.option_bind (Xml.member "userData" xml) String.parse - ; addressing_type = Util.option_bind (Xml.member "addressingType" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; placement = Util.option_bind (Xml.member "placement" xml) SpotPlacement.parse - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingList.parse) - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "networkInterfaceSet" xml) - InstanceNetworkInterfaceSpecificationList.parse) - ; iam_instance_profile = - Util.option_bind - (Xml.member "iamInstanceProfile" xml) - IamInstanceProfileSpecification.parse - ; ebs_optimized = Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse - ; monitoring = - Util.option_bind - (Xml.member "monitoring" xml) - RunInstancesMonitoringEnabled.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", RunInstancesMonitoringEnabled.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair - ("IamInstanceProfile", IamInstanceProfileSpecification.to_query f)) - ; Some + ("Volume", (DiskImageVolumeDescription.to_query v.volume))); + Some + (Query.Pair ("Image", (DiskImageDescription.to_query v.image))); + Some (Query.Pair - ( "NetworkInterfaceSet" - , InstanceNetworkInterfaceSpecificationList.to_query v.network_interfaces - )) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Some + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.placement (fun f -> - Query.Pair ("Placement", SpotPlacement.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.addressing_type (fun f -> - Query.Pair ("AddressingType", String.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.monitoring (fun f -> - "monitoring", RunInstancesMonitoringEnabled.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", IamInstanceProfileSpecification.to_json f) - ; Some - ( "network_interfaces" - , InstanceNetworkInterfaceSpecificationList.to_json v.network_interfaces ) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.placement (fun f -> "placement", SpotPlacement.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.addressing_type (fun f -> - "addressing_type", String.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some ("security_groups", GroupIdentifierList.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ]) - - let of_json j = - { image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; addressing_type = Util.option_map (Json.lookup j "addressing_type") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; placement = Util.option_map (Json.lookup j "placement") SpotPlacement.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; network_interfaces = - InstanceNetworkInterfaceSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - ; iam_instance_profile = - Util.option_map - (Json.lookup j "iam_instance_profile") - IamInstanceProfileSpecification.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; monitoring = - Util.option_map (Json.lookup j "monitoring") RunInstancesMonitoringEnabled.of_json - } -end - -module SpotInstanceState = struct - type t = - | Open - | Active - | Closed - | Cancelled - | Failed - - let str_to_t = - [ "failed", Failed - ; "cancelled", Cancelled - ; "closed", Closed - ; "active", Active - ; "open", Open - ] - - let t_to_str = - [ Failed, "failed" - ; Cancelled, "cancelled" - ; Closed, "closed" - ; Active, "active" - ; Open, "open" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SpotInstanceStateFault = struct - type t = - { code : String.t option - ; message : String.t option - } - - let make ?code ?message () = { code; message } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) String.parse - ; message = Util.option_bind (Xml.member "message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") String.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module SpotInstanceStatus = struct - type t = - { code : String.t option - ; update_time : DateTime.t option - ; message : String.t option - } - - let make ?code ?update_time ?message () = { code; update_time; message } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) String.parse - ; update_time = Util.option_bind (Xml.member "updateTime" xml) DateTime.parse - ; message = Util.option_bind (Xml.member "message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.update_time (fun f -> - Query.Pair ("UpdateTime", DateTime.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.update_time (fun f -> "update_time", DateTime.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") String.of_json - ; update_time = Util.option_map (Json.lookup j "update_time") DateTime.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module SpotInstanceType = struct - type t = - | One_time - | Persistent - - let str_to_t = [ "persistent", Persistent; "one-time", One_time ] - - let t_to_str = [ Persistent, "persistent"; One_time, "one-time" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ExportTaskState = struct - type t = - | Active - | Cancelling - | Cancelled - | Completed - - let str_to_t = - [ "completed", Completed - ; "cancelled", Cancelled - ; "cancelling", Cancelling - ; "active", Active - ] - - let t_to_str = - [ Completed, "completed" - ; Cancelled, "cancelled" - ; Cancelling, "cancelling" - ; Active, "active" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ExportToS3Task = struct - type t = - { disk_image_format : DiskImageFormat.t option - ; container_format : ContainerFormat.t option - ; s3_bucket : String.t option - ; s3_key : String.t option - } - - let make ?disk_image_format ?container_format ?s3_bucket ?s3_key () = - { disk_image_format; container_format; s3_bucket; s3_key } - - let parse xml = - Some - { disk_image_format = - Util.option_bind (Xml.member "diskImageFormat" xml) DiskImageFormat.parse - ; container_format = - Util.option_bind (Xml.member "containerFormat" xml) ContainerFormat.parse - ; s3_bucket = Util.option_bind (Xml.member "s3Bucket" xml) String.parse - ; s3_key = Util.option_bind (Xml.member "s3Key" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> Query.Pair ("S3Key", String.to_query f)) - ; Util.option_map v.s3_bucket (fun f -> - Query.Pair ("S3Bucket", String.to_query f)) - ; Util.option_map v.container_format (fun f -> - Query.Pair ("ContainerFormat", ContainerFormat.to_query f)) - ; Util.option_map v.disk_image_format (fun f -> - Query.Pair ("DiskImageFormat", DiskImageFormat.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> "s3_key", String.to_json f) - ; Util.option_map v.s3_bucket (fun f -> "s3_bucket", String.to_json f) - ; Util.option_map v.container_format (fun f -> - "container_format", ContainerFormat.to_json f) - ; Util.option_map v.disk_image_format (fun f -> - "disk_image_format", DiskImageFormat.to_json f) - ]) - - let of_json j = - { disk_image_format = - Util.option_map (Json.lookup j "disk_image_format") DiskImageFormat.of_json - ; container_format = - Util.option_map (Json.lookup j "container_format") ContainerFormat.of_json - ; s3_bucket = Util.option_map (Json.lookup j "s3_bucket") String.of_json - ; s3_key = Util.option_map (Json.lookup j "s3_key") String.of_json - } -end - -module InstanceExportDetails = struct - type t = - { instance_id : String.t option - ; target_environment : ExportEnvironment.t option - } - - let make ?instance_id ?target_environment () = { instance_id; target_environment } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; target_environment = - Util.option_bind (Xml.member "targetEnvironment" xml) ExportEnvironment.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.target_environment (fun f -> - Query.Pair ("TargetEnvironment", ExportEnvironment.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.target_environment (fun f -> - "target_environment", ExportEnvironment.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; target_environment = - Util.option_map (Json.lookup j "target_environment") ExportEnvironment.of_json - } -end - -module IpPermissionList = struct - type t = IpPermission.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map IpPermission.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list IpPermission.to_query v - - let to_json v = `List (List.map IpPermission.to_json v) - - let of_json j = Json.to_list IpPermission.of_json j -end - -module EbsInstanceBlockDeviceSpecification = struct - type t = - { volume_id : String.t option - ; delete_on_termination : Boolean.t option - } - - let make ?volume_id ?delete_on_termination () = { volume_id; delete_on_termination } - - let parse xml = - Some - { volume_id = Util.option_bind (Xml.member "volumeId" xml) String.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.volume_id (fun f -> - Query.Pair ("VolumeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) - ]) - - let of_json j = - { volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module InternetGatewayAttachmentList = struct - type t = InternetGatewayAttachment.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InternetGatewayAttachment.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InternetGatewayAttachment.to_query v - - let to_json v = `List (List.map InternetGatewayAttachment.to_json v) - - let of_json j = Json.to_list InternetGatewayAttachment.of_json j -end - -module BatchState = struct - type t = - | Submitted - | Active - | Cancelled - | Failed - | Cancelled_running - | Cancelled_terminating - - let str_to_t = - [ "cancelled_terminating", Cancelled_terminating - ; "cancelled_running", Cancelled_running - ; "failed", Failed - ; "cancelled", Cancelled - ; "active", Active - ; "submitted", Submitted - ] - - let t_to_str = - [ Cancelled_terminating, "cancelled_terminating" - ; Cancelled_running, "cancelled_running" - ; Failed, "failed" - ; Cancelled, "cancelled" - ; Active, "active" - ; Submitted, "submitted" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SpotFleetRequestConfigData = struct - type t = - { client_token : String.t option - ; spot_price : String.t - ; target_capacity : Integer.t - ; valid_from : DateTime.t option - ; valid_until : DateTime.t option - ; terminate_instances_with_expiration : Boolean.t option - ; iam_fleet_role : String.t - ; launch_specifications : LaunchSpecsList.t - } - - let make - ?client_token - ~spot_price - ~target_capacity - ?valid_from - ?valid_until - ?terminate_instances_with_expiration - ~iam_fleet_role - ~launch_specifications - () = - { client_token - ; spot_price - ; target_capacity - ; valid_from - ; valid_until - ; terminate_instances_with_expiration - ; iam_fleet_role - ; launch_specifications - } - - let parse xml = - Some - { client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; spot_price = - Xml.required - "spotPrice" + ("BytesConverted", (Long.to_query v.bytes_converted)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Some ("status", (String.to_json v.status)); + Some ("volume", (DiskImageVolumeDescription.to_json v.volume)); + Some ("image", (DiskImageDescription.to_json v.image)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some ("bytes_converted", (Long.to_json v.bytes_converted))]) + let of_json j = + { + bytes_converted = + (Long.of_json + (Util.of_option_exn (Json.lookup j "bytes_converted"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + image = + (DiskImageDescription.of_json + (Util.of_option_exn (Json.lookup j "image"))); + volume = + (DiskImageVolumeDescription.of_json + (Util.of_option_exn (Json.lookup j "volume"))); + status = + (String.of_json (Util.of_option_exn (Json.lookup j "status"))); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module RouteOrigin = + struct + type t = + | CreateRouteTable + | CreateRoute + | EnableVgwRoutePropagation + let str_to_t = + [("EnableVgwRoutePropagation", EnableVgwRoutePropagation); + ("CreateRoute", CreateRoute); + ("CreateRouteTable", CreateRouteTable)] + let t_to_str = + [(EnableVgwRoutePropagation, "EnableVgwRoutePropagation"); + (CreateRoute, "CreateRoute"); + (CreateRouteTable, "CreateRouteTable")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RouteState = + struct + type t = + | Active + | Blackhole + let str_to_t = [("blackhole", Blackhole); ("active", Active)] + let t_to_str = [(Blackhole, "blackhole"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ListingState = + struct + type t = + | Available + | Sold + | Cancelled + | Pending + let str_to_t = + [("pending", Pending); + ("cancelled", Cancelled); + ("sold", Sold); + ("available", Available)] + let t_to_str = + [(Pending, "pending"); + (Cancelled, "cancelled"); + (Sold, "sold"); + (Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module CurrencyCodeValues = + struct + type t = + | USD + let str_to_t = [("USD", USD)] + let t_to_str = [(USD, "USD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module EventCode = + struct + type t = + | Instance_reboot + | System_reboot + | System_maintenance + | Instance_retirement + | Instance_stop + let str_to_t = + [("instance-stop", Instance_stop); + ("instance-retirement", Instance_retirement); + ("system-maintenance", System_maintenance); + ("system-reboot", System_reboot); + ("instance-reboot", Instance_reboot)] + let t_to_str = + [(Instance_stop, "instance-stop"); + (Instance_retirement, "instance-retirement"); + (System_maintenance, "system-maintenance"); + (System_reboot, "system-reboot"); + (Instance_reboot, "instance-reboot")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceStatusDetails = + struct + type t = + { + name: StatusName.t option ; + status: StatusType.t option ; + impaired_since: DateTime.t option } + let make ?name ?status ?impaired_since () = + { name; status; impaired_since } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "name" xml) StatusName.parse); + status = + (Util.option_bind (Xml.member "status" xml) StatusType.parse); + impaired_since = + (Util.option_bind (Xml.member "impairedSince" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.impaired_since + (fun f -> Query.Pair ("ImpairedSince", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (StatusType.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (StatusName.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.impaired_since + (fun f -> ("impaired_since", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (StatusType.to_json f))); + Util.option_map v.name (fun f -> ("name", (StatusName.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") StatusName.of_json); + status = + (Util.option_map (Json.lookup j "status") StatusType.of_json); + impaired_since = + (Util.option_map (Json.lookup j "impaired_since") DateTime.of_json) + } + end +module IpRangeList = + struct + type t = IpRange.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map IpRange.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list IpRange.to_query v + let to_json v = `List (List.map IpRange.to_json v) + let of_json j = Json.to_list IpRange.of_json j + end +module PrefixListIdList = + struct + type t = PrefixListId.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map PrefixListId.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PrefixListId.to_query v + let to_json v = `List (List.map PrefixListId.to_json v) + let of_json j = Json.to_list PrefixListId.of_json j + end +module UserIdGroupPairList = + struct + type t = UserIdGroupPair.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map UserIdGroupPair.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list UserIdGroupPair.to_query v + let to_json v = `List (List.map UserIdGroupPair.to_json v) + let of_json j = Json.to_list UserIdGroupPair.of_json j + end +module SpotFleetLaunchSpecification = + struct + type t = + { + image_id: String.t option ; + key_name: String.t option ; + security_groups: GroupIdentifierList.t ; + user_data: String.t option ; + addressing_type: String.t option ; + instance_type: InstanceType.t option ; + placement: SpotPlacement.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappingList.t ; + monitoring: SpotFleetMonitoring.t option ; + subnet_id: String.t option ; + network_interfaces: InstanceNetworkInterfaceSpecificationList.t ; + iam_instance_profile: IamInstanceProfileSpecification.t option ; + ebs_optimized: Boolean.t option ; + weighted_capacity: Double.t option ; + spot_price: String.t option } + let make ?image_id ?key_name ?(security_groups= []) ?user_data + ?addressing_type ?instance_type ?placement ?kernel_id ?ramdisk_id + ?(block_device_mappings= []) ?monitoring ?subnet_id + ?(network_interfaces= []) ?iam_instance_profile ?ebs_optimized + ?weighted_capacity ?spot_price () = + { + image_id; + key_name; + security_groups; + user_data; + addressing_type; + instance_type; + placement; + kernel_id; + ramdisk_id; + block_device_mappings; + monitoring; + subnet_id; + network_interfaces; + iam_instance_profile; + ebs_optimized; + weighted_capacity; + spot_price + } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + user_data = + (Util.option_bind (Xml.member "userData" xml) String.parse); + addressing_type = + (Util.option_bind (Xml.member "addressingType" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + placement = + (Util.option_bind (Xml.member "placement" xml) + SpotPlacement.parse); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingList.parse)); + monitoring = + (Util.option_bind (Xml.member "monitoring" xml) + SpotFleetMonitoring.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "networkInterfaceSet" xml) + InstanceNetworkInterfaceSpecificationList.parse)); + iam_instance_profile = + (Util.option_bind (Xml.member "iamInstanceProfile" xml) + IamInstanceProfileSpecification.parse); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse); + weighted_capacity = + (Util.option_bind (Xml.member "weightedCapacity" xml) + Double.parse); + spot_price = (Util.option_bind (Xml.member "spotPrice" xml) String.parse) - ; target_capacity = - Xml.required - "targetCapacity" - (Util.option_bind (Xml.member "targetCapacity" xml) Integer.parse) - ; valid_from = Util.option_bind (Xml.member "validFrom" xml) DateTime.parse - ; valid_until = Util.option_bind (Xml.member "validUntil" xml) DateTime.parse - ; terminate_instances_with_expiration = - Util.option_bind - (Xml.member "terminateInstancesWithExpiration" xml) - Boolean.parse - ; iam_fleet_role = - Xml.required - "iamFleetRole" - (Util.option_bind (Xml.member "iamFleetRole" xml) String.parse) - ; launch_specifications = - Xml.required - "launchSpecifications" - (Util.option_bind - (Xml.member "launchSpecifications" xml) - LaunchSpecsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.spot_price + (fun f -> Query.Pair ("SpotPrice", (String.to_query f))); + Util.option_map v.weighted_capacity + (fun f -> Query.Pair ("WeightedCapacity", (Double.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> + Query.Pair + ("IamInstanceProfile", + (IamInstanceProfileSpecification.to_query f))); + Some + (Query.Pair + ("NetworkInterfaceSet", + (InstanceNetworkInterfaceSpecificationList.to_query + v.network_interfaces))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.monitoring + (fun f -> + Query.Pair ("Monitoring", (SpotFleetMonitoring.to_query f))); + Some (Query.Pair - ("LaunchSpecifications", LaunchSpecsList.to_query v.launch_specifications)) - ; Some (Query.Pair ("IamFleetRole", String.to_query v.iam_fleet_role)) - ; Util.option_map v.terminate_instances_with_expiration (fun f -> - Query.Pair ("TerminateInstancesWithExpiration", Boolean.to_query f)) - ; Util.option_map v.valid_until (fun f -> - Query.Pair ("ValidUntil", DateTime.to_query f)) - ; Util.option_map v.valid_from (fun f -> - Query.Pair ("ValidFrom", DateTime.to_query f)) - ; Some (Query.Pair ("TargetCapacity", Integer.to_query v.target_capacity)) - ; Some (Query.Pair ("SpotPrice", String.to_query v.spot_price)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("launch_specifications", LaunchSpecsList.to_json v.launch_specifications) - ; Some ("iam_fleet_role", String.to_json v.iam_fleet_role) - ; Util.option_map v.terminate_instances_with_expiration (fun f -> - "terminate_instances_with_expiration", Boolean.to_json f) - ; Util.option_map v.valid_until (fun f -> "valid_until", DateTime.to_json f) - ; Util.option_map v.valid_from (fun f -> "valid_from", DateTime.to_json f) - ; Some ("target_capacity", Integer.to_json v.target_capacity) - ; Some ("spot_price", String.to_json v.spot_price) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ]) - - let of_json j = - { client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; spot_price = String.of_json (Util.of_option_exn (Json.lookup j "spot_price")) - ; target_capacity = - Integer.of_json (Util.of_option_exn (Json.lookup j "target_capacity")) - ; valid_from = Util.option_map (Json.lookup j "valid_from") DateTime.of_json - ; valid_until = Util.option_map (Json.lookup j "valid_until") DateTime.of_json - ; terminate_instances_with_expiration = - Util.option_map - (Json.lookup j "terminate_instances_with_expiration") - Boolean.of_json - ; iam_fleet_role = - String.of_json (Util.of_option_exn (Json.lookup j "iam_fleet_role")) - ; launch_specifications = - LaunchSpecsList.of_json - (Util.of_option_exn (Json.lookup j "launch_specifications")) - } -end - -module AvailabilityZoneMessageList = struct - type t = AvailabilityZoneMessage.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AvailabilityZoneMessage.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list AvailabilityZoneMessage.to_query v - - let to_json v = `List (List.map AvailabilityZoneMessage.to_json v) - - let of_json j = Json.to_list AvailabilityZoneMessage.of_json j -end - -module AvailabilityZoneState = struct - type t = Available - - let str_to_t = [ "available", Available ] - - let t_to_str = [ Available, "available" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module TrafficType = struct - type t = - | ACCEPT - | REJECT - | ALL - - let str_to_t = [ "ALL", ALL; "REJECT", REJECT; "ACCEPT", ACCEPT ] - - let t_to_str = [ ALL, "ALL"; REJECT, "REJECT"; ACCEPT, "ACCEPT" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BundleTaskError = struct - type t = - { code : String.t option - ; message : String.t option - } - - let make ?code ?message () = { code; message } - - let parse xml = - Some - { code = Util.option_bind (Xml.member "code" xml) String.parse - ; message = Util.option_bind (Xml.member "message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ]) - - let of_json j = - { code = Util.option_map (Json.lookup j "code") String.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module BundleTaskState = struct - type t = - | Pending - | Waiting_for_shutdown - | Bundling - | Storing - | Cancelling - | Complete - | Failed - - let str_to_t = - [ "failed", Failed - ; "complete", Complete - ; "cancelling", Cancelling - ; "storing", Storing - ; "bundling", Bundling - ; "waiting-for-shutdown", Waiting_for_shutdown - ; "pending", Pending - ] - - let t_to_str = - [ Failed, "failed" - ; Complete, "complete" - ; Cancelling, "cancelling" - ; Storing, "storing" - ; Bundling, "bundling" - ; Waiting_for_shutdown, "waiting-for-shutdown" - ; Pending, "pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Storage = struct - type t = { s3 : S3Storage.t option } - - let make ?s3 () = { s3 } - - let parse xml = Some { s3 = Util.option_bind (Xml.member "S3" xml) S3Storage.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3 (fun f -> Query.Pair ("S3", S3Storage.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Util.option_map v.s3 (fun f -> "s3", S3Storage.to_json f) ]) - - let of_json j = { s3 = Util.option_map (Json.lookup j "s3") S3Storage.of_json } -end - -module VolumeStatusActionsList = struct - type t = VolumeStatusAction.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VolumeStatusAction.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VolumeStatusAction.to_query v - - let to_json v = `List (List.map VolumeStatusAction.to_json v) - - let of_json j = Json.to_list VolumeStatusAction.of_json j -end - -module VolumeStatusEventsList = struct - type t = VolumeStatusEvent.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VolumeStatusEvent.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VolumeStatusEvent.to_query v - - let to_json v = `List (List.map VolumeStatusEvent.to_json v) - - let of_json j = Json.to_list VolumeStatusEvent.of_json j -end - -module VolumeStatusInfo = struct - type t = - { status : VolumeStatusInfoStatus.t option - ; details : VolumeStatusDetailsList.t - } - - let make ?status ?(details = []) () = { status; details } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "status" xml) VolumeStatusInfoStatus.parse - ; details = - Util.of_option - [] - (Util.option_bind (Xml.member "details" xml) VolumeStatusDetailsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Details", VolumeStatusDetailsList.to_query v.details)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", VolumeStatusInfoStatus.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("details", VolumeStatusDetailsList.to_json v.details) - ; Util.option_map v.status (fun f -> "status", VolumeStatusInfoStatus.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") VolumeStatusInfoStatus.of_json - ; details = - VolumeStatusDetailsList.of_json (Util.of_option_exn (Json.lookup j "details")) - } -end - -module CreateVolumePermission = struct - type t = - { user_id : String.t option - ; group : PermissionGroup.t option - } - - let make ?user_id ?group () = { user_id; group } - - let parse xml = - Some - { user_id = Util.option_bind (Xml.member "userId" xml) String.parse - ; group = Util.option_bind (Xml.member "group" xml) PermissionGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group (fun f -> - Query.Pair ("Group", PermissionGroup.to_query f)) - ; Util.option_map v.user_id (fun f -> Query.Pair ("UserId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group (fun f -> "group", PermissionGroup.to_json f) - ; Util.option_map v.user_id (fun f -> "user_id", String.to_json f) - ]) - - let of_json j = - { user_id = Util.option_map (Json.lookup j "user_id") String.of_json - ; group = Util.option_map (Json.lookup j "group") PermissionGroup.of_json - } -end - -module VolumeAttachmentList = struct - type t = VolumeAttachment.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VolumeAttachment.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VolumeAttachment.to_query v - - let to_json v = `List (List.map VolumeAttachment.to_json v) - - let of_json j = Json.to_list VolumeAttachment.of_json j -end - -module VolumeState = struct - type t = - | Creating - | Available - | In_use - | Deleting - | Deleted - | Error - - let str_to_t = - [ "error", Error - ; "deleted", Deleted - ; "deleting", Deleting - ; "in-use", In_use - ; "available", Available - ; "creating", Creating - ] - - let t_to_str = - [ Error, "error" - ; Deleted, "deleted" - ; Deleting, "deleting" - ; In_use, "in-use" - ; Available, "available" - ; Creating, "creating" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DomainType = struct - type t = - | Vpc - | Standard - - let str_to_t = [ "standard", Standard; "vpc", Vpc ] - - let t_to_str = [ Standard, "standard"; Vpc, "vpc" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VgwTelemetryList = struct - type t = VgwTelemetry.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VgwTelemetry.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VgwTelemetry.to_query v - - let to_json v = `List (List.map VgwTelemetry.to_json v) - - let of_json j = Json.to_list VgwTelemetry.of_json j -end - -module VpnConnectionOptions = struct - type t = { static_routes_only : Boolean.t option } - - let make ?static_routes_only () = { static_routes_only } - - let parse xml = - Some - { static_routes_only = - Util.option_bind (Xml.member "staticRoutesOnly" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.static_routes_only (fun f -> - Query.Pair ("StaticRoutesOnly", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.static_routes_only (fun f -> - "static_routes_only", Boolean.to_json f) - ]) - - let of_json j = - { static_routes_only = - Util.option_map (Json.lookup j "static_routes_only") Boolean.of_json - } -end - -module VpnStaticRouteList = struct - type t = VpnStaticRoute.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpnStaticRoute.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpnStaticRoute.to_query v - - let to_json v = `List (List.map VpnStaticRoute.to_json v) - - let of_json j = Json.to_list VpnStaticRoute.of_json j -end - -module PricingDetailsList = struct - type t = PricingDetail.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PricingDetail.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PricingDetail.to_query v - - let to_json v = `List (List.map PricingDetail.to_json v) - - let of_json j = Json.to_list PricingDetail.of_json j -end - -module InstanceList = struct - type t = Instance.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Instance.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Instance.to_query v - - let to_json v = `List (List.map Instance.to_json v) - - let of_json j = Json.to_list Instance.of_json j -end - -module VpcPeeringConnectionStateReason = struct - type t = - { code : VpcPeeringConnectionStateReasonCode.t option - ; message : String.t option - } - - let make ?code ?message () = { code; message } - - let parse xml = - Some - { code = - Util.option_bind - (Xml.member "code" xml) - VpcPeeringConnectionStateReasonCode.parse - ; message = Util.option_bind (Xml.member "message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.code (fun f -> - Query.Pair ("Code", VpcPeeringConnectionStateReasonCode.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.code (fun f -> - "code", VpcPeeringConnectionStateReasonCode.to_json f) - ]) - - let of_json j = - { code = - Util.option_map (Json.lookup j "code") VpcPeeringConnectionStateReasonCode.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module VpcPeeringConnectionVpcInfo = struct - type t = - { cidr_block : String.t option - ; owner_id : String.t option - ; vpc_id : String.t option - } - - let make ?cidr_block ?owner_id ?vpc_id () = { cidr_block; owner_id; vpc_id } - - let parse xml = - Some - { cidr_block = Util.option_bind (Xml.member "cidrBlock" xml) String.parse - ; owner_id = Util.option_bind (Xml.member "ownerId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ; Util.option_map v.cidr_block (fun f -> - Query.Pair ("CidrBlock", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ; Util.option_map v.cidr_block (fun f -> "cidr_block", String.to_json f) - ]) - - let of_json j = - { cidr_block = Util.option_map (Json.lookup j "cidr_block") String.of_json - ; owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - } -end - -module VpcState = struct - type t = - | Pending - | Available - - let str_to_t = [ "available", Available; "pending", Pending ] - - let t_to_str = [ Available, "available"; Pending, "pending" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module NetworkAclAssociationList = struct - type t = NetworkAclAssociation.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NetworkAclAssociation.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NetworkAclAssociation.to_query v - - let to_json v = `List (List.map NetworkAclAssociation.to_json v) - - let of_json j = Json.to_list NetworkAclAssociation.of_json j -end - -module NetworkAclEntryList = struct - type t = NetworkAclEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NetworkAclEntry.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NetworkAclEntry.to_query v - - let to_json v = `List (List.map NetworkAclEntry.to_json v) - - let of_json j = Json.to_list NetworkAclEntry.of_json j -end - -module SubnetState = struct - type t = - | Pending - | Available - - let str_to_t = [ "available", Available; "pending", Pending ] - - let t_to_str = [ Available, "available"; Pending, "pending" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SnapshotDetailList = struct - type t = SnapshotDetail.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map SnapshotDetail.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SnapshotDetail.to_query v - - let to_json v = `List (List.map SnapshotDetail.to_json v) - - let of_json j = Json.to_list SnapshotDetail.of_json j -end - -module CancelSpotFleetRequestsError = struct - type t = - { code : CancelBatchErrorCode.t - ; message : String.t - } - - let make ~code ~message () = { code; message } - - let parse xml = - Some - { code = - Xml.required - "code" - (Util.option_bind (Xml.member "code" xml) CancelBatchErrorCode.parse) - ; message = - Xml.required - "message" + ("BlockDeviceMapping", + (BlockDeviceMappingList.to_query v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (SpotPlacement.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.addressing_type + (fun f -> Query.Pair ("AddressingType", (String.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some + (Query.Pair + ("GroupSet", + (GroupIdentifierList.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.spot_price + (fun f -> ("spot_price", (String.to_json f))); + Util.option_map v.weighted_capacity + (fun f -> ("weighted_capacity", (Double.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> + ("iam_instance_profile", + (IamInstanceProfileSpecification.to_json f))); + Some + ("network_interfaces", + (InstanceNetworkInterfaceSpecificationList.to_json + v.network_interfaces)); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.monitoring + (fun f -> ("monitoring", (SpotFleetMonitoring.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappingList.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (SpotPlacement.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.addressing_type + (fun f -> ("addressing_type", (String.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("security_groups", + (GroupIdentifierList.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + addressing_type = + (Util.option_map (Json.lookup j "addressing_type") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + placement = + (Util.option_map (Json.lookup j "placement") SpotPlacement.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + monitoring = + (Util.option_map (Json.lookup j "monitoring") + SpotFleetMonitoring.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + network_interfaces = + (InstanceNetworkInterfaceSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + IamInstanceProfileSpecification.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + weighted_capacity = + (Util.option_map (Json.lookup j "weighted_capacity") Double.of_json); + spot_price = + (Util.option_map (Json.lookup j "spot_price") String.of_json) + } + end +module VolumeStatusDetails = + struct + type t = { + name: VolumeStatusName.t option ; + status: String.t option } + let make ?name ?status () = { name; status } + let parse xml = + Some + { + name = + (Util.option_bind (Xml.member "name" xml) VolumeStatusName.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (VolumeStatusName.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.name + (fun f -> ("name", (VolumeStatusName.to_json f)))]) + let of_json j = + { + name = + (Util.option_map (Json.lookup j "name") VolumeStatusName.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module VolumeAttachmentState = + struct + type t = + | Attaching + | Attached + | Detaching + | Detached + let str_to_t = + [("detached", Detached); + ("detaching", Detaching); + ("attached", Attached); + ("attaching", Attaching)] + let t_to_str = + [(Detached, "detached"); + (Detaching, "detaching"); + (Attached, "attached"); + (Attaching, "attaching")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module TelemetryStatus = + struct + type t = + | UP + | DOWN + let str_to_t = [("DOWN", DOWN); ("UP", UP)] + let t_to_str = [(DOWN, "DOWN"); (UP, "UP")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VpnState = + struct + type t = + | Pending + | Available + | Deleting + | Deleted + let str_to_t = + [("deleted", Deleted); + ("deleting", Deleting); + ("available", Available); + ("pending", Pending)] + let t_to_str = + [(Deleted, "deleted"); + (Deleting, "deleting"); + (Available, "available"); + (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VpnStaticRouteSource = + struct + type t = + | Static + let str_to_t = [("Static", Static)] + let t_to_str = [(Static, "Static")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ArchitectureValues = + struct + type t = + | I386 + | X86_64 + let str_to_t = [("x86_64", X86_64); ("i386", I386)] + let t_to_str = [(X86_64, "x86_64"); (I386, "i386")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DeviceType = + struct + type t = + | Ebs + | Instance_store + let str_to_t = [("instance-store", Instance_store); ("ebs", Ebs)] + let t_to_str = [(Instance_store, "instance-store"); (Ebs, "ebs")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module HypervisorType = + struct + type t = + | Ovm + | Xen + let str_to_t = [("xen", Xen); ("ovm", Ovm)] + let t_to_str = [(Xen, "xen"); (Ovm, "ovm")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module IamInstanceProfile = + struct + type t = { + arn: String.t option ; + id: String.t option } + let make ?arn ?id () = { arn; id } + let parse xml = + Some + { + arn = (Util.option_bind (Xml.member "arn" xml) String.parse); + id = (Util.option_bind (Xml.member "id" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f))); + Util.option_map v.arn + (fun f -> Query.Pair ("Arn", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.id (fun f -> ("id", (String.to_json f))); + Util.option_map v.arn (fun f -> ("arn", (String.to_json f)))]) + let of_json j = + { + arn = (Util.option_map (Json.lookup j "arn") String.of_json); + id = (Util.option_map (Json.lookup j "id") String.of_json) + } + end +module InstanceBlockDeviceMappingList = + struct + type t = InstanceBlockDeviceMapping.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceBlockDeviceMapping.parse (Xml.members "item" xml)) + let to_query v = + Query.to_query_list InstanceBlockDeviceMapping.to_query v + let to_json v = `List (List.map InstanceBlockDeviceMapping.to_json v) + let of_json j = Json.to_list InstanceBlockDeviceMapping.of_json j + end +module InstanceLifecycleType = + struct + type t = + | Spot + let str_to_t = [("spot", Spot)] + let t_to_str = [(Spot, "spot")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceNetworkInterfaceList = + struct + type t = InstanceNetworkInterface.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceNetworkInterface.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceNetworkInterface.to_query v + let to_json v = `List (List.map InstanceNetworkInterface.to_json v) + let of_json j = Json.to_list InstanceNetworkInterface.of_json j + end +module InstanceState = + struct + type t = { + code: Integer.t ; + name: InstanceStateName.t } + let make ~code ~name () = { code; name } + let parse xml = + Some + { + code = + (Xml.required "code" + (Util.option_bind (Xml.member "code" xml) Integer.parse)); + name = + (Xml.required "name" + (Util.option_bind (Xml.member "name" xml) + InstanceStateName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (InstanceStateName.to_query v.name))); + Some (Query.Pair ("Code", (Integer.to_query v.code)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("name", (InstanceStateName.to_json v.name)); + Some ("code", (Integer.to_json v.code))]) + let of_json j = + { + code = (Integer.of_json (Util.of_option_exn (Json.lookup j "code"))); + name = + (InstanceStateName.of_json + (Util.of_option_exn (Json.lookup j "name"))) + } + end +module Monitoring = + struct + type t = { + state: MonitoringState.t option } + let make ?state () = { state } + let parse xml = + Some + { + state = + (Util.option_bind (Xml.member "state" xml) MonitoringState.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> Query.Pair ("State", (MonitoringState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> ("state", (MonitoringState.to_json f)))]) + let of_json j = + { + state = + (Util.option_map (Json.lookup j "state") MonitoringState.of_json) + } + end +module Placement = + struct + type t = + { + availability_zone: String.t option ; + group_name: String.t option ; + tenancy: Tenancy.t option } + let make ?availability_zone ?group_name ?tenancy () = + { availability_zone; group_name; tenancy } + let parse xml = + Some + { + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + group_name = + (Util.option_bind (Xml.member "groupName" xml) String.parse); + tenancy = + (Util.option_bind (Xml.member "tenancy" xml) Tenancy.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.tenancy + (fun f -> Query.Pair ("Tenancy", (Tenancy.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.tenancy + (fun f -> ("tenancy", (Tenancy.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f)))]) + let of_json j = + { + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + tenancy = (Util.option_map (Json.lookup j "tenancy") Tenancy.of_json) + } + end +module PlatformValues = + struct + type t = + | Windows + let str_to_t = [("Windows", Windows)] + let t_to_str = [(Windows, "Windows")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ProductCodeList = + struct + type t = ProductCode.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map ProductCode.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ProductCode.to_query v + let to_json v = `List (List.map ProductCode.to_json v) + let of_json j = Json.to_list ProductCode.of_json j + end +module StateReason = + struct + type t = { + code: String.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) String.parse); + message = (Util.option_bind (Xml.member "message" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Message", String.to_query v.message)) - ; Some (Query.Pair ("Code", CancelBatchErrorCode.to_query v.code)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("message", String.to_json v.message) - ; Some ("code", CancelBatchErrorCode.to_json v.code) - ]) - - let of_json j = - { code = CancelBatchErrorCode.of_json (Util.of_option_exn (Json.lookup j "code")) - ; message = String.of_json (Util.of_option_exn (Json.lookup j "message")) - } -end - -module AccountAttributeValueList = struct - type t = AccountAttributeValue.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AccountAttributeValue.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list AccountAttributeValue.to_query v - - let to_json v = `List (List.map AccountAttributeValue.to_json v) - - let of_json j = Json.to_list AccountAttributeValue.of_json j -end - -module DiskImageDetail = struct - type t = - { format : DiskImageFormat.t - ; bytes : Long.t - ; import_manifest_url : String.t - } - - let make ~format ~bytes ~import_manifest_url () = { format; bytes; import_manifest_url } - - let parse xml = - Some - { format = - Xml.required - "format" - (Util.option_bind (Xml.member "format" xml) DiskImageFormat.parse) - ; bytes = - Xml.required "bytes" (Util.option_bind (Xml.member "bytes" xml) Long.parse) - ; import_manifest_url = - Xml.required - "importManifestUrl" - (Util.option_bind (Xml.member "importManifestUrl" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ImportManifestUrl", String.to_query v.import_manifest_url)) - ; Some (Query.Pair ("Bytes", Long.to_query v.bytes)) - ; Some (Query.Pair ("Format", DiskImageFormat.to_query v.format)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("import_manifest_url", String.to_json v.import_manifest_url) - ; Some ("bytes", Long.to_json v.bytes) - ; Some ("format", DiskImageFormat.to_json v.format) - ]) - - let of_json j = - { format = DiskImageFormat.of_json (Util.of_option_exn (Json.lookup j "format")) - ; bytes = Long.of_json (Util.of_option_exn (Json.lookup j "bytes")) - ; import_manifest_url = - String.of_json (Util.of_option_exn (Json.lookup j "import_manifest_url")) - } -end - -module VolumeDetail = struct - type t = { size : Long.t } - - let make ~size () = { size } - - let parse xml = - Some - { size = Xml.required "size" (Util.option_bind (Xml.member "size" xml) Long.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Size", Long.to_query v.size)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("size", Long.to_json v.size) ]) - - let of_json j = { size = Long.of_json (Util.of_option_exn (Json.lookup j "size")) } -end - -module State = struct - type t = - | Pending - | Available - | Deleting - | Deleted - - let str_to_t = - [ "Deleted", Deleted - ; "Deleting", Deleting - ; "Available", Available - ; "Pending", Pending - ] - - let t_to_str = - [ Deleted, "Deleted" - ; Deleting, "Deleting" - ; Available, "Available" - ; Pending, "Pending" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module UserBucket = struct - type t = - { s3_bucket : String.t option - ; s3_key : String.t option - } - - let make ?s3_bucket ?s3_key () = { s3_bucket; s3_key } - - let parse xml = - Some - { s3_bucket = Util.option_bind (Xml.member "S3Bucket" xml) String.parse - ; s3_key = Util.option_bind (Xml.member "S3Key" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> Query.Pair ("S3Key", String.to_query f)) - ; Util.option_map v.s3_bucket (fun f -> - Query.Pair ("S3Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s3_key (fun f -> "s3_key", String.to_json f) - ; Util.option_map v.s3_bucket (fun f -> "s3_bucket", String.to_json f) - ]) - - let of_json j = - { s3_bucket = Util.option_map (Json.lookup j "s3_bucket") String.of_json - ; s3_key = Util.option_map (Json.lookup j "s3_key") String.of_json - } -end - -module SnapshotState = struct - type t = - | Pending - | Completed - | Error - - let str_to_t = [ "error", Error; "completed", Completed; "pending", Pending ] - - let t_to_str = [ Error, "error"; Completed, "completed"; Pending, "pending" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module NetworkInterface = struct - type t = - { network_interface_id : String.t option - ; subnet_id : String.t option - ; vpc_id : String.t option - ; availability_zone : String.t option - ; description : String.t option - ; owner_id : String.t option - ; requester_id : String.t option - ; requester_managed : Boolean.t option - ; status : NetworkInterfaceStatus.t option - ; mac_address : String.t option - ; private_ip_address : String.t option - ; private_dns_name : String.t option - ; source_dest_check : Boolean.t option - ; groups : GroupIdentifierList.t - ; attachment : NetworkInterfaceAttachment.t option - ; association : NetworkInterfaceAssociation.t option - ; tag_set : TagList.t - ; private_ip_addresses : NetworkInterfacePrivateIpAddressList.t - } - - let make - ?network_interface_id - ?subnet_id - ?vpc_id - ?availability_zone - ?description - ?owner_id - ?requester_id - ?requester_managed - ?status - ?mac_address - ?private_ip_address - ?private_dns_name - ?source_dest_check - ?(groups = []) - ?attachment - ?association - ?(tag_set = []) - ?(private_ip_addresses = []) - () = - { network_interface_id - ; subnet_id - ; vpc_id - ; availability_zone - ; description - ; owner_id - ; requester_id - ; requester_managed - ; status - ; mac_address - ; private_ip_address - ; private_dns_name - ; source_dest_check - ; groups - ; attachment - ; association - ; tag_set - ; private_ip_addresses - } - - let parse xml = - Some - { network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; owner_id = Util.option_bind (Xml.member "ownerId" xml) String.parse - ; requester_id = Util.option_bind (Xml.member "requesterId" xml) String.parse - ; requester_managed = - Util.option_bind (Xml.member "requesterManaged" xml) Boolean.parse - ; status = Util.option_bind (Xml.member "status" xml) NetworkInterfaceStatus.parse - ; mac_address = Util.option_bind (Xml.member "macAddress" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; private_dns_name = Util.option_bind (Xml.member "privateDnsName" xml) String.parse - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) Boolean.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; attachment = - Util.option_bind (Xml.member "attachment" xml) NetworkInterfaceAttachment.parse - ; association = - Util.option_bind - (Xml.member "association" xml) - NetworkInterfaceAssociation.parse - ; tag_set = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; private_ip_addresses = - Util.of_option - [] - (Util.option_bind - (Xml.member "privateIpAddressesSet" xml) - NetworkInterfacePrivateIpAddressList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module VirtualizationType = + struct + type t = + | Hvm + | Paravirtual + let str_to_t = [("paravirtual", Paravirtual); ("hvm", Hvm)] + let t_to_str = [(Paravirtual, "paravirtual"); (Hvm, "hvm")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module IcmpTypeCode = + struct + type t = { + type_: Integer.t option ; + code: Integer.t option } + let make ?type_ ?code () = { type_; code } + let parse xml = + Some + { + type_ = (Util.option_bind (Xml.member "type" xml) Integer.parse); + code = (Util.option_bind (Xml.member "code" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.code + (fun f -> Query.Pair ("Code", (Integer.to_query f))); + Util.option_map v.type_ + (fun f -> Query.Pair ("Type", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.code (fun f -> ("code", (Integer.to_json f))); + Util.option_map v.type_ (fun f -> ("type_", (Integer.to_json f)))]) + let of_json j = + { + type_ = (Util.option_map (Json.lookup j "type_") Integer.of_json); + code = (Util.option_map (Json.lookup j "code") Integer.of_json) + } + end +module PortRange = + struct + type t = { + from: Integer.t option ; + to_: Integer.t option } + let make ?from ?to_ () = { from; to_ } + let parse xml = + Some + { + from = (Util.option_bind (Xml.member "from" xml) Integer.parse); + to_ = (Util.option_bind (Xml.member "to" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.to_ + (fun f -> Query.Pair ("To", (Integer.to_query f))); + Util.option_map v.from + (fun f -> Query.Pair ("From", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.to_ (fun f -> ("to_", (Integer.to_json f))); + Util.option_map v.from (fun f -> ("from", (Integer.to_json f)))]) + let of_json j = + { + from = (Util.option_map (Json.lookup j "from") Integer.of_json); + to_ = (Util.option_map (Json.lookup j "to_") Integer.of_json) + } + end +module RuleAction = + struct + type t = + | Allow + | Deny + let str_to_t = [("deny", Deny); ("allow", Allow)] + let t_to_str = [(Deny, "deny"); (Allow, "allow")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module UserBucketDetails = + struct + type t = { + s3_bucket: String.t option ; + s3_key: String.t option } + let make ?s3_bucket ?s3_key () = { s3_bucket; s3_key } + let parse xml = + Some + { + s3_bucket = + (Util.option_bind (Xml.member "s3Bucket" xml) String.parse); + s3_key = (Util.option_bind (Xml.member "s3Key" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> Query.Pair ("S3Key", (String.to_query f))); + Util.option_map v.s3_bucket + (fun f -> Query.Pair ("S3Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> ("s3_key", (String.to_json f))); + Util.option_map v.s3_bucket + (fun f -> ("s3_bucket", (String.to_json f)))]) + let of_json j = + { + s3_bucket = + (Util.option_map (Json.lookup j "s3_bucket") String.of_json); + s3_key = (Util.option_map (Json.lookup j "s3_key") String.of_json) + } + end +module NetworkInterfacePrivateIpAddress = + struct + type t = + { + private_ip_address: String.t option ; + private_dns_name: String.t option ; + primary: Boolean.t option ; + association: NetworkInterfaceAssociation.t option } + let make ?private_ip_address ?private_dns_name ?primary ?association + () = { private_ip_address; private_dns_name; primary; association } + let parse xml = + Some + { + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + private_dns_name = + (Util.option_bind (Xml.member "privateDnsName" xml) String.parse); + primary = + (Util.option_bind (Xml.member "primary" xml) Boolean.parse); + association = + (Util.option_bind (Xml.member "association" xml) + NetworkInterfaceAssociation.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association + (fun f -> + Query.Pair + ("Association", (NetworkInterfaceAssociation.to_query f))); + Util.option_map v.primary + (fun f -> Query.Pair ("Primary", (Boolean.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association + (fun f -> + ("association", (NetworkInterfaceAssociation.to_json f))); + Util.option_map v.primary + (fun f -> ("primary", (Boolean.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f)))]) + let of_json j = + { + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + primary = (Util.option_map (Json.lookup j "primary") Boolean.of_json); + association = + (Util.option_map (Json.lookup j "association") + NetworkInterfaceAssociation.of_json) + } + end +module DhcpConfiguration = + struct + type t = { + key: String.t option ; + values: DhcpConfigurationValueList.t } + let make ?key ?(values= []) () = { key; values } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "key" xml) String.parse); + values = + (Util.of_option [] + (Util.option_bind (Xml.member "valueSet" xml) + DhcpConfigurationValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ValueSet", (DhcpConfigurationValueList.to_query v.values))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("values", (DhcpConfigurationValueList.to_json v.values)); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + values = + (DhcpConfigurationValueList.of_json + (Util.of_option_exn (Json.lookup j "values"))) + } + end +module VpcAttachment = + struct + type t = { + vpc_id: String.t option ; + state: AttachmentStatus.t option } + let make ?vpc_id ?state () = { vpc_id; state } + let parse xml = + Some + { + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + state = + (Util.option_bind (Xml.member "state" xml) AttachmentStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> Query.Pair ("State", (AttachmentStatus.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> ("state", (AttachmentStatus.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f)))]) + let of_json j = + { + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + state = + (Util.option_map (Json.lookup j "state") AttachmentStatus.of_json) + } + end +module ReservedInstancesModificationResult = + struct + type t = + { + reserved_instances_id: String.t option ; + target_configuration: ReservedInstancesConfiguration.t option } + let make ?reserved_instances_id ?target_configuration () = + { reserved_instances_id; target_configuration } + let parse xml = + Some + { + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse); + target_configuration = + (Util.option_bind (Xml.member "targetConfiguration" xml) + ReservedInstancesConfiguration.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.target_configuration + (fun f -> + Query.Pair + ("TargetConfiguration", + (ReservedInstancesConfiguration.to_query f))); + Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.target_configuration + (fun f -> + ("target_configuration", + (ReservedInstancesConfiguration.to_json f))); + Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json); + target_configuration = + (Util.option_map (Json.lookup j "target_configuration") + ReservedInstancesConfiguration.of_json) + } + end +module ReservedInstancesId = + struct + type t = { + reserved_instances_id: String.t option } + let make ?reserved_instances_id () = { reserved_instances_id } + let parse xml = + Some + { + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json) + } + end +module RecurringCharge = + struct + type t = + { + frequency: RecurringChargeFrequency.t option ; + amount: Double.t option } + let make ?frequency ?amount () = { frequency; amount } + let parse xml = + Some + { + frequency = + (Util.option_bind (Xml.member "frequency" xml) + RecurringChargeFrequency.parse); + amount = (Util.option_bind (Xml.member "amount" xml) Double.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.amount + (fun f -> Query.Pair ("Amount", (Double.to_query f))); + Util.option_map v.frequency + (fun f -> + Query.Pair + ("Frequency", (RecurringChargeFrequency.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.amount + (fun f -> ("amount", (Double.to_json f))); + Util.option_map v.frequency + (fun f -> ("frequency", (RecurringChargeFrequency.to_json f)))]) + let of_json j = + { + frequency = + (Util.option_map (Json.lookup j "frequency") + RecurringChargeFrequency.of_json); + amount = (Util.option_map (Json.lookup j "amount") Double.of_json) + } + end +module PermissionGroup = + struct + type t = + | All + let str_to_t = [("all", All)] + let t_to_str = [(All, "all")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ImportInstanceVolumeDetailSet = + struct + type t = ImportInstanceVolumeDetailItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ImportInstanceVolumeDetailItem.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list ImportInstanceVolumeDetailItem.to_query v + let to_json v = `List (List.map ImportInstanceVolumeDetailItem.to_json v) + let of_json j = Json.to_list ImportInstanceVolumeDetailItem.of_json j + end +module PropagatingVgw = + struct + type t = { + gateway_id: String.t option } + let make ?gateway_id () = { gateway_id } + let parse xml = + Some + { + gateway_id = + (Util.option_bind (Xml.member "gatewayId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.gateway_id + (fun f -> Query.Pair ("GatewayId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.gateway_id + (fun f -> ("gateway_id", (String.to_json f)))]) + let of_json j = + { + gateway_id = + (Util.option_map (Json.lookup j "gateway_id") String.of_json) + } + end +module Route = + struct + type t = + { + destination_cidr_block: String.t option ; + destination_prefix_list_id: String.t option ; + gateway_id: String.t option ; + instance_id: String.t option ; + instance_owner_id: String.t option ; + network_interface_id: String.t option ; + vpc_peering_connection_id: String.t option ; + state: RouteState.t option ; + origin: RouteOrigin.t option } + let make ?destination_cidr_block ?destination_prefix_list_id + ?gateway_id ?instance_id ?instance_owner_id ?network_interface_id + ?vpc_peering_connection_id ?state ?origin () = + { + destination_cidr_block; + destination_prefix_list_id; + gateway_id; + instance_id; + instance_owner_id; + network_interface_id; + vpc_peering_connection_id; + state; + origin + } + let parse xml = + Some + { + destination_cidr_block = + (Util.option_bind (Xml.member "destinationCidrBlock" xml) + String.parse); + destination_prefix_list_id = + (Util.option_bind (Xml.member "destinationPrefixListId" xml) + String.parse); + gateway_id = + (Util.option_bind (Xml.member "gatewayId" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + instance_owner_id = + (Util.option_bind (Xml.member "instanceOwnerId" xml) String.parse); + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + vpc_peering_connection_id = + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse); + state = + (Util.option_bind (Xml.member "state" xml) RouteState.parse); + origin = + (Util.option_bind (Xml.member "origin" xml) RouteOrigin.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.origin + (fun f -> Query.Pair ("Origin", (RouteOrigin.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (RouteState.to_query f))); + Util.option_map v.vpc_peering_connection_id + (fun f -> + Query.Pair ("VpcPeeringConnectionId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f))); + Util.option_map v.instance_owner_id + (fun f -> Query.Pair ("InstanceOwnerId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.gateway_id + (fun f -> Query.Pair ("GatewayId", (String.to_query f))); + Util.option_map v.destination_prefix_list_id + (fun f -> + Query.Pair ("DestinationPrefixListId", (String.to_query f))); + Util.option_map v.destination_cidr_block + (fun f -> + Query.Pair ("DestinationCidrBlock", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.origin + (fun f -> ("origin", (RouteOrigin.to_json f))); + Util.option_map v.state + (fun f -> ("state", (RouteState.to_json f))); + Util.option_map v.vpc_peering_connection_id + (fun f -> ("vpc_peering_connection_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f))); + Util.option_map v.instance_owner_id + (fun f -> ("instance_owner_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.gateway_id + (fun f -> ("gateway_id", (String.to_json f))); + Util.option_map v.destination_prefix_list_id + (fun f -> ("destination_prefix_list_id", (String.to_json f))); + Util.option_map v.destination_cidr_block + (fun f -> ("destination_cidr_block", (String.to_json f)))]) + let of_json j = + { + destination_cidr_block = + (Util.option_map (Json.lookup j "destination_cidr_block") + String.of_json); + destination_prefix_list_id = + (Util.option_map (Json.lookup j "destination_prefix_list_id") + String.of_json); + gateway_id = + (Util.option_map (Json.lookup j "gateway_id") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + instance_owner_id = + (Util.option_map (Json.lookup j "instance_owner_id") String.of_json); + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + vpc_peering_connection_id = + (Util.option_map (Json.lookup j "vpc_peering_connection_id") + String.of_json); + state = (Util.option_map (Json.lookup j "state") RouteState.of_json); + origin = + (Util.option_map (Json.lookup j "origin") RouteOrigin.of_json) + } + end +module RouteTableAssociation = + struct + type t = + { + route_table_association_id: String.t option ; + route_table_id: String.t option ; + subnet_id: String.t option ; + main: Boolean.t option } + let make ?route_table_association_id ?route_table_id ?subnet_id ?main + () = { route_table_association_id; route_table_id; subnet_id; main } + let parse xml = + Some + { + route_table_association_id = + (Util.option_bind (Xml.member "routeTableAssociationId" xml) + String.parse); + route_table_id = + (Util.option_bind (Xml.member "routeTableId" xml) String.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + main = (Util.option_bind (Xml.member "main" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.main + (fun f -> Query.Pair ("Main", (Boolean.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.route_table_id + (fun f -> Query.Pair ("RouteTableId", (String.to_query f))); + Util.option_map v.route_table_association_id + (fun f -> + Query.Pair ("RouteTableAssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.main (fun f -> ("main", (Boolean.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.route_table_id + (fun f -> ("route_table_id", (String.to_json f))); + Util.option_map v.route_table_association_id + (fun f -> ("route_table_association_id", (String.to_json f)))]) + let of_json j = + { + route_table_association_id = + (Util.option_map (Json.lookup j "route_table_association_id") + String.of_json); + route_table_id = + (Util.option_map (Json.lookup j "route_table_id") String.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + main = (Util.option_map (Json.lookup j "main") Boolean.of_json) + } + end +module InstanceCount = + struct + type t = + { + state: ListingState.t option ; + instance_count: Integer.t option } + let make ?state ?instance_count () = { state; instance_count } + let parse xml = + Some + { + state = + (Util.option_bind (Xml.member "state" xml) ListingState.parse); + instance_count = + (Util.option_bind (Xml.member "instanceCount" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (ListingState.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Util.option_map v.state + (fun f -> ("state", (ListingState.to_json f)))]) + let of_json j = + { + state = + (Util.option_map (Json.lookup j "state") ListingState.of_json); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json) + } + end +module PriceSchedule = + struct + type t = + { + term: Long.t option ; + price: Double.t option ; + currency_code: CurrencyCodeValues.t option ; + active: Boolean.t option } + let make ?term ?price ?currency_code ?active () = + { term; price; currency_code; active } + let parse xml = + Some + { + term = (Util.option_bind (Xml.member "term" xml) Long.parse); + price = (Util.option_bind (Xml.member "price" xml) Double.parse); + currency_code = + (Util.option_bind (Xml.member "currencyCode" xml) + CurrencyCodeValues.parse); + active = (Util.option_bind (Xml.member "active" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.active + (fun f -> Query.Pair ("Active", (Boolean.to_query f))); + Util.option_map v.currency_code + (fun f -> + Query.Pair ("CurrencyCode", (CurrencyCodeValues.to_query f))); + Util.option_map v.price + (fun f -> Query.Pair ("Price", (Double.to_query f))); + Util.option_map v.term + (fun f -> Query.Pair ("Term", (Long.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.active + (fun f -> ("active", (Boolean.to_json f))); + Util.option_map v.currency_code + (fun f -> ("currency_code", (CurrencyCodeValues.to_json f))); + Util.option_map v.price (fun f -> ("price", (Double.to_json f))); + Util.option_map v.term (fun f -> ("term", (Long.to_json f)))]) + let of_json j = + { + term = (Util.option_map (Json.lookup j "term") Long.of_json); + price = (Util.option_map (Json.lookup j "price") Double.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") + CurrencyCodeValues.of_json); + active = (Util.option_map (Json.lookup j "active") Boolean.of_json) + } + end +module InstanceStatusEvent = + struct + type t = + { + code: EventCode.t option ; + description: String.t option ; + not_before: DateTime.t option ; + not_after: DateTime.t option } + let make ?code ?description ?not_before ?not_after () = + { code; description; not_before; not_after } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) EventCode.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + not_before = + (Util.option_bind (Xml.member "notBefore" xml) DateTime.parse); + not_after = + (Util.option_bind (Xml.member "notAfter" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.not_after + (fun f -> Query.Pair ("NotAfter", (DateTime.to_query f))); + Util.option_map v.not_before + (fun f -> Query.Pair ("NotBefore", (DateTime.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (EventCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.not_after + (fun f -> ("not_after", (DateTime.to_json f))); + Util.option_map v.not_before + (fun f -> ("not_before", (DateTime.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (EventCode.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") EventCode.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + not_before = + (Util.option_map (Json.lookup j "not_before") DateTime.of_json); + not_after = + (Util.option_map (Json.lookup j "not_after") DateTime.of_json) + } + end +module InstanceStatusDetailsList = + struct + type t = InstanceStatusDetails.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceStatusDetails.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceStatusDetails.to_query v + let to_json v = `List (List.map InstanceStatusDetails.to_json v) + let of_json j = Json.to_list InstanceStatusDetails.of_json j + end +module SummaryStatus = + struct + type t = + | Ok + | Impaired + | Insufficient_data + | Not_applicable + | Initializing + let str_to_t = + [("initializing", Initializing); + ("not-applicable", Not_applicable); + ("insufficient-data", Insufficient_data); + ("impaired", Impaired); + ("ok", Ok)] + let t_to_str = + [(Initializing, "initializing"); + (Not_applicable, "not-applicable"); + (Insufficient_data, "insufficient-data"); + (Impaired, "impaired"); + (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RunInstancesMonitoringEnabled = + struct + type t = { + enabled: Boolean.t } + let make ~enabled () = { enabled } + let parse xml = + Some + { + enabled = + (Xml.required "enabled" + (Util.option_bind (Xml.member "enabled" xml) Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Enabled", (Boolean.to_query v.enabled)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("enabled", (Boolean.to_json v.enabled))]) + let of_json j = + { + enabled = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled"))) + } + end +module ContainerFormat = + struct + type t = + | Ova + let str_to_t = [("ova", Ova)] + let t_to_str = [(Ova, "ova")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ExportEnvironment = + struct + type t = + | Citrix + | Vmware + | Microsoft + let str_to_t = + [("microsoft", Microsoft); ("vmware", Vmware); ("citrix", Citrix)] + let t_to_str = + [(Microsoft, "microsoft"); (Vmware, "vmware"); (Citrix, "citrix")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module IpPermission = + struct + type t = + { + ip_protocol: String.t ; + from_port: Integer.t option ; + to_port: Integer.t option ; + user_id_group_pairs: UserIdGroupPairList.t ; + ip_ranges: IpRangeList.t ; + prefix_list_ids: PrefixListIdList.t } + let make ~ip_protocol ?from_port ?to_port ?(user_id_group_pairs= []) + ?(ip_ranges= []) ?(prefix_list_ids= []) () = + { + ip_protocol; + from_port; + to_port; + user_id_group_pairs; + ip_ranges; + prefix_list_ids + } + let parse xml = + Some + { + ip_protocol = + (Xml.required "ipProtocol" + (Util.option_bind (Xml.member "ipProtocol" xml) String.parse)); + from_port = + (Util.option_bind (Xml.member "fromPort" xml) Integer.parse); + to_port = + (Util.option_bind (Xml.member "toPort" xml) Integer.parse); + user_id_group_pairs = + (Util.of_option [] + (Util.option_bind (Xml.member "groups" xml) + UserIdGroupPairList.parse)); + ip_ranges = + (Util.of_option [] + (Util.option_bind (Xml.member "ipRanges" xml) + IpRangeList.parse)); + prefix_list_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "prefixListIds" xml) + PrefixListIdList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PrefixListIds", + (PrefixListIdList.to_query v.prefix_list_ids))); + Some (Query.Pair ("IpRanges", (IpRangeList.to_query v.ip_ranges))); + Some (Query.Pair - ( "PrivateIpAddressesSet" - , NetworkInterfacePrivateIpAddressList.to_query v.private_ip_addresses )) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tag_set)) - ; Util.option_map v.association (fun f -> - Query.Pair ("Association", NetworkInterfaceAssociation.to_query f)) - ; Util.option_map v.attachment (fun f -> - Query.Pair ("Attachment", NetworkInterfaceAttachment.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", Boolean.to_query f)) - ; Util.option_map v.private_dns_name (fun f -> - Query.Pair ("PrivateDnsName", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.mac_address (fun f -> - Query.Pair ("MacAddress", String.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", NetworkInterfaceStatus.to_query f)) - ; Util.option_map v.requester_managed (fun f -> - Query.Pair ("RequesterManaged", Boolean.to_query f)) - ; Util.option_map v.requester_id (fun f -> - Query.Pair ("RequesterId", String.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "private_ip_addresses" - , NetworkInterfacePrivateIpAddressList.to_json v.private_ip_addresses ) - ; Some ("tag_set", TagList.to_json v.tag_set) - ; Util.option_map v.association (fun f -> - "association", NetworkInterfaceAssociation.to_json f) - ; Util.option_map v.attachment (fun f -> - "attachment", NetworkInterfaceAttachment.to_json f) - ; Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", Boolean.to_json f) - ; Util.option_map v.private_dns_name (fun f -> - "private_dns_name", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.mac_address (fun f -> "mac_address", String.to_json f) - ; Util.option_map v.status (fun f -> "status", NetworkInterfaceStatus.to_json f) - ; Util.option_map v.requester_managed (fun f -> - "requester_managed", Boolean.to_json f) - ; Util.option_map v.requester_id (fun f -> "requester_id", String.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ]) - - let of_json j = - { network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; requester_id = Util.option_map (Json.lookup j "requester_id") String.of_json - ; requester_managed = - Util.option_map (Json.lookup j "requester_managed") Boolean.of_json - ; status = Util.option_map (Json.lookup j "status") NetworkInterfaceStatus.of_json - ; mac_address = Util.option_map (Json.lookup j "mac_address") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; private_dns_name = Util.option_map (Json.lookup j "private_dns_name") String.of_json - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") Boolean.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; attachment = - Util.option_map (Json.lookup j "attachment") NetworkInterfaceAttachment.of_json - ; association = - Util.option_map (Json.lookup j "association") NetworkInterfaceAssociation.of_json - ; tag_set = TagList.of_json (Util.of_option_exn (Json.lookup j "tag_set")) - ; private_ip_addresses = - NetworkInterfacePrivateIpAddressList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - } -end - -module TagDescription = struct - type t = - { resource_id : String.t - ; resource_type : ResourceType.t - ; key : String.t - ; value : String.t - } - - let make ~resource_id ~resource_type ~key ~value () = - { resource_id; resource_type; key; value } - - let parse xml = - Some - { resource_id = - Xml.required - "resourceId" - (Util.option_bind (Xml.member "resourceId" xml) String.parse) - ; resource_type = - Xml.required - "resourceType" - (Util.option_bind (Xml.member "resourceType" xml) ResourceType.parse) - ; key = Xml.required "key" (Util.option_bind (Xml.member "key" xml) String.parse) - ; value = - Xml.required "value" (Util.option_bind (Xml.member "value" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("ResourceType", ResourceType.to_query v.resource_type)) - ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value) - ; Some ("key", String.to_json v.key) - ; Some ("resource_type", ResourceType.to_json v.resource_type) - ; Some ("resource_id", String.to_json v.resource_id) - ]) - - let of_json j = - { resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) - ; resource_type = - ResourceType.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module DhcpOptions = struct - type t = - { dhcp_options_id : String.t option - ; dhcp_configurations : DhcpConfigurationList.t - ; tags : TagList.t - } - - let make ?dhcp_options_id ?(dhcp_configurations = []) ?(tags = []) () = - { dhcp_options_id; dhcp_configurations; tags } - - let parse xml = - Some - { dhcp_options_id = Util.option_bind (Xml.member "dhcpOptionsId" xml) String.parse - ; dhcp_configurations = - Util.of_option - [] - (Util.option_bind - (Xml.member "dhcpConfigurationSet" xml) - DhcpConfigurationList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("Groups", + (UserIdGroupPairList.to_query v.user_id_group_pairs))); + Util.option_map v.to_port + (fun f -> Query.Pair ("ToPort", (Integer.to_query f))); + Util.option_map v.from_port + (fun f -> Query.Pair ("FromPort", (Integer.to_query f))); + Some (Query.Pair ("IpProtocol", (String.to_query v.ip_protocol)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("prefix_list_ids", + (PrefixListIdList.to_json v.prefix_list_ids)); + Some ("ip_ranges", (IpRangeList.to_json v.ip_ranges)); + Some + ("user_id_group_pairs", + (UserIdGroupPairList.to_json v.user_id_group_pairs)); + Util.option_map v.to_port + (fun f -> ("to_port", (Integer.to_json f))); + Util.option_map v.from_port + (fun f -> ("from_port", (Integer.to_json f))); + Some ("ip_protocol", (String.to_json v.ip_protocol))]) + let of_json j = + { + ip_protocol = + (String.of_json (Util.of_option_exn (Json.lookup j "ip_protocol"))); + from_port = + (Util.option_map (Json.lookup j "from_port") Integer.of_json); + to_port = (Util.option_map (Json.lookup j "to_port") Integer.of_json); + user_id_group_pairs = + (UserIdGroupPairList.of_json + (Util.of_option_exn (Json.lookup j "user_id_group_pairs"))); + ip_ranges = + (IpRangeList.of_json + (Util.of_option_exn (Json.lookup j "ip_ranges"))); + prefix_list_ids = + (PrefixListIdList.of_json + (Util.of_option_exn (Json.lookup j "prefix_list_ids"))) + } + end +module InternetGatewayAttachment = + struct + type t = { + vpc_id: String.t ; + state: AttachmentStatus.t } + let make ~vpc_id ~state () = { vpc_id; state } + let parse xml = + Some + { + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) + AttachmentStatus.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("State", (AttachmentStatus.to_query v.state))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("state", (AttachmentStatus.to_json v.state)); + Some ("vpc_id", (String.to_json v.vpc_id))]) + let of_json j = + { + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + state = + (AttachmentStatus.of_json + (Util.of_option_exn (Json.lookup j "state"))) + } + end +module LaunchSpecsList = + struct + type t = SpotFleetLaunchSpecification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SpotFleetLaunchSpecification.parse (Xml.members "item" xml)) + let to_query v = + Query.to_query_list SpotFleetLaunchSpecification.to_query v + let to_json v = `List (List.map SpotFleetLaunchSpecification.to_json v) + let of_json j = Json.to_list SpotFleetLaunchSpecification.of_json j + end +module AvailabilityZoneMessage = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module S3Storage = + struct + type t = + { + bucket: String.t option ; + prefix: String.t option ; + a_w_s_access_key_id: String.t option ; + upload_policy: Blob.t option ; + upload_policy_signature: String.t option } + let make ?bucket ?prefix ?a_w_s_access_key_id ?upload_policy + ?upload_policy_signature () = + { + bucket; + prefix; + a_w_s_access_key_id; + upload_policy; + upload_policy_signature + } + let parse xml = + Some + { + bucket = (Util.option_bind (Xml.member "bucket" xml) String.parse); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse); + a_w_s_access_key_id = + (Util.option_bind (Xml.member "AWSAccessKeyId" xml) String.parse); + upload_policy = + (Util.option_bind (Xml.member "uploadPolicy" xml) Blob.parse); + upload_policy_signature = + (Util.option_bind (Xml.member "uploadPolicySignature" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.upload_policy_signature + (fun f -> + Query.Pair ("UploadPolicySignature", (String.to_query f))); + Util.option_map v.upload_policy + (fun f -> Query.Pair ("UploadPolicy", (Blob.to_query f))); + Util.option_map v.a_w_s_access_key_id + (fun f -> Query.Pair ("AWSAccessKeyId", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.upload_policy_signature + (fun f -> ("upload_policy_signature", (String.to_json f))); + Util.option_map v.upload_policy + (fun f -> ("upload_policy", (Blob.to_json f))); + Util.option_map v.a_w_s_access_key_id + (fun f -> ("a_w_s_access_key_id", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f)))]) + let of_json j = + { + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + a_w_s_access_key_id = + (Util.option_map (Json.lookup j "a_w_s_access_key_id") + String.of_json); + upload_policy = + (Util.option_map (Json.lookup j "upload_policy") Blob.of_json); + upload_policy_signature = + (Util.option_map (Json.lookup j "upload_policy_signature") + String.of_json) + } + end +module VolumeStatusAction = + struct + type t = + { + code: String.t option ; + description: String.t option ; + event_type: String.t option ; + event_id: String.t option } + let make ?code ?description ?event_type ?event_id () = + { code; description; event_type; event_id } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + event_type = + (Util.option_bind (Xml.member "eventType" xml) String.parse); + event_id = + (Util.option_bind (Xml.member "eventId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_id + (fun f -> Query.Pair ("EventId", (String.to_query f))); + Util.option_map v.event_type + (fun f -> Query.Pair ("EventType", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_id + (fun f -> ("event_id", (String.to_json f))); + Util.option_map v.event_type + (fun f -> ("event_type", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + event_type = + (Util.option_map (Json.lookup j "event_type") String.of_json); + event_id = + (Util.option_map (Json.lookup j "event_id") String.of_json) + } + end +module VolumeStatusEvent = + struct + type t = + { + event_type: String.t option ; + description: String.t option ; + not_before: DateTime.t option ; + not_after: DateTime.t option ; + event_id: String.t option } + let make ?event_type ?description ?not_before ?not_after ?event_id + () = { event_type; description; not_before; not_after; event_id } + let parse xml = + Some + { + event_type = + (Util.option_bind (Xml.member "eventType" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + not_before = + (Util.option_bind (Xml.member "notBefore" xml) DateTime.parse); + not_after = + (Util.option_bind (Xml.member "notAfter" xml) DateTime.parse); + event_id = + (Util.option_bind (Xml.member "eventId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_id + (fun f -> Query.Pair ("EventId", (String.to_query f))); + Util.option_map v.not_after + (fun f -> Query.Pair ("NotAfter", (DateTime.to_query f))); + Util.option_map v.not_before + (fun f -> Query.Pair ("NotBefore", (DateTime.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.event_type + (fun f -> Query.Pair ("EventType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_id + (fun f -> ("event_id", (String.to_json f))); + Util.option_map v.not_after + (fun f -> ("not_after", (DateTime.to_json f))); + Util.option_map v.not_before + (fun f -> ("not_before", (DateTime.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.event_type + (fun f -> ("event_type", (String.to_json f)))]) + let of_json j = + { + event_type = + (Util.option_map (Json.lookup j "event_type") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + not_before = + (Util.option_map (Json.lookup j "not_before") DateTime.of_json); + not_after = + (Util.option_map (Json.lookup j "not_after") DateTime.of_json); + event_id = + (Util.option_map (Json.lookup j "event_id") String.of_json) + } + end +module VolumeStatusDetailsList = + struct + type t = VolumeStatusDetails.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VolumeStatusDetails.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VolumeStatusDetails.to_query v + let to_json v = `List (List.map VolumeStatusDetails.to_json v) + let of_json j = Json.to_list VolumeStatusDetails.of_json j + end +module VolumeStatusInfoStatus = + struct + type t = + | Ok + | Impaired + | Insufficient_data + let str_to_t = + [("insufficient-data", Insufficient_data); + ("impaired", Impaired); + ("ok", Ok)] + let t_to_str = + [(Insufficient_data, "insufficient-data"); + (Impaired, "impaired"); + (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VolumeAttachment = + struct + type t = + { + volume_id: String.t option ; + instance_id: String.t option ; + device: String.t option ; + state: VolumeAttachmentState.t option ; + attach_time: DateTime.t option ; + delete_on_termination: Boolean.t option } + let make ?volume_id ?instance_id ?device ?state ?attach_time + ?delete_on_termination () = + { + volume_id; + instance_id; + device; + state; + attach_time; + delete_on_termination + } + let parse xml = + Some + { + volume_id = + (Util.option_bind (Xml.member "volumeId" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + device = (Util.option_bind (Xml.member "device" xml) String.parse); + state = + (Util.option_bind (Xml.member "status" xml) + VolumeAttachmentState.parse); + attach_time = + (Util.option_bind (Xml.member "attachTime" xml) DateTime.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.attach_time + (fun f -> Query.Pair ("AttachTime", (DateTime.to_query f))); + Util.option_map v.state + (fun f -> + Query.Pair ("Status", (VolumeAttachmentState.to_query f))); + Util.option_map v.device + (fun f -> Query.Pair ("Device", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.volume_id + (fun f -> Query.Pair ("VolumeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.attach_time + (fun f -> ("attach_time", (DateTime.to_json f))); + Util.option_map v.state + (fun f -> ("state", (VolumeAttachmentState.to_json f))); + Util.option_map v.device (fun f -> ("device", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.volume_id + (fun f -> ("volume_id", (String.to_json f)))]) + let of_json j = + { + volume_id = + (Util.option_map (Json.lookup j "volume_id") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + device = (Util.option_map (Json.lookup j "device") String.of_json); + state = + (Util.option_map (Json.lookup j "state") + VolumeAttachmentState.of_json); + attach_time = + (Util.option_map (Json.lookup j "attach_time") DateTime.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module VgwTelemetry = + struct + type t = + { + outside_ip_address: String.t option ; + status: TelemetryStatus.t option ; + last_status_change: DateTime.t option ; + status_message: String.t option ; + accepted_route_count: Integer.t option } + let make ?outside_ip_address ?status ?last_status_change + ?status_message ?accepted_route_count () = + { + outside_ip_address; + status; + last_status_change; + status_message; + accepted_route_count + } + let parse xml = + Some + { + outside_ip_address = + (Util.option_bind (Xml.member "outsideIpAddress" xml) + String.parse); + status = + (Util.option_bind (Xml.member "status" xml) TelemetryStatus.parse); + last_status_change = + (Util.option_bind (Xml.member "lastStatusChange" xml) + DateTime.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + accepted_route_count = + (Util.option_bind (Xml.member "acceptedRouteCount" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.accepted_route_count + (fun f -> + Query.Pair ("AcceptedRouteCount", (Integer.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.last_status_change + (fun f -> Query.Pair ("LastStatusChange", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (TelemetryStatus.to_query f))); + Util.option_map v.outside_ip_address + (fun f -> Query.Pair ("OutsideIpAddress", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.accepted_route_count + (fun f -> ("accepted_route_count", (Integer.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.last_status_change + (fun f -> ("last_status_change", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (TelemetryStatus.to_json f))); + Util.option_map v.outside_ip_address + (fun f -> ("outside_ip_address", (String.to_json f)))]) + let of_json j = + { + outside_ip_address = + (Util.option_map (Json.lookup j "outside_ip_address") + String.of_json); + status = + (Util.option_map (Json.lookup j "status") TelemetryStatus.of_json); + last_status_change = + (Util.option_map (Json.lookup j "last_status_change") + DateTime.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + accepted_route_count = + (Util.option_map (Json.lookup j "accepted_route_count") + Integer.of_json) + } + end +module VpnStaticRoute = + struct + type t = + { + destination_cidr_block: String.t option ; + source: VpnStaticRouteSource.t option ; + state: VpnState.t option } + let make ?destination_cidr_block ?source ?state () = + { destination_cidr_block; source; state } + let parse xml = + Some + { + destination_cidr_block = + (Util.option_bind (Xml.member "destinationCidrBlock" xml) + String.parse); + source = + (Util.option_bind (Xml.member "source" xml) + VpnStaticRouteSource.parse); + state = (Util.option_bind (Xml.member "state" xml) VpnState.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> Query.Pair ("State", (VpnState.to_query f))); + Util.option_map v.source + (fun f -> + Query.Pair ("Source", (VpnStaticRouteSource.to_query f))); + Util.option_map v.destination_cidr_block + (fun f -> + Query.Pair ("DestinationCidrBlock", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> ("state", (VpnState.to_json f))); + Util.option_map v.source + (fun f -> ("source", (VpnStaticRouteSource.to_json f))); + Util.option_map v.destination_cidr_block + (fun f -> ("destination_cidr_block", (String.to_json f)))]) + let of_json j = + { + destination_cidr_block = + (Util.option_map (Json.lookup j "destination_cidr_block") + String.of_json); + source = + (Util.option_map (Json.lookup j "source") + VpnStaticRouteSource.of_json); + state = (Util.option_map (Json.lookup j "state") VpnState.of_json) + } + end +module PricingDetail = + struct + type t = { + price: Double.t option ; + count: Integer.t option } + let make ?price ?count () = { price; count } + let parse xml = + Some + { + price = (Util.option_bind (Xml.member "price" xml) Double.parse); + count = (Util.option_bind (Xml.member "count" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.count + (fun f -> Query.Pair ("Count", (Integer.to_query f))); + Util.option_map v.price + (fun f -> Query.Pair ("Price", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.count (fun f -> ("count", (Integer.to_json f))); + Util.option_map v.price (fun f -> ("price", (Double.to_json f)))]) + let of_json j = + { + price = (Util.option_map (Json.lookup j "price") Double.of_json); + count = (Util.option_map (Json.lookup j "count") Integer.of_json) + } + end +module Instance = + struct + type t = + { + instance_id: String.t ; + image_id: String.t ; + state: InstanceState.t ; + private_dns_name: String.t option ; + public_dns_name: String.t option ; + state_transition_reason: String.t option ; + key_name: String.t option ; + ami_launch_index: Integer.t ; + product_codes: ProductCodeList.t ; + instance_type: InstanceType.t ; + launch_time: DateTime.t ; + placement: Placement.t ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + platform: PlatformValues.t option ; + monitoring: Monitoring.t ; + subnet_id: String.t option ; + vpc_id: String.t option ; + private_ip_address: String.t option ; + public_ip_address: String.t option ; + state_reason: StateReason.t option ; + architecture: ArchitectureValues.t ; + root_device_type: DeviceType.t ; + root_device_name: String.t option ; + block_device_mappings: InstanceBlockDeviceMappingList.t ; + virtualization_type: VirtualizationType.t ; + instance_lifecycle: InstanceLifecycleType.t option ; + spot_instance_request_id: String.t option ; + client_token: String.t option ; + tags: TagList.t ; + security_groups: GroupIdentifierList.t ; + source_dest_check: Boolean.t option ; + hypervisor: HypervisorType.t ; + network_interfaces: InstanceNetworkInterfaceList.t ; + iam_instance_profile: IamInstanceProfile.t option ; + ebs_optimized: Boolean.t option ; + sriov_net_support: String.t option } + let make ~instance_id ~image_id ~state ?private_dns_name + ?public_dns_name ?state_transition_reason ?key_name + ~ami_launch_index ?(product_codes= []) ~instance_type ~launch_time + ~placement ?kernel_id ?ramdisk_id ?platform ~monitoring ?subnet_id + ?vpc_id ?private_ip_address ?public_ip_address ?state_reason + ~architecture ~root_device_type ?root_device_name + ?(block_device_mappings= []) ~virtualization_type ?instance_lifecycle + ?spot_instance_request_id ?client_token ?(tags= []) + ?(security_groups= []) ?source_dest_check ~hypervisor + ?(network_interfaces= []) ?iam_instance_profile ?ebs_optimized + ?sriov_net_support () = + { + instance_id; + image_id; + state; + private_dns_name; + public_dns_name; + state_transition_reason; + key_name; + ami_launch_index; + product_codes; + instance_type; + launch_time; + placement; + kernel_id; + ramdisk_id; + platform; + monitoring; + subnet_id; + vpc_id; + private_ip_address; + public_ip_address; + state_reason; + architecture; + root_device_type; + root_device_name; + block_device_mappings; + virtualization_type; + instance_lifecycle; + spot_instance_request_id; + client_token; + tags; + security_groups; + source_dest_check; + hypervisor; + network_interfaces; + iam_instance_profile; + ebs_optimized; + sriov_net_support + } + let parse xml = + Some + { + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + image_id = + (Xml.required "imageId" + (Util.option_bind (Xml.member "imageId" xml) String.parse)); + state = + (Xml.required "instanceState" + (Util.option_bind (Xml.member "instanceState" xml) + InstanceState.parse)); + private_dns_name = + (Util.option_bind (Xml.member "privateDnsName" xml) String.parse); + public_dns_name = + (Util.option_bind (Xml.member "dnsName" xml) String.parse); + state_transition_reason = + (Util.option_bind (Xml.member "reason" xml) String.parse); + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + ami_launch_index = + (Xml.required "amiLaunchIndex" + (Util.option_bind (Xml.member "amiLaunchIndex" xml) + Integer.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)); + instance_type = + (Xml.required "instanceType" + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse)); + launch_time = + (Xml.required "launchTime" + (Util.option_bind (Xml.member "launchTime" xml) DateTime.parse)); + placement = + (Xml.required "placement" + (Util.option_bind (Xml.member "placement" xml) Placement.parse)); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) + PlatformValues.parse); + monitoring = + (Xml.required "monitoring" + (Util.option_bind (Xml.member "monitoring" xml) + Monitoring.parse)); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + public_ip_address = + (Util.option_bind (Xml.member "ipAddress" xml) String.parse); + state_reason = + (Util.option_bind (Xml.member "stateReason" xml) + StateReason.parse); + architecture = + (Xml.required "architecture" + (Util.option_bind (Xml.member "architecture" xml) + ArchitectureValues.parse)); + root_device_type = + (Xml.required "rootDeviceType" + (Util.option_bind (Xml.member "rootDeviceType" xml) + DeviceType.parse)); + root_device_name = + (Util.option_bind (Xml.member "rootDeviceName" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + InstanceBlockDeviceMappingList.parse)); + virtualization_type = + (Xml.required "virtualizationType" + (Util.option_bind (Xml.member "virtualizationType" xml) + VirtualizationType.parse)); + instance_lifecycle = + (Util.option_bind (Xml.member "instanceLifecycle" xml) + InstanceLifecycleType.parse); + spot_instance_request_id = + (Util.option_bind (Xml.member "spotInstanceRequestId" xml) + String.parse); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + Boolean.parse); + hypervisor = + (Xml.required "hypervisor" + (Util.option_bind (Xml.member "hypervisor" xml) + HypervisorType.parse)); + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "networkInterfaceSet" xml) + InstanceNetworkInterfaceList.parse)); + iam_instance_profile = + (Util.option_bind (Xml.member "iamInstanceProfile" xml) + IamInstanceProfile.parse); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> Query.Pair ("SriovNetSupport", (String.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> + Query.Pair + ("IamInstanceProfile", (IamInstanceProfile.to_query f))); + Some (Query.Pair - ( "DhcpConfigurationSet" - , DhcpConfigurationList.to_query v.dhcp_configurations )) - ; Util.option_map v.dhcp_options_id (fun f -> - Query.Pair ("DhcpOptionsId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ("dhcp_configurations", DhcpConfigurationList.to_json v.dhcp_configurations) - ; Util.option_map v.dhcp_options_id (fun f -> - "dhcp_options_id", String.to_json f) - ]) - - let of_json j = - { dhcp_options_id = Util.option_map (Json.lookup j "dhcp_options_id") String.of_json - ; dhcp_configurations = - DhcpConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "dhcp_configurations")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module VpnGateway = struct - type t = - { vpn_gateway_id : String.t option - ; state : VpnState.t option - ; type_ : GatewayType.t option - ; availability_zone : String.t option - ; vpc_attachments : VpcAttachmentList.t - ; tags : TagList.t - } - - let make - ?vpn_gateway_id - ?state - ?type_ - ?availability_zone - ?(vpc_attachments = []) - ?(tags = []) - () = - { vpn_gateway_id; state; type_; availability_zone; vpc_attachments; tags } - - let parse xml = - Some - { vpn_gateway_id = Util.option_bind (Xml.member "vpnGatewayId" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) VpnState.parse - ; type_ = Util.option_bind (Xml.member "type" xml) GatewayType.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; vpc_attachments = - Util.of_option - [] - (Util.option_bind (Xml.member "attachments" xml) VpcAttachmentList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some (Query.Pair ("Attachments", VpcAttachmentList.to_query v.vpc_attachments)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.type_ (fun f -> Query.Pair ("Type", GatewayType.to_query f)) - ; Util.option_map v.state (fun f -> Query.Pair ("State", VpnState.to_query f)) - ; Util.option_map v.vpn_gateway_id (fun f -> - Query.Pair ("VpnGatewayId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("vpc_attachments", VpcAttachmentList.to_json v.vpc_attachments) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.type_ (fun f -> "type_", GatewayType.to_json f) - ; Util.option_map v.state (fun f -> "state", VpnState.to_json f) - ; Util.option_map v.vpn_gateway_id (fun f -> "vpn_gateway_id", String.to_json f) - ]) - - let of_json j = - { vpn_gateway_id = Util.option_map (Json.lookup j "vpn_gateway_id") String.of_json - ; state = Util.option_map (Json.lookup j "state") VpnState.of_json - ; type_ = Util.option_map (Json.lookup j "type_") GatewayType.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; vpc_attachments = - VpcAttachmentList.of_json (Util.of_option_exn (Json.lookup j "vpc_attachments")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ReservedInstancesModification = struct - type t = - { reserved_instances_modification_id : String.t option - ; reserved_instances_ids : ReservedIntancesIds.t - ; modification_results : ReservedInstancesModificationResultList.t - ; create_date : DateTime.t option - ; update_date : DateTime.t option - ; effective_date : DateTime.t option - ; status : String.t option - ; status_message : String.t option - ; client_token : String.t option - } - - let make - ?reserved_instances_modification_id - ?(reserved_instances_ids = []) - ?(modification_results = []) - ?create_date - ?update_date - ?effective_date - ?status - ?status_message - ?client_token - () = - { reserved_instances_modification_id - ; reserved_instances_ids - ; modification_results - ; create_date - ; update_date - ; effective_date - ; status - ; status_message - ; client_token - } - - let parse xml = - Some - { reserved_instances_modification_id = - Util.option_bind (Xml.member "reservedInstancesModificationId" xml) String.parse - ; reserved_instances_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesSet" xml) - ReservedIntancesIds.parse) - ; modification_results = - Util.of_option - [] - (Util.option_bind - (Xml.member "modificationResultSet" xml) - ReservedInstancesModificationResultList.parse) - ; create_date = Util.option_bind (Xml.member "createDate" xml) DateTime.parse - ; update_date = Util.option_bind (Xml.member "updateDate" xml) DateTime.parse - ; effective_date = Util.option_bind (Xml.member "effectiveDate" xml) DateTime.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.effective_date (fun f -> - Query.Pair ("EffectiveDate", DateTime.to_query f)) - ; Util.option_map v.update_date (fun f -> - Query.Pair ("UpdateDate", DateTime.to_query f)) - ; Util.option_map v.create_date (fun f -> - Query.Pair ("CreateDate", DateTime.to_query f)) - ; Some + ("NetworkInterfaceSet", + (InstanceNetworkInterfaceList.to_query v.network_interfaces))); + Some (Query.Pair - ( "ModificationResultSet" - , ReservedInstancesModificationResultList.to_query v.modification_results - )) - ; Some + ("Hypervisor", (HypervisorType.to_query v.hypervisor))); + Util.option_map v.source_dest_check + (fun f -> Query.Pair ("SourceDestCheck", (Boolean.to_query f))); + Some (Query.Pair - ( "ReservedInstancesSet" - , ReservedIntancesIds.to_query v.reserved_instances_ids )) - ; Util.option_map v.reserved_instances_modification_id (fun f -> - Query.Pair ("ReservedInstancesModificationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.effective_date (fun f -> - "effective_date", DateTime.to_json f) - ; Util.option_map v.update_date (fun f -> "update_date", DateTime.to_json f) - ; Util.option_map v.create_date (fun f -> "create_date", DateTime.to_json f) - ; Some - ( "modification_results" - , ReservedInstancesModificationResultList.to_json v.modification_results ) - ; Some - ( "reserved_instances_ids" - , ReservedIntancesIds.to_json v.reserved_instances_ids ) - ; Util.option_map v.reserved_instances_modification_id (fun f -> - "reserved_instances_modification_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_modification_id = - Util.option_map - (Json.lookup j "reserved_instances_modification_id") - String.of_json - ; reserved_instances_ids = - ReservedIntancesIds.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_ids")) - ; modification_results = - ReservedInstancesModificationResultList.of_json - (Util.of_option_exn (Json.lookup j "modification_results")) - ; create_date = Util.option_map (Json.lookup j "create_date") DateTime.of_json - ; update_date = Util.option_map (Json.lookup j "update_date") DateTime.of_json - ; effective_date = Util.option_map (Json.lookup j "effective_date") DateTime.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module ReservedInstances = struct - type t = - { reserved_instances_id : String.t option - ; instance_type : InstanceType.t option - ; availability_zone : String.t option - ; start : DateTime.t option - ; end_ : DateTime.t option - ; duration : Long.t option - ; usage_price : Float.t option - ; fixed_price : Float.t option - ; instance_count : Integer.t option - ; product_description : RIProductDescription.t option - ; state : ReservedInstanceState.t option - ; tags : TagList.t - ; instance_tenancy : Tenancy.t option - ; currency_code : CurrencyCodeValues.t option - ; offering_type : OfferingTypeValues.t option - ; recurring_charges : RecurringChargesList.t - } - - let make - ?reserved_instances_id - ?instance_type - ?availability_zone - ?start - ?end_ - ?duration - ?usage_price - ?fixed_price - ?instance_count - ?product_description - ?state - ?(tags = []) - ?instance_tenancy - ?currency_code - ?offering_type - ?(recurring_charges = []) - () = - { reserved_instances_id - ; instance_type - ; availability_zone - ; start - ; end_ - ; duration - ; usage_price - ; fixed_price - ; instance_count - ; product_description - ; state - ; tags - ; instance_tenancy - ; currency_code - ; offering_type - ; recurring_charges - } - - let parse xml = - Some - { reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; start = Util.option_bind (Xml.member "start" xml) DateTime.parse - ; end_ = Util.option_bind (Xml.member "end" xml) DateTime.parse - ; duration = Util.option_bind (Xml.member "duration" xml) Long.parse - ; usage_price = Util.option_bind (Xml.member "usagePrice" xml) Float.parse - ; fixed_price = Util.option_bind (Xml.member "fixedPrice" xml) Float.parse - ; instance_count = Util.option_bind (Xml.member "instanceCount" xml) Integer.parse - ; product_description = - Util.option_bind - (Xml.member "productDescription" xml) - RIProductDescription.parse - ; state = Util.option_bind (Xml.member "state" xml) ReservedInstanceState.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; instance_tenancy = - Util.option_bind (Xml.member "instanceTenancy" xml) Tenancy.parse - ; currency_code = - Util.option_bind (Xml.member "currencyCode" xml) CurrencyCodeValues.parse - ; offering_type = - Util.option_bind (Xml.member "offeringType" xml) OfferingTypeValues.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "recurringCharges" xml) - RecurringChargesList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("GroupSet", + (GroupIdentifierList.to_query v.security_groups))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.spot_instance_request_id + (fun f -> + Query.Pair ("SpotInstanceRequestId", (String.to_query f))); + Util.option_map v.instance_lifecycle + (fun f -> + Query.Pair + ("InstanceLifecycle", (InstanceLifecycleType.to_query f))); + Some (Query.Pair - ("RecurringCharges", RecurringChargesList.to_query v.recurring_charges)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", OfferingTypeValues.to_query f)) - ; Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", CurrencyCodeValues.to_query f)) - ; Util.option_map v.instance_tenancy (fun f -> - Query.Pair ("InstanceTenancy", Tenancy.to_query f)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.state (fun f -> - Query.Pair ("State", ReservedInstanceState.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", RIProductDescription.to_query f)) - ; Util.option_map v.instance_count (fun f -> - Query.Pair ("InstanceCount", Integer.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Float.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Float.to_query f)) - ; Util.option_map v.duration (fun f -> Query.Pair ("Duration", Long.to_query f)) - ; Util.option_map v.end_ (fun f -> Query.Pair ("End", DateTime.to_query f)) - ; Util.option_map v.start (fun f -> Query.Pair ("Start", DateTime.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("recurring_charges", RecurringChargesList.to_json v.recurring_charges) - ; Util.option_map v.offering_type (fun f -> - "offering_type", OfferingTypeValues.to_json f) - ; Util.option_map v.currency_code (fun f -> - "currency_code", CurrencyCodeValues.to_json f) - ; Util.option_map v.instance_tenancy (fun f -> - "instance_tenancy", Tenancy.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.state (fun f -> "state", ReservedInstanceState.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", RIProductDescription.to_json f) - ; Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Float.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Float.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Long.to_json f) - ; Util.option_map v.end_ (fun f -> "end_", DateTime.to_json f) - ; Util.option_map v.start (fun f -> "start", DateTime.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; start = Util.option_map (Json.lookup j "start") DateTime.of_json - ; end_ = Util.option_map (Json.lookup j "end_") DateTime.of_json - ; duration = Util.option_map (Json.lookup j "duration") Long.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Float.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Float.of_json - ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") RIProductDescription.of_json - ; state = Util.option_map (Json.lookup j "state") ReservedInstanceState.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; instance_tenancy = - Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json - ; currency_code = - Util.option_map (Json.lookup j "currency_code") CurrencyCodeValues.of_json - ; offering_type = - Util.option_map (Json.lookup j "offering_type") OfferingTypeValues.of_json - ; recurring_charges = - RecurringChargesList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - } -end - -module Filter = struct - type t = - { name : String.t - ; values : ValueStringList.t - } - - let make ~name ?(values = []) () = { name; values } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; values = - Util.of_option - [] - (Util.option_bind (Xml.member "Value" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", ValueStringList.to_query v.values)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("values", ValueStringList.to_json v.values) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; values = ValueStringList.of_json (Util.of_option_exn (Json.lookup j "values")) - } -end - -module PlacementGroup = struct - type t = - { group_name : String.t option - ; strategy : PlacementStrategy.t option - ; state : PlacementGroupState.t option - } - - let make ?group_name ?strategy ?state () = { group_name; strategy; state } - - let parse xml = - Some - { group_name = Util.option_bind (Xml.member "groupName" xml) String.parse - ; strategy = Util.option_bind (Xml.member "strategy" xml) PlacementStrategy.parse - ; state = Util.option_bind (Xml.member "state" xml) PlacementGroupState.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> - Query.Pair ("State", PlacementGroupState.to_query f)) - ; Util.option_map v.strategy (fun f -> - Query.Pair ("Strategy", PlacementStrategy.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> "state", PlacementGroupState.to_json f) - ; Util.option_map v.strategy (fun f -> "strategy", PlacementStrategy.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ]) - - let of_json j = - { group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; strategy = Util.option_map (Json.lookup j "strategy") PlacementStrategy.of_json - ; state = Util.option_map (Json.lookup j "state") PlacementGroupState.of_json - } -end - -module KeyPairInfo = struct - type t = - { key_name : String.t option - ; key_fingerprint : String.t option - } - - let make ?key_name ?key_fingerprint () = { key_name; key_fingerprint } - - let parse xml = - Some - { key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; key_fingerprint = Util.option_bind (Xml.member "keyFingerprint" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.key_fingerprint (fun f -> - Query.Pair ("KeyFingerprint", String.to_query f)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.key_fingerprint (fun f -> - "key_fingerprint", String.to_json f) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ]) - - let of_json j = - { key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; key_fingerprint = Util.option_map (Json.lookup j "key_fingerprint") String.of_json - } -end - -module CancelledSpotInstanceRequest = struct - type t = - { spot_instance_request_id : String.t option - ; state : CancelSpotInstanceRequestState.t option - } - - let make ?spot_instance_request_id ?state () = { spot_instance_request_id; state } - - let parse xml = - Some - { spot_instance_request_id = - Util.option_bind (Xml.member "spotInstanceRequestId" xml) String.parse - ; state = - Util.option_bind (Xml.member "state" xml) CancelSpotInstanceRequestState.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> - Query.Pair ("State", CancelSpotInstanceRequestState.to_query f)) - ; Util.option_map v.spot_instance_request_id (fun f -> - Query.Pair ("SpotInstanceRequestId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.state (fun f -> - "state", CancelSpotInstanceRequestState.to_json f) - ; Util.option_map v.spot_instance_request_id (fun f -> - "spot_instance_request_id", String.to_json f) - ]) - - let of_json j = - { spot_instance_request_id = - Util.option_map (Json.lookup j "spot_instance_request_id") String.of_json - ; state = - Util.option_map (Json.lookup j "state") CancelSpotInstanceRequestState.of_json - } -end - -module DatafeedSubscriptionState = struct - type t = - | Active - | Inactive - - let str_to_t = [ "Inactive", Inactive; "Active", Active ] - - let t_to_str = [ Inactive, "Inactive"; Active, "Active" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module LaunchPermissionList = struct - type t = LaunchPermission.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LaunchPermission.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list LaunchPermission.to_query v - - let to_json v = `List (List.map LaunchPermission.to_json v) - - let of_json j = Json.to_list LaunchPermission.of_json j -end - -module ConversionTask = struct - type t = - { conversion_task_id : String.t - ; expiration_time : String.t option - ; import_instance : ImportInstanceTaskDetails.t option - ; import_volume : ImportVolumeTaskDetails.t option - ; state : ConversionTaskState.t - ; status_message : String.t option - ; tags : TagList.t - } - - let make - ~conversion_task_id - ?expiration_time - ?import_instance - ?import_volume - ~state - ?status_message - ?(tags = []) - () = - { conversion_task_id - ; expiration_time - ; import_instance - ; import_volume - ; state - ; status_message - ; tags - } - - let parse xml = - Some - { conversion_task_id = - Xml.required - "conversionTaskId" - (Util.option_bind (Xml.member "conversionTaskId" xml) String.parse) - ; expiration_time = Util.option_bind (Xml.member "expirationTime" xml) String.parse - ; import_instance = - Util.option_bind - (Xml.member "importInstance" xml) - ImportInstanceTaskDetails.parse - ; import_volume = - Util.option_bind (Xml.member "importVolume" xml) ImportVolumeTaskDetails.parse - ; state = - Xml.required - "state" - (Util.option_bind (Xml.member "state" xml) ConversionTaskState.parse) - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Some (Query.Pair ("State", ConversionTaskState.to_query v.state)) - ; Util.option_map v.import_volume (fun f -> - Query.Pair ("ImportVolume", ImportVolumeTaskDetails.to_query f)) - ; Util.option_map v.import_instance (fun f -> - Query.Pair ("ImportInstance", ImportInstanceTaskDetails.to_query f)) - ; Util.option_map v.expiration_time (fun f -> - Query.Pair ("ExpirationTime", String.to_query f)) - ; Some (Query.Pair ("ConversionTaskId", String.to_query v.conversion_task_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Some ("state", ConversionTaskState.to_json v.state) - ; Util.option_map v.import_volume (fun f -> - "import_volume", ImportVolumeTaskDetails.to_json f) - ; Util.option_map v.import_instance (fun f -> - "import_instance", ImportInstanceTaskDetails.to_json f) - ; Util.option_map v.expiration_time (fun f -> - "expiration_time", String.to_json f) - ; Some ("conversion_task_id", String.to_json v.conversion_task_id) - ]) - - let of_json j = - { conversion_task_id = - String.of_json (Util.of_option_exn (Json.lookup j "conversion_task_id")) - ; expiration_time = Util.option_map (Json.lookup j "expiration_time") String.of_json - ; import_instance = - Util.option_map - (Json.lookup j "import_instance") - ImportInstanceTaskDetails.of_json - ; import_volume = - Util.option_map (Json.lookup j "import_volume") ImportVolumeTaskDetails.of_json - ; state = ConversionTaskState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module HistoryRecord = struct - type t = - { timestamp : DateTime.t - ; event_type : EventType.t - ; event_information : EventInformation.t - } - - let make ~timestamp ~event_type ~event_information () = - { timestamp; event_type; event_information } - - let parse xml = - Some - { timestamp = - Xml.required - "timestamp" - (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse) - ; event_type = - Xml.required - "eventType" - (Util.option_bind (Xml.member "eventType" xml) EventType.parse) - ; event_information = - Xml.required - "eventInformation" - (Util.option_bind (Xml.member "eventInformation" xml) EventInformation.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("VirtualizationType", + (VirtualizationType.to_query v.virtualization_type))); + Some (Query.Pair - ("EventInformation", EventInformation.to_query v.event_information)) - ; Some (Query.Pair ("EventType", EventType.to_query v.event_type)) - ; Some (Query.Pair ("Timestamp", DateTime.to_query v.timestamp)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("event_information", EventInformation.to_json v.event_information) - ; Some ("event_type", EventType.to_json v.event_type) - ; Some ("timestamp", DateTime.to_json v.timestamp) - ]) - - let of_json j = - { timestamp = DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp")) - ; event_type = EventType.of_json (Util.of_option_exn (Json.lookup j "event_type")) - ; event_information = - EventInformation.of_json (Util.of_option_exn (Json.lookup j "event_information")) - } -end - -module UnsuccessfulItem = struct - type t = - { resource_id : String.t option - ; error : UnsuccessfulItemError.t - } - - let make ?resource_id ~error () = { resource_id; error } - - let parse xml = - Some - { resource_id = Util.option_bind (Xml.member "resourceId" xml) String.parse - ; error = - Xml.required - "error" - (Util.option_bind (Xml.member "error" xml) UnsuccessfulItemError.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Error", UnsuccessfulItemError.to_query v.error)) - ; Util.option_map v.resource_id (fun f -> - Query.Pair ("ResourceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("error", UnsuccessfulItemError.to_json v.error) - ; Util.option_map v.resource_id (fun f -> "resource_id", String.to_json f) - ]) - - let of_json j = - { resource_id = Util.option_map (Json.lookup j "resource_id") String.of_json - ; error = UnsuccessfulItemError.of_json (Util.of_option_exn (Json.lookup j "error")) - } -end - -module RouteTable = struct - type t = - { route_table_id : String.t option - ; vpc_id : String.t option - ; routes : RouteList.t - ; associations : RouteTableAssociationList.t - ; tags : TagList.t - ; propagating_vgws : PropagatingVgwList.t - } - - let make - ?route_table_id - ?vpc_id - ?(routes = []) - ?(associations = []) - ?(tags = []) - ?(propagating_vgws = []) - () = - { route_table_id; vpc_id; routes; associations; tags; propagating_vgws } - - let parse xml = - Some - { route_table_id = Util.option_bind (Xml.member "routeTableId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; routes = - Util.of_option [] (Util.option_bind (Xml.member "routeSet" xml) RouteList.parse) - ; associations = - Util.of_option - [] - (Util.option_bind - (Xml.member "associationSet" xml) - RouteTableAssociationList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; propagating_vgws = - Util.of_option - [] - (Util.option_bind - (Xml.member "propagatingVgwSet" xml) - PropagatingVgwList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("BlockDeviceMapping", + (InstanceBlockDeviceMappingList.to_query + v.block_device_mappings))); + Util.option_map v.root_device_name + (fun f -> Query.Pair ("RootDeviceName", (String.to_query f))); + Some (Query.Pair - ("PropagatingVgwSet", PropagatingVgwList.to_query v.propagating_vgws)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("RootDeviceType", (DeviceType.to_query v.root_device_type))); + Some (Query.Pair - ("AssociationSet", RouteTableAssociationList.to_query v.associations)) - ; Some (Query.Pair ("RouteSet", RouteList.to_query v.routes)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.route_table_id (fun f -> - Query.Pair ("RouteTableId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("propagating_vgws", PropagatingVgwList.to_json v.propagating_vgws) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("associations", RouteTableAssociationList.to_json v.associations) - ; Some ("routes", RouteList.to_json v.routes) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.route_table_id (fun f -> "route_table_id", String.to_json f) - ]) - - let of_json j = - { route_table_id = Util.option_map (Json.lookup j "route_table_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; routes = RouteList.of_json (Util.of_option_exn (Json.lookup j "routes")) - ; associations = - RouteTableAssociationList.of_json - (Util.of_option_exn (Json.lookup j "associations")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; propagating_vgws = - PropagatingVgwList.of_json (Util.of_option_exn (Json.lookup j "propagating_vgws")) - } -end - -module ReservedInstancesListing = struct - type t = - { reserved_instances_listing_id : String.t option - ; reserved_instances_id : String.t option - ; create_date : DateTime.t option - ; update_date : DateTime.t option - ; status : ListingStatus.t option - ; status_message : String.t option - ; instance_counts : InstanceCountList.t - ; price_schedules : PriceScheduleList.t - ; tags : TagList.t - ; client_token : String.t option - } - - let make - ?reserved_instances_listing_id - ?reserved_instances_id - ?create_date - ?update_date - ?status - ?status_message - ?(instance_counts = []) - ?(price_schedules = []) - ?(tags = []) - ?client_token - () = - { reserved_instances_listing_id - ; reserved_instances_id - ; create_date - ; update_date - ; status - ; status_message - ; instance_counts - ; price_schedules - ; tags - ; client_token - } - - let parse xml = - Some - { reserved_instances_listing_id = - Util.option_bind (Xml.member "reservedInstancesListingId" xml) String.parse - ; reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - ; create_date = Util.option_bind (Xml.member "createDate" xml) DateTime.parse - ; update_date = Util.option_bind (Xml.member "updateDate" xml) DateTime.parse - ; status = Util.option_bind (Xml.member "status" xml) ListingStatus.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; instance_counts = - Util.of_option - [] - (Util.option_bind (Xml.member "instanceCounts" xml) InstanceCountList.parse) - ; price_schedules = - Util.of_option - [] - (Util.option_bind (Xml.member "priceSchedules" xml) PriceScheduleList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some - (Query.Pair ("PriceSchedules", PriceScheduleList.to_query v.price_schedules)) - ; Some - (Query.Pair ("InstanceCounts", InstanceCountList.to_query v.instance_counts)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", ListingStatus.to_query f)) - ; Util.option_map v.update_date (fun f -> - Query.Pair ("UpdateDate", DateTime.to_query f)) - ; Util.option_map v.create_date (fun f -> - Query.Pair ("CreateDate", DateTime.to_query f)) - ; Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ; Util.option_map v.reserved_instances_listing_id (fun f -> - Query.Pair ("ReservedInstancesListingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("price_schedules", PriceScheduleList.to_json v.price_schedules) - ; Some ("instance_counts", InstanceCountList.to_json v.instance_counts) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.status (fun f -> "status", ListingStatus.to_json f) - ; Util.option_map v.update_date (fun f -> "update_date", DateTime.to_json f) - ; Util.option_map v.create_date (fun f -> "create_date", DateTime.to_json f) - ; Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ; Util.option_map v.reserved_instances_listing_id (fun f -> - "reserved_instances_listing_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_listing_id = - Util.option_map (Json.lookup j "reserved_instances_listing_id") String.of_json - ; reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - ; create_date = Util.option_map (Json.lookup j "create_date") DateTime.of_json - ; update_date = Util.option_map (Json.lookup j "update_date") DateTime.of_json - ; status = Util.option_map (Json.lookup j "status") ListingStatus.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; instance_counts = - InstanceCountList.of_json (Util.of_option_exn (Json.lookup j "instance_counts")) - ; price_schedules = - PriceScheduleList.of_json (Util.of_option_exn (Json.lookup j "price_schedules")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module InstanceStateChange = struct - type t = - { instance_id : String.t option - ; current_state : InstanceState.t option - ; previous_state : InstanceState.t option - } - - let make ?instance_id ?current_state ?previous_state () = - { instance_id; current_state; previous_state } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; current_state = - Util.option_bind (Xml.member "currentState" xml) InstanceState.parse - ; previous_state = - Util.option_bind (Xml.member "previousState" xml) InstanceState.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.previous_state (fun f -> - Query.Pair ("PreviousState", InstanceState.to_query f)) - ; Util.option_map v.current_state (fun f -> - Query.Pair ("CurrentState", InstanceState.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.previous_state (fun f -> - "previous_state", InstanceState.to_json f) - ; Util.option_map v.current_state (fun f -> - "current_state", InstanceState.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; current_state = - Util.option_map (Json.lookup j "current_state") InstanceState.of_json - ; previous_state = - Util.option_map (Json.lookup j "previous_state") InstanceState.of_json - } -end - -module MovingAddressStatus = struct - type t = - { public_ip : String.t option - ; move_status : MoveStatus.t option - } - - let make ?public_ip ?move_status () = { public_ip; move_status } - - let parse xml = - Some - { public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - ; move_status = Util.option_bind (Xml.member "moveStatus" xml) MoveStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.move_status (fun f -> - Query.Pair ("MoveStatus", MoveStatus.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.move_status (fun f -> "move_status", MoveStatus.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ]) - - let of_json j = - { public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; move_status = Util.option_map (Json.lookup j "move_status") MoveStatus.of_json - } -end - -module InstanceStatus = struct - type t = - { instance_id : String.t option - ; availability_zone : String.t option - ; events : InstanceStatusEventList.t - ; instance_state : InstanceState.t option - ; system_status : InstanceStatusSummary.t option - ; instance_status : InstanceStatusSummary.t option - } - - let make - ?instance_id - ?availability_zone - ?(events = []) - ?instance_state - ?system_status - ?instance_status - () = - { instance_id - ; availability_zone - ; events - ; instance_state - ; system_status - ; instance_status - } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; events = - Util.of_option - [] - (Util.option_bind (Xml.member "eventsSet" xml) InstanceStatusEventList.parse) - ; instance_state = - Util.option_bind (Xml.member "instanceState" xml) InstanceState.parse - ; system_status = - Util.option_bind (Xml.member "systemStatus" xml) InstanceStatusSummary.parse - ; instance_status = - Util.option_bind (Xml.member "instanceStatus" xml) InstanceStatusSummary.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_status (fun f -> - Query.Pair ("InstanceStatus", InstanceStatusSummary.to_query f)) - ; Util.option_map v.system_status (fun f -> - Query.Pair ("SystemStatus", InstanceStatusSummary.to_query f)) - ; Util.option_map v.instance_state (fun f -> - Query.Pair ("InstanceState", InstanceState.to_query f)) - ; Some (Query.Pair ("EventsSet", InstanceStatusEventList.to_query v.events)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_status (fun f -> - "instance_status", InstanceStatusSummary.to_json f) - ; Util.option_map v.system_status (fun f -> - "system_status", InstanceStatusSummary.to_json f) - ; Util.option_map v.instance_state (fun f -> - "instance_state", InstanceState.to_json f) - ; Some ("events", InstanceStatusEventList.to_json v.events) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; events = - InstanceStatusEventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; instance_state = - Util.option_map (Json.lookup j "instance_state") InstanceState.of_json - ; system_status = - Util.option_map (Json.lookup j "system_status") InstanceStatusSummary.of_json - ; instance_status = - Util.option_map (Json.lookup j "instance_status") InstanceStatusSummary.of_json - } -end - -module Image = struct - type t = - { image_id : String.t - ; image_location : String.t - ; state : ImageState.t - ; owner_id : String.t - ; creation_date : String.t option - ; public : Boolean.t - ; product_codes : ProductCodeList.t - ; architecture : ArchitectureValues.t - ; image_type : ImageTypeValues.t - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; platform : PlatformValues.t option - ; sriov_net_support : String.t option - ; state_reason : StateReason.t option - ; image_owner_alias : String.t option - ; name : String.t option - ; description : String.t option - ; root_device_type : DeviceType.t - ; root_device_name : String.t option - ; block_device_mappings : BlockDeviceMappingList.t - ; virtualization_type : VirtualizationType.t - ; tags : TagList.t - ; hypervisor : HypervisorType.t - } - - let make - ~image_id - ~image_location - ~state - ~owner_id - ?creation_date - ~public - ?(product_codes = []) - ~architecture - ~image_type - ?kernel_id - ?ramdisk_id - ?platform - ?sriov_net_support - ?state_reason - ?image_owner_alias - ?name - ?description - ~root_device_type - ?root_device_name - ?(block_device_mappings = []) - ~virtualization_type - ?(tags = []) - ~hypervisor - () = - { image_id - ; image_location - ; state - ; owner_id - ; creation_date - ; public - ; product_codes - ; architecture - ; image_type - ; kernel_id - ; ramdisk_id - ; platform - ; sriov_net_support - ; state_reason - ; image_owner_alias - ; name - ; description - ; root_device_type - ; root_device_name - ; block_device_mappings - ; virtualization_type - ; tags - ; hypervisor - } - - let parse xml = - Some - { image_id = - Xml.required - "imageId" - (Util.option_bind (Xml.member "imageId" xml) String.parse) - ; image_location = - Xml.required - "imageLocation" - (Util.option_bind (Xml.member "imageLocation" xml) String.parse) - ; state = - Xml.required - "imageState" - (Util.option_bind (Xml.member "imageState" xml) ImageState.parse) - ; owner_id = - Xml.required - "imageOwnerId" - (Util.option_bind (Xml.member "imageOwnerId" xml) String.parse) - ; creation_date = Util.option_bind (Xml.member "creationDate" xml) String.parse - ; public = - Xml.required - "isPublic" - (Util.option_bind (Xml.member "isPublic" xml) Boolean.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - ; architecture = - Xml.required - "architecture" - (Util.option_bind (Xml.member "architecture" xml) ArchitectureValues.parse) - ; image_type = - Xml.required - "imageType" - (Util.option_bind (Xml.member "imageType" xml) ImageTypeValues.parse) - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) PlatformValues.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse - ; state_reason = Util.option_bind (Xml.member "stateReason" xml) StateReason.parse - ; image_owner_alias = - Util.option_bind (Xml.member "imageOwnerAlias" xml) String.parse - ; name = Util.option_bind (Xml.member "name" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; root_device_type = - Xml.required - "rootDeviceType" - (Util.option_bind (Xml.member "rootDeviceType" xml) DeviceType.parse) - ; root_device_name = Util.option_bind (Xml.member "rootDeviceName" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingList.parse) - ; virtualization_type = - Xml.required - "virtualizationType" - (Util.option_bind - (Xml.member "virtualizationType" xml) - VirtualizationType.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; hypervisor = - Xml.required - "hypervisor" - (Util.option_bind (Xml.member "hypervisor" xml) HypervisorType.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Hypervisor", HypervisorType.to_query v.hypervisor)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("Architecture", + (ArchitectureValues.to_query v.architecture))); + Util.option_map v.state_reason + (fun f -> Query.Pair ("StateReason", (StateReason.to_query f))); + Util.option_map v.public_ip_address + (fun f -> Query.Pair ("IpAddress", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Some + (Query.Pair ("Monitoring", (Monitoring.to_query v.monitoring))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (PlatformValues.to_query f))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Some (Query.Pair ("Placement", (Placement.to_query v.placement))); + Some + (Query.Pair ("LaunchTime", (DateTime.to_query v.launch_time))); + Some (Query.Pair - ("VirtualizationType", VirtualizationType.to_query v.virtualization_type)) - ; Some + ("InstanceType", (InstanceType.to_query v.instance_type))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.root_device_name (fun f -> - Query.Pair ("RootDeviceName", String.to_query f)) - ; Some (Query.Pair ("RootDeviceType", DeviceType.to_query v.root_device_type)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ; Util.option_map v.image_owner_alias (fun f -> - Query.Pair ("ImageOwnerAlias", String.to_query f)) - ; Util.option_map v.state_reason (fun f -> - Query.Pair ("StateReason", StateReason.to_query f)) - ; Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", String.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", PlatformValues.to_query f)) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Some (Query.Pair ("ImageType", ImageTypeValues.to_query v.image_type)) - ; Some (Query.Pair ("Architecture", ArchitectureValues.to_query v.architecture)) - ; Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Some (Query.Pair ("IsPublic", Boolean.to_query v.public)) - ; Util.option_map v.creation_date (fun f -> - Query.Pair ("CreationDate", String.to_query f)) - ; Some (Query.Pair ("ImageOwnerId", String.to_query v.owner_id)) - ; Some (Query.Pair ("ImageState", ImageState.to_query v.state)) - ; Some (Query.Pair ("ImageLocation", String.to_query v.image_location)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("hypervisor", HypervisorType.to_json v.hypervisor) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("virtualization_type", VirtualizationType.to_json v.virtualization_type) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.root_device_name (fun f -> - "root_device_name", String.to_json f) - ; Some ("root_device_type", DeviceType.to_json v.root_device_type) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ; Util.option_map v.image_owner_alias (fun f -> - "image_owner_alias", String.to_json f) - ; Util.option_map v.state_reason (fun f -> "state_reason", StateReason.to_json f) - ; Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", String.to_json f) - ; Util.option_map v.platform (fun f -> "platform", PlatformValues.to_json f) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Some ("image_type", ImageTypeValues.to_json v.image_type) - ; Some ("architecture", ArchitectureValues.to_json v.architecture) - ; Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Some ("public", Boolean.to_json v.public) - ; Util.option_map v.creation_date (fun f -> "creation_date", String.to_json f) - ; Some ("owner_id", String.to_json v.owner_id) - ; Some ("state", ImageState.to_json v.state) - ; Some ("image_location", String.to_json v.image_location) - ; Some ("image_id", String.to_json v.image_id) - ]) - - let of_json j = - { image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; image_location = - String.of_json (Util.of_option_exn (Json.lookup j "image_location")) - ; state = ImageState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; owner_id = String.of_json (Util.of_option_exn (Json.lookup j "owner_id")) - ; creation_date = Util.option_map (Json.lookup j "creation_date") String.of_json - ; public = Boolean.of_json (Util.of_option_exn (Json.lookup j "public")) - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - ; architecture = - ArchitectureValues.of_json (Util.of_option_exn (Json.lookup j "architecture")) - ; image_type = - ImageTypeValues.of_json (Util.of_option_exn (Json.lookup j "image_type")) - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") PlatformValues.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") String.of_json - ; state_reason = Util.option_map (Json.lookup j "state_reason") StateReason.of_json - ; image_owner_alias = - Util.option_map (Json.lookup j "image_owner_alias") String.of_json - ; name = Util.option_map (Json.lookup j "name") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; root_device_type = - DeviceType.of_json (Util.of_option_exn (Json.lookup j "root_device_type")) - ; root_device_name = Util.option_map (Json.lookup j "root_device_name") String.of_json - ; block_device_mappings = - BlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; virtualization_type = - VirtualizationType.of_json - (Util.of_option_exn (Json.lookup j "virtualization_type")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; hypervisor = - HypervisorType.of_json (Util.of_option_exn (Json.lookup j "hypervisor")) - } -end - -module PriceScheduleSpecification = struct - type t = - { term : Long.t option - ; price : Double.t option - ; currency_code : CurrencyCodeValues.t option - } - - let make ?term ?price ?currency_code () = { term; price; currency_code } - - let parse xml = - Some - { term = Util.option_bind (Xml.member "term" xml) Long.parse - ; price = Util.option_bind (Xml.member "price" xml) Double.parse - ; currency_code = - Util.option_bind (Xml.member "currencyCode" xml) CurrencyCodeValues.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", CurrencyCodeValues.to_query f)) - ; Util.option_map v.price (fun f -> Query.Pair ("Price", Double.to_query f)) - ; Util.option_map v.term (fun f -> Query.Pair ("Term", Long.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.currency_code (fun f -> - "currency_code", CurrencyCodeValues.to_json f) - ; Util.option_map v.price (fun f -> "price", Double.to_json f) - ; Util.option_map v.term (fun f -> "term", Long.to_json f) - ]) - - let of_json j = - { term = Util.option_map (Json.lookup j "term") Long.of_json - ; price = Util.option_map (Json.lookup j "price") Double.of_json - ; currency_code = - Util.option_map (Json.lookup j "currency_code") CurrencyCodeValues.of_json - } -end - -module ImportSnapshotTask = struct - type t = - { import_task_id : String.t option - ; snapshot_task_detail : SnapshotTaskDetail.t option - ; description : String.t option - } - - let make ?import_task_id ?snapshot_task_detail ?description () = - { import_task_id; snapshot_task_detail; description } - - let parse xml = - Some - { import_task_id = Util.option_bind (Xml.member "importTaskId" xml) String.parse - ; snapshot_task_detail = - Util.option_bind (Xml.member "snapshotTaskDetail" xml) SnapshotTaskDetail.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.snapshot_task_detail (fun f -> - Query.Pair ("SnapshotTaskDetail", SnapshotTaskDetail.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.snapshot_task_detail (fun f -> - "snapshot_task_detail", SnapshotTaskDetail.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ]) - - let of_json j = - { import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; snapshot_task_detail = - Util.option_map (Json.lookup j "snapshot_task_detail") SnapshotTaskDetail.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module SpotInstanceRequest = struct - type t = - { spot_instance_request_id : String.t option - ; spot_price : String.t option - ; type_ : SpotInstanceType.t option - ; state : SpotInstanceState.t option - ; fault : SpotInstanceStateFault.t option - ; status : SpotInstanceStatus.t option - ; valid_from : DateTime.t option - ; valid_until : DateTime.t option - ; launch_group : String.t option - ; availability_zone_group : String.t option - ; launch_specification : LaunchSpecification.t option - ; instance_id : String.t option - ; create_time : DateTime.t option - ; product_description : RIProductDescription.t option - ; tags : TagList.t - ; launched_availability_zone : String.t option - } - - let make - ?spot_instance_request_id - ?spot_price - ?type_ - ?state - ?fault - ?status - ?valid_from - ?valid_until - ?launch_group - ?availability_zone_group - ?launch_specification - ?instance_id - ?create_time - ?product_description - ?(tags = []) - ?launched_availability_zone - () = - { spot_instance_request_id - ; spot_price - ; type_ - ; state - ; fault - ; status - ; valid_from - ; valid_until - ; launch_group - ; availability_zone_group - ; launch_specification - ; instance_id - ; create_time - ; product_description - ; tags - ; launched_availability_zone - } - - let parse xml = - Some - { spot_instance_request_id = - Util.option_bind (Xml.member "spotInstanceRequestId" xml) String.parse - ; spot_price = Util.option_bind (Xml.member "spotPrice" xml) String.parse - ; type_ = Util.option_bind (Xml.member "type" xml) SpotInstanceType.parse - ; state = Util.option_bind (Xml.member "state" xml) SpotInstanceState.parse - ; fault = Util.option_bind (Xml.member "fault" xml) SpotInstanceStateFault.parse - ; status = Util.option_bind (Xml.member "status" xml) SpotInstanceStatus.parse - ; valid_from = Util.option_bind (Xml.member "validFrom" xml) DateTime.parse - ; valid_until = Util.option_bind (Xml.member "validUntil" xml) DateTime.parse - ; launch_group = Util.option_bind (Xml.member "launchGroup" xml) String.parse - ; availability_zone_group = - Util.option_bind (Xml.member "availabilityZoneGroup" xml) String.parse - ; launch_specification = - Util.option_bind - (Xml.member "launchSpecification" xml) - LaunchSpecification.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; create_time = Util.option_bind (Xml.member "createTime" xml) DateTime.parse - ; product_description = - Util.option_bind - (Xml.member "productDescription" xml) - RIProductDescription.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; launched_availability_zone = - Util.option_bind (Xml.member "launchedAvailabilityZone" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.launched_availability_zone (fun f -> - Query.Pair ("LaunchedAvailabilityZone", String.to_query f)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", RIProductDescription.to_query f)) - ; Util.option_map v.create_time (fun f -> - Query.Pair ("CreateTime", DateTime.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.launch_specification (fun f -> - Query.Pair ("LaunchSpecification", LaunchSpecification.to_query f)) - ; Util.option_map v.availability_zone_group (fun f -> - Query.Pair ("AvailabilityZoneGroup", String.to_query f)) - ; Util.option_map v.launch_group (fun f -> - Query.Pair ("LaunchGroup", String.to_query f)) - ; Util.option_map v.valid_until (fun f -> - Query.Pair ("ValidUntil", DateTime.to_query f)) - ; Util.option_map v.valid_from (fun f -> - Query.Pair ("ValidFrom", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", SpotInstanceStatus.to_query f)) - ; Util.option_map v.fault (fun f -> - Query.Pair ("Fault", SpotInstanceStateFault.to_query f)) - ; Util.option_map v.state (fun f -> - Query.Pair ("State", SpotInstanceState.to_query f)) - ; Util.option_map v.type_ (fun f -> - Query.Pair ("Type", SpotInstanceType.to_query f)) - ; Util.option_map v.spot_price (fun f -> - Query.Pair ("SpotPrice", String.to_query f)) - ; Util.option_map v.spot_instance_request_id (fun f -> - Query.Pair ("SpotInstanceRequestId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.launched_availability_zone (fun f -> - "launched_availability_zone", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.product_description (fun f -> - "product_description", RIProductDescription.to_json f) - ; Util.option_map v.create_time (fun f -> "create_time", DateTime.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.launch_specification (fun f -> - "launch_specification", LaunchSpecification.to_json f) - ; Util.option_map v.availability_zone_group (fun f -> - "availability_zone_group", String.to_json f) - ; Util.option_map v.launch_group (fun f -> "launch_group", String.to_json f) - ; Util.option_map v.valid_until (fun f -> "valid_until", DateTime.to_json f) - ; Util.option_map v.valid_from (fun f -> "valid_from", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", SpotInstanceStatus.to_json f) - ; Util.option_map v.fault (fun f -> "fault", SpotInstanceStateFault.to_json f) - ; Util.option_map v.state (fun f -> "state", SpotInstanceState.to_json f) - ; Util.option_map v.type_ (fun f -> "type_", SpotInstanceType.to_json f) - ; Util.option_map v.spot_price (fun f -> "spot_price", String.to_json f) - ; Util.option_map v.spot_instance_request_id (fun f -> - "spot_instance_request_id", String.to_json f) - ]) - - let of_json j = - { spot_instance_request_id = - Util.option_map (Json.lookup j "spot_instance_request_id") String.of_json - ; spot_price = Util.option_map (Json.lookup j "spot_price") String.of_json - ; type_ = Util.option_map (Json.lookup j "type_") SpotInstanceType.of_json - ; state = Util.option_map (Json.lookup j "state") SpotInstanceState.of_json - ; fault = Util.option_map (Json.lookup j "fault") SpotInstanceStateFault.of_json - ; status = Util.option_map (Json.lookup j "status") SpotInstanceStatus.of_json - ; valid_from = Util.option_map (Json.lookup j "valid_from") DateTime.of_json - ; valid_until = Util.option_map (Json.lookup j "valid_until") DateTime.of_json - ; launch_group = Util.option_map (Json.lookup j "launch_group") String.of_json - ; availability_zone_group = - Util.option_map (Json.lookup j "availability_zone_group") String.of_json - ; launch_specification = - Util.option_map (Json.lookup j "launch_specification") LaunchSpecification.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; create_time = Util.option_map (Json.lookup j "create_time") DateTime.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") RIProductDescription.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; launched_availability_zone = - Util.option_map (Json.lookup j "launched_availability_zone") String.of_json - } -end - -module ExportTask = struct - type t = - { export_task_id : String.t - ; description : String.t - ; state : ExportTaskState.t - ; status_message : String.t - ; instance_export_details : InstanceExportDetails.t - ; export_to_s3_task : ExportToS3Task.t - } - - let make - ~export_task_id - ~description - ~state - ~status_message - ~instance_export_details - ~export_to_s3_task - () = - { export_task_id - ; description - ; state - ; status_message - ; instance_export_details - ; export_to_s3_task - } - - let parse xml = - Some - { export_task_id = - Xml.required - "exportTaskId" - (Util.option_bind (Xml.member "exportTaskId" xml) String.parse) - ; description = - Xml.required - "description" + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Some + (Query.Pair + ("AmiLaunchIndex", (Integer.to_query v.ami_launch_index))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Util.option_map v.state_transition_reason + (fun f -> Query.Pair ("Reason", (String.to_query f))); + Util.option_map v.public_dns_name + (fun f -> Query.Pair ("DnsName", (String.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Some + (Query.Pair ("InstanceState", (InstanceState.to_query v.state))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (String.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> + ("iam_instance_profile", (IamInstanceProfile.to_json f))); + Some + ("network_interfaces", + (InstanceNetworkInterfaceList.to_json v.network_interfaces)); + Some ("hypervisor", (HypervisorType.to_json v.hypervisor)); + Util.option_map v.source_dest_check + (fun f -> ("source_dest_check", (Boolean.to_json f))); + Some + ("security_groups", + (GroupIdentifierList.to_json v.security_groups)); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.spot_instance_request_id + (fun f -> ("spot_instance_request_id", (String.to_json f))); + Util.option_map v.instance_lifecycle + (fun f -> + ("instance_lifecycle", (InstanceLifecycleType.to_json f))); + Some + ("virtualization_type", + (VirtualizationType.to_json v.virtualization_type)); + Some + ("block_device_mappings", + (InstanceBlockDeviceMappingList.to_json + v.block_device_mappings)); + Util.option_map v.root_device_name + (fun f -> ("root_device_name", (String.to_json f))); + Some ("root_device_type", (DeviceType.to_json v.root_device_type)); + Some ("architecture", (ArchitectureValues.to_json v.architecture)); + Util.option_map v.state_reason + (fun f -> ("state_reason", (StateReason.to_json f))); + Util.option_map v.public_ip_address + (fun f -> ("public_ip_address", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Some ("monitoring", (Monitoring.to_json v.monitoring)); + Util.option_map v.platform + (fun f -> ("platform", (PlatformValues.to_json f))); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Some ("placement", (Placement.to_json v.placement)); + Some ("launch_time", (DateTime.to_json v.launch_time)); + Some ("instance_type", (InstanceType.to_json v.instance_type)); + Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Some ("ami_launch_index", (Integer.to_json v.ami_launch_index)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Util.option_map v.state_transition_reason + (fun f -> ("state_transition_reason", (String.to_json f))); + Util.option_map v.public_dns_name + (fun f -> ("public_dns_name", (String.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Some ("state", (InstanceState.to_json v.state)); + Some ("image_id", (String.to_json v.image_id)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + state = + (InstanceState.of_json (Util.of_option_exn (Json.lookup j "state"))); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + public_dns_name = + (Util.option_map (Json.lookup j "public_dns_name") String.of_json); + state_transition_reason = + (Util.option_map (Json.lookup j "state_transition_reason") + String.of_json); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + ami_launch_index = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "ami_launch_index"))); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))); + instance_type = + (InstanceType.of_json + (Util.of_option_exn (Json.lookup j "instance_type"))); + launch_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "launch_time"))); + placement = + (Placement.of_json (Util.of_option_exn (Json.lookup j "placement"))); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") PlatformValues.of_json); + monitoring = + (Monitoring.of_json + (Util.of_option_exn (Json.lookup j "monitoring"))); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + public_ip_address = + (Util.option_map (Json.lookup j "public_ip_address") String.of_json); + state_reason = + (Util.option_map (Json.lookup j "state_reason") StateReason.of_json); + architecture = + (ArchitectureValues.of_json + (Util.of_option_exn (Json.lookup j "architecture"))); + root_device_type = + (DeviceType.of_json + (Util.of_option_exn (Json.lookup j "root_device_type"))); + root_device_name = + (Util.option_map (Json.lookup j "root_device_name") String.of_json); + block_device_mappings = + (InstanceBlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + virtualization_type = + (VirtualizationType.of_json + (Util.of_option_exn (Json.lookup j "virtualization_type"))); + instance_lifecycle = + (Util.option_map (Json.lookup j "instance_lifecycle") + InstanceLifecycleType.of_json); + spot_instance_request_id = + (Util.option_map (Json.lookup j "spot_instance_request_id") + String.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + security_groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + Boolean.of_json); + hypervisor = + (HypervisorType.of_json + (Util.of_option_exn (Json.lookup j "hypervisor"))); + network_interfaces = + (InstanceNetworkInterfaceList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + IamInstanceProfile.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") String.of_json) + } + end +module VpcPeeringConnectionStateReasonCode = + struct + type t = + | Initiating_request + | Pending_acceptance + | Active + | Deleted + | Rejected + | Failed + | Expired + | Provisioning + | Deleting + let str_to_t = + [("deleting", Deleting); + ("provisioning", Provisioning); + ("expired", Expired); + ("failed", Failed); + ("rejected", Rejected); + ("deleted", Deleted); + ("active", Active); + ("pending-acceptance", Pending_acceptance); + ("initiating-request", Initiating_request)] + let t_to_str = + [(Deleting, "deleting"); + (Provisioning, "provisioning"); + (Expired, "expired"); + (Failed, "failed"); + (Rejected, "rejected"); + (Deleted, "deleted"); + (Active, "active"); + (Pending_acceptance, "pending-acceptance"); + (Initiating_request, "initiating-request")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module NetworkAclAssociation = + struct + type t = + { + network_acl_association_id: String.t option ; + network_acl_id: String.t option ; + subnet_id: String.t option } + let make ?network_acl_association_id ?network_acl_id ?subnet_id () = + { network_acl_association_id; network_acl_id; subnet_id } + let parse xml = + Some + { + network_acl_association_id = + (Util.option_bind (Xml.member "networkAclAssociationId" xml) + String.parse); + network_acl_id = + (Util.option_bind (Xml.member "networkAclId" xml) String.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.network_acl_id + (fun f -> Query.Pair ("NetworkAclId", (String.to_query f))); + Util.option_map v.network_acl_association_id + (fun f -> + Query.Pair ("NetworkAclAssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.network_acl_id + (fun f -> ("network_acl_id", (String.to_json f))); + Util.option_map v.network_acl_association_id + (fun f -> ("network_acl_association_id", (String.to_json f)))]) + let of_json j = + { + network_acl_association_id = + (Util.option_map (Json.lookup j "network_acl_association_id") + String.of_json); + network_acl_id = + (Util.option_map (Json.lookup j "network_acl_id") String.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json) + } + end +module NetworkAclEntry = + struct + type t = + { + rule_number: Integer.t option ; + protocol: String.t option ; + rule_action: RuleAction.t option ; + egress: Boolean.t option ; + cidr_block: String.t option ; + icmp_type_code: IcmpTypeCode.t option ; + port_range: PortRange.t option } + let make ?rule_number ?protocol ?rule_action ?egress ?cidr_block + ?icmp_type_code ?port_range () = + { + rule_number; + protocol; + rule_action; + egress; + cidr_block; + icmp_type_code; + port_range + } + let parse xml = + Some + { + rule_number = + (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse); + protocol = + (Util.option_bind (Xml.member "protocol" xml) String.parse); + rule_action = + (Util.option_bind (Xml.member "ruleAction" xml) RuleAction.parse); + egress = (Util.option_bind (Xml.member "egress" xml) Boolean.parse); + cidr_block = + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse); + icmp_type_code = + (Util.option_bind (Xml.member "icmpTypeCode" xml) + IcmpTypeCode.parse); + port_range = + (Util.option_bind (Xml.member "portRange" xml) PortRange.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> Query.Pair ("PortRange", (PortRange.to_query f))); + Util.option_map v.icmp_type_code + (fun f -> Query.Pair ("IcmpTypeCode", (IcmpTypeCode.to_query f))); + Util.option_map v.cidr_block + (fun f -> Query.Pair ("CidrBlock", (String.to_query f))); + Util.option_map v.egress + (fun f -> Query.Pair ("Egress", (Boolean.to_query f))); + Util.option_map v.rule_action + (fun f -> Query.Pair ("RuleAction", (RuleAction.to_query f))); + Util.option_map v.protocol + (fun f -> Query.Pair ("Protocol", (String.to_query f))); + Util.option_map v.rule_number + (fun f -> Query.Pair ("RuleNumber", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> ("port_range", (PortRange.to_json f))); + Util.option_map v.icmp_type_code + (fun f -> ("icmp_type_code", (IcmpTypeCode.to_json f))); + Util.option_map v.cidr_block + (fun f -> ("cidr_block", (String.to_json f))); + Util.option_map v.egress + (fun f -> ("egress", (Boolean.to_json f))); + Util.option_map v.rule_action + (fun f -> ("rule_action", (RuleAction.to_json f))); + Util.option_map v.protocol + (fun f -> ("protocol", (String.to_json f))); + Util.option_map v.rule_number + (fun f -> ("rule_number", (Integer.to_json f)))]) + let of_json j = + { + rule_number = + (Util.option_map (Json.lookup j "rule_number") Integer.of_json); + protocol = + (Util.option_map (Json.lookup j "protocol") String.of_json); + rule_action = + (Util.option_map (Json.lookup j "rule_action") RuleAction.of_json); + egress = (Util.option_map (Json.lookup j "egress") Boolean.of_json); + cidr_block = + (Util.option_map (Json.lookup j "cidr_block") String.of_json); + icmp_type_code = + (Util.option_map (Json.lookup j "icmp_type_code") + IcmpTypeCode.of_json); + port_range = + (Util.option_map (Json.lookup j "port_range") PortRange.of_json) + } + end +module SnapshotDetail = + struct + type t = + { + disk_image_size: Double.t option ; + description: String.t option ; + format: String.t option ; + url: String.t option ; + user_bucket: UserBucketDetails.t option ; + device_name: String.t option ; + snapshot_id: String.t option ; + progress: String.t option ; + status_message: String.t option ; + status: String.t option } + let make ?disk_image_size ?description ?format ?url ?user_bucket + ?device_name ?snapshot_id ?progress ?status_message ?status () = + { + disk_image_size; + description; + format; + url; + user_bucket; + device_name; + snapshot_id; + progress; + status_message; + status + } + let parse xml = + Some + { + disk_image_size = + (Util.option_bind (Xml.member "diskImageSize" xml) Double.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + format = (Util.option_bind (Xml.member "format" xml) String.parse); + url = (Util.option_bind (Xml.member "url" xml) String.parse); + user_bucket = + (Util.option_bind (Xml.member "userBucket" xml) + UserBucketDetails.parse); + device_name = + (Util.option_bind (Xml.member "deviceName" xml) String.parse); + snapshot_id = + (Util.option_bind (Xml.member "snapshotId" xml) String.parse); + progress = + (Util.option_bind (Xml.member "progress" xml) String.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.progress + (fun f -> Query.Pair ("Progress", (String.to_query f))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f))); + Util.option_map v.device_name + (fun f -> Query.Pair ("DeviceName", (String.to_query f))); + Util.option_map v.user_bucket + (fun f -> + Query.Pair ("UserBucket", (UserBucketDetails.to_query f))); + Util.option_map v.url + (fun f -> Query.Pair ("Url", (String.to_query f))); + Util.option_map v.format + (fun f -> Query.Pair ("Format", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.disk_image_size + (fun f -> Query.Pair ("DiskImageSize", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.progress + (fun f -> ("progress", (String.to_json f))); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f))); + Util.option_map v.device_name + (fun f -> ("device_name", (String.to_json f))); + Util.option_map v.user_bucket + (fun f -> ("user_bucket", (UserBucketDetails.to_json f))); + Util.option_map v.url (fun f -> ("url", (String.to_json f))); + Util.option_map v.format (fun f -> ("format", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.disk_image_size + (fun f -> ("disk_image_size", (Double.to_json f)))]) + let of_json j = + { + disk_image_size = + (Util.option_map (Json.lookup j "disk_image_size") Double.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + format = (Util.option_map (Json.lookup j "format") String.of_json); + url = (Util.option_map (Json.lookup j "url") String.of_json); + user_bucket = + (Util.option_map (Json.lookup j "user_bucket") + UserBucketDetails.of_json); + device_name = + (Util.option_map (Json.lookup j "device_name") String.of_json); + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + progress = + (Util.option_map (Json.lookup j "progress") String.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module CancelBatchErrorCode = + struct + type t = + | FleetRequestIdDoesNotExist + | FleetRequestIdMalformed + | FleetRequestNotInCancellableState + | UnexpectedError + let str_to_t = + [("unexpectedError", UnexpectedError); + ("fleetRequestNotInCancellableState", + FleetRequestNotInCancellableState); + ("fleetRequestIdMalformed", FleetRequestIdMalformed); + ("fleetRequestIdDoesNotExist", FleetRequestIdDoesNotExist)] + let t_to_str = + [(UnexpectedError, "unexpectedError"); + (FleetRequestNotInCancellableState, + "fleetRequestNotInCancellableState"); + (FleetRequestIdMalformed, "fleetRequestIdMalformed"); + (FleetRequestIdDoesNotExist, "fleetRequestIdDoesNotExist")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AccountAttributeValue = + struct + type t = { + attribute_value: String.t option } + let make ?attribute_value () = { attribute_value } + let parse xml = + Some + { + attribute_value = + (Util.option_bind (Xml.member "attributeValue" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> Query.Pair ("AttributeValue", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> ("attribute_value", (String.to_json f)))]) + let of_json j = + { + attribute_value = + (Util.option_map (Json.lookup j "attribute_value") String.of_json) + } + end +module NetworkInterfaceAttachment = + struct + type t = + { + attachment_id: String.t option ; + instance_id: String.t option ; + instance_owner_id: String.t option ; + device_index: Integer.t option ; + status: AttachmentStatus.t option ; + attach_time: DateTime.t option ; + delete_on_termination: Boolean.t option } + let make ?attachment_id ?instance_id ?instance_owner_id ?device_index + ?status ?attach_time ?delete_on_termination () = + { + attachment_id; + instance_id; + instance_owner_id; + device_index; + status; + attach_time; + delete_on_termination + } + let parse xml = + Some + { + attachment_id = + (Util.option_bind (Xml.member "attachmentId" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + instance_owner_id = + (Util.option_bind (Xml.member "instanceOwnerId" xml) String.parse); + device_index = + (Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse); + status = + (Util.option_bind (Xml.member "status" xml) + AttachmentStatus.parse); + attach_time = + (Util.option_bind (Xml.member "attachTime" xml) DateTime.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.attach_time + (fun f -> Query.Pair ("AttachTime", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (AttachmentStatus.to_query f))); + Util.option_map v.device_index + (fun f -> Query.Pair ("DeviceIndex", (Integer.to_query f))); + Util.option_map v.instance_owner_id + (fun f -> Query.Pair ("InstanceOwnerId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.attachment_id + (fun f -> Query.Pair ("AttachmentId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.attach_time + (fun f -> ("attach_time", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (AttachmentStatus.to_json f))); + Util.option_map v.device_index + (fun f -> ("device_index", (Integer.to_json f))); + Util.option_map v.instance_owner_id + (fun f -> ("instance_owner_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.attachment_id + (fun f -> ("attachment_id", (String.to_json f)))]) + let of_json j = + { + attachment_id = + (Util.option_map (Json.lookup j "attachment_id") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + instance_owner_id = + (Util.option_map (Json.lookup j "instance_owner_id") String.of_json); + device_index = + (Util.option_map (Json.lookup j "device_index") Integer.of_json); + status = + (Util.option_map (Json.lookup j "status") AttachmentStatus.of_json); + attach_time = + (Util.option_map (Json.lookup j "attach_time") DateTime.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module NetworkInterfacePrivateIpAddressList = + struct + type t = NetworkInterfacePrivateIpAddress.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NetworkInterfacePrivateIpAddress.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list NetworkInterfacePrivateIpAddress.to_query v + let to_json v = + `List (List.map NetworkInterfacePrivateIpAddress.to_json v) + let of_json j = Json.to_list NetworkInterfacePrivateIpAddress.of_json j + end +module ResourceType = + struct + type t = + | Customer_gateway + | Dhcp_options + | Image + | Instance + | Internet_gateway + | Network_acl + | Network_interface + | Reserved_instances + | Route_table + | Snapshot + | Spot_instances_request + | Subnet + | Security_group + | Volume + | Vpc + | Vpn_connection + | Vpn_gateway + let str_to_t = + [("vpn-gateway", Vpn_gateway); + ("vpn-connection", Vpn_connection); + ("vpc", Vpc); + ("volume", Volume); + ("security-group", Security_group); + ("subnet", Subnet); + ("spot-instances-request", Spot_instances_request); + ("snapshot", Snapshot); + ("route-table", Route_table); + ("reserved-instances", Reserved_instances); + ("network-interface", Network_interface); + ("network-acl", Network_acl); + ("internet-gateway", Internet_gateway); + ("instance", Instance); + ("image", Image); + ("dhcp-options", Dhcp_options); + ("customer-gateway", Customer_gateway)] + let t_to_str = + [(Vpn_gateway, "vpn-gateway"); + (Vpn_connection, "vpn-connection"); + (Vpc, "vpc"); + (Volume, "volume"); + (Security_group, "security-group"); + (Subnet, "subnet"); + (Spot_instances_request, "spot-instances-request"); + (Snapshot, "snapshot"); + (Route_table, "route-table"); + (Reserved_instances, "reserved-instances"); + (Network_interface, "network-interface"); + (Network_acl, "network-acl"); + (Internet_gateway, "internet-gateway"); + (Instance, "instance"); + (Image, "image"); + (Dhcp_options, "dhcp-options"); + (Customer_gateway, "customer-gateway")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DhcpConfigurationList = + struct + type t = DhcpConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DhcpConfiguration.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list DhcpConfiguration.to_query v + let to_json v = `List (List.map DhcpConfiguration.to_json v) + let of_json j = Json.to_list DhcpConfiguration.of_json j + end +module GatewayType = + struct + type t = + | Ipsec_1 + let str_to_t = [("ipsec.1", Ipsec_1)] + let t_to_str = [(Ipsec_1, "ipsec.1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VpcAttachmentList = + struct + type t = VpcAttachment.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VpcAttachment.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpcAttachment.to_query v + let to_json v = `List (List.map VpcAttachment.to_json v) + let of_json j = Json.to_list VpcAttachment.of_json j + end +module ReservedInstancesModificationResultList = + struct + type t = ReservedInstancesModificationResult.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesModificationResult.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list ReservedInstancesModificationResult.to_query v + let to_json v = + `List (List.map ReservedInstancesModificationResult.to_json v) + let of_json j = + Json.to_list ReservedInstancesModificationResult.of_json j + end +module ReservedIntancesIds = + struct + type t = ReservedInstancesId.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesId.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ReservedInstancesId.to_query v + let to_json v = `List (List.map ReservedInstancesId.to_json v) + let of_json j = Json.to_list ReservedInstancesId.of_json j + end +module OfferingTypeValues = + struct + type t = + | Heavy_Utilization + | Medium_Utilization + | Light_Utilization + | No_Upfront + | Partial_Upfront + | All_Upfront + let str_to_t = + [("All Upfront", All_Upfront); + ("Partial Upfront", Partial_Upfront); + ("No Upfront", No_Upfront); + ("Light Utilization", Light_Utilization); + ("Medium Utilization", Medium_Utilization); + ("Heavy Utilization", Heavy_Utilization)] + let t_to_str = + [(All_Upfront, "All Upfront"); + (Partial_Upfront, "Partial Upfront"); + (No_Upfront, "No Upfront"); + (Light_Utilization, "Light Utilization"); + (Medium_Utilization, "Medium Utilization"); + (Heavy_Utilization, "Heavy Utilization")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RIProductDescription = + struct + type t = + | Linux_UNIX + | Linux_UNIX__Amazon_VPC_ + | Windows + | Windows__Amazon_VPC_ + let str_to_t = + [("Windows (Amazon VPC)", Windows__Amazon_VPC_); + ("Windows", Windows); + ("Linux/UNIX (Amazon VPC)", Linux_UNIX__Amazon_VPC_); + ("Linux/UNIX", Linux_UNIX)] + let t_to_str = + [(Windows__Amazon_VPC_, "Windows (Amazon VPC)"); + (Windows, "Windows"); + (Linux_UNIX__Amazon_VPC_, "Linux/UNIX (Amazon VPC)"); + (Linux_UNIX, "Linux/UNIX")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RecurringChargesList = + struct + type t = RecurringCharge.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map RecurringCharge.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list RecurringCharge.to_query v + let to_json v = `List (List.map RecurringCharge.to_json v) + let of_json j = Json.to_list RecurringCharge.of_json j + end +module ReservedInstanceState = + struct + type t = + | Payment_pending + | Active + | Payment_failed + | Retired + let str_to_t = + [("retired", Retired); + ("payment-failed", Payment_failed); + ("active", Active); + ("payment-pending", Payment_pending)] + let t_to_str = + [(Retired, "retired"); + (Payment_failed, "payment-failed"); + (Active, "active"); + (Payment_pending, "payment-pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ValueStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module PlacementGroupState = + struct + type t = + | Pending + | Available + | Deleting + | Deleted + let str_to_t = + [("deleted", Deleted); + ("deleting", Deleting); + ("available", Available); + ("pending", Pending)] + let t_to_str = + [(Deleted, "deleted"); + (Deleting, "deleting"); + (Available, "available"); + (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module PlacementStrategy = + struct + type t = + | Cluster + let str_to_t = [("cluster", Cluster)] + let t_to_str = [(Cluster, "cluster")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module CancelSpotInstanceRequestState = + struct + type t = + | Active + | Open + | Closed + | Cancelled + | Completed + let str_to_t = + [("completed", Completed); + ("cancelled", Cancelled); + ("closed", Closed); + ("open", Open); + ("active", Active)] + let t_to_str = + [(Completed, "completed"); + (Cancelled, "cancelled"); + (Closed, "closed"); + (Open, "open"); + (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module LaunchPermission = + struct + type t = { + user_id: String.t option ; + group: PermissionGroup.t option } + let make ?user_id ?group () = { user_id; group } + let parse xml = + Some + { + user_id = (Util.option_bind (Xml.member "userId" xml) String.parse); + group = + (Util.option_bind (Xml.member "group" xml) PermissionGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group + (fun f -> Query.Pair ("Group", (PermissionGroup.to_query f))); + Util.option_map v.user_id + (fun f -> Query.Pair ("UserId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group + (fun f -> ("group", (PermissionGroup.to_json f))); + Util.option_map v.user_id + (fun f -> ("user_id", (String.to_json f)))]) + let of_json j = + { + user_id = (Util.option_map (Json.lookup j "user_id") String.of_json); + group = + (Util.option_map (Json.lookup j "group") PermissionGroup.of_json) + } + end +module ConversionTaskState = + struct + type t = + | Active + | Cancelling + | Cancelled + | Completed + let str_to_t = + [("completed", Completed); + ("cancelled", Cancelled); + ("cancelling", Cancelling); + ("active", Active)] + let t_to_str = + [(Completed, "completed"); + (Cancelled, "cancelled"); + (Cancelling, "cancelling"); + (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ImportInstanceTaskDetails = + struct + type t = + { + volumes: ImportInstanceVolumeDetailSet.t ; + instance_id: String.t option ; + platform: PlatformValues.t option ; + description: String.t option } + let make ~volumes ?instance_id ?platform ?description () = + { volumes; instance_id; platform; description } + let parse xml = + Some + { + volumes = + (Xml.required "volumes" + (Util.option_bind (Xml.member "volumes" xml) + ImportInstanceVolumeDetailSet.parse)); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) + PlatformValues.parse); + description = (Util.option_bind (Xml.member "description" xml) String.parse) - ; state = - Xml.required - "state" - (Util.option_bind (Xml.member "state" xml) ExportTaskState.parse) - ; status_message = - Xml.required - "statusMessage" - (Util.option_bind (Xml.member "statusMessage" xml) String.parse) - ; instance_export_details = - Xml.required - "instanceExport" - (Util.option_bind - (Xml.member "instanceExport" xml) - InstanceExportDetails.parse) - ; export_to_s3_task = - Xml.required - "exportToS3" - (Util.option_bind (Xml.member "exportToS3" xml) ExportToS3Task.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ExportToS3", ExportToS3Task.to_query v.export_to_s3_task)) - ; Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (PlatformValues.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Some (Query.Pair - ( "InstanceExport" - , InstanceExportDetails.to_query v.instance_export_details )) - ; Some (Query.Pair ("StatusMessage", String.to_query v.status_message)) - ; Some (Query.Pair ("State", ExportTaskState.to_query v.state)) - ; Some (Query.Pair ("Description", String.to_query v.description)) - ; Some (Query.Pair ("ExportTaskId", String.to_query v.export_task_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("export_to_s3_task", ExportToS3Task.to_json v.export_to_s3_task) - ; Some - ( "instance_export_details" - , InstanceExportDetails.to_json v.instance_export_details ) - ; Some ("status_message", String.to_json v.status_message) - ; Some ("state", ExportTaskState.to_json v.state) - ; Some ("description", String.to_json v.description) - ; Some ("export_task_id", String.to_json v.export_task_id) - ]) - - let of_json j = - { export_task_id = - String.of_json (Util.of_option_exn (Json.lookup j "export_task_id")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; state = ExportTaskState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; status_message = - String.of_json (Util.of_option_exn (Json.lookup j "status_message")) - ; instance_export_details = - InstanceExportDetails.of_json - (Util.of_option_exn (Json.lookup j "instance_export_details")) - ; export_to_s3_task = - ExportToS3Task.of_json (Util.of_option_exn (Json.lookup j "export_to_s3_task")) - } -end - -module PrefixList = struct - type t = - { prefix_list_id : String.t option - ; prefix_list_name : String.t option - ; cidrs : ValueStringList.t - } - - let make ?prefix_list_id ?prefix_list_name ?(cidrs = []) () = - { prefix_list_id; prefix_list_name; cidrs } - - let parse xml = - Some - { prefix_list_id = Util.option_bind (Xml.member "prefixListId" xml) String.parse - ; prefix_list_name = Util.option_bind (Xml.member "prefixListName" xml) String.parse - ; cidrs = - Util.of_option - [] - (Util.option_bind (Xml.member "cidrSet" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CidrSet", ValueStringList.to_query v.cidrs)) - ; Util.option_map v.prefix_list_name (fun f -> - Query.Pair ("PrefixListName", String.to_query f)) - ; Util.option_map v.prefix_list_id (fun f -> - Query.Pair ("PrefixListId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cidrs", ValueStringList.to_json v.cidrs) - ; Util.option_map v.prefix_list_name (fun f -> - "prefix_list_name", String.to_json f) - ; Util.option_map v.prefix_list_id (fun f -> "prefix_list_id", String.to_json f) - ]) - - let of_json j = - { prefix_list_id = Util.option_map (Json.lookup j "prefix_list_id") String.of_json - ; prefix_list_name = Util.option_map (Json.lookup j "prefix_list_name") String.of_json - ; cidrs = ValueStringList.of_json (Util.of_option_exn (Json.lookup j "cidrs")) - } -end - -module InstanceMonitoring = struct - type t = - { instance_id : String.t option - ; monitoring : Monitoring.t option - } - - let make ?instance_id ?monitoring () = { instance_id; monitoring } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; monitoring = Util.option_bind (Xml.member "monitoring" xml) Monitoring.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", Monitoring.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.monitoring (fun f -> "monitoring", Monitoring.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; monitoring = Util.option_map (Json.lookup j "monitoring") Monitoring.of_json - } -end - -module SecurityGroup = struct - type t = - { owner_id : String.t - ; group_name : String.t - ; group_id : String.t - ; description : String.t - ; ip_permissions : IpPermissionList.t - ; ip_permissions_egress : IpPermissionList.t - ; vpc_id : String.t option - ; tags : TagList.t - } - - let make - ~owner_id - ~group_name - ~group_id - ~description - ?(ip_permissions = []) - ?(ip_permissions_egress = []) - ?vpc_id - ?(tags = []) - () = - { owner_id - ; group_name - ; group_id - ; description - ; ip_permissions - ; ip_permissions_egress - ; vpc_id - ; tags - } - - let parse xml = - Some - { owner_id = - Xml.required - "ownerId" - (Util.option_bind (Xml.member "ownerId" xml) String.parse) - ; group_name = - Xml.required - "groupName" - (Util.option_bind (Xml.member "groupName" xml) String.parse) - ; group_id = - Xml.required - "groupId" - (Util.option_bind (Xml.member "groupId" xml) String.parse) - ; description = - Xml.required - "groupDescription" - (Util.option_bind (Xml.member "groupDescription" xml) String.parse) - ; ip_permissions = - Util.of_option - [] - (Util.option_bind (Xml.member "ipPermissions" xml) IpPermissionList.parse) - ; ip_permissions_egress = - Util.of_option - [] - (Util.option_bind - (Xml.member "ipPermissionsEgress" xml) - IpPermissionList.parse) - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Some + ("Volumes", + (ImportInstanceVolumeDetailSet.to_query v.volumes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (PlatformValues.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Some + ("volumes", (ImportInstanceVolumeDetailSet.to_json v.volumes))]) + let of_json j = + { + volumes = + (ImportInstanceVolumeDetailSet.of_json + (Util.of_option_exn (Json.lookup j "volumes"))); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") PlatformValues.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module ImportVolumeTaskDetails = + struct + type t = + { + bytes_converted: Long.t ; + availability_zone: String.t ; + description: String.t option ; + image: DiskImageDescription.t ; + volume: DiskImageVolumeDescription.t } + let make ~bytes_converted ~availability_zone ?description ~image + ~volume () = + { bytes_converted; availability_zone; description; image; volume } + let parse xml = + Some + { + bytes_converted = + (Xml.required "bytesConverted" + (Util.option_bind (Xml.member "bytesConverted" xml) Long.parse)); + availability_zone = + (Xml.required "availabilityZone" + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + image = + (Xml.required "image" + (Util.option_bind (Xml.member "image" xml) + DiskImageDescription.parse)); + volume = + (Xml.required "volume" + (Util.option_bind (Xml.member "volume" xml) + DiskImageVolumeDescription.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Volume", (DiskImageVolumeDescription.to_query v.volume))); + Some + (Query.Pair ("Image", (DiskImageDescription.to_query v.image))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair - ("IpPermissionsEgress", IpPermissionList.to_query v.ip_permissions_egress)) - ; Some (Query.Pair ("IpPermissions", IpPermissionList.to_query v.ip_permissions)) - ; Some (Query.Pair ("GroupDescription", String.to_query v.description)) - ; Some (Query.Pair ("GroupId", String.to_query v.group_id)) - ; Some (Query.Pair ("GroupName", String.to_query v.group_name)) - ; Some (Query.Pair ("OwnerId", String.to_query v.owner_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Some ("ip_permissions_egress", IpPermissionList.to_json v.ip_permissions_egress) - ; Some ("ip_permissions", IpPermissionList.to_json v.ip_permissions) - ; Some ("description", String.to_json v.description) - ; Some ("group_id", String.to_json v.group_id) - ; Some ("group_name", String.to_json v.group_name) - ; Some ("owner_id", String.to_json v.owner_id) - ]) - - let of_json j = - { owner_id = String.of_json (Util.of_option_exn (Json.lookup j "owner_id")) - ; group_name = String.of_json (Util.of_option_exn (Json.lookup j "group_name")) - ; group_id = String.of_json (Util.of_option_exn (Json.lookup j "group_id")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; ip_permissions = - IpPermissionList.of_json (Util.of_option_exn (Json.lookup j "ip_permissions")) - ; ip_permissions_egress = - IpPermissionList.of_json - (Util.of_option_exn (Json.lookup j "ip_permissions_egress")) - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ActiveInstance = struct - type t = - { instance_type : String.t option - ; instance_id : String.t option - ; spot_instance_request_id : String.t option - } - - let make ?instance_type ?instance_id ?spot_instance_request_id () = - { instance_type; instance_id; spot_instance_request_id } - - let parse xml = - Some - { instance_type = Util.option_bind (Xml.member "instanceType" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; spot_instance_request_id = - Util.option_bind (Xml.member "spotInstanceRequestId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.spot_instance_request_id (fun f -> - Query.Pair ("SpotInstanceRequestId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.spot_instance_request_id (fun f -> - "spot_instance_request_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.instance_type (fun f -> "instance_type", String.to_json f) - ]) - - let of_json j = - { instance_type = Util.option_map (Json.lookup j "instance_type") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; spot_instance_request_id = - Util.option_map (Json.lookup j "spot_instance_request_id") String.of_json - } -end - -module InstanceBlockDeviceMappingSpecification = struct - type t = - { device_name : String.t option - ; ebs : EbsInstanceBlockDeviceSpecification.t option - ; virtual_name : String.t option - ; no_device : String.t option - } - - let make ?device_name ?ebs ?virtual_name ?no_device () = - { device_name; ebs; virtual_name; no_device } - - let parse xml = - Some - { device_name = Util.option_bind (Xml.member "deviceName" xml) String.parse - ; ebs = - Util.option_bind - (Xml.member "ebs" xml) - EbsInstanceBlockDeviceSpecification.parse - ; virtual_name = Util.option_bind (Xml.member "virtualName" xml) String.parse - ; no_device = Util.option_bind (Xml.member "noDevice" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> - Query.Pair ("NoDevice", String.to_query f)) - ; Util.option_map v.virtual_name (fun f -> - Query.Pair ("VirtualName", String.to_query f)) - ; Util.option_map v.ebs (fun f -> - Query.Pair ("Ebs", EbsInstanceBlockDeviceSpecification.to_query f)) - ; Util.option_map v.device_name (fun f -> - Query.Pair ("DeviceName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.no_device (fun f -> "no_device", String.to_json f) - ; Util.option_map v.virtual_name (fun f -> "virtual_name", String.to_json f) - ; Util.option_map v.ebs (fun f -> - "ebs", EbsInstanceBlockDeviceSpecification.to_json f) - ; Util.option_map v.device_name (fun f -> "device_name", String.to_json f) - ]) - - let of_json j = - { device_name = Util.option_map (Json.lookup j "device_name") String.of_json - ; ebs = - Util.option_map (Json.lookup j "ebs") EbsInstanceBlockDeviceSpecification.of_json - ; virtual_name = Util.option_map (Json.lookup j "virtual_name") String.of_json - ; no_device = Util.option_map (Json.lookup j "no_device") String.of_json - } -end - -module InternetGateway = struct - type t = - { internet_gateway_id : String.t - ; attachments : InternetGatewayAttachmentList.t - ; tags : TagList.t - } - - let make ~internet_gateway_id ?(attachments = []) ?(tags = []) () = - { internet_gateway_id; attachments; tags } - - let parse xml = - Some - { internet_gateway_id = - Xml.required - "internetGatewayId" - (Util.option_bind (Xml.member "internetGatewayId" xml) String.parse) - ; attachments = - Util.of_option - [] - (Util.option_bind - (Xml.member "attachmentSet" xml) - InternetGatewayAttachmentList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair - ("AttachmentSet", InternetGatewayAttachmentList.to_query v.attachments)) - ; Some (Query.Pair ("InternetGatewayId", String.to_query v.internet_gateway_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("attachments", InternetGatewayAttachmentList.to_json v.attachments) - ; Some ("internet_gateway_id", String.to_json v.internet_gateway_id) - ]) - - let of_json j = - { internet_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "internet_gateway_id")) - ; attachments = - InternetGatewayAttachmentList.of_json - (Util.of_option_exn (Json.lookup j "attachments")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module AccountAttributeName = struct - type t = - | Supported_platforms - | Default_vpc - - let str_to_t = - [ "default-vpc", Default_vpc; "supported-platforms", Supported_platforms ] - - let t_to_str = - [ Default_vpc, "default-vpc"; Supported_platforms, "supported-platforms" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SpotFleetRequestConfig = struct - type t = - { spot_fleet_request_id : String.t - ; spot_fleet_request_state : BatchState.t - ; spot_fleet_request_config : SpotFleetRequestConfigData.t - } - - let make ~spot_fleet_request_id ~spot_fleet_request_state ~spot_fleet_request_config () - = - { spot_fleet_request_id; spot_fleet_request_state; spot_fleet_request_config } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; spot_fleet_request_state = - Xml.required - "spotFleetRequestState" - (Util.option_bind (Xml.member "spotFleetRequestState" xml) BatchState.parse) - ; spot_fleet_request_config = - Xml.required - "spotFleetRequestConfig" - (Util.option_bind - (Xml.member "spotFleetRequestConfig" xml) - SpotFleetRequestConfigData.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("BytesConverted", (Long.to_query v.bytes_converted)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("volume", (DiskImageVolumeDescription.to_json v.volume)); + Some ("image", (DiskImageDescription.to_json v.image)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some ("bytes_converted", (Long.to_json v.bytes_converted))]) + let of_json j = + { + bytes_converted = + (Long.of_json + (Util.of_option_exn (Json.lookup j "bytes_converted"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + image = + (DiskImageDescription.of_json + (Util.of_option_exn (Json.lookup j "image"))); + volume = + (DiskImageVolumeDescription.of_json + (Util.of_option_exn (Json.lookup j "volume"))) + } + end +module EventInformation = + struct + type t = + { + instance_id: String.t option ; + event_sub_type: String.t option ; + event_description: String.t option } + let make ?instance_id ?event_sub_type ?event_description () = + { instance_id; event_sub_type; event_description } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + event_sub_type = + (Util.option_bind (Xml.member "eventSubType" xml) String.parse); + event_description = + (Util.option_bind (Xml.member "eventDescription" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_description + (fun f -> Query.Pair ("EventDescription", (String.to_query f))); + Util.option_map v.event_sub_type + (fun f -> Query.Pair ("EventSubType", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_description + (fun f -> ("event_description", (String.to_json f))); + Util.option_map v.event_sub_type + (fun f -> ("event_sub_type", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + event_sub_type = + (Util.option_map (Json.lookup j "event_sub_type") String.of_json); + event_description = + (Util.option_map (Json.lookup j "event_description") String.of_json) + } + end +module EventType = + struct + type t = + | InstanceChange + | FleetRequestChange + | Error + let str_to_t = + [("error", Error); + ("fleetRequestChange", FleetRequestChange); + ("instanceChange", InstanceChange)] + let t_to_str = + [(Error, "error"); + (FleetRequestChange, "fleetRequestChange"); + (InstanceChange, "instanceChange")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module UnsuccessfulItemError = + struct + type t = { + code: String.t ; + message: String.t } + let make ~code ~message () = { code; message } + let parse xml = + Some + { + code = + (Xml.required "code" + (Util.option_bind (Xml.member "code" xml) String.parse)); + message = + (Xml.required "message" + (Util.option_bind (Xml.member "message" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Message", (String.to_query v.message))); + Some (Query.Pair ("Code", (String.to_query v.code)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("message", (String.to_json v.message)); + Some ("code", (String.to_json v.code))]) + let of_json j = + { + code = (String.of_json (Util.of_option_exn (Json.lookup j "code"))); + message = + (String.of_json (Util.of_option_exn (Json.lookup j "message"))) + } + end +module PropagatingVgwList = + struct + type t = PropagatingVgw.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PropagatingVgw.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PropagatingVgw.to_query v + let to_json v = `List (List.map PropagatingVgw.to_json v) + let of_json j = Json.to_list PropagatingVgw.of_json j + end +module RouteList = + struct + type t = Route.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Route.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Route.to_query v + let to_json v = `List (List.map Route.to_json v) + let of_json j = Json.to_list Route.of_json j + end +module RouteTableAssociationList = + struct + type t = RouteTableAssociation.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map RouteTableAssociation.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list RouteTableAssociation.to_query v + let to_json v = `List (List.map RouteTableAssociation.to_json v) + let of_json j = Json.to_list RouteTableAssociation.of_json j + end +module InstanceCountList = + struct + type t = InstanceCount.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map InstanceCount.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceCount.to_query v + let to_json v = `List (List.map InstanceCount.to_json v) + let of_json j = Json.to_list InstanceCount.of_json j + end +module ListingStatus = + struct + type t = + | Active + | Pending + | Cancelled + | Closed + let str_to_t = + [("closed", Closed); + ("cancelled", Cancelled); + ("pending", Pending); + ("active", Active)] + let t_to_str = + [(Closed, "closed"); + (Cancelled, "cancelled"); + (Pending, "pending"); + (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module PriceScheduleList = + struct + type t = PriceSchedule.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map PriceSchedule.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PriceSchedule.to_query v + let to_json v = `List (List.map PriceSchedule.to_json v) + let of_json j = Json.to_list PriceSchedule.of_json j + end +module MoveStatus = + struct + type t = + | MovingToVpc + | RestoringToClassic + let str_to_t = + [("restoringToClassic", RestoringToClassic); + ("movingToVpc", MovingToVpc)] + let t_to_str = + [(RestoringToClassic, "restoringToClassic"); + (MovingToVpc, "movingToVpc")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module InstanceStatusEventList = + struct + type t = InstanceStatusEvent.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceStatusEvent.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceStatusEvent.to_query v + let to_json v = `List (List.map InstanceStatusEvent.to_json v) + let of_json j = Json.to_list InstanceStatusEvent.of_json j + end +module InstanceStatusSummary = + struct + type t = { + status: SummaryStatus.t ; + details: InstanceStatusDetailsList.t } + let make ~status ?(details= []) () = { status; details } + let parse xml = + Some + { + status = + (Xml.required "status" + (Util.option_bind (Xml.member "status" xml) + SummaryStatus.parse)); + details = + (Util.of_option [] + (Util.option_bind (Xml.member "details" xml) + InstanceStatusDetailsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Details", (InstanceStatusDetailsList.to_query v.details))); + Some (Query.Pair ("Status", (SummaryStatus.to_query v.status)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("details", (InstanceStatusDetailsList.to_json v.details)); + Some ("status", (SummaryStatus.to_json v.status))]) + let of_json j = + { + status = + (SummaryStatus.of_json + (Util.of_option_exn (Json.lookup j "status"))); + details = + (InstanceStatusDetailsList.of_json + (Util.of_option_exn (Json.lookup j "details"))) + } + end +module ImageState = + struct + type t = + | Pending + | Available + | Invalid + | Deregistered + | Transient + | Failed + | Error + let str_to_t = + [("error", Error); + ("failed", Failed); + ("transient", Transient); + ("deregistered", Deregistered); + ("invalid", Invalid); + ("available", Available); + ("pending", Pending)] + let t_to_str = + [(Error, "error"); + (Failed, "failed"); + (Transient, "transient"); + (Deregistered, "deregistered"); + (Invalid, "invalid"); + (Available, "available"); + (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ImageTypeValues = + struct + type t = + | Machine + | Kernel + | Ramdisk + let str_to_t = + [("ramdisk", Ramdisk); ("kernel", Kernel); ("machine", Machine)] + let t_to_str = + [(Ramdisk, "ramdisk"); (Kernel, "kernel"); (Machine, "machine")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SnapshotTaskDetail = + struct + type t = + { + disk_image_size: Double.t option ; + description: String.t option ; + format: String.t option ; + url: String.t option ; + user_bucket: UserBucketDetails.t option ; + snapshot_id: String.t option ; + progress: String.t option ; + status_message: String.t option ; + status: String.t option } + let make ?disk_image_size ?description ?format ?url ?user_bucket + ?snapshot_id ?progress ?status_message ?status () = + { + disk_image_size; + description; + format; + url; + user_bucket; + snapshot_id; + progress; + status_message; + status + } + let parse xml = + Some + { + disk_image_size = + (Util.option_bind (Xml.member "diskImageSize" xml) Double.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + format = (Util.option_bind (Xml.member "format" xml) String.parse); + url = (Util.option_bind (Xml.member "url" xml) String.parse); + user_bucket = + (Util.option_bind (Xml.member "userBucket" xml) + UserBucketDetails.parse); + snapshot_id = + (Util.option_bind (Xml.member "snapshotId" xml) String.parse); + progress = + (Util.option_bind (Xml.member "progress" xml) String.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.progress + (fun f -> Query.Pair ("Progress", (String.to_query f))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f))); + Util.option_map v.user_bucket + (fun f -> + Query.Pair ("UserBucket", (UserBucketDetails.to_query f))); + Util.option_map v.url + (fun f -> Query.Pair ("Url", (String.to_query f))); + Util.option_map v.format + (fun f -> Query.Pair ("Format", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.disk_image_size + (fun f -> Query.Pair ("DiskImageSize", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.progress + (fun f -> ("progress", (String.to_json f))); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f))); + Util.option_map v.user_bucket + (fun f -> ("user_bucket", (UserBucketDetails.to_json f))); + Util.option_map v.url (fun f -> ("url", (String.to_json f))); + Util.option_map v.format (fun f -> ("format", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.disk_image_size + (fun f -> ("disk_image_size", (Double.to_json f)))]) + let of_json j = + { + disk_image_size = + (Util.option_map (Json.lookup j "disk_image_size") Double.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + format = (Util.option_map (Json.lookup j "format") String.of_json); + url = (Util.option_map (Json.lookup j "url") String.of_json); + user_bucket = + (Util.option_map (Json.lookup j "user_bucket") + UserBucketDetails.of_json); + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + progress = + (Util.option_map (Json.lookup j "progress") String.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module LaunchSpecification = + struct + type t = + { + image_id: String.t option ; + key_name: String.t option ; + security_groups: GroupIdentifierList.t ; + user_data: String.t option ; + addressing_type: String.t option ; + instance_type: InstanceType.t option ; + placement: SpotPlacement.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappingList.t ; + subnet_id: String.t option ; + network_interfaces: InstanceNetworkInterfaceSpecificationList.t ; + iam_instance_profile: IamInstanceProfileSpecification.t option ; + ebs_optimized: Boolean.t option ; + monitoring: RunInstancesMonitoringEnabled.t option } + let make ?image_id ?key_name ?(security_groups= []) ?user_data + ?addressing_type ?instance_type ?placement ?kernel_id ?ramdisk_id + ?(block_device_mappings= []) ?subnet_id ?(network_interfaces= []) + ?iam_instance_profile ?ebs_optimized ?monitoring () = + { + image_id; + key_name; + security_groups; + user_data; + addressing_type; + instance_type; + placement; + kernel_id; + ramdisk_id; + block_device_mappings; + subnet_id; + network_interfaces; + iam_instance_profile; + ebs_optimized; + monitoring + } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + user_data = + (Util.option_bind (Xml.member "userData" xml) String.parse); + addressing_type = + (Util.option_bind (Xml.member "addressingType" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + placement = + (Util.option_bind (Xml.member "placement" xml) + SpotPlacement.parse); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingList.parse)); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "networkInterfaceSet" xml) + InstanceNetworkInterfaceSpecificationList.parse)); + iam_instance_profile = + (Util.option_bind (Xml.member "iamInstanceProfile" xml) + IamInstanceProfileSpecification.parse); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse); + monitoring = + (Util.option_bind (Xml.member "monitoring" xml) + RunInstancesMonitoringEnabled.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.monitoring + (fun f -> + Query.Pair + ("Monitoring", (RunInstancesMonitoringEnabled.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> + Query.Pair + ("IamInstanceProfile", + (IamInstanceProfileSpecification.to_query f))); + Some (Query.Pair - ( "SpotFleetRequestConfig" - , SpotFleetRequestConfigData.to_query v.spot_fleet_request_config )) - ; Some + ("NetworkInterfaceSet", + (InstanceNetworkInterfaceSpecificationList.to_query + v.network_interfaces))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Some (Query.Pair - ("SpotFleetRequestState", BatchState.to_query v.spot_fleet_request_state)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "spot_fleet_request_config" - , SpotFleetRequestConfigData.to_json v.spot_fleet_request_config ) - ; Some ("spot_fleet_request_state", BatchState.to_json v.spot_fleet_request_state) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; spot_fleet_request_state = - BatchState.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_state")) - ; spot_fleet_request_config = - SpotFleetRequestConfigData.of_json - (Util.of_option_exn (Json.lookup j "spot_fleet_request_config")) - } -end - -module AvailabilityZone = struct - type t = - { zone_name : String.t option - ; state : AvailabilityZoneState.t option - ; region_name : String.t option - ; messages : AvailabilityZoneMessageList.t - } - - let make ?zone_name ?state ?region_name ?(messages = []) () = - { zone_name; state; region_name; messages } - - let parse xml = - Some - { zone_name = Util.option_bind (Xml.member "zoneName" xml) String.parse - ; state = Util.option_bind (Xml.member "zoneState" xml) AvailabilityZoneState.parse - ; region_name = Util.option_bind (Xml.member "regionName" xml) String.parse - ; messages = - Util.of_option - [] - (Util.option_bind - (Xml.member "messageSet" xml) - AvailabilityZoneMessageList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("MessageSet", AvailabilityZoneMessageList.to_query v.messages)) - ; Util.option_map v.region_name (fun f -> - Query.Pair ("RegionName", String.to_query f)) - ; Util.option_map v.state (fun f -> - Query.Pair ("ZoneState", AvailabilityZoneState.to_query f)) - ; Util.option_map v.zone_name (fun f -> - Query.Pair ("ZoneName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("messages", AvailabilityZoneMessageList.to_json v.messages) - ; Util.option_map v.region_name (fun f -> "region_name", String.to_json f) - ; Util.option_map v.state (fun f -> "state", AvailabilityZoneState.to_json f) - ; Util.option_map v.zone_name (fun f -> "zone_name", String.to_json f) - ]) - - let of_json j = - { zone_name = Util.option_map (Json.lookup j "zone_name") String.of_json - ; state = Util.option_map (Json.lookup j "state") AvailabilityZoneState.of_json - ; region_name = Util.option_map (Json.lookup j "region_name") String.of_json - ; messages = - AvailabilityZoneMessageList.of_json - (Util.of_option_exn (Json.lookup j "messages")) - } -end - -module CustomerGateway = struct - type t = - { customer_gateway_id : String.t - ; state : String.t - ; type_ : String.t - ; ip_address : String.t - ; bgp_asn : String.t - ; tags : TagList.t - } - - let make ~customer_gateway_id ~state ~type_ ~ip_address ~bgp_asn ?(tags = []) () = - { customer_gateway_id; state; type_; ip_address; bgp_asn; tags } - - let parse xml = - Some - { customer_gateway_id = - Xml.required - "customerGatewayId" - (Util.option_bind (Xml.member "customerGatewayId" xml) String.parse) - ; state = - Xml.required "state" (Util.option_bind (Xml.member "state" xml) String.parse) - ; type_ = - Xml.required "type" (Util.option_bind (Xml.member "type" xml) String.parse) - ; ip_address = - Xml.required - "ipAddress" - (Util.option_bind (Xml.member "ipAddress" xml) String.parse) - ; bgp_asn = - Xml.required "bgpAsn" (Util.option_bind (Xml.member "bgpAsn" xml) String.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some (Query.Pair ("BgpAsn", String.to_query v.bgp_asn)) - ; Some (Query.Pair ("IpAddress", String.to_query v.ip_address)) - ; Some (Query.Pair ("Type", String.to_query v.type_)) - ; Some (Query.Pair ("State", String.to_query v.state)) - ; Some (Query.Pair ("CustomerGatewayId", String.to_query v.customer_gateway_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("bgp_asn", String.to_json v.bgp_asn) - ; Some ("ip_address", String.to_json v.ip_address) - ; Some ("type_", String.to_json v.type_) - ; Some ("state", String.to_json v.state) - ; Some ("customer_gateway_id", String.to_json v.customer_gateway_id) - ]) - - let of_json j = - { customer_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "customer_gateway_id")) - ; state = String.of_json (Util.of_option_exn (Json.lookup j "state")) - ; type_ = String.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; ip_address = String.of_json (Util.of_option_exn (Json.lookup j "ip_address")) - ; bgp_asn = String.of_json (Util.of_option_exn (Json.lookup j "bgp_asn")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module FlowLog = struct - type t = - { creation_time : DateTime.t option - ; flow_log_id : String.t option - ; flow_log_status : String.t option - ; resource_id : String.t option - ; traffic_type : TrafficType.t option - ; log_group_name : String.t option - ; deliver_logs_status : String.t option - ; deliver_logs_error_message : String.t option - ; deliver_logs_permission_arn : String.t option - } - - let make - ?creation_time - ?flow_log_id - ?flow_log_status - ?resource_id - ?traffic_type - ?log_group_name - ?deliver_logs_status - ?deliver_logs_error_message - ?deliver_logs_permission_arn - () = - { creation_time - ; flow_log_id - ; flow_log_status - ; resource_id - ; traffic_type - ; log_group_name - ; deliver_logs_status - ; deliver_logs_error_message - ; deliver_logs_permission_arn - } - - let parse xml = - Some - { creation_time = Util.option_bind (Xml.member "creationTime" xml) DateTime.parse - ; flow_log_id = Util.option_bind (Xml.member "flowLogId" xml) String.parse - ; flow_log_status = Util.option_bind (Xml.member "flowLogStatus" xml) String.parse - ; resource_id = Util.option_bind (Xml.member "resourceId" xml) String.parse - ; traffic_type = Util.option_bind (Xml.member "trafficType" xml) TrafficType.parse - ; log_group_name = Util.option_bind (Xml.member "logGroupName" xml) String.parse - ; deliver_logs_status = - Util.option_bind (Xml.member "deliverLogsStatus" xml) String.parse - ; deliver_logs_error_message = - Util.option_bind (Xml.member "deliverLogsErrorMessage" xml) String.parse - ; deliver_logs_permission_arn = - Util.option_bind (Xml.member "deliverLogsPermissionArn" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.deliver_logs_permission_arn (fun f -> - Query.Pair ("DeliverLogsPermissionArn", String.to_query f)) - ; Util.option_map v.deliver_logs_error_message (fun f -> - Query.Pair ("DeliverLogsErrorMessage", String.to_query f)) - ; Util.option_map v.deliver_logs_status (fun f -> - Query.Pair ("DeliverLogsStatus", String.to_query f)) - ; Util.option_map v.log_group_name (fun f -> - Query.Pair ("LogGroupName", String.to_query f)) - ; Util.option_map v.traffic_type (fun f -> - Query.Pair ("TrafficType", TrafficType.to_query f)) - ; Util.option_map v.resource_id (fun f -> - Query.Pair ("ResourceId", String.to_query f)) - ; Util.option_map v.flow_log_status (fun f -> - Query.Pair ("FlowLogStatus", String.to_query f)) - ; Util.option_map v.flow_log_id (fun f -> - Query.Pair ("FlowLogId", String.to_query f)) - ; Util.option_map v.creation_time (fun f -> - Query.Pair ("CreationTime", DateTime.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.deliver_logs_permission_arn (fun f -> - "deliver_logs_permission_arn", String.to_json f) - ; Util.option_map v.deliver_logs_error_message (fun f -> - "deliver_logs_error_message", String.to_json f) - ; Util.option_map v.deliver_logs_status (fun f -> - "deliver_logs_status", String.to_json f) - ; Util.option_map v.log_group_name (fun f -> "log_group_name", String.to_json f) - ; Util.option_map v.traffic_type (fun f -> "traffic_type", TrafficType.to_json f) - ; Util.option_map v.resource_id (fun f -> "resource_id", String.to_json f) - ; Util.option_map v.flow_log_status (fun f -> - "flow_log_status", String.to_json f) - ; Util.option_map v.flow_log_id (fun f -> "flow_log_id", String.to_json f) - ; Util.option_map v.creation_time (fun f -> "creation_time", DateTime.to_json f) - ]) - - let of_json j = - { creation_time = Util.option_map (Json.lookup j "creation_time") DateTime.of_json - ; flow_log_id = Util.option_map (Json.lookup j "flow_log_id") String.of_json - ; flow_log_status = Util.option_map (Json.lookup j "flow_log_status") String.of_json - ; resource_id = Util.option_map (Json.lookup j "resource_id") String.of_json - ; traffic_type = Util.option_map (Json.lookup j "traffic_type") TrafficType.of_json - ; log_group_name = Util.option_map (Json.lookup j "log_group_name") String.of_json - ; deliver_logs_status = - Util.option_map (Json.lookup j "deliver_logs_status") String.of_json - ; deliver_logs_error_message = - Util.option_map (Json.lookup j "deliver_logs_error_message") String.of_json - ; deliver_logs_permission_arn = - Util.option_map (Json.lookup j "deliver_logs_permission_arn") String.of_json - } -end - -module BundleTask = struct - type t = - { instance_id : String.t - ; bundle_id : String.t - ; state : BundleTaskState.t - ; start_time : DateTime.t - ; update_time : DateTime.t - ; storage : Storage.t - ; progress : String.t - ; bundle_task_error : BundleTaskError.t option - } - - let make - ~instance_id - ~bundle_id - ~state - ~start_time - ~update_time - ~storage - ~progress - ?bundle_task_error - () = - { instance_id - ; bundle_id - ; state - ; start_time - ; update_time - ; storage - ; progress - ; bundle_task_error - } - - let parse xml = - Some - { instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; bundle_id = - Xml.required - "bundleId" - (Util.option_bind (Xml.member "bundleId" xml) String.parse) - ; state = - Xml.required - "state" - (Util.option_bind (Xml.member "state" xml) BundleTaskState.parse) - ; start_time = - Xml.required - "startTime" - (Util.option_bind (Xml.member "startTime" xml) DateTime.parse) - ; update_time = - Xml.required - "updateTime" - (Util.option_bind (Xml.member "updateTime" xml) DateTime.parse) - ; storage = - Xml.required - "storage" - (Util.option_bind (Xml.member "storage" xml) Storage.parse) - ; progress = - Xml.required - "progress" - (Util.option_bind (Xml.member "progress" xml) String.parse) - ; bundle_task_error = - Util.option_bind (Xml.member "error" xml) BundleTaskError.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.bundle_task_error (fun f -> - Query.Pair ("Error", BundleTaskError.to_query f)) - ; Some (Query.Pair ("Progress", String.to_query v.progress)) - ; Some (Query.Pair ("Storage", Storage.to_query v.storage)) - ; Some (Query.Pair ("UpdateTime", DateTime.to_query v.update_time)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Some (Query.Pair ("State", BundleTaskState.to_query v.state)) - ; Some (Query.Pair ("BundleId", String.to_query v.bundle_id)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.bundle_task_error (fun f -> - "bundle_task_error", BundleTaskError.to_json f) - ; Some ("progress", String.to_json v.progress) - ; Some ("storage", Storage.to_json v.storage) - ; Some ("update_time", DateTime.to_json v.update_time) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Some ("state", BundleTaskState.to_json v.state) - ; Some ("bundle_id", String.to_json v.bundle_id) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; bundle_id = String.of_json (Util.of_option_exn (Json.lookup j "bundle_id")) - ; state = BundleTaskState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; update_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "update_time")) - ; storage = Storage.of_json (Util.of_option_exn (Json.lookup j "storage")) - ; progress = String.of_json (Util.of_option_exn (Json.lookup j "progress")) - ; bundle_task_error = - Util.option_map (Json.lookup j "bundle_task_error") BundleTaskError.of_json - } -end - -module VolumeStatusItem = struct - type t = - { volume_id : String.t option - ; availability_zone : String.t option - ; volume_status : VolumeStatusInfo.t option - ; events : VolumeStatusEventsList.t - ; actions : VolumeStatusActionsList.t - } - - let make ?volume_id ?availability_zone ?volume_status ?(events = []) ?(actions = []) () - = - { volume_id; availability_zone; volume_status; events; actions } - - let parse xml = - Some - { volume_id = Util.option_bind (Xml.member "volumeId" xml) String.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; volume_status = - Util.option_bind (Xml.member "volumeStatus" xml) VolumeStatusInfo.parse - ; events = - Util.of_option - [] - (Util.option_bind (Xml.member "eventsSet" xml) VolumeStatusEventsList.parse) - ; actions = - Util.of_option - [] - (Util.option_bind (Xml.member "actionsSet" xml) VolumeStatusActionsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ActionsSet", VolumeStatusActionsList.to_query v.actions)) - ; Some (Query.Pair ("EventsSet", VolumeStatusEventsList.to_query v.events)) - ; Util.option_map v.volume_status (fun f -> - Query.Pair ("VolumeStatus", VolumeStatusInfo.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.volume_id (fun f -> - Query.Pair ("VolumeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("actions", VolumeStatusActionsList.to_json v.actions) - ; Some ("events", VolumeStatusEventsList.to_json v.events) - ; Util.option_map v.volume_status (fun f -> - "volume_status", VolumeStatusInfo.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) - ]) - - let of_json j = - { volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; volume_status = - Util.option_map (Json.lookup j "volume_status") VolumeStatusInfo.of_json - ; events = - VolumeStatusEventsList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; actions = - VolumeStatusActionsList.of_json (Util.of_option_exn (Json.lookup j "actions")) - } -end - -module CreateVolumePermissionList = struct - type t = CreateVolumePermission.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CreateVolumePermission.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list CreateVolumePermission.to_query v - - let to_json v = `List (List.map CreateVolumePermission.to_json v) - - let of_json j = Json.to_list CreateVolumePermission.of_json j -end - -module Volume = struct - type t = - { volume_id : String.t - ; size : Integer.t - ; snapshot_id : String.t - ; availability_zone : String.t - ; state : VolumeState.t - ; create_time : DateTime.t - ; attachments : VolumeAttachmentList.t - ; tags : TagList.t - ; volume_type : VolumeType.t - ; iops : Integer.t option - ; encrypted : Boolean.t - ; kms_key_id : String.t option - } - - let make - ~volume_id - ~size - ~snapshot_id - ~availability_zone - ~state - ~create_time - ?(attachments = []) - ?(tags = []) - ~volume_type - ?iops - ~encrypted - ?kms_key_id - () = - { volume_id - ; size - ; snapshot_id - ; availability_zone - ; state - ; create_time - ; attachments - ; tags - ; volume_type - ; iops - ; encrypted - ; kms_key_id - } - - let parse xml = - Some - { volume_id = - Xml.required - "volumeId" - (Util.option_bind (Xml.member "volumeId" xml) String.parse) - ; size = - Xml.required "size" (Util.option_bind (Xml.member "size" xml) Integer.parse) - ; snapshot_id = - Xml.required - "snapshotId" - (Util.option_bind (Xml.member "snapshotId" xml) String.parse) - ; availability_zone = - Xml.required - "availabilityZone" - (Util.option_bind (Xml.member "availabilityZone" xml) String.parse) - ; state = - Xml.required - "status" - (Util.option_bind (Xml.member "status" xml) VolumeState.parse) - ; create_time = - Xml.required - "createTime" - (Util.option_bind (Xml.member "createTime" xml) DateTime.parse) - ; attachments = - Util.of_option - [] - (Util.option_bind (Xml.member "attachmentSet" xml) VolumeAttachmentList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; volume_type = - Xml.required - "volumeType" - (Util.option_bind (Xml.member "volumeType" xml) VolumeType.parse) - ; iops = Util.option_bind (Xml.member "iops" xml) Integer.parse - ; encrypted = - Xml.required - "encrypted" - (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse) - ; kms_key_id = Util.option_bind (Xml.member "kmsKeyId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Some (Query.Pair ("Encrypted", Boolean.to_query v.encrypted)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Some (Query.Pair ("VolumeType", VolumeType.to_query v.volume_type)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some - (Query.Pair ("AttachmentSet", VolumeAttachmentList.to_query v.attachments)) - ; Some (Query.Pair ("CreateTime", DateTime.to_query v.create_time)) - ; Some (Query.Pair ("Status", VolumeState.to_query v.state)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ; Some (Query.Pair ("Size", Integer.to_query v.size)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Some ("encrypted", Boolean.to_json v.encrypted) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Some ("volume_type", VolumeType.to_json v.volume_type) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("attachments", VolumeAttachmentList.to_json v.attachments) - ; Some ("create_time", DateTime.to_json v.create_time) - ; Some ("state", VolumeState.to_json v.state) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some ("snapshot_id", String.to_json v.snapshot_id) - ; Some ("size", Integer.to_json v.size) - ; Some ("volume_id", String.to_json v.volume_id) - ]) - - let of_json j = - { volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; size = Integer.of_json (Util.of_option_exn (Json.lookup j "size")) - ; snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; state = VolumeState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; create_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "create_time")) - ; attachments = - VolumeAttachmentList.of_json (Util.of_option_exn (Json.lookup j "attachments")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; volume_type = VolumeType.of_json (Util.of_option_exn (Json.lookup j "volume_type")) - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; encrypted = Boolean.of_json (Util.of_option_exn (Json.lookup j "encrypted")) - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - } -end - -module Region = struct - type t = - { region_name : String.t option - ; endpoint : String.t option - } - - let make ?region_name ?endpoint () = { region_name; endpoint } - - let parse xml = - Some - { region_name = Util.option_bind (Xml.member "regionName" xml) String.parse - ; endpoint = Util.option_bind (Xml.member "regionEndpoint" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.endpoint (fun f -> - Query.Pair ("RegionEndpoint", String.to_query f)) - ; Util.option_map v.region_name (fun f -> - Query.Pair ("RegionName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.endpoint (fun f -> "endpoint", String.to_json f) - ; Util.option_map v.region_name (fun f -> "region_name", String.to_json f) - ]) - - let of_json j = - { region_name = Util.option_map (Json.lookup j "region_name") String.of_json - ; endpoint = Util.option_map (Json.lookup j "endpoint") String.of_json - } -end - -module Address = struct - type t = - { instance_id : String.t option - ; public_ip : String.t option - ; allocation_id : String.t option - ; association_id : String.t option - ; domain : DomainType.t option - ; network_interface_id : String.t option - ; network_interface_owner_id : String.t option - ; private_ip_address : String.t option - } - - let make - ?instance_id - ?public_ip - ?allocation_id - ?association_id - ?domain - ?network_interface_id - ?network_interface_owner_id - ?private_ip_address - () = - { instance_id - ; public_ip - ; allocation_id - ; association_id - ; domain - ; network_interface_id - ; network_interface_owner_id - ; private_ip_address - } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - ; allocation_id = Util.option_bind (Xml.member "allocationId" xml) String.parse - ; association_id = Util.option_bind (Xml.member "associationId" xml) String.parse - ; domain = Util.option_bind (Xml.member "domain" xml) DomainType.parse - ; network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; network_interface_owner_id = - Util.option_bind (Xml.member "networkInterfaceOwnerId" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.network_interface_owner_id (fun f -> - Query.Pair ("NetworkInterfaceOwnerId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ; Util.option_map v.domain (fun f -> - Query.Pair ("Domain", DomainType.to_query f)) - ; Util.option_map v.association_id (fun f -> - Query.Pair ("AssociationId", String.to_query f)) - ; Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.network_interface_owner_id (fun f -> - "network_interface_owner_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ; Util.option_map v.domain (fun f -> "domain", DomainType.to_json f) - ; Util.option_map v.association_id (fun f -> "association_id", String.to_json f) - ; Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - ; association_id = Util.option_map (Json.lookup j "association_id") String.of_json - ; domain = Util.option_map (Json.lookup j "domain") DomainType.of_json - ; network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; network_interface_owner_id = - Util.option_map (Json.lookup j "network_interface_owner_id") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - } -end - -module VpnConnection = struct - type t = - { vpn_connection_id : String.t - ; state : VpnState.t - ; customer_gateway_configuration : String.t option - ; type_ : GatewayType.t - ; customer_gateway_id : String.t - ; vpn_gateway_id : String.t option - ; tags : TagList.t - ; vgw_telemetry : VgwTelemetryList.t - ; options : VpnConnectionOptions.t option - ; routes : VpnStaticRouteList.t - } - - let make - ~vpn_connection_id - ~state - ?customer_gateway_configuration - ~type_ - ~customer_gateway_id - ?vpn_gateway_id - ?(tags = []) - ?(vgw_telemetry = []) - ?options - ?(routes = []) - () = - { vpn_connection_id - ; state - ; customer_gateway_configuration - ; type_ - ; customer_gateway_id - ; vpn_gateway_id - ; tags - ; vgw_telemetry - ; options - ; routes - } - - let parse xml = - Some - { vpn_connection_id = - Xml.required - "vpnConnectionId" - (Util.option_bind (Xml.member "vpnConnectionId" xml) String.parse) - ; state = - Xml.required "state" (Util.option_bind (Xml.member "state" xml) VpnState.parse) - ; customer_gateway_configuration = - Util.option_bind (Xml.member "customerGatewayConfiguration" xml) String.parse - ; type_ = - Xml.required "type" (Util.option_bind (Xml.member "type" xml) GatewayType.parse) - ; customer_gateway_id = - Xml.required - "customerGatewayId" - (Util.option_bind (Xml.member "customerGatewayId" xml) String.parse) - ; vpn_gateway_id = Util.option_bind (Xml.member "vpnGatewayId" xml) String.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; vgw_telemetry = - Util.of_option - [] - (Util.option_bind (Xml.member "vgwTelemetry" xml) VgwTelemetryList.parse) - ; options = Util.option_bind (Xml.member "options" xml) VpnConnectionOptions.parse - ; routes = - Util.of_option - [] - (Util.option_bind (Xml.member "routes" xml) VpnStaticRouteList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Routes", VpnStaticRouteList.to_query v.routes)) - ; Util.option_map v.options (fun f -> - Query.Pair ("Options", VpnConnectionOptions.to_query f)) - ; Some (Query.Pair ("VgwTelemetry", VgwTelemetryList.to_query v.vgw_telemetry)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.vpn_gateway_id (fun f -> - Query.Pair ("VpnGatewayId", String.to_query f)) - ; Some (Query.Pair ("CustomerGatewayId", String.to_query v.customer_gateway_id)) - ; Some (Query.Pair ("Type", GatewayType.to_query v.type_)) - ; Util.option_map v.customer_gateway_configuration (fun f -> - Query.Pair ("CustomerGatewayConfiguration", String.to_query f)) - ; Some (Query.Pair ("State", VpnState.to_query v.state)) - ; Some (Query.Pair ("VpnConnectionId", String.to_query v.vpn_connection_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("routes", VpnStaticRouteList.to_json v.routes) - ; Util.option_map v.options (fun f -> "options", VpnConnectionOptions.to_json f) - ; Some ("vgw_telemetry", VgwTelemetryList.to_json v.vgw_telemetry) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.vpn_gateway_id (fun f -> "vpn_gateway_id", String.to_json f) - ; Some ("customer_gateway_id", String.to_json v.customer_gateway_id) - ; Some ("type_", GatewayType.to_json v.type_) - ; Util.option_map v.customer_gateway_configuration (fun f -> - "customer_gateway_configuration", String.to_json f) - ; Some ("state", VpnState.to_json v.state) - ; Some ("vpn_connection_id", String.to_json v.vpn_connection_id) - ]) - - let of_json j = - { vpn_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_connection_id")) - ; state = VpnState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; customer_gateway_configuration = - Util.option_map (Json.lookup j "customer_gateway_configuration") String.of_json - ; type_ = GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; customer_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "customer_gateway_id")) - ; vpn_gateway_id = Util.option_map (Json.lookup j "vpn_gateway_id") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; vgw_telemetry = - VgwTelemetryList.of_json (Util.of_option_exn (Json.lookup j "vgw_telemetry")) - ; options = Util.option_map (Json.lookup j "options") VpnConnectionOptions.of_json - ; routes = VpnStaticRouteList.of_json (Util.of_option_exn (Json.lookup j "routes")) - } -end - -module ReservedInstancesOffering = struct - type t = - { reserved_instances_offering_id : String.t option - ; instance_type : InstanceType.t option - ; availability_zone : String.t option - ; duration : Long.t option - ; usage_price : Float.t option - ; fixed_price : Float.t option - ; product_description : RIProductDescription.t option - ; instance_tenancy : Tenancy.t option - ; currency_code : CurrencyCodeValues.t option - ; offering_type : OfferingTypeValues.t option - ; recurring_charges : RecurringChargesList.t - ; marketplace : Boolean.t option - ; pricing_details : PricingDetailsList.t - } - - let make - ?reserved_instances_offering_id - ?instance_type - ?availability_zone - ?duration - ?usage_price - ?fixed_price - ?product_description - ?instance_tenancy - ?currency_code - ?offering_type - ?(recurring_charges = []) - ?marketplace - ?(pricing_details = []) - () = - { reserved_instances_offering_id - ; instance_type - ; availability_zone - ; duration - ; usage_price - ; fixed_price - ; product_description - ; instance_tenancy - ; currency_code - ; offering_type - ; recurring_charges - ; marketplace - ; pricing_details - } - - let parse xml = - Some - { reserved_instances_offering_id = - Util.option_bind (Xml.member "reservedInstancesOfferingId" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; duration = Util.option_bind (Xml.member "duration" xml) Long.parse - ; usage_price = Util.option_bind (Xml.member "usagePrice" xml) Float.parse - ; fixed_price = Util.option_bind (Xml.member "fixedPrice" xml) Float.parse - ; product_description = - Util.option_bind - (Xml.member "productDescription" xml) - RIProductDescription.parse - ; instance_tenancy = - Util.option_bind (Xml.member "instanceTenancy" xml) Tenancy.parse - ; currency_code = - Util.option_bind (Xml.member "currencyCode" xml) CurrencyCodeValues.parse - ; offering_type = - Util.option_bind (Xml.member "offeringType" xml) OfferingTypeValues.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "recurringCharges" xml) - RecurringChargesList.parse) - ; marketplace = Util.option_bind (Xml.member "marketplace" xml) Boolean.parse - ; pricing_details = - Util.of_option - [] + ("BlockDeviceMapping", + (BlockDeviceMappingList.to_query v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (SpotPlacement.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.addressing_type + (fun f -> Query.Pair ("AddressingType", (String.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some + (Query.Pair + ("GroupSet", + (GroupIdentifierList.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.monitoring + (fun f -> + ("monitoring", (RunInstancesMonitoringEnabled.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> + ("iam_instance_profile", + (IamInstanceProfileSpecification.to_json f))); + Some + ("network_interfaces", + (InstanceNetworkInterfaceSpecificationList.to_json + v.network_interfaces)); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappingList.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (SpotPlacement.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.addressing_type + (fun f -> ("addressing_type", (String.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("security_groups", + (GroupIdentifierList.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + addressing_type = + (Util.option_map (Json.lookup j "addressing_type") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + placement = + (Util.option_map (Json.lookup j "placement") SpotPlacement.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + network_interfaces = + (InstanceNetworkInterfaceSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + IamInstanceProfileSpecification.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + monitoring = + (Util.option_map (Json.lookup j "monitoring") + RunInstancesMonitoringEnabled.of_json) + } + end +module SpotInstanceState = + struct + type t = + | Open + | Active + | Closed + | Cancelled + | Failed + let str_to_t = + [("failed", Failed); + ("cancelled", Cancelled); + ("closed", Closed); + ("active", Active); + ("open", Open)] + let t_to_str = + [(Failed, "failed"); + (Cancelled, "cancelled"); + (Closed, "closed"); + (Active, "active"); + (Open, "open")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SpotInstanceStateFault = + struct + type t = { + code: String.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) String.parse); + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module SpotInstanceStatus = + struct + type t = + { + code: String.t option ; + update_time: DateTime.t option ; + message: String.t option } + let make ?code ?update_time ?message () = + { code; update_time; message } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) String.parse); + update_time = + (Util.option_bind (Xml.member "updateTime" xml) DateTime.parse); + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.update_time + (fun f -> Query.Pair ("UpdateTime", (DateTime.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.update_time + (fun f -> ("update_time", (DateTime.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") String.of_json); + update_time = + (Util.option_map (Json.lookup j "update_time") DateTime.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module SpotInstanceType = + struct + type t = + | One_time + | Persistent + let str_to_t = [("persistent", Persistent); ("one-time", One_time)] + let t_to_str = [(Persistent, "persistent"); (One_time, "one-time")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ExportTaskState = + struct + type t = + | Active + | Cancelling + | Cancelled + | Completed + let str_to_t = + [("completed", Completed); + ("cancelled", Cancelled); + ("cancelling", Cancelling); + ("active", Active)] + let t_to_str = + [(Completed, "completed"); + (Cancelled, "cancelled"); + (Cancelling, "cancelling"); + (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ExportToS3Task = + struct + type t = + { + disk_image_format: DiskImageFormat.t option ; + container_format: ContainerFormat.t option ; + s3_bucket: String.t option ; + s3_key: String.t option } + let make ?disk_image_format ?container_format ?s3_bucket ?s3_key () = + { disk_image_format; container_format; s3_bucket; s3_key } + let parse xml = + Some + { + disk_image_format = + (Util.option_bind (Xml.member "diskImageFormat" xml) + DiskImageFormat.parse); + container_format = + (Util.option_bind (Xml.member "containerFormat" xml) + ContainerFormat.parse); + s3_bucket = + (Util.option_bind (Xml.member "s3Bucket" xml) String.parse); + s3_key = (Util.option_bind (Xml.member "s3Key" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> Query.Pair ("S3Key", (String.to_query f))); + Util.option_map v.s3_bucket + (fun f -> Query.Pair ("S3Bucket", (String.to_query f))); + Util.option_map v.container_format + (fun f -> + Query.Pair ("ContainerFormat", (ContainerFormat.to_query f))); + Util.option_map v.disk_image_format + (fun f -> + Query.Pair ("DiskImageFormat", (DiskImageFormat.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> ("s3_key", (String.to_json f))); + Util.option_map v.s3_bucket + (fun f -> ("s3_bucket", (String.to_json f))); + Util.option_map v.container_format + (fun f -> ("container_format", (ContainerFormat.to_json f))); + Util.option_map v.disk_image_format + (fun f -> ("disk_image_format", (DiskImageFormat.to_json f)))]) + let of_json j = + { + disk_image_format = + (Util.option_map (Json.lookup j "disk_image_format") + DiskImageFormat.of_json); + container_format = + (Util.option_map (Json.lookup j "container_format") + ContainerFormat.of_json); + s3_bucket = + (Util.option_map (Json.lookup j "s3_bucket") String.of_json); + s3_key = (Util.option_map (Json.lookup j "s3_key") String.of_json) + } + end +module InstanceExportDetails = + struct + type t = + { + instance_id: String.t option ; + target_environment: ExportEnvironment.t option } + let make ?instance_id ?target_environment () = + { instance_id; target_environment } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + target_environment = + (Util.option_bind (Xml.member "targetEnvironment" xml) + ExportEnvironment.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.target_environment + (fun f -> + Query.Pair + ("TargetEnvironment", (ExportEnvironment.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.target_environment + (fun f -> ("target_environment", (ExportEnvironment.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + target_environment = + (Util.option_map (Json.lookup j "target_environment") + ExportEnvironment.of_json) + } + end +module IpPermissionList = + struct + type t = IpPermission.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map IpPermission.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list IpPermission.to_query v + let to_json v = `List (List.map IpPermission.to_json v) + let of_json j = Json.to_list IpPermission.of_json j + end +module EbsInstanceBlockDeviceSpecification = + struct + type t = + { + volume_id: String.t option ; + delete_on_termination: Boolean.t option } + let make ?volume_id ?delete_on_termination () = + { volume_id; delete_on_termination } + let parse xml = + Some + { + volume_id = + (Util.option_bind (Xml.member "volumeId" xml) String.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.volume_id + (fun f -> Query.Pair ("VolumeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.volume_id + (fun f -> ("volume_id", (String.to_json f)))]) + let of_json j = + { + volume_id = + (Util.option_map (Json.lookup j "volume_id") String.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module InternetGatewayAttachmentList = + struct + type t = InternetGatewayAttachment.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InternetGatewayAttachment.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InternetGatewayAttachment.to_query v + let to_json v = `List (List.map InternetGatewayAttachment.to_json v) + let of_json j = Json.to_list InternetGatewayAttachment.of_json j + end +module BatchState = + struct + type t = + | Submitted + | Active + | Cancelled + | Failed + | Cancelled_running + | Cancelled_terminating + let str_to_t = + [("cancelled_terminating", Cancelled_terminating); + ("cancelled_running", Cancelled_running); + ("failed", Failed); + ("cancelled", Cancelled); + ("active", Active); + ("submitted", Submitted)] + let t_to_str = + [(Cancelled_terminating, "cancelled_terminating"); + (Cancelled_running, "cancelled_running"); + (Failed, "failed"); + (Cancelled, "cancelled"); + (Active, "active"); + (Submitted, "submitted")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SpotFleetRequestConfigData = + struct + type t = + { + client_token: String.t option ; + spot_price: String.t ; + target_capacity: Integer.t ; + valid_from: DateTime.t option ; + valid_until: DateTime.t option ; + terminate_instances_with_expiration: Boolean.t option ; + iam_fleet_role: String.t ; + launch_specifications: LaunchSpecsList.t } + let make ?client_token ~spot_price ~target_capacity ?valid_from + ?valid_until ?terminate_instances_with_expiration ~iam_fleet_role + ~launch_specifications () = + { + client_token; + spot_price; + target_capacity; + valid_from; + valid_until; + terminate_instances_with_expiration; + iam_fleet_role; + launch_specifications + } + let parse xml = + Some + { + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + spot_price = + (Xml.required "spotPrice" + (Util.option_bind (Xml.member "spotPrice" xml) String.parse)); + target_capacity = + (Xml.required "targetCapacity" + (Util.option_bind (Xml.member "targetCapacity" xml) + Integer.parse)); + valid_from = + (Util.option_bind (Xml.member "validFrom" xml) DateTime.parse); + valid_until = + (Util.option_bind (Xml.member "validUntil" xml) DateTime.parse); + terminate_instances_with_expiration = (Util.option_bind - (Xml.member "pricingDetailsSet" xml) - PricingDetailsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "terminateInstancesWithExpiration" xml) + Boolean.parse); + iam_fleet_role = + (Xml.required "iamFleetRole" + (Util.option_bind (Xml.member "iamFleetRole" xml) String.parse)); + launch_specifications = + (Xml.required "launchSpecifications" + (Util.option_bind (Xml.member "launchSpecifications" xml) + LaunchSpecsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LaunchSpecifications", + (LaunchSpecsList.to_query v.launch_specifications))); + Some + (Query.Pair ("IamFleetRole", (String.to_query v.iam_fleet_role))); + Util.option_map v.terminate_instances_with_expiration + (fun f -> + Query.Pair + ("TerminateInstancesWithExpiration", (Boolean.to_query f))); + Util.option_map v.valid_until + (fun f -> Query.Pair ("ValidUntil", (DateTime.to_query f))); + Util.option_map v.valid_from + (fun f -> Query.Pair ("ValidFrom", (DateTime.to_query f))); + Some (Query.Pair - ("PricingDetailsSet", PricingDetailsList.to_query v.pricing_details)) - ; Util.option_map v.marketplace (fun f -> - Query.Pair ("Marketplace", Boolean.to_query f)) - ; Some + ("TargetCapacity", (Integer.to_query v.target_capacity))); + Some (Query.Pair ("SpotPrice", (String.to_query v.spot_price))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("launch_specifications", + (LaunchSpecsList.to_json v.launch_specifications)); + Some ("iam_fleet_role", (String.to_json v.iam_fleet_role)); + Util.option_map v.terminate_instances_with_expiration + (fun f -> + ("terminate_instances_with_expiration", (Boolean.to_json f))); + Util.option_map v.valid_until + (fun f -> ("valid_until", (DateTime.to_json f))); + Util.option_map v.valid_from + (fun f -> ("valid_from", (DateTime.to_json f))); + Some ("target_capacity", (Integer.to_json v.target_capacity)); + Some ("spot_price", (String.to_json v.spot_price)); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f)))]) + let of_json j = + { + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + spot_price = + (String.of_json (Util.of_option_exn (Json.lookup j "spot_price"))); + target_capacity = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "target_capacity"))); + valid_from = + (Util.option_map (Json.lookup j "valid_from") DateTime.of_json); + valid_until = + (Util.option_map (Json.lookup j "valid_until") DateTime.of_json); + terminate_instances_with_expiration = + (Util.option_map + (Json.lookup j "terminate_instances_with_expiration") + Boolean.of_json); + iam_fleet_role = + (String.of_json + (Util.of_option_exn (Json.lookup j "iam_fleet_role"))); + launch_specifications = + (LaunchSpecsList.of_json + (Util.of_option_exn (Json.lookup j "launch_specifications"))) + } + end +module AvailabilityZoneMessageList = + struct + type t = AvailabilityZoneMessage.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AvailabilityZoneMessage.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list AvailabilityZoneMessage.to_query v + let to_json v = `List (List.map AvailabilityZoneMessage.to_json v) + let of_json j = Json.to_list AvailabilityZoneMessage.of_json j + end +module AvailabilityZoneState = + struct + type t = + | Available + let str_to_t = [("available", Available)] + let t_to_str = [(Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module TrafficType = + struct + type t = + | ACCEPT + | REJECT + | ALL + let str_to_t = [("ALL", ALL); ("REJECT", REJECT); ("ACCEPT", ACCEPT)] + let t_to_str = [(ALL, "ALL"); (REJECT, "REJECT"); (ACCEPT, "ACCEPT")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BundleTaskError = + struct + type t = { + code: String.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = (Util.option_bind (Xml.member "code" xml) String.parse); + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f)))]) + let of_json j = + { + code = (Util.option_map (Json.lookup j "code") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module BundleTaskState = + struct + type t = + | Pending + | Waiting_for_shutdown + | Bundling + | Storing + | Cancelling + | Complete + | Failed + let str_to_t = + [("failed", Failed); + ("complete", Complete); + ("cancelling", Cancelling); + ("storing", Storing); + ("bundling", Bundling); + ("waiting-for-shutdown", Waiting_for_shutdown); + ("pending", Pending)] + let t_to_str = + [(Failed, "failed"); + (Complete, "complete"); + (Cancelling, "cancelling"); + (Storing, "storing"); + (Bundling, "bundling"); + (Waiting_for_shutdown, "waiting-for-shutdown"); + (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Storage = + struct + type t = { + s3: S3Storage.t option } + let make ?s3 () = { s3 } + let parse xml = + Some { s3 = (Util.option_bind (Xml.member "S3" xml) S3Storage.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3 + (fun f -> Query.Pair ("S3", (S3Storage.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3 (fun f -> ("s3", (S3Storage.to_json f)))]) + let of_json j = + { s3 = (Util.option_map (Json.lookup j "s3") S3Storage.of_json) } + end +module VolumeStatusActionsList = + struct + type t = VolumeStatusAction.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VolumeStatusAction.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VolumeStatusAction.to_query v + let to_json v = `List (List.map VolumeStatusAction.to_json v) + let of_json j = Json.to_list VolumeStatusAction.of_json j + end +module VolumeStatusEventsList = + struct + type t = VolumeStatusEvent.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VolumeStatusEvent.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VolumeStatusEvent.to_query v + let to_json v = `List (List.map VolumeStatusEvent.to_json v) + let of_json j = Json.to_list VolumeStatusEvent.of_json j + end +module VolumeStatusInfo = + struct + type t = + { + status: VolumeStatusInfoStatus.t option ; + details: VolumeStatusDetailsList.t } + let make ?status ?(details= []) () = { status; details } + let parse xml = + Some + { + status = + (Util.option_bind (Xml.member "status" xml) + VolumeStatusInfoStatus.parse); + details = + (Util.of_option [] + (Util.option_bind (Xml.member "details" xml) + VolumeStatusDetailsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Details", (VolumeStatusDetailsList.to_query v.details))); + Util.option_map v.status + (fun f -> + Query.Pair ("Status", (VolumeStatusInfoStatus.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("details", (VolumeStatusDetailsList.to_json v.details)); + Util.option_map v.status + (fun f -> ("status", (VolumeStatusInfoStatus.to_json f)))]) + let of_json j = + { + status = + (Util.option_map (Json.lookup j "status") + VolumeStatusInfoStatus.of_json); + details = + (VolumeStatusDetailsList.of_json + (Util.of_option_exn (Json.lookup j "details"))) + } + end +module CreateVolumePermission = + struct + type t = { + user_id: String.t option ; + group: PermissionGroup.t option } + let make ?user_id ?group () = { user_id; group } + let parse xml = + Some + { + user_id = (Util.option_bind (Xml.member "userId" xml) String.parse); + group = + (Util.option_bind (Xml.member "group" xml) PermissionGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group + (fun f -> Query.Pair ("Group", (PermissionGroup.to_query f))); + Util.option_map v.user_id + (fun f -> Query.Pair ("UserId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group + (fun f -> ("group", (PermissionGroup.to_json f))); + Util.option_map v.user_id + (fun f -> ("user_id", (String.to_json f)))]) + let of_json j = + { + user_id = (Util.option_map (Json.lookup j "user_id") String.of_json); + group = + (Util.option_map (Json.lookup j "group") PermissionGroup.of_json) + } + end +module VolumeAttachmentList = + struct + type t = VolumeAttachment.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VolumeAttachment.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VolumeAttachment.to_query v + let to_json v = `List (List.map VolumeAttachment.to_json v) + let of_json j = Json.to_list VolumeAttachment.of_json j + end +module VolumeState = + struct + type t = + | Creating + | Available + | In_use + | Deleting + | Deleted + | Error + let str_to_t = + [("error", Error); + ("deleted", Deleted); + ("deleting", Deleting); + ("in-use", In_use); + ("available", Available); + ("creating", Creating)] + let t_to_str = + [(Error, "error"); + (Deleted, "deleted"); + (Deleting, "deleting"); + (In_use, "in-use"); + (Available, "available"); + (Creating, "creating")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DomainType = + struct + type t = + | Vpc + | Standard + let str_to_t = [("standard", Standard); ("vpc", Vpc)] + let t_to_str = [(Standard, "standard"); (Vpc, "vpc")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VgwTelemetryList = + struct + type t = VgwTelemetry.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VgwTelemetry.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VgwTelemetry.to_query v + let to_json v = `List (List.map VgwTelemetry.to_json v) + let of_json j = Json.to_list VgwTelemetry.of_json j + end +module VpnConnectionOptions = + struct + type t = { + static_routes_only: Boolean.t option } + let make ?static_routes_only () = { static_routes_only } + let parse xml = + Some + { + static_routes_only = + (Util.option_bind (Xml.member "staticRoutesOnly" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.static_routes_only + (fun f -> Query.Pair ("StaticRoutesOnly", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.static_routes_only + (fun f -> ("static_routes_only", (Boolean.to_json f)))]) + let of_json j = + { + static_routes_only = + (Util.option_map (Json.lookup j "static_routes_only") + Boolean.of_json) + } + end +module VpnStaticRouteList = + struct + type t = VpnStaticRoute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VpnStaticRoute.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpnStaticRoute.to_query v + let to_json v = `List (List.map VpnStaticRoute.to_json v) + let of_json j = Json.to_list VpnStaticRoute.of_json j + end +module PricingDetailsList = + struct + type t = PricingDetail.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map PricingDetail.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PricingDetail.to_query v + let to_json v = `List (List.map PricingDetail.to_json v) + let of_json j = Json.to_list PricingDetail.of_json j + end +module InstanceList = + struct + type t = Instance.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Instance.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Instance.to_query v + let to_json v = `List (List.map Instance.to_json v) + let of_json j = Json.to_list Instance.of_json j + end +module VpcPeeringConnectionStateReason = + struct + type t = + { + code: VpcPeeringConnectionStateReasonCode.t option ; + message: String.t option } + let make ?code ?message () = { code; message } + let parse xml = + Some + { + code = + (Util.option_bind (Xml.member "code" xml) + VpcPeeringConnectionStateReasonCode.parse); + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> + Query.Pair + ("Code", (VpcPeeringConnectionStateReasonCode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code + (fun f -> + ("code", (VpcPeeringConnectionStateReasonCode.to_json f)))]) + let of_json j = + { + code = + (Util.option_map (Json.lookup j "code") + VpcPeeringConnectionStateReasonCode.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module VpcPeeringConnectionVpcInfo = + struct + type t = + { + cidr_block: String.t option ; + owner_id: String.t option ; + vpc_id: String.t option } + let make ?cidr_block ?owner_id ?vpc_id () = + { cidr_block; owner_id; vpc_id } + let parse xml = + Some + { + cidr_block = + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse); + owner_id = + (Util.option_bind (Xml.member "ownerId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f))); + Util.option_map v.cidr_block + (fun f -> Query.Pair ("CidrBlock", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f))); + Util.option_map v.cidr_block + (fun f -> ("cidr_block", (String.to_json f)))]) + let of_json j = + { + cidr_block = + (Util.option_map (Json.lookup j "cidr_block") String.of_json); + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json) + } + end +module VpcState = + struct + type t = + | Pending + | Available + let str_to_t = [("available", Available); ("pending", Pending)] + let t_to_str = [(Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module NetworkAclAssociationList = + struct + type t = NetworkAclAssociation.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NetworkAclAssociation.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list NetworkAclAssociation.to_query v + let to_json v = `List (List.map NetworkAclAssociation.to_json v) + let of_json j = Json.to_list NetworkAclAssociation.of_json j + end +module NetworkAclEntryList = + struct + type t = NetworkAclEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NetworkAclEntry.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list NetworkAclEntry.to_query v + let to_json v = `List (List.map NetworkAclEntry.to_json v) + let of_json j = Json.to_list NetworkAclEntry.of_json j + end +module SubnetState = + struct + type t = + | Pending + | Available + let str_to_t = [("available", Available); ("pending", Pending)] + let t_to_str = [(Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SnapshotDetailList = + struct + type t = SnapshotDetail.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SnapshotDetail.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list SnapshotDetail.to_query v + let to_json v = `List (List.map SnapshotDetail.to_json v) + let of_json j = Json.to_list SnapshotDetail.of_json j + end +module CancelSpotFleetRequestsError = + struct + type t = { + code: CancelBatchErrorCode.t ; + message: String.t } + let make ~code ~message () = { code; message } + let parse xml = + Some + { + code = + (Xml.required "code" + (Util.option_bind (Xml.member "code" xml) + CancelBatchErrorCode.parse)); + message = + (Xml.required "message" + (Util.option_bind (Xml.member "message" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Message", (String.to_query v.message))); + Some (Query.Pair ("Code", (CancelBatchErrorCode.to_query v.code)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("message", (String.to_json v.message)); + Some ("code", (CancelBatchErrorCode.to_json v.code))]) + let of_json j = + { + code = + (CancelBatchErrorCode.of_json + (Util.of_option_exn (Json.lookup j "code"))); + message = + (String.of_json (Util.of_option_exn (Json.lookup j "message"))) + } + end +module AccountAttributeValueList = + struct + type t = AccountAttributeValue.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AccountAttributeValue.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list AccountAttributeValue.to_query v + let to_json v = `List (List.map AccountAttributeValue.to_json v) + let of_json j = Json.to_list AccountAttributeValue.of_json j + end +module DiskImageDetail = + struct + type t = + { + format: DiskImageFormat.t ; + bytes: Long.t ; + import_manifest_url: String.t } + let make ~format ~bytes ~import_manifest_url () = + { format; bytes; import_manifest_url } + let parse xml = + Some + { + format = + (Xml.required "format" + (Util.option_bind (Xml.member "format" xml) + DiskImageFormat.parse)); + bytes = + (Xml.required "bytes" + (Util.option_bind (Xml.member "bytes" xml) Long.parse)); + import_manifest_url = + (Xml.required "importManifestUrl" + (Util.option_bind (Xml.member "importManifestUrl" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ImportManifestUrl", + (String.to_query v.import_manifest_url))); + Some (Query.Pair ("Bytes", (Long.to_query v.bytes))); + Some (Query.Pair ("Format", (DiskImageFormat.to_query v.format)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("import_manifest_url", (String.to_json v.import_manifest_url)); + Some ("bytes", (Long.to_json v.bytes)); + Some ("format", (DiskImageFormat.to_json v.format))]) + let of_json j = + { + format = + (DiskImageFormat.of_json + (Util.of_option_exn (Json.lookup j "format"))); + bytes = (Long.of_json (Util.of_option_exn (Json.lookup j "bytes"))); + import_manifest_url = + (String.of_json + (Util.of_option_exn (Json.lookup j "import_manifest_url"))) + } + end +module VolumeDetail = + struct + type t = { + size: Long.t } + let make ~size () = { size } + let parse xml = + Some + { + size = + (Xml.required "size" + (Util.option_bind (Xml.member "size" xml) Long.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Size", (Long.to_query v.size)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("size", (Long.to_json v.size))]) + let of_json j = + { size = (Long.of_json (Util.of_option_exn (Json.lookup j "size"))) } + end +module State = + struct + type t = + | Pending + | Available + | Deleting + | Deleted + let str_to_t = + [("Deleted", Deleted); + ("Deleting", Deleting); + ("Available", Available); + ("Pending", Pending)] + let t_to_str = + [(Deleted, "Deleted"); + (Deleting, "Deleting"); + (Available, "Available"); + (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module UserBucket = + struct + type t = { + s3_bucket: String.t option ; + s3_key: String.t option } + let make ?s3_bucket ?s3_key () = { s3_bucket; s3_key } + let parse xml = + Some + { + s3_bucket = + (Util.option_bind (Xml.member "S3Bucket" xml) String.parse); + s3_key = (Util.option_bind (Xml.member "S3Key" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> Query.Pair ("S3Key", (String.to_query f))); + Util.option_map v.s3_bucket + (fun f -> Query.Pair ("S3Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3_key + (fun f -> ("s3_key", (String.to_json f))); + Util.option_map v.s3_bucket + (fun f -> ("s3_bucket", (String.to_json f)))]) + let of_json j = + { + s3_bucket = + (Util.option_map (Json.lookup j "s3_bucket") String.of_json); + s3_key = (Util.option_map (Json.lookup j "s3_key") String.of_json) + } + end +module SnapshotState = + struct + type t = + | Pending + | Completed + | Error + let str_to_t = + [("error", Error); ("completed", Completed); ("pending", Pending)] + let t_to_str = + [(Error, "error"); (Completed, "completed"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module NetworkInterface = + struct + type t = + { + network_interface_id: String.t option ; + subnet_id: String.t option ; + vpc_id: String.t option ; + availability_zone: String.t option ; + description: String.t option ; + owner_id: String.t option ; + requester_id: String.t option ; + requester_managed: Boolean.t option ; + status: NetworkInterfaceStatus.t option ; + mac_address: String.t option ; + private_ip_address: String.t option ; + private_dns_name: String.t option ; + source_dest_check: Boolean.t option ; + groups: GroupIdentifierList.t ; + attachment: NetworkInterfaceAttachment.t option ; + association: NetworkInterfaceAssociation.t option ; + tag_set: TagList.t ; + private_ip_addresses: NetworkInterfacePrivateIpAddressList.t } + let make ?network_interface_id ?subnet_id ?vpc_id ?availability_zone + ?description ?owner_id ?requester_id ?requester_managed ?status + ?mac_address ?private_ip_address ?private_dns_name + ?source_dest_check ?(groups= []) ?attachment ?association + ?(tag_set= []) ?(private_ip_addresses= []) () = + { + network_interface_id; + subnet_id; + vpc_id; + availability_zone; + description; + owner_id; + requester_id; + requester_managed; + status; + mac_address; + private_ip_address; + private_dns_name; + source_dest_check; + groups; + attachment; + association; + tag_set; + private_ip_addresses + } + let parse xml = + Some + { + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + owner_id = + (Util.option_bind (Xml.member "ownerId" xml) String.parse); + requester_id = + (Util.option_bind (Xml.member "requesterId" xml) String.parse); + requester_managed = + (Util.option_bind (Xml.member "requesterManaged" xml) + Boolean.parse); + status = + (Util.option_bind (Xml.member "status" xml) + NetworkInterfaceStatus.parse); + mac_address = + (Util.option_bind (Xml.member "macAddress" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + private_dns_name = + (Util.option_bind (Xml.member "privateDnsName" xml) String.parse); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + Boolean.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + attachment = + (Util.option_bind (Xml.member "attachment" xml) + NetworkInterfaceAttachment.parse); + association = + (Util.option_bind (Xml.member "association" xml) + NetworkInterfaceAssociation.parse); + tag_set = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + private_ip_addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "privateIpAddressesSet" xml) + NetworkInterfacePrivateIpAddressList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PrivateIpAddressesSet", + (NetworkInterfacePrivateIpAddressList.to_query + v.private_ip_addresses))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tag_set))); + Util.option_map v.association + (fun f -> + Query.Pair + ("Association", (NetworkInterfaceAssociation.to_query f))); + Util.option_map v.attachment + (fun f -> + Query.Pair + ("Attachment", (NetworkInterfaceAttachment.to_query f))); + Some (Query.Pair - ("RecurringCharges", RecurringChargesList.to_query v.recurring_charges)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", OfferingTypeValues.to_query f)) - ; Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", CurrencyCodeValues.to_query f)) - ; Util.option_map v.instance_tenancy (fun f -> - Query.Pair ("InstanceTenancy", Tenancy.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", RIProductDescription.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Float.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Float.to_query f)) - ; Util.option_map v.duration (fun f -> Query.Pair ("Duration", Long.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.reserved_instances_offering_id (fun f -> - Query.Pair ("ReservedInstancesOfferingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("pricing_details", PricingDetailsList.to_json v.pricing_details) - ; Util.option_map v.marketplace (fun f -> "marketplace", Boolean.to_json f) - ; Some ("recurring_charges", RecurringChargesList.to_json v.recurring_charges) - ; Util.option_map v.offering_type (fun f -> - "offering_type", OfferingTypeValues.to_json f) - ; Util.option_map v.currency_code (fun f -> - "currency_code", CurrencyCodeValues.to_json f) - ; Util.option_map v.instance_tenancy (fun f -> - "instance_tenancy", Tenancy.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", RIProductDescription.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Float.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Float.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Long.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.reserved_instances_offering_id (fun f -> - "reserved_instances_offering_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_offering_id = - Util.option_map (Json.lookup j "reserved_instances_offering_id") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") Long.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Float.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Float.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") RIProductDescription.of_json - ; instance_tenancy = - Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json - ; currency_code = - Util.option_map (Json.lookup j "currency_code") CurrencyCodeValues.of_json - ; offering_type = - Util.option_map (Json.lookup j "offering_type") OfferingTypeValues.of_json - ; recurring_charges = - RecurringChargesList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - ; marketplace = Util.option_map (Json.lookup j "marketplace") Boolean.of_json - ; pricing_details = - PricingDetailsList.of_json (Util.of_option_exn (Json.lookup j "pricing_details")) - } -end - -module Reservation = struct - type t = - { reservation_id : String.t - ; owner_id : String.t - ; requester_id : String.t option - ; groups : GroupIdentifierList.t - ; instances : InstanceList.t - } - - let make ~reservation_id ~owner_id ?requester_id ?(groups = []) ?(instances = []) () = - { reservation_id; owner_id; requester_id; groups; instances } - - let parse xml = - Some - { reservation_id = - Xml.required - "reservationId" - (Util.option_bind (Xml.member "reservationId" xml) String.parse) - ; owner_id = - Xml.required - "ownerId" - (Util.option_bind (Xml.member "ownerId" xml) String.parse) - ; requester_id = Util.option_bind (Xml.member "requesterId" xml) String.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; instances = - Util.of_option - [] - (Util.option_bind (Xml.member "instancesSet" xml) InstanceList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstancesSet", InstanceList.to_query v.instances)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.requester_id (fun f -> - Query.Pair ("RequesterId", String.to_query f)) - ; Some (Query.Pair ("OwnerId", String.to_query v.owner_id)) - ; Some (Query.Pair ("ReservationId", String.to_query v.reservation_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instances", InstanceList.to_json v.instances) - ; Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.requester_id (fun f -> "requester_id", String.to_json f) - ; Some ("owner_id", String.to_json v.owner_id) - ; Some ("reservation_id", String.to_json v.reservation_id) - ]) - - let of_json j = - { reservation_id = - String.of_json (Util.of_option_exn (Json.lookup j "reservation_id")) - ; owner_id = String.of_json (Util.of_option_exn (Json.lookup j "owner_id")) - ; requester_id = Util.option_map (Json.lookup j "requester_id") String.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; instances = InstanceList.of_json (Util.of_option_exn (Json.lookup j "instances")) - } -end - -module VpcPeeringConnection = struct - type t = - { accepter_vpc_info : VpcPeeringConnectionVpcInfo.t option - ; expiration_time : DateTime.t option - ; requester_vpc_info : VpcPeeringConnectionVpcInfo.t option - ; status : VpcPeeringConnectionStateReason.t option - ; tags : TagList.t - ; vpc_peering_connection_id : String.t option - } - - let make - ?accepter_vpc_info - ?expiration_time - ?requester_vpc_info - ?status - ?(tags = []) - ?vpc_peering_connection_id - () = - { accepter_vpc_info - ; expiration_time - ; requester_vpc_info - ; status - ; tags - ; vpc_peering_connection_id - } - - let parse xml = - Some - { accepter_vpc_info = - Util.option_bind - (Xml.member "accepterVpcInfo" xml) - VpcPeeringConnectionVpcInfo.parse - ; expiration_time = - Util.option_bind (Xml.member "expirationTime" xml) DateTime.parse - ; requester_vpc_info = - Util.option_bind - (Xml.member "requesterVpcInfo" xml) - VpcPeeringConnectionVpcInfo.parse - ; status = - Util.option_bind (Xml.member "status" xml) VpcPeeringConnectionStateReason.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; vpc_peering_connection_id = - Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - Query.Pair ("VpcPeeringConnectionId", String.to_query f)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", VpcPeeringConnectionStateReason.to_query f)) - ; Util.option_map v.requester_vpc_info (fun f -> - Query.Pair ("RequesterVpcInfo", VpcPeeringConnectionVpcInfo.to_query f)) - ; Util.option_map v.expiration_time (fun f -> - Query.Pair ("ExpirationTime", DateTime.to_query f)) - ; Util.option_map v.accepter_vpc_info (fun f -> - Query.Pair ("AccepterVpcInfo", VpcPeeringConnectionVpcInfo.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - "vpc_peering_connection_id", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.status (fun f -> - "status", VpcPeeringConnectionStateReason.to_json f) - ; Util.option_map v.requester_vpc_info (fun f -> - "requester_vpc_info", VpcPeeringConnectionVpcInfo.to_json f) - ; Util.option_map v.expiration_time (fun f -> - "expiration_time", DateTime.to_json f) - ; Util.option_map v.accepter_vpc_info (fun f -> - "accepter_vpc_info", VpcPeeringConnectionVpcInfo.to_json f) - ]) - - let of_json j = - { accepter_vpc_info = - Util.option_map - (Json.lookup j "accepter_vpc_info") - VpcPeeringConnectionVpcInfo.of_json - ; expiration_time = Util.option_map (Json.lookup j "expiration_time") DateTime.of_json - ; requester_vpc_info = - Util.option_map - (Json.lookup j "requester_vpc_info") - VpcPeeringConnectionVpcInfo.of_json - ; status = - Util.option_map (Json.lookup j "status") VpcPeeringConnectionStateReason.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; vpc_peering_connection_id = - Util.option_map (Json.lookup j "vpc_peering_connection_id") String.of_json - } -end - -module Vpc = struct - type t = - { vpc_id : String.t - ; state : VpcState.t - ; cidr_block : String.t - ; dhcp_options_id : String.t - ; tags : TagList.t - ; instance_tenancy : Tenancy.t - ; is_default : Boolean.t - } - - let make - ~vpc_id - ~state - ~cidr_block - ~dhcp_options_id - ?(tags = []) - ~instance_tenancy - ~is_default - () = - { vpc_id; state; cidr_block; dhcp_options_id; tags; instance_tenancy; is_default } - - let parse xml = - Some - { vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - ; state = - Xml.required "state" (Util.option_bind (Xml.member "state" xml) VpcState.parse) - ; cidr_block = - Xml.required - "cidrBlock" - (Util.option_bind (Xml.member "cidrBlock" xml) String.parse) - ; dhcp_options_id = - Xml.required - "dhcpOptionsId" - (Util.option_bind (Xml.member "dhcpOptionsId" xml) String.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; instance_tenancy = - Xml.required - "instanceTenancy" - (Util.option_bind (Xml.member "instanceTenancy" xml) Tenancy.parse) - ; is_default = - Xml.required - "isDefault" - (Util.option_bind (Xml.member "isDefault" xml) Boolean.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IsDefault", Boolean.to_query v.is_default)) - ; Some (Query.Pair ("InstanceTenancy", Tenancy.to_query v.instance_tenancy)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some (Query.Pair ("DhcpOptionsId", String.to_query v.dhcp_options_id)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Some (Query.Pair ("State", VpcState.to_query v.state)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("is_default", Boolean.to_json v.is_default) - ; Some ("instance_tenancy", Tenancy.to_json v.instance_tenancy) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("dhcp_options_id", String.to_json v.dhcp_options_id) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Some ("state", VpcState.to_json v.state) - ; Some ("vpc_id", String.to_json v.vpc_id) - ]) - - let of_json j = - { vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; state = VpcState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; dhcp_options_id = - String.of_json (Util.of_option_exn (Json.lookup j "dhcp_options_id")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; instance_tenancy = - Tenancy.of_json (Util.of_option_exn (Json.lookup j "instance_tenancy")) - ; is_default = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_default")) - } -end - -module NetworkAcl = struct - type t = - { network_acl_id : String.t option - ; vpc_id : String.t option - ; is_default : Boolean.t option - ; entries : NetworkAclEntryList.t - ; associations : NetworkAclAssociationList.t - ; tags : TagList.t - } - - let make - ?network_acl_id - ?vpc_id - ?is_default - ?(entries = []) - ?(associations = []) - ?(tags = []) - () = - { network_acl_id; vpc_id; is_default; entries; associations; tags } - - let parse xml = - Some - { network_acl_id = Util.option_bind (Xml.member "networkAclId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; is_default = Util.option_bind (Xml.member "default" xml) Boolean.parse - ; entries = - Util.of_option - [] - (Util.option_bind (Xml.member "entrySet" xml) NetworkAclEntryList.parse) - ; associations = - Util.of_option - [] - (Util.option_bind - (Xml.member "associationSet" xml) - NetworkAclAssociationList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.source_dest_check + (fun f -> Query.Pair ("SourceDestCheck", (Boolean.to_query f))); + Util.option_map v.private_dns_name + (fun f -> Query.Pair ("PrivateDnsName", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.mac_address + (fun f -> Query.Pair ("MacAddress", (String.to_query f))); + Util.option_map v.status + (fun f -> + Query.Pair ("Status", (NetworkInterfaceStatus.to_query f))); + Util.option_map v.requester_managed + (fun f -> Query.Pair ("RequesterManaged", (Boolean.to_query f))); + Util.option_map v.requester_id + (fun f -> Query.Pair ("RequesterId", (String.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("private_ip_addresses", + (NetworkInterfacePrivateIpAddressList.to_json + v.private_ip_addresses)); + Some ("tag_set", (TagList.to_json v.tag_set)); + Util.option_map v.association + (fun f -> + ("association", (NetworkInterfaceAssociation.to_json f))); + Util.option_map v.attachment + (fun f -> ("attachment", (NetworkInterfaceAttachment.to_json f))); + Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.source_dest_check + (fun f -> ("source_dest_check", (Boolean.to_json f))); + Util.option_map v.private_dns_name + (fun f -> ("private_dns_name", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.mac_address + (fun f -> ("mac_address", (String.to_json f))); + Util.option_map v.status + (fun f -> ("status", (NetworkInterfaceStatus.to_json f))); + Util.option_map v.requester_managed + (fun f -> ("requester_managed", (Boolean.to_json f))); + Util.option_map v.requester_id + (fun f -> ("requester_id", (String.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f)))]) + let of_json j = + { + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + requester_id = + (Util.option_map (Json.lookup j "requester_id") String.of_json); + requester_managed = + (Util.option_map (Json.lookup j "requester_managed") + Boolean.of_json); + status = + (Util.option_map (Json.lookup j "status") + NetworkInterfaceStatus.of_json); + mac_address = + (Util.option_map (Json.lookup j "mac_address") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + private_dns_name = + (Util.option_map (Json.lookup j "private_dns_name") String.of_json); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + Boolean.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + attachment = + (Util.option_map (Json.lookup j "attachment") + NetworkInterfaceAttachment.of_json); + association = + (Util.option_map (Json.lookup j "association") + NetworkInterfaceAssociation.of_json); + tag_set = + (TagList.of_json (Util.of_option_exn (Json.lookup j "tag_set"))); + private_ip_addresses = + (NetworkInterfacePrivateIpAddressList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))) + } + end +module TagDescription = + struct + type t = + { + resource_id: String.t ; + resource_type: ResourceType.t ; + key: String.t ; + value: String.t } + let make ~resource_id ~resource_type ~key ~value () = + { resource_id; resource_type; key; value } + let parse xml = + Some + { + resource_id = + (Xml.required "resourceId" + (Util.option_bind (Xml.member "resourceId" xml) String.parse)); + resource_type = + (Xml.required "resourceType" + (Util.option_bind (Xml.member "resourceType" xml) + ResourceType.parse)); + key = + (Xml.required "key" + (Util.option_bind (Xml.member "key" xml) String.parse)); + value = + (Xml.required "value" + (Util.option_bind (Xml.member "value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair - ("AssociationSet", NetworkAclAssociationList.to_query v.associations)) - ; Some (Query.Pair ("EntrySet", NetworkAclEntryList.to_query v.entries)) - ; Util.option_map v.is_default (fun f -> - Query.Pair ("Default", Boolean.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.network_acl_id (fun f -> - Query.Pair ("NetworkAclId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("associations", NetworkAclAssociationList.to_json v.associations) - ; Some ("entries", NetworkAclEntryList.to_json v.entries) - ; Util.option_map v.is_default (fun f -> "is_default", Boolean.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.network_acl_id (fun f -> "network_acl_id", String.to_json f) - ]) - - let of_json j = - { network_acl_id = Util.option_map (Json.lookup j "network_acl_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; is_default = Util.option_map (Json.lookup j "is_default") Boolean.of_json - ; entries = NetworkAclEntryList.of_json (Util.of_option_exn (Json.lookup j "entries")) - ; associations = - NetworkAclAssociationList.of_json - (Util.of_option_exn (Json.lookup j "associations")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module Subnet = struct - type t = - { subnet_id : String.t - ; state : SubnetState.t - ; vpc_id : String.t - ; cidr_block : String.t - ; available_ip_address_count : Integer.t - ; availability_zone : String.t - ; default_for_az : Boolean.t - ; map_public_ip_on_launch : Boolean.t - ; tags : TagList.t - } - - let make - ~subnet_id - ~state - ~vpc_id - ~cidr_block - ~available_ip_address_count - ~availability_zone - ~default_for_az - ~map_public_ip_on_launch - ?(tags = []) - () = - { subnet_id - ; state - ; vpc_id - ; cidr_block - ; available_ip_address_count - ; availability_zone - ; default_for_az - ; map_public_ip_on_launch - ; tags - } - - let parse xml = - Some - { subnet_id = - Xml.required - "subnetId" - (Util.option_bind (Xml.member "subnetId" xml) String.parse) - ; state = - Xml.required - "state" - (Util.option_bind (Xml.member "state" xml) SubnetState.parse) - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - ; cidr_block = - Xml.required - "cidrBlock" - (Util.option_bind (Xml.member "cidrBlock" xml) String.parse) - ; available_ip_address_count = - Xml.required - "availableIpAddressCount" - (Util.option_bind (Xml.member "availableIpAddressCount" xml) Integer.parse) - ; availability_zone = - Xml.required - "availabilityZone" - (Util.option_bind (Xml.member "availabilityZone" xml) String.parse) - ; default_for_az = - Xml.required - "defaultForAz" - (Util.option_bind (Xml.member "defaultForAz" xml) Boolean.parse) - ; map_public_ip_on_launch = - Xml.required - "mapPublicIpOnLaunch" - (Util.option_bind (Xml.member "mapPublicIpOnLaunch" xml) Boolean.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some + ("ResourceType", (ResourceType.to_query v.resource_type))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("key", (String.to_json v.key)); + Some ("resource_type", (ResourceType.to_json v.resource_type)); + Some ("resource_id", (String.to_json v.resource_id))]) + let of_json j = + { + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + resource_type = + (ResourceType.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) + } + end +module DhcpOptions = + struct + type t = + { + dhcp_options_id: String.t option ; + dhcp_configurations: DhcpConfigurationList.t ; + tags: TagList.t } + let make ?dhcp_options_id ?(dhcp_configurations= []) ?(tags= []) () = + { dhcp_options_id; dhcp_configurations; tags } + let parse xml = + Some + { + dhcp_options_id = + (Util.option_bind (Xml.member "dhcpOptionsId" xml) String.parse); + dhcp_configurations = + (Util.of_option [] + (Util.option_bind (Xml.member "dhcpConfigurationSet" xml) + DhcpConfigurationList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ("MapPublicIpOnLaunch", Boolean.to_query v.map_public_ip_on_launch)) - ; Some (Query.Pair ("DefaultForAz", Boolean.to_query v.default_for_az)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Some + ("DhcpConfigurationSet", + (DhcpConfigurationList.to_query v.dhcp_configurations))); + Util.option_map v.dhcp_options_id + (fun f -> Query.Pair ("DhcpOptionsId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("dhcp_configurations", + (DhcpConfigurationList.to_json v.dhcp_configurations)); + Util.option_map v.dhcp_options_id + (fun f -> ("dhcp_options_id", (String.to_json f)))]) + let of_json j = + { + dhcp_options_id = + (Util.option_map (Json.lookup j "dhcp_options_id") String.of_json); + dhcp_configurations = + (DhcpConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "dhcp_configurations"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module VpnGateway = + struct + type t = + { + vpn_gateway_id: String.t option ; + state: VpnState.t option ; + type_: GatewayType.t option ; + availability_zone: String.t option ; + vpc_attachments: VpcAttachmentList.t ; + tags: TagList.t } + let make ?vpn_gateway_id ?state ?type_ ?availability_zone + ?(vpc_attachments= []) ?(tags= []) () = + { + vpn_gateway_id; + state; + type_; + availability_zone; + vpc_attachments; + tags + } + let parse xml = + Some + { + vpn_gateway_id = + (Util.option_bind (Xml.member "vpnGatewayId" xml) String.parse); + state = (Util.option_bind (Xml.member "state" xml) VpnState.parse); + type_ = + (Util.option_bind (Xml.member "type" xml) GatewayType.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + vpc_attachments = + (Util.of_option [] + (Util.option_bind (Xml.member "attachments" xml) + VpcAttachmentList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ("AvailableIpAddressCount", Integer.to_query v.available_ip_address_count)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("State", SubnetState.to_query v.state)) - ; Some (Query.Pair ("SubnetId", String.to_query v.subnet_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("map_public_ip_on_launch", Boolean.to_json v.map_public_ip_on_launch) - ; Some ("default_for_az", Boolean.to_json v.default_for_az) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Some - ("available_ip_address_count", Integer.to_json v.available_ip_address_count) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("state", SubnetState.to_json v.state) - ; Some ("subnet_id", String.to_json v.subnet_id) - ]) - - let of_json j = - { subnet_id = String.of_json (Util.of_option_exn (Json.lookup j "subnet_id")) - ; state = SubnetState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; available_ip_address_count = - Integer.of_json (Util.of_option_exn (Json.lookup j "available_ip_address_count")) - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; default_for_az = - Boolean.of_json (Util.of_option_exn (Json.lookup j "default_for_az")) - ; map_public_ip_on_launch = - Boolean.of_json (Util.of_option_exn (Json.lookup j "map_public_ip_on_launch")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module VpcClassicLink = struct - type t = - { vpc_id : String.t option - ; classic_link_enabled : Boolean.t option - ; tags : TagList.t - } - - let make ?vpc_id ?classic_link_enabled ?(tags = []) () = - { vpc_id; classic_link_enabled; tags } - - let parse xml = - Some - { vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; classic_link_enabled = - Util.option_bind (Xml.member "classicLinkEnabled" xml) Boolean.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.classic_link_enabled (fun f -> - Query.Pair ("ClassicLinkEnabled", Boolean.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.classic_link_enabled (fun f -> - "classic_link_enabled", Boolean.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ]) - - let of_json j = - { vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; classic_link_enabled = - Util.option_map (Json.lookup j "classic_link_enabled") Boolean.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ImportImageTask = struct - type t = - { import_task_id : String.t option - ; architecture : String.t option - ; license_type : String.t option - ; platform : String.t option - ; hypervisor : String.t option - ; description : String.t option - ; snapshot_details : SnapshotDetailList.t - ; image_id : String.t option - ; progress : String.t option - ; status_message : String.t option - ; status : String.t option - } - - let make - ?import_task_id - ?architecture - ?license_type - ?platform - ?hypervisor - ?description - ?(snapshot_details = []) - ?image_id - ?progress - ?status_message - ?status - () = - { import_task_id - ; architecture - ; license_type - ; platform - ; hypervisor - ; description - ; snapshot_details - ; image_id - ; progress - ; status_message - ; status - } - - let parse xml = - Some - { import_task_id = Util.option_bind (Xml.member "importTaskId" xml) String.parse - ; architecture = Util.option_bind (Xml.member "architecture" xml) String.parse - ; license_type = Util.option_bind (Xml.member "licenseType" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) String.parse - ; hypervisor = Util.option_bind (Xml.member "hypervisor" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; snapshot_details = - Util.of_option - [] + ("Attachments", + (VpcAttachmentList.to_query v.vpc_attachments))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.type_ + (fun f -> Query.Pair ("Type", (GatewayType.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (VpnState.to_query f))); + Util.option_map v.vpn_gateway_id + (fun f -> Query.Pair ("VpnGatewayId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("vpc_attachments", + (VpcAttachmentList.to_json v.vpc_attachments)); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.type_ + (fun f -> ("type_", (GatewayType.to_json f))); + Util.option_map v.state (fun f -> ("state", (VpnState.to_json f))); + Util.option_map v.vpn_gateway_id + (fun f -> ("vpn_gateway_id", (String.to_json f)))]) + let of_json j = + { + vpn_gateway_id = + (Util.option_map (Json.lookup j "vpn_gateway_id") String.of_json); + state = (Util.option_map (Json.lookup j "state") VpnState.of_json); + type_ = (Util.option_map (Json.lookup j "type_") GatewayType.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + vpc_attachments = + (VpcAttachmentList.of_json + (Util.of_option_exn (Json.lookup j "vpc_attachments"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ReservedInstancesModification = + struct + type t = + { + reserved_instances_modification_id: String.t option ; + reserved_instances_ids: ReservedIntancesIds.t ; + modification_results: ReservedInstancesModificationResultList.t ; + create_date: DateTime.t option ; + update_date: DateTime.t option ; + effective_date: DateTime.t option ; + status: String.t option ; + status_message: String.t option ; + client_token: String.t option } + let make ?reserved_instances_modification_id ?(reserved_instances_ids= + []) ?(modification_results= []) ?create_date ?update_date + ?effective_date ?status ?status_message ?client_token () = + { + reserved_instances_modification_id; + reserved_instances_ids; + modification_results; + create_date; + update_date; + effective_date; + status; + status_message; + client_token + } + let parse xml = + Some + { + reserved_instances_modification_id = (Util.option_bind - (Xml.member "snapshotDetailSet" xml) - SnapshotDetailList.parse) - ; image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; progress = Util.option_bind (Xml.member "progress" xml) String.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.progress (fun f -> - Query.Pair ("Progress", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ; Some + (Xml.member "reservedInstancesModificationId" xml) + String.parse); + reserved_instances_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "reservedInstancesSet" xml) + ReservedIntancesIds.parse)); + modification_results = + (Util.of_option [] + (Util.option_bind (Xml.member "modificationResultSet" xml) + ReservedInstancesModificationResultList.parse)); + create_date = + (Util.option_bind (Xml.member "createDate" xml) DateTime.parse); + update_date = + (Util.option_bind (Xml.member "updateDate" xml) DateTime.parse); + effective_date = + (Util.option_bind (Xml.member "effectiveDate" xml) DateTime.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.effective_date + (fun f -> Query.Pair ("EffectiveDate", (DateTime.to_query f))); + Util.option_map v.update_date + (fun f -> Query.Pair ("UpdateDate", (DateTime.to_query f))); + Util.option_map v.create_date + (fun f -> Query.Pair ("CreateDate", (DateTime.to_query f))); + Some (Query.Pair - ("SnapshotDetailSet", SnapshotDetailList.to_query v.snapshot_details)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.hypervisor (fun f -> - Query.Pair ("Hypervisor", String.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", String.to_query f)) - ; Util.option_map v.license_type (fun f -> - Query.Pair ("LicenseType", String.to_query f)) - ; Util.option_map v.architecture (fun f -> - Query.Pair ("Architecture", String.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.progress (fun f -> "progress", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ; Some ("snapshot_details", SnapshotDetailList.to_json v.snapshot_details) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.hypervisor (fun f -> "hypervisor", String.to_json f) - ; Util.option_map v.platform (fun f -> "platform", String.to_json f) - ; Util.option_map v.license_type (fun f -> "license_type", String.to_json f) - ; Util.option_map v.architecture (fun f -> "architecture", String.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ]) - - let of_json j = - { import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; architecture = Util.option_map (Json.lookup j "architecture") String.of_json - ; license_type = Util.option_map (Json.lookup j "license_type") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") String.of_json - ; hypervisor = Util.option_map (Json.lookup j "hypervisor") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; snapshot_details = - SnapshotDetailList.of_json (Util.of_option_exn (Json.lookup j "snapshot_details")) - ; image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; progress = Util.option_map (Json.lookup j "progress") String.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module CancelSpotFleetRequestsErrorItem = struct - type t = - { spot_fleet_request_id : String.t - ; error : CancelSpotFleetRequestsError.t - } - - let make ~spot_fleet_request_id ~error () = { spot_fleet_request_id; error } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; error = - Xml.required - "error" - (Util.option_bind (Xml.member "error" xml) CancelSpotFleetRequestsError.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Error", CancelSpotFleetRequestsError.to_query v.error)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("error", CancelSpotFleetRequestsError.to_json v.error) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; error = - CancelSpotFleetRequestsError.of_json (Util.of_option_exn (Json.lookup j "error")) - } -end - -module CancelSpotFleetRequestsSuccessItem = struct - type t = - { spot_fleet_request_id : String.t - ; current_spot_fleet_request_state : BatchState.t - ; previous_spot_fleet_request_state : BatchState.t - } - - let make - ~spot_fleet_request_id - ~current_spot_fleet_request_state - ~previous_spot_fleet_request_state - () = - { spot_fleet_request_id - ; current_spot_fleet_request_state - ; previous_spot_fleet_request_state - } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; current_spot_fleet_request_state = - Xml.required - "currentSpotFleetRequestState" - (Util.option_bind - (Xml.member "currentSpotFleetRequestState" xml) - BatchState.parse) - ; previous_spot_fleet_request_state = - Xml.required - "previousSpotFleetRequestState" - (Util.option_bind - (Xml.member "previousSpotFleetRequestState" xml) - BatchState.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ModificationResultSet", + (ReservedInstancesModificationResultList.to_query + v.modification_results))); + Some (Query.Pair - ( "PreviousSpotFleetRequestState" - , BatchState.to_query v.previous_spot_fleet_request_state )) - ; Some + ("ReservedInstancesSet", + (ReservedIntancesIds.to_query v.reserved_instances_ids))); + Util.option_map v.reserved_instances_modification_id + (fun f -> + Query.Pair + ("ReservedInstancesModificationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.effective_date + (fun f -> ("effective_date", (DateTime.to_json f))); + Util.option_map v.update_date + (fun f -> ("update_date", (DateTime.to_json f))); + Util.option_map v.create_date + (fun f -> ("create_date", (DateTime.to_json f))); + Some + ("modification_results", + (ReservedInstancesModificationResultList.to_json + v.modification_results)); + Some + ("reserved_instances_ids", + (ReservedIntancesIds.to_json v.reserved_instances_ids)); + Util.option_map v.reserved_instances_modification_id + (fun f -> + ("reserved_instances_modification_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_modification_id = + (Util.option_map + (Json.lookup j "reserved_instances_modification_id") + String.of_json); + reserved_instances_ids = + (ReservedIntancesIds.of_json + (Util.of_option_exn (Json.lookup j "reserved_instances_ids"))); + modification_results = + (ReservedInstancesModificationResultList.of_json + (Util.of_option_exn (Json.lookup j "modification_results"))); + create_date = + (Util.option_map (Json.lookup j "create_date") DateTime.of_json); + update_date = + (Util.option_map (Json.lookup j "update_date") DateTime.of_json); + effective_date = + (Util.option_map (Json.lookup j "effective_date") DateTime.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module ReservedInstances = + struct + type t = + { + reserved_instances_id: String.t option ; + instance_type: InstanceType.t option ; + availability_zone: String.t option ; + start: DateTime.t option ; + end_: DateTime.t option ; + duration: Long.t option ; + usage_price: Float.t option ; + fixed_price: Float.t option ; + instance_count: Integer.t option ; + product_description: RIProductDescription.t option ; + state: ReservedInstanceState.t option ; + tags: TagList.t ; + instance_tenancy: Tenancy.t option ; + currency_code: CurrencyCodeValues.t option ; + offering_type: OfferingTypeValues.t option ; + recurring_charges: RecurringChargesList.t } + let make ?reserved_instances_id ?instance_type ?availability_zone + ?start ?end_ ?duration ?usage_price ?fixed_price ?instance_count + ?product_description ?state ?(tags= []) ?instance_tenancy + ?currency_code ?offering_type ?(recurring_charges= []) () = + { + reserved_instances_id; + instance_type; + availability_zone; + start; + end_; + duration; + usage_price; + fixed_price; + instance_count; + product_description; + state; + tags; + instance_tenancy; + currency_code; + offering_type; + recurring_charges + } + let parse xml = + Some + { + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + start = (Util.option_bind (Xml.member "start" xml) DateTime.parse); + end_ = (Util.option_bind (Xml.member "end" xml) DateTime.parse); + duration = + (Util.option_bind (Xml.member "duration" xml) Long.parse); + usage_price = + (Util.option_bind (Xml.member "usagePrice" xml) Float.parse); + fixed_price = + (Util.option_bind (Xml.member "fixedPrice" xml) Float.parse); + instance_count = + (Util.option_bind (Xml.member "instanceCount" xml) Integer.parse); + product_description = + (Util.option_bind (Xml.member "productDescription" xml) + RIProductDescription.parse); + state = + (Util.option_bind (Xml.member "state" xml) + ReservedInstanceState.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + instance_tenancy = + (Util.option_bind (Xml.member "instanceTenancy" xml) + Tenancy.parse); + currency_code = + (Util.option_bind (Xml.member "currencyCode" xml) + CurrencyCodeValues.parse); + offering_type = + (Util.option_bind (Xml.member "offeringType" xml) + OfferingTypeValues.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "recurringCharges" xml) + RecurringChargesList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RecurringCharges", + (RecurringChargesList.to_query v.recurring_charges))); + Util.option_map v.offering_type + (fun f -> + Query.Pair ("OfferingType", (OfferingTypeValues.to_query f))); + Util.option_map v.currency_code + (fun f -> + Query.Pair ("CurrencyCode", (CurrencyCodeValues.to_query f))); + Util.option_map v.instance_tenancy + (fun f -> Query.Pair ("InstanceTenancy", (Tenancy.to_query f))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.state + (fun f -> + Query.Pair ("State", (ReservedInstanceState.to_query f))); + Util.option_map v.product_description + (fun f -> + Query.Pair + ("ProductDescription", (RIProductDescription.to_query f))); + Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Float.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Float.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Long.to_query f))); + Util.option_map v.end_ + (fun f -> Query.Pair ("End", (DateTime.to_query f))); + Util.option_map v.start + (fun f -> Query.Pair ("Start", (DateTime.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("recurring_charges", + (RecurringChargesList.to_json v.recurring_charges)); + Util.option_map v.offering_type + (fun f -> ("offering_type", (OfferingTypeValues.to_json f))); + Util.option_map v.currency_code + (fun f -> ("currency_code", (CurrencyCodeValues.to_json f))); + Util.option_map v.instance_tenancy + (fun f -> ("instance_tenancy", (Tenancy.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.state + (fun f -> ("state", (ReservedInstanceState.to_json f))); + Util.option_map v.product_description + (fun f -> + ("product_description", (RIProductDescription.to_json f))); + Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Float.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Float.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Long.to_json f))); + Util.option_map v.end_ (fun f -> ("end_", (DateTime.to_json f))); + Util.option_map v.start (fun f -> ("start", (DateTime.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + start = (Util.option_map (Json.lookup j "start") DateTime.of_json); + end_ = (Util.option_map (Json.lookup j "end_") DateTime.of_json); + duration = (Util.option_map (Json.lookup j "duration") Long.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Float.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Float.of_json); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + RIProductDescription.of_json); + state = + (Util.option_map (Json.lookup j "state") + ReservedInstanceState.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + instance_tenancy = + (Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") + CurrencyCodeValues.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") + OfferingTypeValues.of_json); + recurring_charges = + (RecurringChargesList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))) + } + end +module Filter = + struct + type t = { + name: String.t ; + values: ValueStringList.t } + let make ~name ?(values= []) () = { name; values } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + values = + (Util.of_option [] + (Util.option_bind (Xml.member "Value" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (ValueStringList.to_query v.values))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("values", (ValueStringList.to_json v.values)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + values = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "values"))) + } + end +module PlacementGroup = + struct + type t = + { + group_name: String.t option ; + strategy: PlacementStrategy.t option ; + state: PlacementGroupState.t option } + let make ?group_name ?strategy ?state () = + { group_name; strategy; state } + let parse xml = + Some + { + group_name = + (Util.option_bind (Xml.member "groupName" xml) String.parse); + strategy = + (Util.option_bind (Xml.member "strategy" xml) + PlacementStrategy.parse); + state = + (Util.option_bind (Xml.member "state" xml) + PlacementGroupState.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> + Query.Pair ("State", (PlacementGroupState.to_query f))); + Util.option_map v.strategy + (fun f -> + Query.Pair ("Strategy", (PlacementStrategy.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> ("state", (PlacementGroupState.to_json f))); + Util.option_map v.strategy + (fun f -> ("strategy", (PlacementStrategy.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f)))]) + let of_json j = + { + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + strategy = + (Util.option_map (Json.lookup j "strategy") + PlacementStrategy.of_json); + state = + (Util.option_map (Json.lookup j "state") + PlacementGroupState.of_json) + } + end +module KeyPairInfo = + struct + type t = { + key_name: String.t option ; + key_fingerprint: String.t option } + let make ?key_name ?key_fingerprint () = { key_name; key_fingerprint } + let parse xml = + Some + { + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + key_fingerprint = + (Util.option_bind (Xml.member "keyFingerprint" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.key_fingerprint + (fun f -> Query.Pair ("KeyFingerprint", (String.to_query f))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.key_fingerprint + (fun f -> ("key_fingerprint", (String.to_json f))); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f)))]) + let of_json j = + { + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + key_fingerprint = + (Util.option_map (Json.lookup j "key_fingerprint") String.of_json) + } + end +module CancelledSpotInstanceRequest = + struct + type t = + { + spot_instance_request_id: String.t option ; + state: CancelSpotInstanceRequestState.t option } + let make ?spot_instance_request_id ?state () = + { spot_instance_request_id; state } + let parse xml = + Some + { + spot_instance_request_id = + (Util.option_bind (Xml.member "spotInstanceRequestId" xml) + String.parse); + state = + (Util.option_bind (Xml.member "state" xml) + CancelSpotInstanceRequestState.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> + Query.Pair + ("State", (CancelSpotInstanceRequestState.to_query f))); + Util.option_map v.spot_instance_request_id + (fun f -> + Query.Pair ("SpotInstanceRequestId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.state + (fun f -> ("state", (CancelSpotInstanceRequestState.to_json f))); + Util.option_map v.spot_instance_request_id + (fun f -> ("spot_instance_request_id", (String.to_json f)))]) + let of_json j = + { + spot_instance_request_id = + (Util.option_map (Json.lookup j "spot_instance_request_id") + String.of_json); + state = + (Util.option_map (Json.lookup j "state") + CancelSpotInstanceRequestState.of_json) + } + end +module DatafeedSubscriptionState = + struct + type t = + | Active + | Inactive + let str_to_t = [("Inactive", Inactive); ("Active", Active)] + let t_to_str = [(Inactive, "Inactive"); (Active, "Active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module LaunchPermissionList = + struct + type t = LaunchPermission.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LaunchPermission.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list LaunchPermission.to_query v + let to_json v = `List (List.map LaunchPermission.to_json v) + let of_json j = Json.to_list LaunchPermission.of_json j + end +module ConversionTask = + struct + type t = + { + conversion_task_id: String.t ; + expiration_time: String.t option ; + import_instance: ImportInstanceTaskDetails.t option ; + import_volume: ImportVolumeTaskDetails.t option ; + state: ConversionTaskState.t ; + status_message: String.t option ; + tags: TagList.t } + let make ~conversion_task_id ?expiration_time ?import_instance + ?import_volume ~state ?status_message ?(tags= []) () = + { + conversion_task_id; + expiration_time; + import_instance; + import_volume; + state; + status_message; + tags + } + let parse xml = + Some + { + conversion_task_id = + (Xml.required "conversionTaskId" + (Util.option_bind (Xml.member "conversionTaskId" xml) + String.parse)); + expiration_time = + (Util.option_bind (Xml.member "expirationTime" xml) String.parse); + import_instance = + (Util.option_bind (Xml.member "importInstance" xml) + ImportInstanceTaskDetails.parse); + import_volume = + (Util.option_bind (Xml.member "importVolume" xml) + ImportVolumeTaskDetails.parse); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) + ConversionTaskState.parse)); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Some + (Query.Pair ("State", (ConversionTaskState.to_query v.state))); + Util.option_map v.import_volume + (fun f -> + Query.Pair + ("ImportVolume", (ImportVolumeTaskDetails.to_query f))); + Util.option_map v.import_instance + (fun f -> + Query.Pair + ("ImportInstance", (ImportInstanceTaskDetails.to_query f))); + Util.option_map v.expiration_time + (fun f -> Query.Pair ("ExpirationTime", (String.to_query f))); + Some (Query.Pair - ( "CurrentSpotFleetRequestState" - , BatchState.to_query v.current_spot_fleet_request_state )) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "previous_spot_fleet_request_state" - , BatchState.to_json v.previous_spot_fleet_request_state ) - ; Some - ( "current_spot_fleet_request_state" - , BatchState.to_json v.current_spot_fleet_request_state ) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; current_spot_fleet_request_state = - BatchState.of_json - (Util.of_option_exn (Json.lookup j "current_spot_fleet_request_state")) - ; previous_spot_fleet_request_state = - BatchState.of_json - (Util.of_option_exn (Json.lookup j "previous_spot_fleet_request_state")) - } -end - -module AccountAttribute = struct - type t = - { attribute_name : String.t option - ; attribute_values : AccountAttributeValueList.t - } - - let make ?attribute_name ?(attribute_values = []) () = - { attribute_name; attribute_values } - - let parse xml = - Some - { attribute_name = Util.option_bind (Xml.member "attributeName" xml) String.parse - ; attribute_values = - Util.of_option - [] - (Util.option_bind - (Xml.member "attributeValueSet" xml) - AccountAttributeValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ConversionTaskId", (String.to_query v.conversion_task_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Some ("state", (ConversionTaskState.to_json v.state)); + Util.option_map v.import_volume + (fun f -> ("import_volume", (ImportVolumeTaskDetails.to_json f))); + Util.option_map v.import_instance + (fun f -> + ("import_instance", (ImportInstanceTaskDetails.to_json f))); + Util.option_map v.expiration_time + (fun f -> ("expiration_time", (String.to_json f))); + Some ("conversion_task_id", (String.to_json v.conversion_task_id))]) + let of_json j = + { + conversion_task_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "conversion_task_id"))); + expiration_time = + (Util.option_map (Json.lookup j "expiration_time") String.of_json); + import_instance = + (Util.option_map (Json.lookup j "import_instance") + ImportInstanceTaskDetails.of_json); + import_volume = + (Util.option_map (Json.lookup j "import_volume") + ImportVolumeTaskDetails.of_json); + state = + (ConversionTaskState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module HistoryRecord = + struct + type t = + { + timestamp: DateTime.t ; + event_type: EventType.t ; + event_information: EventInformation.t } + let make ~timestamp ~event_type ~event_information () = + { timestamp; event_type; event_information } + let parse xml = + Some + { + timestamp = + (Xml.required "timestamp" + (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse)); + event_type = + (Xml.required "eventType" + (Util.option_bind (Xml.member "eventType" xml) EventType.parse)); + event_information = + (Xml.required "eventInformation" + (Util.option_bind (Xml.member "eventInformation" xml) + EventInformation.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EventInformation", + (EventInformation.to_query v.event_information))); + Some (Query.Pair ("EventType", (EventType.to_query v.event_type))); + Some (Query.Pair ("Timestamp", (DateTime.to_query v.timestamp)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("event_information", + (EventInformation.to_json v.event_information)); + Some ("event_type", (EventType.to_json v.event_type)); + Some ("timestamp", (DateTime.to_json v.timestamp))]) + let of_json j = + { + timestamp = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp"))); + event_type = + (EventType.of_json + (Util.of_option_exn (Json.lookup j "event_type"))); + event_information = + (EventInformation.of_json + (Util.of_option_exn (Json.lookup j "event_information"))) + } + end +module UnsuccessfulItem = + struct + type t = { + resource_id: String.t option ; + error: UnsuccessfulItemError.t } + let make ?resource_id ~error () = { resource_id; error } + let parse xml = + Some + { + resource_id = + (Util.option_bind (Xml.member "resourceId" xml) String.parse); + error = + (Xml.required "error" + (Util.option_bind (Xml.member "error" xml) + UnsuccessfulItemError.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Error", (UnsuccessfulItemError.to_query v.error))); + Util.option_map v.resource_id + (fun f -> Query.Pair ("ResourceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("error", (UnsuccessfulItemError.to_json v.error)); + Util.option_map v.resource_id + (fun f -> ("resource_id", (String.to_json f)))]) + let of_json j = + { + resource_id = + (Util.option_map (Json.lookup j "resource_id") String.of_json); + error = + (UnsuccessfulItemError.of_json + (Util.of_option_exn (Json.lookup j "error"))) + } + end +module RouteTable = + struct + type t = + { + route_table_id: String.t option ; + vpc_id: String.t option ; + routes: RouteList.t ; + associations: RouteTableAssociationList.t ; + tags: TagList.t ; + propagating_vgws: PropagatingVgwList.t } + let make ?route_table_id ?vpc_id ?(routes= []) ?(associations= []) + ?(tags= []) ?(propagating_vgws= []) () = + { route_table_id; vpc_id; routes; associations; tags; propagating_vgws + } + let parse xml = + Some + { + route_table_id = + (Util.option_bind (Xml.member "routeTableId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + routes = + (Util.of_option [] + (Util.option_bind (Xml.member "routeSet" xml) RouteList.parse)); + associations = + (Util.of_option [] + (Util.option_bind (Xml.member "associationSet" xml) + RouteTableAssociationList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + propagating_vgws = + (Util.of_option [] + (Util.option_bind (Xml.member "propagatingVgwSet" xml) + PropagatingVgwList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PropagatingVgwSet", + (PropagatingVgwList.to_query v.propagating_vgws))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "AttributeValueSet" - , AccountAttributeValueList.to_query v.attribute_values )) - ; Util.option_map v.attribute_name (fun f -> - Query.Pair ("AttributeName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute_values", AccountAttributeValueList.to_json v.attribute_values) - ; Util.option_map v.attribute_name (fun f -> "attribute_name", String.to_json f) - ]) - - let of_json j = - { attribute_name = Util.option_map (Json.lookup j "attribute_name") String.of_json - ; attribute_values = - AccountAttributeValueList.of_json - (Util.of_option_exn (Json.lookup j "attribute_values")) - } -end - -module SpotPrice = struct - type t = - { instance_type : InstanceType.t option - ; product_description : RIProductDescription.t option - ; spot_price : String.t option - ; timestamp : DateTime.t option - ; availability_zone : String.t option - } - - let make - ?instance_type - ?product_description - ?spot_price - ?timestamp - ?availability_zone - () = - { instance_type; product_description; spot_price; timestamp; availability_zone } - - let parse xml = - Some - { instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; product_description = - Util.option_bind - (Xml.member "productDescription" xml) - RIProductDescription.parse - ; spot_price = Util.option_bind (Xml.member "spotPrice" xml) String.parse - ; timestamp = Util.option_bind (Xml.member "timestamp" xml) DateTime.parse - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", DateTime.to_query f)) - ; Util.option_map v.spot_price (fun f -> - Query.Pair ("SpotPrice", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", RIProductDescription.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.timestamp (fun f -> "timestamp", DateTime.to_json f) - ; Util.option_map v.spot_price (fun f -> "spot_price", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", RIProductDescription.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ]) - - let of_json j = - { instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") RIProductDescription.of_json - ; spot_price = Util.option_map (Json.lookup j "spot_price") String.of_json - ; timestamp = Util.option_map (Json.lookup j "timestamp") DateTime.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - } -end - -module ReportInstanceReasonCodes = struct - type t = - | Instance_stuck_in_state - | Unresponsive - | Not_accepting_credentials - | Password_not_available - | Performance_network - | Performance_instance_store - | Performance_ebs_volume - | Performance_other - | Other - - let str_to_t = - [ "other", Other - ; "performance-other", Performance_other - ; "performance-ebs-volume", Performance_ebs_volume - ; "performance-instance-store", Performance_instance_store - ; "performance-network", Performance_network - ; "password-not-available", Password_not_available - ; "not-accepting-credentials", Not_accepting_credentials - ; "unresponsive", Unresponsive - ; "instance-stuck-in-state", Instance_stuck_in_state - ] - - let t_to_str = - [ Other, "other" - ; Performance_other, "performance-other" - ; Performance_ebs_volume, "performance-ebs-volume" - ; Performance_instance_store, "performance-instance-store" - ; Performance_network, "performance-network" - ; Password_not_available, "password-not-available" - ; Not_accepting_credentials, "not-accepting-credentials" - ; Unresponsive, "unresponsive" - ; Instance_stuck_in_state, "instance-stuck-in-state" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DiskImage = struct - type t = - { image : DiskImageDetail.t option - ; description : String.t option - ; volume : VolumeDetail.t option - } - - let make ?image ?description ?volume () = { image; description; volume } - - let parse xml = - Some - { image = Util.option_bind (Xml.member "Image" xml) DiskImageDetail.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; volume = Util.option_bind (Xml.member "Volume" xml) VolumeDetail.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.volume (fun f -> - Query.Pair ("Volume", VolumeDetail.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.image (fun f -> - Query.Pair ("Image", DiskImageDetail.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.volume (fun f -> "volume", VolumeDetail.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.image (fun f -> "image", DiskImageDetail.to_json f) - ]) - - let of_json j = - { image = Util.option_map (Json.lookup j "image") DiskImageDetail.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; volume = Util.option_map (Json.lookup j "volume") VolumeDetail.of_json - } -end - -module SecurityGroupStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SecurityGroup" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ShutdownBehavior = struct - type t = - | Stop - | Terminate - - let str_to_t = [ "terminate", Terminate; "stop", Stop ] - - let t_to_str = [ Terminate, "terminate"; Stop, "stop" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module UserData = struct - type t = { data : String.t option } - - let make ?data () = { data } - - let parse xml = Some { data = Util.option_bind (Xml.member "data" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.data (fun f -> Query.Pair ("Data", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.data (fun f -> "data", String.to_json f) ]) - - let of_json j = { data = Util.option_map (Json.lookup j "data") String.of_json } -end - -module VpcEndpoint = struct - type t = - { vpc_endpoint_id : String.t option - ; vpc_id : String.t option - ; service_name : String.t option - ; state : State.t option - ; policy_document : String.t option - ; route_table_ids : ValueStringList.t - ; creation_timestamp : DateTime.t option - } - - let make - ?vpc_endpoint_id - ?vpc_id - ?service_name - ?state - ?policy_document - ?(route_table_ids = []) - ?creation_timestamp - () = - { vpc_endpoint_id - ; vpc_id - ; service_name - ; state - ; policy_document - ; route_table_ids - ; creation_timestamp - } - - let parse xml = - Some - { vpc_endpoint_id = Util.option_bind (Xml.member "vpcEndpointId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; service_name = Util.option_bind (Xml.member "serviceName" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) State.parse - ; policy_document = Util.option_bind (Xml.member "policyDocument" xml) String.parse - ; route_table_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "routeTableIdSet" xml) ValueStringList.parse) - ; creation_timestamp = - Util.option_bind (Xml.member "creationTimestamp" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.creation_timestamp (fun f -> - Query.Pair ("CreationTimestamp", DateTime.to_query f)) - ; Some - (Query.Pair ("RouteTableIdSet", ValueStringList.to_query v.route_table_ids)) - ; Util.option_map v.policy_document (fun f -> - Query.Pair ("PolicyDocument", String.to_query f)) - ; Util.option_map v.state (fun f -> Query.Pair ("State", State.to_query f)) - ; Util.option_map v.service_name (fun f -> - Query.Pair ("ServiceName", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.vpc_endpoint_id (fun f -> - Query.Pair ("VpcEndpointId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.creation_timestamp (fun f -> - "creation_timestamp", DateTime.to_json f) - ; Some ("route_table_ids", ValueStringList.to_json v.route_table_ids) - ; Util.option_map v.policy_document (fun f -> - "policy_document", String.to_json f) - ; Util.option_map v.state (fun f -> "state", State.to_json f) - ; Util.option_map v.service_name (fun f -> "service_name", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.vpc_endpoint_id (fun f -> - "vpc_endpoint_id", String.to_json f) - ]) - - let of_json j = - { vpc_endpoint_id = Util.option_map (Json.lookup j "vpc_endpoint_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; service_name = Util.option_map (Json.lookup j "service_name") String.of_json - ; state = Util.option_map (Json.lookup j "state") State.of_json - ; policy_document = Util.option_map (Json.lookup j "policy_document") String.of_json - ; route_table_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "route_table_ids")) - ; creation_timestamp = - Util.option_map (Json.lookup j "creation_timestamp") DateTime.of_json - } -end - -module ImageDiskContainer = struct - type t = - { description : String.t option - ; format : String.t option - ; url : String.t option - ; user_bucket : UserBucket.t option - ; device_name : String.t option - ; snapshot_id : String.t option - } - - let make ?description ?format ?url ?user_bucket ?device_name ?snapshot_id () = - { description; format; url; user_bucket; device_name; snapshot_id } - - let parse xml = - Some - { description = Util.option_bind (Xml.member "Description" xml) String.parse - ; format = Util.option_bind (Xml.member "Format" xml) String.parse - ; url = Util.option_bind (Xml.member "Url" xml) String.parse - ; user_bucket = Util.option_bind (Xml.member "UserBucket" xml) UserBucket.parse - ; device_name = Util.option_bind (Xml.member "DeviceName" xml) String.parse - ; snapshot_id = Util.option_bind (Xml.member "SnapshotId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ; Util.option_map v.device_name (fun f -> - Query.Pair ("DeviceName", String.to_query f)) - ; Util.option_map v.user_bucket (fun f -> - Query.Pair ("UserBucket", UserBucket.to_query f)) - ; Util.option_map v.url (fun f -> Query.Pair ("Url", String.to_query f)) - ; Util.option_map v.format (fun f -> Query.Pair ("Format", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ; Util.option_map v.device_name (fun f -> "device_name", String.to_json f) - ; Util.option_map v.user_bucket (fun f -> "user_bucket", UserBucket.to_json f) - ; Util.option_map v.url (fun f -> "url", String.to_json f) - ; Util.option_map v.format (fun f -> "format", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ]) - - let of_json j = - { description = Util.option_map (Json.lookup j "description") String.of_json - ; format = Util.option_map (Json.lookup j "format") String.of_json - ; url = Util.option_map (Json.lookup j "url") String.of_json - ; user_bucket = Util.option_map (Json.lookup j "user_bucket") UserBucket.of_json - ; device_name = Util.option_map (Json.lookup j "device_name") String.of_json - ; snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - } -end - -module ClassicLinkInstance = struct - type t = - { instance_id : String.t option - ; vpc_id : String.t option - ; groups : GroupIdentifierList.t - ; tags : TagList.t - } - - let make ?instance_id ?vpc_id ?(groups = []) ?(tags = []) () = - { instance_id; vpc_id; groups; tags } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module Snapshot = struct - type t = - { snapshot_id : String.t - ; volume_id : String.t - ; state : SnapshotState.t - ; start_time : DateTime.t - ; progress : String.t - ; owner_id : String.t - ; description : String.t - ; volume_size : Integer.t - ; owner_alias : String.t option - ; tags : TagList.t - ; encrypted : Boolean.t - ; kms_key_id : String.t option - } - - let make - ~snapshot_id - ~volume_id - ~state - ~start_time - ~progress - ~owner_id - ~description - ~volume_size - ?owner_alias - ?(tags = []) - ~encrypted - ?kms_key_id - () = - { snapshot_id - ; volume_id - ; state - ; start_time - ; progress - ; owner_id - ; description - ; volume_size - ; owner_alias - ; tags - ; encrypted - ; kms_key_id - } - - let parse xml = - Some - { snapshot_id = - Xml.required - "snapshotId" - (Util.option_bind (Xml.member "snapshotId" xml) String.parse) - ; volume_id = - Xml.required - "volumeId" - (Util.option_bind (Xml.member "volumeId" xml) String.parse) - ; state = - Xml.required - "status" - (Util.option_bind (Xml.member "status" xml) SnapshotState.parse) - ; start_time = - Xml.required - "startTime" - (Util.option_bind (Xml.member "startTime" xml) DateTime.parse) - ; progress = - Xml.required - "progress" - (Util.option_bind (Xml.member "progress" xml) String.parse) - ; owner_id = - Xml.required - "ownerId" - (Util.option_bind (Xml.member "ownerId" xml) String.parse) - ; description = - Xml.required - "description" - (Util.option_bind (Xml.member "description" xml) String.parse) - ; volume_size = - Xml.required - "volumeSize" - (Util.option_bind (Xml.member "volumeSize" xml) Integer.parse) - ; owner_alias = Util.option_bind (Xml.member "ownerAlias" xml) String.parse - ; tags = - Util.of_option [] (Util.option_bind (Xml.member "tagSet" xml) TagList.parse) - ; encrypted = - Xml.required - "encrypted" - (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse) - ; kms_key_id = Util.option_bind (Xml.member "kmsKeyId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Some (Query.Pair ("Encrypted", Boolean.to_query v.encrypted)) - ; Some (Query.Pair ("TagSet", TagList.to_query v.tags)) - ; Util.option_map v.owner_alias (fun f -> - Query.Pair ("OwnerAlias", String.to_query f)) - ; Some (Query.Pair ("VolumeSize", Integer.to_query v.volume_size)) - ; Some (Query.Pair ("Description", String.to_query v.description)) - ; Some (Query.Pair ("OwnerId", String.to_query v.owner_id)) - ; Some (Query.Pair ("Progress", String.to_query v.progress)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Some (Query.Pair ("Status", SnapshotState.to_query v.state)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Some ("encrypted", Boolean.to_json v.encrypted) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.owner_alias (fun f -> "owner_alias", String.to_json f) - ; Some ("volume_size", Integer.to_json v.volume_size) - ; Some ("description", String.to_json v.description) - ; Some ("owner_id", String.to_json v.owner_id) - ; Some ("progress", String.to_json v.progress) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Some ("state", SnapshotState.to_json v.state) - ; Some ("volume_id", String.to_json v.volume_id) - ; Some ("snapshot_id", String.to_json v.snapshot_id) - ]) - - let of_json j = - { snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; state = SnapshotState.of_json (Util.of_option_exn (Json.lookup j "state")) - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; progress = String.of_json (Util.of_option_exn (Json.lookup j "progress")) - ; owner_id = String.of_json (Util.of_option_exn (Json.lookup j "owner_id")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; volume_size = Integer.of_json (Util.of_option_exn (Json.lookup j "volume_size")) - ; owner_alias = Util.option_map (Json.lookup j "owner_alias") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; encrypted = Boolean.of_json (Util.of_option_exn (Json.lookup j "encrypted")) - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - } -end - -module NewDhcpConfiguration = struct - type t = - { key : String.t option - ; values : ValueStringList.t - } - - let make ?key ?(values = []) () = { key; values } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "key" xml) String.parse - ; values = - Util.of_option - [] - (Util.option_bind (Xml.member "Value" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", ValueStringList.to_query v.values)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("values", ValueStringList.to_json v.values) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; values = ValueStringList.of_json (Util.of_option_exn (Json.lookup j "values")) - } -end - -module VpcAttributeName = struct - type t = - | EnableDnsSupport - | EnableDnsHostnames - - let str_to_t = - [ "enableDnsHostnames", EnableDnsHostnames; "enableDnsSupport", EnableDnsSupport ] - - let t_to_str = - [ EnableDnsHostnames, "enableDnsHostnames"; EnableDnsSupport, "enableDnsSupport" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BlockDeviceMappingRequestList = struct - type t = BlockDeviceMapping.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map BlockDeviceMapping.parse (Xml.members "BlockDeviceMapping" xml)) - - let to_query v = Query.to_query_list BlockDeviceMapping.to_query v - - let to_json v = `List (List.map BlockDeviceMapping.to_json v) - - let of_json j = Json.to_list BlockDeviceMapping.of_json j -end - -module NetworkInterfaceList = struct - type t = NetworkInterface.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NetworkInterface.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NetworkInterface.to_query v - - let to_json v = `List (List.map NetworkInterface.to_json v) - - let of_json j = Json.to_list NetworkInterface.of_json j -end - -module TagDescriptionList = struct - type t = TagDescription.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map TagDescription.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list TagDescription.to_query v - - let to_json v = `List (List.map TagDescription.to_json v) - - let of_json j = Json.to_list TagDescription.of_json j -end - -module DhcpOptionsList = struct - type t = DhcpOptions.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map DhcpOptions.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list DhcpOptions.to_query v - - let to_json v = `List (List.map DhcpOptions.to_json v) - - let of_json j = Json.to_list DhcpOptions.of_json j -end - -module VpnGatewayList = struct - type t = VpnGateway.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpnGateway.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpnGateway.to_query v - - let to_json v = `List (List.map VpnGateway.to_json v) - - let of_json j = Json.to_list VpnGateway.of_json j -end - -module AttributeBooleanValue = struct - type t = { value : Boolean.t option } - - let make ?value () = { value } - - let parse xml = Some { value = Util.option_bind (Xml.member "value" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", Boolean.to_json f) ]) - - let of_json j = { value = Util.option_map (Json.lookup j "value") Boolean.of_json } -end - -module ReservedInstancesModificationList = struct - type t = ReservedInstancesModification.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ReservedInstancesModification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesModification.to_query v - - let to_json v = `List (List.map ReservedInstancesModification.to_json v) - - let of_json j = Json.to_list ReservedInstancesModification.of_json j -end - -module ReservedInstancesList = struct - type t = ReservedInstances.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReservedInstances.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstances.to_query v - - let to_json v = `List (List.map ReservedInstances.to_json v) - - let of_json j = Json.to_list ReservedInstances.of_json j -end - -module FilterList = struct - type t = Filter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Filter.parse (Xml.members "Filter" xml)) - - let to_query v = Query.to_query_list Filter.to_query v - - let to_json v = `List (List.map Filter.to_json v) - - let of_json j = Json.to_list Filter.of_json j -end - -module PlacementGroupList = struct - type t = PlacementGroup.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PlacementGroup.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PlacementGroup.to_query v - - let to_json v = `List (List.map PlacementGroup.to_json v) - - let of_json j = Json.to_list PlacementGroup.of_json j -end - -module KeyPairList = struct - type t = KeyPairInfo.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map KeyPairInfo.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list KeyPairInfo.to_query v - - let to_json v = `List (List.map KeyPairInfo.to_json v) - - let of_json j = Json.to_list KeyPairInfo.of_json j -end - -module CancelledSpotInstanceRequestList = struct - type t = CancelledSpotInstanceRequest.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CancelledSpotInstanceRequest.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list CancelledSpotInstanceRequest.to_query v - - let to_json v = `List (List.map CancelledSpotInstanceRequest.to_json v) - - let of_json j = Json.to_list CancelledSpotInstanceRequest.of_json j -end - -module SpotDatafeedSubscription = struct - type t = - { owner_id : String.t option - ; bucket : String.t option - ; prefix : String.t option - ; state : DatafeedSubscriptionState.t option - ; fault : SpotInstanceStateFault.t option - } - - let make ?owner_id ?bucket ?prefix ?state ?fault () = - { owner_id; bucket; prefix; state; fault } - - let parse xml = - Some - { owner_id = Util.option_bind (Xml.member "ownerId" xml) String.parse - ; bucket = Util.option_bind (Xml.member "bucket" xml) String.parse - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) DatafeedSubscriptionState.parse - ; fault = Util.option_bind (Xml.member "fault" xml) SpotInstanceStateFault.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.fault (fun f -> - Query.Pair ("Fault", SpotInstanceStateFault.to_query f)) - ; Util.option_map v.state (fun f -> - Query.Pair ("State", DatafeedSubscriptionState.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.fault (fun f -> "fault", SpotInstanceStateFault.to_json f) - ; Util.option_map v.state (fun f -> "state", DatafeedSubscriptionState.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ]) - - let of_json j = - { owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; state = Util.option_map (Json.lookup j "state") DatafeedSubscriptionState.of_json - ; fault = Util.option_map (Json.lookup j "fault") SpotInstanceStateFault.of_json - } -end - -module LaunchPermissionModifications = struct - type t = - { add : LaunchPermissionList.t - ; remove : LaunchPermissionList.t - } - - let make ?(add = []) ?(remove = []) () = { add; remove } - - let parse xml = - Some - { add = - Util.of_option - [] - (Util.option_bind (Xml.member "Add" xml) LaunchPermissionList.parse) - ; remove = - Util.of_option - [] - (Util.option_bind (Xml.member "Remove" xml) LaunchPermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Remove", LaunchPermissionList.to_query v.remove)) - ; Some (Query.Pair ("Add", LaunchPermissionList.to_query v.add)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("remove", LaunchPermissionList.to_json v.remove) - ; Some ("add", LaunchPermissionList.to_json v.add) - ]) - - let of_json j = - { add = LaunchPermissionList.of_json (Util.of_option_exn (Json.lookup j "add")) - ; remove = LaunchPermissionList.of_json (Util.of_option_exn (Json.lookup j "remove")) - } -end - -module OperationType = struct - type t = - | Add - | Remove - - let str_to_t = [ "remove", Remove; "add", Add ] - - let t_to_str = [ Remove, "remove"; Add, "add" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ProductCodeStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ProductCode" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module UserGroupStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "UserGroup" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module UserIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "UserId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module InstanceAttributeName = struct - type t = - | InstanceType - | Kernel - | Ramdisk - | UserData - | DisableApiTermination - | InstanceInitiatedShutdownBehavior - | RootDeviceName - | BlockDeviceMapping - | ProductCodes - | SourceDestCheck - | GroupSet - | EbsOptimized - | SriovNetSupport - - let str_to_t = - [ "sriovNetSupport", SriovNetSupport - ; "ebsOptimized", EbsOptimized - ; "groupSet", GroupSet - ; "sourceDestCheck", SourceDestCheck - ; "productCodes", ProductCodes - ; "blockDeviceMapping", BlockDeviceMapping - ; "rootDeviceName", RootDeviceName - ; "instanceInitiatedShutdownBehavior", InstanceInitiatedShutdownBehavior - ; "disableApiTermination", DisableApiTermination - ; "userData", UserData - ; "ramdisk", Ramdisk - ; "kernel", Kernel - ; "instanceType", InstanceType - ] - - let t_to_str = - [ SriovNetSupport, "sriovNetSupport" - ; EbsOptimized, "ebsOptimized" - ; GroupSet, "groupSet" - ; SourceDestCheck, "sourceDestCheck" - ; ProductCodes, "productCodes" - ; BlockDeviceMapping, "blockDeviceMapping" - ; RootDeviceName, "rootDeviceName" - ; InstanceInitiatedShutdownBehavior, "instanceInitiatedShutdownBehavior" - ; DisableApiTermination, "disableApiTermination" - ; UserData, "userData" - ; Ramdisk, "ramdisk" - ; Kernel, "kernel" - ; InstanceType, "instanceType" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BundleIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "BundleId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DescribeConversionTaskList = struct - type t = ConversionTask.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map ConversionTask.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ConversionTask.to_query v - - let to_json v = `List (List.map ConversionTask.to_json v) - - let of_json j = Json.to_list ConversionTask.of_json j -end - -module ExportToS3TaskSpecification = struct - type t = - { disk_image_format : DiskImageFormat.t option - ; container_format : ContainerFormat.t option - ; s3_bucket : String.t option - ; s3_prefix : String.t option - } - - let make ?disk_image_format ?container_format ?s3_bucket ?s3_prefix () = - { disk_image_format; container_format; s3_bucket; s3_prefix } - - let parse xml = - Some - { disk_image_format = - Util.option_bind (Xml.member "diskImageFormat" xml) DiskImageFormat.parse - ; container_format = - Util.option_bind (Xml.member "containerFormat" xml) ContainerFormat.parse - ; s3_bucket = Util.option_bind (Xml.member "s3Bucket" xml) String.parse - ; s3_prefix = Util.option_bind (Xml.member "s3Prefix" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3_prefix (fun f -> - Query.Pair ("S3Prefix", String.to_query f)) - ; Util.option_map v.s3_bucket (fun f -> - Query.Pair ("S3Bucket", String.to_query f)) - ; Util.option_map v.container_format (fun f -> - Query.Pair ("ContainerFormat", ContainerFormat.to_query f)) - ; Util.option_map v.disk_image_format (fun f -> - Query.Pair ("DiskImageFormat", DiskImageFormat.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s3_prefix (fun f -> "s3_prefix", String.to_json f) - ; Util.option_map v.s3_bucket (fun f -> "s3_bucket", String.to_json f) - ; Util.option_map v.container_format (fun f -> - "container_format", ContainerFormat.to_json f) - ; Util.option_map v.disk_image_format (fun f -> - "disk_image_format", DiskImageFormat.to_json f) - ]) - - let of_json j = - { disk_image_format = - Util.option_map (Json.lookup j "disk_image_format") DiskImageFormat.of_json - ; container_format = - Util.option_map (Json.lookup j "container_format") ContainerFormat.of_json - ; s3_bucket = Util.option_map (Json.lookup j "s3_bucket") String.of_json - ; s3_prefix = Util.option_map (Json.lookup j "s3_prefix") String.of_json - } -end - -module HistoryRecords = struct - type t = HistoryRecord.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map HistoryRecord.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list HistoryRecord.to_query v - - let to_json v = `List (List.map HistoryRecord.to_json v) - - let of_json j = Json.to_list HistoryRecord.of_json j -end - -module OwnerStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "Owner" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module RestorableByStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SnapshotIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "SnapshotId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReservedInstancesConfigurationList = struct - type t = ReservedInstancesConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ReservedInstancesConfiguration.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesConfiguration.to_query v - - let to_json v = `List (List.map ReservedInstancesConfiguration.to_json v) - - let of_json j = Json.to_list ReservedInstancesConfiguration.of_json j -end - -module ReservedInstancesIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "ReservedInstancesId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module GroupIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "groupId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module GroupNameStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "GroupName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module RequestSpotLaunchSpecification = struct - type t = - { image_id : String.t option - ; key_name : String.t option - ; security_groups : ValueStringList.t - ; user_data : String.t option - ; addressing_type : String.t option - ; instance_type : InstanceType.t option - ; placement : SpotPlacement.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappingList.t - ; subnet_id : String.t option - ; network_interfaces : InstanceNetworkInterfaceSpecificationList.t - ; iam_instance_profile : IamInstanceProfileSpecification.t option - ; ebs_optimized : Boolean.t option - ; monitoring : RunInstancesMonitoringEnabled.t option - ; security_group_ids : ValueStringList.t - } - - let make - ?image_id - ?key_name - ?(security_groups = []) - ?user_data - ?addressing_type - ?instance_type - ?placement - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?subnet_id - ?(network_interfaces = []) - ?iam_instance_profile - ?ebs_optimized - ?monitoring - ?(security_group_ids = []) - () = - { image_id - ; key_name - ; security_groups - ; user_data - ; addressing_type - ; instance_type - ; placement - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; subnet_id - ; network_interfaces - ; iam_instance_profile - ; ebs_optimized - ; monitoring - ; security_group_ids - } - - let parse xml = - Some - { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroup" xml) ValueStringList.parse) - ; user_data = Util.option_bind (Xml.member "userData" xml) String.parse - ; addressing_type = Util.option_bind (Xml.member "addressingType" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; placement = Util.option_bind (Xml.member "placement" xml) SpotPlacement.parse - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingList.parse) - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "NetworkInterface" xml) - InstanceNetworkInterfaceSpecificationList.parse) - ; iam_instance_profile = - Util.option_bind - (Xml.member "iamInstanceProfile" xml) - IamInstanceProfileSpecification.parse - ; ebs_optimized = Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse - ; monitoring = - Util.option_bind - (Xml.member "monitoring" xml) - RunInstancesMonitoringEnabled.parse - ; security_group_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroupId" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("SecurityGroupId", ValueStringList.to_query v.security_group_ids)) - ; Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", RunInstancesMonitoringEnabled.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair - ("IamInstanceProfile", IamInstanceProfileSpecification.to_query f)) - ; Some + ("AssociationSet", + (RouteTableAssociationList.to_query v.associations))); + Some (Query.Pair ("RouteSet", (RouteList.to_query v.routes))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.route_table_id + (fun f -> Query.Pair ("RouteTableId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("propagating_vgws", + (PropagatingVgwList.to_json v.propagating_vgws)); + Some ("tags", (TagList.to_json v.tags)); + Some + ("associations", + (RouteTableAssociationList.to_json v.associations)); + Some ("routes", (RouteList.to_json v.routes)); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.route_table_id + (fun f -> ("route_table_id", (String.to_json f)))]) + let of_json j = + { + route_table_id = + (Util.option_map (Json.lookup j "route_table_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + routes = + (RouteList.of_json (Util.of_option_exn (Json.lookup j "routes"))); + associations = + (RouteTableAssociationList.of_json + (Util.of_option_exn (Json.lookup j "associations"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + propagating_vgws = + (PropagatingVgwList.of_json + (Util.of_option_exn (Json.lookup j "propagating_vgws"))) + } + end +module ReservedInstancesListing = + struct + type t = + { + reserved_instances_listing_id: String.t option ; + reserved_instances_id: String.t option ; + create_date: DateTime.t option ; + update_date: DateTime.t option ; + status: ListingStatus.t option ; + status_message: String.t option ; + instance_counts: InstanceCountList.t ; + price_schedules: PriceScheduleList.t ; + tags: TagList.t ; + client_token: String.t option } + let make ?reserved_instances_listing_id ?reserved_instances_id + ?create_date ?update_date ?status ?status_message + ?(instance_counts= []) ?(price_schedules= []) ?(tags= []) + ?client_token () = + { + reserved_instances_listing_id; + reserved_instances_id; + create_date; + update_date; + status; + status_message; + instance_counts; + price_schedules; + tags; + client_token + } + let parse xml = + Some + { + reserved_instances_listing_id = + (Util.option_bind (Xml.member "reservedInstancesListingId" xml) + String.parse); + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse); + create_date = + (Util.option_bind (Xml.member "createDate" xml) DateTime.parse); + update_date = + (Util.option_bind (Xml.member "updateDate" xml) DateTime.parse); + status = + (Util.option_bind (Xml.member "status" xml) ListingStatus.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + instance_counts = + (Util.of_option [] + (Util.option_bind (Xml.member "instanceCounts" xml) + InstanceCountList.parse)); + price_schedules = + (Util.of_option [] + (Util.option_bind (Xml.member "priceSchedules" xml) + PriceScheduleList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "NetworkInterface" - , InstanceNetworkInterfaceSpecificationList.to_query v.network_interfaces - )) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Some + ("PriceSchedules", + (PriceScheduleList.to_query v.price_schedules))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.placement (fun f -> - Query.Pair ("Placement", SpotPlacement.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.addressing_type (fun f -> - Query.Pair ("AddressingType", String.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some (Query.Pair ("SecurityGroup", ValueStringList.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("security_group_ids", ValueStringList.to_json v.security_group_ids) - ; Util.option_map v.monitoring (fun f -> - "monitoring", RunInstancesMonitoringEnabled.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", IamInstanceProfileSpecification.to_json f) - ; Some - ( "network_interfaces" - , InstanceNetworkInterfaceSpecificationList.to_json v.network_interfaces ) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.placement (fun f -> "placement", SpotPlacement.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.addressing_type (fun f -> - "addressing_type", String.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some ("security_groups", ValueStringList.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ]) - - let of_json j = - { image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; addressing_type = Util.option_map (Json.lookup j "addressing_type") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; placement = Util.option_map (Json.lookup j "placement") SpotPlacement.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; network_interfaces = - InstanceNetworkInterfaceSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - ; iam_instance_profile = - Util.option_map - (Json.lookup j "iam_instance_profile") - IamInstanceProfileSpecification.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - ; monitoring = - Util.option_map (Json.lookup j "monitoring") RunInstancesMonitoringEnabled.of_json - ; security_group_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "security_group_ids")) - } -end - -module PrivateIpAddressStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "PrivateIpAddress" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module UnsuccessfulItemSet = struct - type t = UnsuccessfulItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map UnsuccessfulItem.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list UnsuccessfulItem.to_query v - - let to_json v = `List (List.map UnsuccessfulItem.to_json v) - - let of_json j = Json.to_list UnsuccessfulItem.of_json j -end - -module Status = struct - type t = - | MoveInProgress - | InVpc - | InClassic - - let str_to_t = - [ "InClassic", InClassic; "InVpc", InVpc; "MoveInProgress", MoveInProgress ] - - let t_to_str = - [ InClassic, "InClassic"; InVpc, "InVpc"; MoveInProgress, "MoveInProgress" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RouteTableList = struct - type t = RouteTable.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map RouteTable.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list RouteTable.to_query v - - let to_json v = `List (List.map RouteTable.to_json v) - - let of_json j = Json.to_list RouteTable.of_json j -end - -module InstanceIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "InstanceId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ImportTaskIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ImportTaskId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReservedInstancesListingList = struct - type t = ReservedInstancesListing.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReservedInstancesListing.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesListing.to_query v - - let to_json v = `List (List.map ReservedInstancesListing.to_json v) - - let of_json j = Json.to_list ReservedInstancesListing.of_json j -end - -module InstanceStateChangeList = struct - type t = InstanceStateChange.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceStateChange.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceStateChange.to_query v - - let to_json v = `List (List.map InstanceStateChange.to_json v) - - let of_json j = Json.to_list InstanceStateChange.of_json j -end - -module ExecutableByStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ExecutableBy" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ImageIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ImageId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module MovingAddressStatusSet = struct - type t = MovingAddressStatus.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map MovingAddressStatus.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list MovingAddressStatus.to_query v - - let to_json v = `List (List.map MovingAddressStatus.to_json v) - - let of_json j = Json.to_list MovingAddressStatus.of_json j -end - -module ExportTaskIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ExportTaskId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReservedInstancesOfferingIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module InstanceStatusList = struct - type t = InstanceStatus.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map InstanceStatus.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceStatus.to_query v - - let to_json v = `List (List.map InstanceStatus.to_json v) - - let of_json j = Json.to_list InstanceStatus.of_json j -end - -module NetworkInterfaceAttachmentChanges = struct - type t = - { attachment_id : String.t option - ; delete_on_termination : Boolean.t option - } - - let make ?attachment_id ?delete_on_termination () = - { attachment_id; delete_on_termination } - - let parse xml = - Some - { attachment_id = Util.option_bind (Xml.member "attachmentId" xml) String.parse - ; delete_on_termination = - Util.option_bind (Xml.member "deleteOnTermination" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - Query.Pair ("DeleteOnTermination", Boolean.to_query f)) - ; Util.option_map v.attachment_id (fun f -> - Query.Pair ("AttachmentId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_on_termination (fun f -> - "delete_on_termination", Boolean.to_json f) - ; Util.option_map v.attachment_id (fun f -> "attachment_id", String.to_json f) - ]) - - let of_json j = - { attachment_id = Util.option_map (Json.lookup j "attachment_id") String.of_json - ; delete_on_termination = - Util.option_map (Json.lookup j "delete_on_termination") Boolean.of_json - } -end - -module ImageList = struct - type t = Image.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Image.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Image.to_query v - - let to_json v = `List (List.map Image.to_json v) - - let of_json j = Json.to_list Image.of_json j -end - -module PriceScheduleSpecificationList = struct - type t = PriceScheduleSpecification.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map PriceScheduleSpecification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PriceScheduleSpecification.to_query v - - let to_json v = `List (List.map PriceScheduleSpecification.to_json v) - - let of_json j = Json.to_list PriceScheduleSpecification.of_json j -end - -module ImportSnapshotTaskList = struct - type t = ImportSnapshotTask.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ImportSnapshotTask.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ImportSnapshotTask.to_query v - - let to_json v = `List (List.map ImportSnapshotTask.to_json v) - - let of_json j = Json.to_list ImportSnapshotTask.of_json j -end - -module SpotInstanceRequestIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SpotInstanceRequestId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module KeyNameStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "KeyName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SpotInstanceRequestList = struct - type t = SpotInstanceRequest.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map SpotInstanceRequest.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SpotInstanceRequest.to_query v - - let to_json v = `List (List.map SpotInstanceRequest.to_json v) - - let of_json j = Json.to_list SpotInstanceRequest.of_json j -end - -module InstanceTypeList = struct - type t = InstanceType.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map InstanceType.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list InstanceType.to_query v - - let to_json v = `List (List.map InstanceType.to_json v) - - let of_json j = Json.to_list InstanceType.of_json j -end - -module ProductDescriptionList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module CustomerGatewayIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "CustomerGatewayId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ExportTaskList = struct - type t = ExportTask.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map ExportTask.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ExportTask.to_query v - - let to_json v = `List (List.map ExportTask.to_json v) - - let of_json j = Json.to_list ExportTask.of_json j -end - -module PrefixListSet = struct - type t = PrefixList.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map PrefixList.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list PrefixList.to_query v - - let to_json v = `List (List.map PrefixList.to_json v) - - let of_json j = Json.to_list PrefixList.of_json j -end - -module InstanceMonitoringList = struct - type t = InstanceMonitoring.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceMonitoring.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceMonitoring.to_query v - - let to_json v = `List (List.map InstanceMonitoring.to_json v) - - let of_json j = Json.to_list InstanceMonitoring.of_json j -end - -module SecurityGroupList = struct - type t = SecurityGroup.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map SecurityGroup.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SecurityGroup.to_query v - - let to_json v = `List (List.map SecurityGroup.to_json v) - - let of_json j = Json.to_list SecurityGroup.of_json j -end - -module VpnConnectionIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "VpnConnectionId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ActiveInstanceSet = struct - type t = ActiveInstance.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map ActiveInstance.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ActiveInstance.to_query v - - let to_json v = `List (List.map ActiveInstance.to_json v) - - let of_json j = Json.to_list ActiveInstance.of_json j -end - -module SnapshotAttributeName = struct - type t = - | ProductCodes - | CreateVolumePermission - - let str_to_t = - [ "createVolumePermission", CreateVolumePermission; "productCodes", ProductCodes ] - - let t_to_str = - [ CreateVolumePermission, "createVolumePermission"; ProductCodes, "productCodes" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BlobAttributeValue = struct - type t = { value : Blob.t option } - - let make ?value () = { value } - - let parse xml = Some { value = Util.option_bind (Xml.member "value" xml) Blob.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", Blob.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", Blob.to_json f) ]) - - let of_json j = { value = Util.option_map (Json.lookup j "value") Blob.of_json } -end - -module InstanceBlockDeviceMappingSpecificationList = struct - type t = InstanceBlockDeviceMappingSpecification.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map InstanceBlockDeviceMappingSpecification.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InstanceBlockDeviceMappingSpecification.to_query v - - let to_json v = `List (List.map InstanceBlockDeviceMappingSpecification.to_json v) - - let of_json j = Json.to_list InstanceBlockDeviceMappingSpecification.of_json j -end - -module InternetGatewayList = struct - type t = InternetGateway.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InternetGateway.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list InternetGateway.to_query v - - let to_json v = `List (List.map InternetGateway.to_json v) - - let of_json j = Json.to_list InternetGateway.of_json j -end - -module NetworkInterfaceIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AccountAttributeNameStringList = struct - type t = AccountAttributeName.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map AccountAttributeName.parse (Xml.members "attributeName" xml)) - - let to_query v = Query.to_query_list AccountAttributeName.to_query v - - let to_json v = `List (List.map AccountAttributeName.to_json v) - - let of_json j = Json.to_list AccountAttributeName.of_json j -end - -module ConversionIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ZoneNameStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ZoneName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module VpnGatewayIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "VpnGatewayId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReservedInstancesModificationIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map String.parse (Xml.members "ReservedInstancesModificationId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SpotFleetRequestConfigSet = struct - type t = SpotFleetRequestConfig.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map SpotFleetRequestConfig.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SpotFleetRequestConfig.to_query v - - let to_json v = `List (List.map SpotFleetRequestConfig.to_json v) - - let of_json j = Json.to_list SpotFleetRequestConfig.of_json j -end - -module VolumeAttributeName = struct - type t = - | AutoEnableIO - | ProductCodes - - let str_to_t = [ "productCodes", ProductCodes; "autoEnableIO", AutoEnableIO ] - - let t_to_str = [ ProductCodes, "productCodes"; AutoEnableIO, "autoEnableIO" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module PlacementGroupStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AvailabilityZoneList = struct - type t = AvailabilityZone.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AvailabilityZone.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list AvailabilityZone.to_query v - - let to_json v = `List (List.map AvailabilityZone.to_json v) - - let of_json j = Json.to_list AvailabilityZone.of_json j -end - -module CustomerGatewayList = struct - type t = CustomerGateway.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CustomerGateway.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list CustomerGateway.to_query v - - let to_json v = `List (List.map CustomerGateway.to_json v) - - let of_json j = Json.to_list CustomerGateway.of_json j -end - -module FlowLogSet = struct - type t = FlowLog.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map FlowLog.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list FlowLog.to_query v - - let to_json v = `List (List.map FlowLog.to_json v) - - let of_json j = Json.to_list FlowLog.of_json j -end - -module BundleTaskList = struct - type t = BundleTask.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map BundleTask.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list BundleTask.to_query v - - let to_json v = `List (List.map BundleTask.to_json v) - - let of_json j = Json.to_list BundleTask.of_json j -end - -module VolumeStatusList = struct - type t = VolumeStatusItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VolumeStatusItem.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VolumeStatusItem.to_query v - - let to_json v = `List (List.map VolumeStatusItem.to_json v) - - let of_json j = Json.to_list VolumeStatusItem.of_json j -end - -module SubnetIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "SubnetId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module CreateVolumePermissionModifications = struct - type t = - { add : CreateVolumePermissionList.t - ; remove : CreateVolumePermissionList.t - } - - let make ?(add = []) ?(remove = []) () = { add; remove } - - let parse xml = - Some - { add = - Util.of_option - [] - (Util.option_bind (Xml.member "Add" xml) CreateVolumePermissionList.parse) - ; remove = - Util.of_option - [] - (Util.option_bind (Xml.member "Remove" xml) CreateVolumePermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Remove", CreateVolumePermissionList.to_query v.remove)) - ; Some (Query.Pair ("Add", CreateVolumePermissionList.to_query v.add)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("remove", CreateVolumePermissionList.to_json v.remove) - ; Some ("add", CreateVolumePermissionList.to_json v.add) - ]) - - let of_json j = - { add = CreateVolumePermissionList.of_json (Util.of_option_exn (Json.lookup j "add")) - ; remove = - CreateVolumePermissionList.of_json (Util.of_option_exn (Json.lookup j "remove")) - } -end - -module VolumeList = struct - type t = Volume.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Volume.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Volume.to_query v - - let to_json v = `List (List.map Volume.to_json v) - - let of_json j = Json.to_list Volume.of_json j -end - -module VpcClassicLinkIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "VpcId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module RegionList = struct - type t = Region.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Region.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Region.to_query v - - let to_json v = `List (List.map Region.to_json v) - - let of_json j = Json.to_list Region.of_json j -end - -module VpnConnectionOptionsSpecification = struct - type t = { static_routes_only : Boolean.t option } - - let make ?static_routes_only () = { static_routes_only } - - let parse xml = - Some - { static_routes_only = - Util.option_bind (Xml.member "staticRoutesOnly" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.static_routes_only (fun f -> - Query.Pair ("StaticRoutesOnly", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.static_routes_only (fun f -> - "static_routes_only", Boolean.to_json f) - ]) - - let of_json j = - { static_routes_only = - Util.option_map (Json.lookup j "static_routes_only") Boolean.of_json - } -end - -module ResourceIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AllocationIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "AllocationId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module PublicIpStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "PublicIp" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AddressList = struct - type t = Address.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Address.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Address.to_query v - - let to_json v = `List (List.map Address.to_json v) - - let of_json j = Json.to_list Address.of_json j -end - -module ClientData = struct - type t = - { upload_start : DateTime.t option - ; upload_end : DateTime.t option - ; upload_size : Double.t option - ; comment : String.t option - } - - let make ?upload_start ?upload_end ?upload_size ?comment () = - { upload_start; upload_end; upload_size; comment } - - let parse xml = - Some - { upload_start = Util.option_bind (Xml.member "UploadStart" xml) DateTime.parse - ; upload_end = Util.option_bind (Xml.member "UploadEnd" xml) DateTime.parse - ; upload_size = Util.option_bind (Xml.member "UploadSize" xml) Double.parse - ; comment = Util.option_bind (Xml.member "Comment" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ; Util.option_map v.upload_size (fun f -> - Query.Pair ("UploadSize", Double.to_query f)) - ; Util.option_map v.upload_end (fun f -> - Query.Pair ("UploadEnd", DateTime.to_query f)) - ; Util.option_map v.upload_start (fun f -> - Query.Pair ("UploadStart", DateTime.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> "comment", String.to_json f) - ; Util.option_map v.upload_size (fun f -> "upload_size", Double.to_json f) - ; Util.option_map v.upload_end (fun f -> "upload_end", DateTime.to_json f) - ; Util.option_map v.upload_start (fun f -> "upload_start", DateTime.to_json f) - ]) - - let of_json j = - { upload_start = Util.option_map (Json.lookup j "upload_start") DateTime.of_json - ; upload_end = Util.option_map (Json.lookup j "upload_end") DateTime.of_json - ; upload_size = Util.option_map (Json.lookup j "upload_size") Double.of_json - ; comment = Util.option_map (Json.lookup j "comment") String.of_json - } -end - -module SnapshotDiskContainer = struct - type t = - { description : String.t option - ; format : String.t option - ; url : String.t option - ; user_bucket : UserBucket.t option - } - - let make ?description ?format ?url ?user_bucket () = - { description; format; url; user_bucket } - - let parse xml = - Some - { description = Util.option_bind (Xml.member "Description" xml) String.parse - ; format = Util.option_bind (Xml.member "Format" xml) String.parse - ; url = Util.option_bind (Xml.member "Url" xml) String.parse - ; user_bucket = Util.option_bind (Xml.member "UserBucket" xml) UserBucket.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.user_bucket (fun f -> - Query.Pair ("UserBucket", UserBucket.to_query f)) - ; Util.option_map v.url (fun f -> Query.Pair ("Url", String.to_query f)) - ; Util.option_map v.format (fun f -> Query.Pair ("Format", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.user_bucket (fun f -> "user_bucket", UserBucket.to_json f) - ; Util.option_map v.url (fun f -> "url", String.to_json f) - ; Util.option_map v.format (fun f -> "format", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ]) - - let of_json j = - { description = Util.option_map (Json.lookup j "description") String.of_json - ; format = Util.option_map (Json.lookup j "format") String.of_json - ; url = Util.option_map (Json.lookup j "url") String.of_json - ; user_bucket = Util.option_map (Json.lookup j "user_bucket") UserBucket.of_json - } -end - -module VpnConnectionList = struct - type t = VpnConnection.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpnConnection.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpnConnection.to_query v - - let to_json v = `List (List.map VpnConnection.to_json v) - - let of_json j = Json.to_list VpnConnection.of_json j -end - -module ReservedInstancesOfferingList = struct - type t = ReservedInstancesOffering.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReservedInstancesOffering.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReservedInstancesOffering.to_query v - - let to_json v = `List (List.map ReservedInstancesOffering.to_json v) - - let of_json j = Json.to_list ReservedInstancesOffering.of_json j -end - -module ReservationList = struct - type t = Reservation.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Reservation.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Reservation.to_query v - - let to_json v = `List (List.map Reservation.to_json v) - - let of_json j = Json.to_list Reservation.of_json j -end - -module VolumeIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "VolumeId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module RegionNameStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "RegionName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module VpcPeeringConnectionList = struct - type t = VpcPeeringConnection.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map VpcPeeringConnection.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpcPeeringConnection.to_query v - - let to_json v = `List (List.map VpcPeeringConnection.to_json v) - - let of_json j = Json.to_list VpcPeeringConnection.of_json j -end - -module VpcList = struct - type t = Vpc.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Vpc.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Vpc.to_query v - - let to_json v = `List (List.map Vpc.to_json v) - - let of_json j = Json.to_list Vpc.of_json j -end - -module NetworkAclList = struct - type t = NetworkAcl.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map NetworkAcl.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NetworkAcl.to_query v - - let to_json v = `List (List.map NetworkAcl.to_json v) - - let of_json j = Json.to_list NetworkAcl.of_json j -end - -module SubnetList = struct - type t = Subnet.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Subnet.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Subnet.to_query v - - let to_json v = `List (List.map Subnet.to_json v) - - let of_json j = Json.to_list Subnet.of_json j -end - -module VpcClassicLinkList = struct - type t = VpcClassicLink.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpcClassicLink.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpcClassicLink.to_query v - - let to_json v = `List (List.map VpcClassicLink.to_json v) - - let of_json j = Json.to_list VpcClassicLink.of_json j -end - -module ImportImageTaskList = struct - type t = ImportImageTask.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ImportImageTask.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ImportImageTask.to_query v - - let to_json v = `List (List.map ImportImageTask.to_json v) - - let of_json j = Json.to_list ImportImageTask.of_json j -end - -module FlowLogsResourceType = struct - type t = - | VPC - | Subnet - | NetworkInterface - - let str_to_t = [ "NetworkInterface", NetworkInterface; "Subnet", Subnet; "VPC", VPC ] - - let t_to_str = [ NetworkInterface, "NetworkInterface"; Subnet, "Subnet"; VPC, "VPC" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module CancelSpotFleetRequestsErrorSet = struct - type t = CancelSpotFleetRequestsErrorItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CancelSpotFleetRequestsErrorItem.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list CancelSpotFleetRequestsErrorItem.to_query v - - let to_json v = `List (List.map CancelSpotFleetRequestsErrorItem.to_json v) - - let of_json j = Json.to_list CancelSpotFleetRequestsErrorItem.of_json j -end - -module CancelSpotFleetRequestsSuccessSet = struct - type t = CancelSpotFleetRequestsSuccessItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CancelSpotFleetRequestsSuccessItem.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list CancelSpotFleetRequestsSuccessItem.to_query v - - let to_json v = `List (List.map CancelSpotFleetRequestsSuccessItem.to_json v) - - let of_json j = Json.to_list CancelSpotFleetRequestsSuccessItem.of_json j -end - -module AccountAttributeList = struct - type t = AccountAttribute.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AccountAttribute.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list AccountAttribute.to_query v - - let to_json v = `List (List.map AccountAttribute.to_json v) - - let of_json j = Json.to_list AccountAttribute.of_json j -end - -module DhcpOptionsIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "DhcpOptionsId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SpotPriceHistoryList = struct - type t = SpotPrice.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map SpotPrice.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list SpotPrice.to_query v - - let to_json v = `List (List.map SpotPrice.to_json v) - - let of_json j = Json.to_list SpotPrice.of_json j -end - -module ReasonCodesList = struct - type t = ReportInstanceReasonCodes.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReportInstanceReasonCodes.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ReportInstanceReasonCodes.to_query v - - let to_json v = `List (List.map ReportInstanceReasonCodes.to_json v) - - let of_json j = Json.to_list ReportInstanceReasonCodes.of_json j -end - -module ReportStatusType = struct - type t = - | Ok - | Impaired - - let str_to_t = [ "impaired", Impaired; "ok", Ok ] - - let t_to_str = [ Impaired, "impaired"; Ok, "ok" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module VpcIdStringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "VpcId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DiskImageList = struct - type t = DiskImage.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map DiskImage.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list DiskImage.to_query v - - let to_json v = `List (List.map DiskImage.to_json v) - - let of_json j = Json.to_list DiskImage.of_json j -end - -module ImportInstanceLaunchSpecification = struct - type t = - { architecture : ArchitectureValues.t option - ; group_names : SecurityGroupStringList.t - ; group_ids : SecurityGroupIdStringList.t - ; additional_info : String.t option - ; user_data : UserData.t option - ; instance_type : InstanceType.t option - ; placement : Placement.t option - ; monitoring : Boolean.t option - ; subnet_id : String.t option - ; instance_initiated_shutdown_behavior : ShutdownBehavior.t option - ; private_ip_address : String.t option - } - - let make - ?architecture - ?(group_names = []) - ?(group_ids = []) - ?additional_info - ?user_data - ?instance_type - ?placement - ?monitoring - ?subnet_id - ?instance_initiated_shutdown_behavior - ?private_ip_address - () = - { architecture - ; group_names - ; group_ids - ; additional_info - ; user_data - ; instance_type - ; placement - ; monitoring - ; subnet_id - ; instance_initiated_shutdown_behavior - ; private_ip_address - } - - let parse xml = - Some - { architecture = - Util.option_bind (Xml.member "architecture" xml) ArchitectureValues.parse - ; group_names = - Util.of_option - [] - (Util.option_bind (Xml.member "GroupName" xml) SecurityGroupStringList.parse) - ; group_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "GroupId" xml) SecurityGroupIdStringList.parse) - ; additional_info = Util.option_bind (Xml.member "additionalInfo" xml) String.parse - ; user_data = Util.option_bind (Xml.member "userData" xml) UserData.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) InstanceType.parse - ; placement = Util.option_bind (Xml.member "placement" xml) Placement.parse - ; monitoring = Util.option_bind (Xml.member "monitoring" xml) Boolean.parse - ; subnet_id = Util.option_bind (Xml.member "subnetId" xml) String.parse - ; instance_initiated_shutdown_behavior = - Util.option_bind - (Xml.member "instanceInitiatedShutdownBehavior" xml) - ShutdownBehavior.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - Query.Pair - ("InstanceInitiatedShutdownBehavior", ShutdownBehavior.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", Boolean.to_query f)) - ; Util.option_map v.placement (fun f -> - Query.Pair ("Placement", Placement.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", UserData.to_query f)) - ; Util.option_map v.additional_info (fun f -> - Query.Pair ("AdditionalInfo", String.to_query f)) - ; Some (Query.Pair ("GroupId", SecurityGroupIdStringList.to_query v.group_ids)) - ; Some (Query.Pair ("GroupName", SecurityGroupStringList.to_query v.group_names)) - ; Util.option_map v.architecture (fun f -> - Query.Pair ("Architecture", ArchitectureValues.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - "instance_initiated_shutdown_behavior", ShutdownBehavior.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.monitoring (fun f -> "monitoring", Boolean.to_json f) - ; Util.option_map v.placement (fun f -> "placement", Placement.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", UserData.to_json f) - ; Util.option_map v.additional_info (fun f -> - "additional_info", String.to_json f) - ; Some ("group_ids", SecurityGroupIdStringList.to_json v.group_ids) - ; Some ("group_names", SecurityGroupStringList.to_json v.group_names) - ; Util.option_map v.architecture (fun f -> - "architecture", ArchitectureValues.to_json f) - ]) - - let of_json j = - { architecture = - Util.option_map (Json.lookup j "architecture") ArchitectureValues.of_json - ; group_names = - SecurityGroupStringList.of_json (Util.of_option_exn (Json.lookup j "group_names")) - ; group_ids = - SecurityGroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "group_ids")) - ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json - ; user_data = Util.option_map (Json.lookup j "user_data") UserData.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; placement = Util.option_map (Json.lookup j "placement") Placement.of_json - ; monitoring = Util.option_map (Json.lookup j "monitoring") Boolean.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; instance_initiated_shutdown_behavior = - Util.option_map - (Json.lookup j "instance_initiated_shutdown_behavior") - ShutdownBehavior.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - } -end - -module VpcEndpointSet = struct - type t = VpcEndpoint.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VpcEndpoint.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list VpcEndpoint.to_query v - - let to_json v = `List (List.map VpcEndpoint.to_json v) - - let of_json j = Json.to_list VpcEndpoint.of_json j -end - -module ImageDiskContainerList = struct - type t = ImageDiskContainer.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ImageDiskContainer.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ImageDiskContainer.to_query v - - let to_json v = `List (List.map ImageDiskContainer.to_json v) - - let of_json j = Json.to_list ImageDiskContainer.of_json j -end - -module ClassicLinkInstanceList = struct - type t = ClassicLinkInstance.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ClassicLinkInstance.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list ClassicLinkInstance.to_query v - - let to_json v = `List (List.map ClassicLinkInstance.to_json v) - - let of_json j = Json.to_list ClassicLinkInstance.of_json j -end - -module ImageAttributeName = struct - type t = - | Description - | Kernel - | Ramdisk - | LaunchPermission - | ProductCodes - | BlockDeviceMapping - | SriovNetSupport - - let str_to_t = - [ "sriovNetSupport", SriovNetSupport - ; "blockDeviceMapping", BlockDeviceMapping - ; "productCodes", ProductCodes - ; "launchPermission", LaunchPermission - ; "ramdisk", Ramdisk - ; "kernel", Kernel - ; "description", Description - ] - - let t_to_str = - [ SriovNetSupport, "sriovNetSupport" - ; BlockDeviceMapping, "blockDeviceMapping" - ; ProductCodes, "productCodes" - ; LaunchPermission, "launchPermission" - ; Ramdisk, "ramdisk" - ; Kernel, "kernel" - ; Description, "description" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module SnapshotList = struct - type t = Snapshot.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Snapshot.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list Snapshot.to_query v - - let to_json v = `List (List.map Snapshot.to_json v) - - let of_json j = Json.to_list Snapshot.of_json j -end - -module NetworkInterfaceAttribute = struct - type t = - | Description - | GroupSet - | SourceDestCheck - | Attachment - - let str_to_t = - [ "attachment", Attachment - ; "sourceDestCheck", SourceDestCheck - ; "groupSet", GroupSet - ; "description", Description - ] - - let t_to_str = - [ Attachment, "attachment" - ; SourceDestCheck, "sourceDestCheck" - ; GroupSet, "groupSet" - ; Description, "description" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ReservedInstanceLimitPrice = struct - type t = - { amount : Double.t option - ; currency_code : CurrencyCodeValues.t option - } - - let make ?amount ?currency_code () = { amount; currency_code } - - let parse xml = - Some - { amount = Util.option_bind (Xml.member "amount" xml) Double.parse - ; currency_code = - Util.option_bind (Xml.member "currencyCode" xml) CurrencyCodeValues.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", CurrencyCodeValues.to_query f)) - ; Util.option_map v.amount (fun f -> Query.Pair ("Amount", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.currency_code (fun f -> - "currency_code", CurrencyCodeValues.to_json f) - ; Util.option_map v.amount (fun f -> "amount", Double.to_json f) - ]) - - let of_json j = - { amount = Util.option_map (Json.lookup j "amount") Double.of_json - ; currency_code = - Util.option_map (Json.lookup j "currency_code") CurrencyCodeValues.of_json - } -end - -module ResetImageAttributeName = struct - type t = LaunchPermission - - let str_to_t = [ "launchPermission", LaunchPermission ] - - let t_to_str = [ LaunchPermission, "launchPermission" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module NewDhcpConfigurationList = struct - type t = NewDhcpConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NewDhcpConfiguration.parse (Xml.members "item" xml)) - - let to_query v = Query.to_query_list NewDhcpConfiguration.to_query v - - let to_json v = `List (List.map NewDhcpConfiguration.to_json v) - - let of_json j = Json.to_list NewDhcpConfiguration.of_json j -end - -module DescribeVpcAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - ; attribute : VpcAttributeName.t option - } - - let make ?dry_run ~vpc_id ?attribute () = { dry_run; vpc_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - ; attribute = Util.option_bind (Xml.member "Attribute" xml) VpcAttributeName.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", VpcAttributeName.to_query f)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> "attribute", VpcAttributeName.to_json f) - ; Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; attribute = Util.option_map (Json.lookup j "attribute") VpcAttributeName.of_json - } -end - -module DeleteNetworkAclRequest = struct - type t = - { dry_run : Boolean.t option - ; network_acl_id : String.t - } - - let make ?dry_run ~network_acl_id () = { dry_run; network_acl_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_acl_id = - Xml.required - "networkAclId" - (Util.option_bind (Xml.member "networkAclId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("NetworkAclId", String.to_query v.network_acl_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("network_acl_id", String.to_json v.network_acl_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_acl_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_acl_id")) - } -end - -module CreateImageRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; name : String.t - ; description : String.t option - ; no_reboot : Boolean.t option - ; block_device_mappings : BlockDeviceMappingRequestList.t - } - - let make - ?dry_run - ~instance_id - ~name - ?description - ?no_reboot - ?(block_device_mappings = []) - () = - { dry_run; instance_id; name; description; no_reboot; block_device_mappings } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; name = Xml.required "name" (Util.option_bind (Xml.member "name" xml) String.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; no_reboot = Util.option_bind (Xml.member "noReboot" xml) Boolean.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingRequestList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("InstanceCounts", + (InstanceCountList.to_query v.instance_counts))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (ListingStatus.to_query f))); + Util.option_map v.update_date + (fun f -> Query.Pair ("UpdateDate", (DateTime.to_query f))); + Util.option_map v.create_date + (fun f -> Query.Pair ("CreateDate", (DateTime.to_query f))); + Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f))); + Util.option_map v.reserved_instances_listing_id + (fun f -> + Query.Pair + ("ReservedInstancesListingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Some + ("price_schedules", + (PriceScheduleList.to_json v.price_schedules)); + Some + ("instance_counts", + (InstanceCountList.to_json v.instance_counts)); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.status + (fun f -> ("status", (ListingStatus.to_json f))); + Util.option_map v.update_date + (fun f -> ("update_date", (DateTime.to_json f))); + Util.option_map v.create_date + (fun f -> ("create_date", (DateTime.to_json f))); + Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f))); + Util.option_map v.reserved_instances_listing_id + (fun f -> ("reserved_instances_listing_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_listing_id = + (Util.option_map (Json.lookup j "reserved_instances_listing_id") + String.of_json); + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json); + create_date = + (Util.option_map (Json.lookup j "create_date") DateTime.of_json); + update_date = + (Util.option_map (Json.lookup j "update_date") DateTime.of_json); + status = + (Util.option_map (Json.lookup j "status") ListingStatus.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + instance_counts = + (InstanceCountList.of_json + (Util.of_option_exn (Json.lookup j "instance_counts"))); + price_schedules = + (PriceScheduleList.of_json + (Util.of_option_exn (Json.lookup j "price_schedules"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module InstanceStateChange = + struct + type t = + { + instance_id: String.t option ; + current_state: InstanceState.t option ; + previous_state: InstanceState.t option } + let make ?instance_id ?current_state ?previous_state () = + { instance_id; current_state; previous_state } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + current_state = + (Util.option_bind (Xml.member "currentState" xml) + InstanceState.parse); + previous_state = + (Util.option_bind (Xml.member "previousState" xml) + InstanceState.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.previous_state + (fun f -> + Query.Pair ("PreviousState", (InstanceState.to_query f))); + Util.option_map v.current_state + (fun f -> + Query.Pair ("CurrentState", (InstanceState.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.previous_state + (fun f -> ("previous_state", (InstanceState.to_json f))); + Util.option_map v.current_state + (fun f -> ("current_state", (InstanceState.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + current_state = + (Util.option_map (Json.lookup j "current_state") + InstanceState.of_json); + previous_state = + (Util.option_map (Json.lookup j "previous_state") + InstanceState.of_json) + } + end +module MovingAddressStatus = + struct + type t = { + public_ip: String.t option ; + move_status: MoveStatus.t option } + let make ?public_ip ?move_status () = { public_ip; move_status } + let parse xml = + Some + { + public_ip = + (Util.option_bind (Xml.member "publicIp" xml) String.parse); + move_status = + (Util.option_bind (Xml.member "moveStatus" xml) MoveStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.move_status + (fun f -> Query.Pair ("MoveStatus", (MoveStatus.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.move_status + (fun f -> ("move_status", (MoveStatus.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f)))]) + let of_json j = + { + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + move_status = + (Util.option_map (Json.lookup j "move_status") MoveStatus.of_json) + } + end +module InstanceStatus = + struct + type t = + { + instance_id: String.t option ; + availability_zone: String.t option ; + events: InstanceStatusEventList.t ; + instance_state: InstanceState.t option ; + system_status: InstanceStatusSummary.t option ; + instance_status: InstanceStatusSummary.t option } + let make ?instance_id ?availability_zone ?(events= []) ?instance_state + ?system_status ?instance_status () = + { + instance_id; + availability_zone; + events; + instance_state; + system_status; + instance_status + } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + events = + (Util.of_option [] + (Util.option_bind (Xml.member "eventsSet" xml) + InstanceStatusEventList.parse)); + instance_state = + (Util.option_bind (Xml.member "instanceState" xml) + InstanceState.parse); + system_status = + (Util.option_bind (Xml.member "systemStatus" xml) + InstanceStatusSummary.parse); + instance_status = + (Util.option_bind (Xml.member "instanceStatus" xml) + InstanceStatusSummary.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_status + (fun f -> + Query.Pair + ("InstanceStatus", (InstanceStatusSummary.to_query f))); + Util.option_map v.system_status + (fun f -> + Query.Pair + ("SystemStatus", (InstanceStatusSummary.to_query f))); + Util.option_map v.instance_state + (fun f -> + Query.Pair ("InstanceState", (InstanceState.to_query f))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingRequestList.to_query v.block_device_mappings )) - ; Util.option_map v.no_reboot (fun f -> - Query.Pair ("NoReboot", Boolean.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "block_device_mappings" - , BlockDeviceMappingRequestList.to_json v.block_device_mappings ) - ; Util.option_map v.no_reboot (fun f -> "no_reboot", Boolean.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("name", String.to_json v.name) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; no_reboot = Util.option_map (Json.lookup j "no_reboot") Boolean.of_json - ; block_device_mappings = - BlockDeviceMappingRequestList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - } -end - -module DescribeNetworkInterfacesResult = struct - type t = { network_interfaces : NetworkInterfaceList.t } - - let make ?(network_interfaces = []) () = { network_interfaces } - - let parse xml = - Some - { network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "networkInterfaceSet" xml) - NetworkInterfaceList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("EventsSet", (InstanceStatusEventList.to_query v.events))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_status + (fun f -> + ("instance_status", (InstanceStatusSummary.to_json f))); + Util.option_map v.system_status + (fun f -> ("system_status", (InstanceStatusSummary.to_json f))); + Util.option_map v.instance_state + (fun f -> ("instance_state", (InstanceState.to_json f))); + Some ("events", (InstanceStatusEventList.to_json v.events)); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + events = + (InstanceStatusEventList.of_json + (Util.of_option_exn (Json.lookup j "events"))); + instance_state = + (Util.option_map (Json.lookup j "instance_state") + InstanceState.of_json); + system_status = + (Util.option_map (Json.lookup j "system_status") + InstanceStatusSummary.of_json); + instance_status = + (Util.option_map (Json.lookup j "instance_status") + InstanceStatusSummary.of_json) + } + end +module Image = + struct + type t = + { + image_id: String.t ; + image_location: String.t ; + state: ImageState.t ; + owner_id: String.t ; + creation_date: String.t option ; + public: Boolean.t ; + product_codes: ProductCodeList.t ; + architecture: ArchitectureValues.t ; + image_type: ImageTypeValues.t ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + platform: PlatformValues.t option ; + sriov_net_support: String.t option ; + state_reason: StateReason.t option ; + image_owner_alias: String.t option ; + name: String.t option ; + description: String.t option ; + root_device_type: DeviceType.t ; + root_device_name: String.t option ; + block_device_mappings: BlockDeviceMappingList.t ; + virtualization_type: VirtualizationType.t ; + tags: TagList.t ; + hypervisor: HypervisorType.t } + let make ~image_id ~image_location ~state ~owner_id ?creation_date + ~public ?(product_codes= []) ~architecture ~image_type ?kernel_id + ?ramdisk_id ?platform ?sriov_net_support ?state_reason + ?image_owner_alias ?name ?description ~root_device_type + ?root_device_name ?(block_device_mappings= []) ~virtualization_type + ?(tags= []) ~hypervisor () = + { + image_id; + image_location; + state; + owner_id; + creation_date; + public; + product_codes; + architecture; + image_type; + kernel_id; + ramdisk_id; + platform; + sriov_net_support; + state_reason; + image_owner_alias; + name; + description; + root_device_type; + root_device_name; + block_device_mappings; + virtualization_type; + tags; + hypervisor + } + let parse xml = + Some + { + image_id = + (Xml.required "imageId" + (Util.option_bind (Xml.member "imageId" xml) String.parse)); + image_location = + (Xml.required "imageLocation" + (Util.option_bind (Xml.member "imageLocation" xml) + String.parse)); + state = + (Xml.required "imageState" + (Util.option_bind (Xml.member "imageState" xml) + ImageState.parse)); + owner_id = + (Xml.required "imageOwnerId" + (Util.option_bind (Xml.member "imageOwnerId" xml) String.parse)); + creation_date = + (Util.option_bind (Xml.member "creationDate" xml) String.parse); + public = + (Xml.required "isPublic" + (Util.option_bind (Xml.member "isPublic" xml) Boolean.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)); + architecture = + (Xml.required "architecture" + (Util.option_bind (Xml.member "architecture" xml) + ArchitectureValues.parse)); + image_type = + (Xml.required "imageType" + (Util.option_bind (Xml.member "imageType" xml) + ImageTypeValues.parse)); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) + PlatformValues.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse); + state_reason = + (Util.option_bind (Xml.member "stateReason" xml) + StateReason.parse); + image_owner_alias = + (Util.option_bind (Xml.member "imageOwnerAlias" xml) String.parse); + name = (Util.option_bind (Xml.member "name" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + root_device_type = + (Xml.required "rootDeviceType" + (Util.option_bind (Xml.member "rootDeviceType" xml) + DeviceType.parse)); + root_device_name = + (Util.option_bind (Xml.member "rootDeviceName" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingList.parse)); + virtualization_type = + (Xml.required "virtualizationType" + (Util.option_bind (Xml.member "virtualizationType" xml) + VirtualizationType.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + hypervisor = + (Xml.required "hypervisor" + (Util.option_bind (Xml.member "hypervisor" xml) + HypervisorType.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Hypervisor", (HypervisorType.to_query v.hypervisor))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ("NetworkInterfaceSet", NetworkInterfaceList.to_query v.network_interfaces)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("network_interfaces", NetworkInterfaceList.to_json v.network_interfaces) - ]) - - let of_json j = - { network_interfaces = - NetworkInterfaceList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - } -end - -module CreateVpcRequest = struct - type t = - { dry_run : Boolean.t option - ; cidr_block : String.t - ; instance_tenancy : Tenancy.t option - } - - let make ?dry_run ~cidr_block ?instance_tenancy () = - { dry_run; cidr_block; instance_tenancy } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; cidr_block = - Xml.required - "CidrBlock" - (Util.option_bind (Xml.member "CidrBlock" xml) String.parse) - ; instance_tenancy = - Util.option_bind (Xml.member "instanceTenancy" xml) Tenancy.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_tenancy (fun f -> - Query.Pair ("InstanceTenancy", Tenancy.to_query f)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_tenancy (fun f -> - "instance_tenancy", Tenancy.to_json f) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; instance_tenancy = - Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json - } -end - -module DescribeTagsResult = struct - type t = - { tags : TagDescriptionList.t - ; next_token : String.t option - } - - let make ?(tags = []) ?next_token () = { tags; next_token } - - let parse xml = - Some - { tags = - Util.of_option - [] - (Util.option_bind (Xml.member "tagSet" xml) TagDescriptionList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("TagSet", TagDescriptionList.to_query v.tags)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("tags", TagDescriptionList.to_json v.tags) - ]) - - let of_json j = - { tags = TagDescriptionList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeDhcpOptionsResult = struct - type t = { dhcp_options : DhcpOptionsList.t } - - let make ?(dhcp_options = []) () = { dhcp_options } - - let parse xml = - Some - { dhcp_options = - Util.of_option - [] - (Util.option_bind (Xml.member "dhcpOptionsSet" xml) DhcpOptionsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DhcpOptionsSet", DhcpOptionsList.to_query v.dhcp_options)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("dhcp_options", DhcpOptionsList.to_json v.dhcp_options) ]) - - let of_json j = - { dhcp_options = - DhcpOptionsList.of_json (Util.of_option_exn (Json.lookup j "dhcp_options")) - } -end - -module DescribeVpnGatewaysResult = struct - type t = { vpn_gateways : VpnGatewayList.t } - - let make ?(vpn_gateways = []) () = { vpn_gateways } - - let parse xml = - Some - { vpn_gateways = - Util.of_option - [] - (Util.option_bind (Xml.member "vpnGatewaySet" xml) VpnGatewayList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpnGatewaySet", VpnGatewayList.to_query v.vpn_gateways)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpn_gateways", VpnGatewayList.to_json v.vpn_gateways) ]) - - let of_json j = - { vpn_gateways = - VpnGatewayList.of_json (Util.of_option_exn (Json.lookup j "vpn_gateways")) - } -end - -module CreateImageResult = struct - type t = { image_id : String.t option } - - let make ?image_id () = { image_id } - - let parse xml = - Some { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> "image_id", String.to_json f) ]) - - let of_json j = { image_id = Util.option_map (Json.lookup j "image_id") String.of_json } -end - -module CreateNetworkAclRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - } - - let make ?dry_run ~vpc_id () = { dry_run; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module AuthorizeSecurityGroupEgressRequest = struct - type t = - { dry_run : Boolean.t option - ; group_id : String.t - ; source_security_group_name : String.t option - ; source_security_group_owner_id : String.t option - ; ip_protocol : String.t option - ; from_port : Integer.t option - ; to_port : Integer.t option - ; cidr_ip : String.t option - ; ip_permissions : IpPermissionList.t - } - - let make - ?dry_run - ~group_id - ?source_security_group_name - ?source_security_group_owner_id - ?ip_protocol - ?from_port - ?to_port - ?cidr_ip - ?(ip_permissions = []) - () = - { dry_run - ; group_id - ; source_security_group_name - ; source_security_group_owner_id - ; ip_protocol - ; from_port - ; to_port - ; cidr_ip - ; ip_permissions - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_id = - Xml.required - "groupId" - (Util.option_bind (Xml.member "groupId" xml) String.parse) - ; source_security_group_name = - Util.option_bind (Xml.member "sourceSecurityGroupName" xml) String.parse - ; source_security_group_owner_id = - Util.option_bind (Xml.member "sourceSecurityGroupOwnerId" xml) String.parse - ; ip_protocol = Util.option_bind (Xml.member "ipProtocol" xml) String.parse - ; from_port = Util.option_bind (Xml.member "fromPort" xml) Integer.parse - ; to_port = Util.option_bind (Xml.member "toPort" xml) Integer.parse - ; cidr_ip = Util.option_bind (Xml.member "cidrIp" xml) String.parse - ; ip_permissions = - Util.of_option - [] - (Util.option_bind (Xml.member "ipPermissions" xml) IpPermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IpPermissions", IpPermissionList.to_query v.ip_permissions)) - ; Util.option_map v.cidr_ip (fun f -> Query.Pair ("CidrIp", String.to_query f)) - ; Util.option_map v.to_port (fun f -> Query.Pair ("ToPort", Integer.to_query f)) - ; Util.option_map v.from_port (fun f -> - Query.Pair ("FromPort", Integer.to_query f)) - ; Util.option_map v.ip_protocol (fun f -> - Query.Pair ("IpProtocol", String.to_query f)) - ; Util.option_map v.source_security_group_owner_id (fun f -> - Query.Pair ("SourceSecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.source_security_group_name (fun f -> - Query.Pair ("SourceSecurityGroupName", String.to_query f)) - ; Some (Query.Pair ("GroupId", String.to_query v.group_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("ip_permissions", IpPermissionList.to_json v.ip_permissions) - ; Util.option_map v.cidr_ip (fun f -> "cidr_ip", String.to_json f) - ; Util.option_map v.to_port (fun f -> "to_port", Integer.to_json f) - ; Util.option_map v.from_port (fun f -> "from_port", Integer.to_json f) - ; Util.option_map v.ip_protocol (fun f -> "ip_protocol", String.to_json f) - ; Util.option_map v.source_security_group_owner_id (fun f -> - "source_security_group_owner_id", String.to_json f) - ; Util.option_map v.source_security_group_name (fun f -> - "source_security_group_name", String.to_json f) - ; Some ("group_id", String.to_json v.group_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_id = String.of_json (Util.of_option_exn (Json.lookup j "group_id")) - ; source_security_group_name = - Util.option_map (Json.lookup j "source_security_group_name") String.of_json - ; source_security_group_owner_id = - Util.option_map (Json.lookup j "source_security_group_owner_id") String.of_json - ; ip_protocol = Util.option_map (Json.lookup j "ip_protocol") String.of_json - ; from_port = Util.option_map (Json.lookup j "from_port") Integer.of_json - ; to_port = Util.option_map (Json.lookup j "to_port") Integer.of_json - ; cidr_ip = Util.option_map (Json.lookup j "cidr_ip") String.of_json - ; ip_permissions = - IpPermissionList.of_json (Util.of_option_exn (Json.lookup j "ip_permissions")) - } -end - -module CopyImageRequest = struct - type t = - { dry_run : Boolean.t option - ; source_region : String.t - ; source_image_id : String.t - ; name : String.t - ; description : String.t option - ; client_token : String.t option - } - - let make ?dry_run ~source_region ~source_image_id ~name ?description ?client_token () = - { dry_run; source_region; source_image_id; name; description; client_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; source_region = - Xml.required - "SourceRegion" - (Util.option_bind (Xml.member "SourceRegion" xml) String.parse) - ; source_image_id = - Xml.required - "SourceImageId" - (Util.option_bind (Xml.member "SourceImageId" xml) String.parse) - ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; client_token = Util.option_bind (Xml.member "ClientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ; Some (Query.Pair ("SourceImageId", String.to_query v.source_image_id)) - ; Some (Query.Pair ("SourceRegion", String.to_query v.source_region)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("name", String.to_json v.name) - ; Some ("source_image_id", String.to_json v.source_image_id) - ; Some ("source_region", String.to_json v.source_region) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; source_region = String.of_json (Util.of_option_exn (Json.lookup j "source_region")) - ; source_image_id = - String.of_json (Util.of_option_exn (Json.lookup j "source_image_id")) - ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module DescribeNetworkInterfaceAttributeResult = struct - type t = - { network_interface_id : String.t option - ; description : AttributeValue.t option - ; source_dest_check : AttributeBooleanValue.t option - ; groups : GroupIdentifierList.t - ; attachment : NetworkInterfaceAttachment.t option - } - - let make - ?network_interface_id - ?description - ?source_dest_check - ?(groups = []) - ?attachment - () = - { network_interface_id; description; source_dest_check; groups; attachment } - - let parse xml = - Some - { network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) AttributeValue.parse - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) AttributeBooleanValue.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - ; attachment = - Util.option_bind (Xml.member "attachment" xml) NetworkInterfaceAttachment.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attachment (fun f -> - Query.Pair ("Attachment", NetworkInterfaceAttachment.to_query f)) - ; Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", AttributeBooleanValue.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", AttributeValue.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attachment (fun f -> - "attachment", NetworkInterfaceAttachment.to_json f) - ; Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", AttributeBooleanValue.to_json f) - ; Util.option_map v.description (fun f -> - "description", AttributeValue.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ]) - - let of_json j = - { network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; description = Util.option_map (Json.lookup j "description") AttributeValue.of_json - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") AttributeBooleanValue.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; attachment = - Util.option_map (Json.lookup j "attachment") NetworkInterfaceAttachment.of_json - } -end - -module DescribeReservedInstancesModificationsResult = struct - type t = - { reserved_instances_modifications : ReservedInstancesModificationList.t - ; next_token : String.t option - } - - let make ?(reserved_instances_modifications = []) ?next_token () = - { reserved_instances_modifications; next_token } - - let parse xml = - Some - { reserved_instances_modifications = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesModificationsSet" xml) - ReservedInstancesModificationList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("VirtualizationType", + (VirtualizationType.to_query v.virtualization_type))); + Some (Query.Pair - ( "ReservedInstancesModificationsSet" - , ReservedInstancesModificationList.to_query - v.reserved_instances_modifications )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "reserved_instances_modifications" - , ReservedInstancesModificationList.to_json - v.reserved_instances_modifications ) - ]) - - let of_json j = - { reserved_instances_modifications = - ReservedInstancesModificationList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_modifications")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeReservedInstancesResult = struct - type t = { reserved_instances : ReservedInstancesList.t } - - let make ?(reserved_instances = []) () = { reserved_instances } - - let parse xml = - Some - { reserved_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesSet" xml) - ReservedInstancesList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("BlockDeviceMapping", + (BlockDeviceMappingList.to_query v.block_device_mappings))); + Util.option_map v.root_device_name + (fun f -> Query.Pair ("RootDeviceName", (String.to_query f))); + Some (Query.Pair - ( "ReservedInstancesSet" - , ReservedInstancesList.to_query v.reserved_instances )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("reserved_instances", ReservedInstancesList.to_json v.reserved_instances) - ]) - - let of_json j = - { reserved_instances = - ReservedInstancesList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances")) - } -end - -module CreateNetworkAclEntryRequest = struct - type t = - { dry_run : Boolean.t option - ; network_acl_id : String.t - ; rule_number : Integer.t - ; protocol : String.t - ; rule_action : RuleAction.t - ; egress : Boolean.t - ; cidr_block : String.t - ; icmp_type_code : IcmpTypeCode.t option - ; port_range : PortRange.t option - } - - let make - ?dry_run - ~network_acl_id - ~rule_number - ~protocol - ~rule_action - ~egress - ~cidr_block - ?icmp_type_code - ?port_range - () = - { dry_run - ; network_acl_id - ; rule_number - ; protocol - ; rule_action - ; egress - ; cidr_block - ; icmp_type_code - ; port_range - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_acl_id = - Xml.required - "networkAclId" - (Util.option_bind (Xml.member "networkAclId" xml) String.parse) - ; rule_number = - Xml.required - "ruleNumber" - (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse) - ; protocol = - Xml.required - "protocol" - (Util.option_bind (Xml.member "protocol" xml) String.parse) - ; rule_action = - Xml.required - "ruleAction" - (Util.option_bind (Xml.member "ruleAction" xml) RuleAction.parse) - ; egress = - Xml.required "egress" (Util.option_bind (Xml.member "egress" xml) Boolean.parse) - ; cidr_block = - Xml.required - "cidrBlock" - (Util.option_bind (Xml.member "cidrBlock" xml) String.parse) - ; icmp_type_code = Util.option_bind (Xml.member "Icmp" xml) IcmpTypeCode.parse - ; port_range = Util.option_bind (Xml.member "portRange" xml) PortRange.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> - Query.Pair ("PortRange", PortRange.to_query f)) - ; Util.option_map v.icmp_type_code (fun f -> - Query.Pair ("Icmp", IcmpTypeCode.to_query f)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Some (Query.Pair ("Egress", Boolean.to_query v.egress)) - ; Some (Query.Pair ("RuleAction", RuleAction.to_query v.rule_action)) - ; Some (Query.Pair ("Protocol", String.to_query v.protocol)) - ; Some (Query.Pair ("RuleNumber", Integer.to_query v.rule_number)) - ; Some (Query.Pair ("NetworkAclId", String.to_query v.network_acl_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> "port_range", PortRange.to_json f) - ; Util.option_map v.icmp_type_code (fun f -> - "icmp_type_code", IcmpTypeCode.to_json f) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Some ("egress", Boolean.to_json v.egress) - ; Some ("rule_action", RuleAction.to_json v.rule_action) - ; Some ("protocol", String.to_json v.protocol) - ; Some ("rule_number", Integer.to_json v.rule_number) - ; Some ("network_acl_id", String.to_json v.network_acl_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_acl_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_acl_id")) - ; rule_number = Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number")) - ; protocol = String.of_json (Util.of_option_exn (Json.lookup j "protocol")) - ; rule_action = RuleAction.of_json (Util.of_option_exn (Json.lookup j "rule_action")) - ; egress = Boolean.of_json (Util.of_option_exn (Json.lookup j "egress")) - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; icmp_type_code = - Util.option_map (Json.lookup j "icmp_type_code") IcmpTypeCode.of_json - ; port_range = Util.option_map (Json.lookup j "port_range") PortRange.of_json - } -end - -module DescribeTagsRequest = struct - type t = - { dry_run : Boolean.t option - ; filters : FilterList.t - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?dry_run ?(filters = []) ?max_results ?next_token () = - { dry_run; filters; max_results; next_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribePlacementGroupsResult = struct - type t = { placement_groups : PlacementGroupList.t } - - let make ?(placement_groups = []) () = { placement_groups } - - let parse xml = - Some - { placement_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "placementGroupSet" xml) - PlacementGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("RootDeviceType", (DeviceType.to_query v.root_device_type))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.image_owner_alias + (fun f -> Query.Pair ("ImageOwnerAlias", (String.to_query f))); + Util.option_map v.state_reason + (fun f -> Query.Pair ("StateReason", (StateReason.to_query f))); + Util.option_map v.sriov_net_support + (fun f -> Query.Pair ("SriovNetSupport", (String.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (PlatformValues.to_query f))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Some (Query.Pair - ("PlacementGroupSet", PlacementGroupList.to_query v.placement_groups)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("placement_groups", PlacementGroupList.to_json v.placement_groups) ]) - - let of_json j = - { placement_groups = - PlacementGroupList.of_json (Util.of_option_exn (Json.lookup j "placement_groups")) - } -end - -module CreateSubnetRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - ; cidr_block : String.t - ; availability_zone : String.t option - } - - let make ?dry_run ~vpc_id ~cidr_block ?availability_zone () = - { dry_run; vpc_id; cidr_block; availability_zone } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - ; cidr_block = - Xml.required - "CidrBlock" - (Util.option_bind (Xml.member "CidrBlock" xml) String.parse) - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - } -end - -module DeletePlacementGroupRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t - } - - let make ?dry_run ~group_name () = { dry_run; group_name } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = - Xml.required - "groupName" - (Util.option_bind (Xml.member "groupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("GroupName", String.to_query v.group_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("group_name", String.to_json v.group_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = String.of_json (Util.of_option_exn (Json.lookup j "group_name")) - } -end - -module DescribeKeyPairsResult = struct - type t = { key_pairs : KeyPairList.t } - - let make ?(key_pairs = []) () = { key_pairs } - - let parse xml = - Some - { key_pairs = - Util.of_option [] (Util.option_bind (Xml.member "keySet" xml) KeyPairList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("KeySet", KeyPairList.to_query v.key_pairs)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("key_pairs", KeyPairList.to_json v.key_pairs) ]) - - let of_json j = - { key_pairs = KeyPairList.of_json (Util.of_option_exn (Json.lookup j "key_pairs")) } -end - -module CancelSpotInstanceRequestsResult = struct - type t = { cancelled_spot_instance_requests : CancelledSpotInstanceRequestList.t } - - let make ?(cancelled_spot_instance_requests = []) () = - { cancelled_spot_instance_requests } - - let parse xml = - Some - { cancelled_spot_instance_requests = - Util.of_option - [] - (Util.option_bind - (Xml.member "spotInstanceRequestSet" xml) - CancelledSpotInstanceRequestList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ImageType", (ImageTypeValues.to_query v.image_type))); + Some (Query.Pair - ( "SpotInstanceRequestSet" - , CancelledSpotInstanceRequestList.to_query - v.cancelled_spot_instance_requests )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cancelled_spot_instance_requests" - , CancelledSpotInstanceRequestList.to_json v.cancelled_spot_instance_requests - ) - ]) - - let of_json j = - { cancelled_spot_instance_requests = - CancelledSpotInstanceRequestList.of_json - (Util.of_option_exn (Json.lookup j "cancelled_spot_instance_requests")) - } -end - -module CreateSpotDatafeedSubscriptionResult = struct - type t = { spot_datafeed_subscription : SpotDatafeedSubscription.t option } - - let make ?spot_datafeed_subscription () = { spot_datafeed_subscription } - - let parse xml = - Some - { spot_datafeed_subscription = - Util.option_bind - (Xml.member "spotDatafeedSubscription" xml) - SpotDatafeedSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.spot_datafeed_subscription (fun f -> - Query.Pair ("SpotDatafeedSubscription", SpotDatafeedSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.spot_datafeed_subscription (fun f -> - "spot_datafeed_subscription", SpotDatafeedSubscription.to_json f) - ]) - - let of_json j = - { spot_datafeed_subscription = - Util.option_map - (Json.lookup j "spot_datafeed_subscription") - SpotDatafeedSubscription.of_json - } -end - -module ModifyImageAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; image_id : String.t - ; attribute : String.t option - ; operation_type : OperationType.t option - ; user_ids : UserIdStringList.t - ; user_groups : UserGroupStringList.t - ; product_codes : ProductCodeStringList.t - ; value : String.t option - ; launch_permission : LaunchPermissionModifications.t option - ; description : AttributeValue.t option - } - - let make - ?dry_run - ~image_id - ?attribute - ?operation_type - ?(user_ids = []) - ?(user_groups = []) - ?(product_codes = []) - ?value - ?launch_permission - ?description - () = - { dry_run - ; image_id - ; attribute - ; operation_type - ; user_ids - ; user_groups - ; product_codes - ; value - ; launch_permission - ; description - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - ; attribute = Util.option_bind (Xml.member "Attribute" xml) String.parse - ; operation_type = - Util.option_bind (Xml.member "OperationType" xml) OperationType.parse - ; user_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "UserId" xml) UserIdStringList.parse) - ; user_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "UserGroup" xml) UserGroupStringList.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "ProductCode" xml) ProductCodeStringList.parse) - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - ; launch_permission = - Util.option_bind - (Xml.member "LaunchPermission" xml) - LaunchPermissionModifications.parse - ; description = Util.option_bind (Xml.member "Description" xml) AttributeValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", AttributeValue.to_query f)) - ; Util.option_map v.launch_permission (fun f -> - Query.Pair ("LaunchPermission", LaunchPermissionModifications.to_query f)) - ; Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Some - (Query.Pair ("ProductCode", ProductCodeStringList.to_query v.product_codes)) - ; Some (Query.Pair ("UserGroup", UserGroupStringList.to_query v.user_groups)) - ; Some (Query.Pair ("UserId", UserIdStringList.to_query v.user_ids)) - ; Util.option_map v.operation_type (fun f -> - Query.Pair ("OperationType", OperationType.to_query f)) - ; Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", String.to_query f)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - "description", AttributeValue.to_json f) - ; Util.option_map v.launch_permission (fun f -> - "launch_permission", LaunchPermissionModifications.to_json f) - ; Util.option_map v.value (fun f -> "value", String.to_json f) - ; Some ("product_codes", ProductCodeStringList.to_json v.product_codes) - ; Some ("user_groups", UserGroupStringList.to_json v.user_groups) - ; Some ("user_ids", UserIdStringList.to_json v.user_ids) - ; Util.option_map v.operation_type (fun f -> - "operation_type", OperationType.to_json f) - ; Util.option_map v.attribute (fun f -> "attribute", String.to_json f) - ; Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; attribute = Util.option_map (Json.lookup j "attribute") String.of_json - ; operation_type = - Util.option_map (Json.lookup j "operation_type") OperationType.of_json - ; user_ids = UserIdStringList.of_json (Util.of_option_exn (Json.lookup j "user_ids")) - ; user_groups = - UserGroupStringList.of_json (Util.of_option_exn (Json.lookup j "user_groups")) - ; product_codes = - ProductCodeStringList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - ; value = Util.option_map (Json.lookup j "value") String.of_json - ; launch_permission = - Util.option_map - (Json.lookup j "launch_permission") - LaunchPermissionModifications.of_json - ; description = Util.option_map (Json.lookup j "description") AttributeValue.of_json - } -end - -module DescribeInstanceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; attribute : InstanceAttributeName.t - } - - let make ?dry_run ~instance_id ~attribute () = { dry_run; instance_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; attribute = - Xml.required - "attribute" - (Util.option_bind (Xml.member "attribute" xml) InstanceAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", InstanceAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", InstanceAttributeName.to_json v.attribute) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; attribute = - InstanceAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module DescribeBundleTasksRequest = struct - type t = - { dry_run : Boolean.t option - ; bundle_ids : BundleIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(bundle_ids = []) ?(filters = []) () = - { dry_run; bundle_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; bundle_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "BundleId" xml) BundleIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("BundleId", BundleIdStringList.to_query v.bundle_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("bundle_ids", BundleIdStringList.to_json v.bundle_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; bundle_ids = - BundleIdStringList.of_json (Util.of_option_exn (Json.lookup j "bundle_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeConversionTasksResult = struct - type t = { conversion_tasks : DescribeConversionTaskList.t } - - let make ?(conversion_tasks = []) () = { conversion_tasks } - - let parse xml = - Some - { conversion_tasks = - Util.of_option - [] - (Util.option_bind - (Xml.member "conversionTasks" xml) - DescribeConversionTaskList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("Architecture", + (ArchitectureValues.to_query v.architecture))); + Some (Query.Pair - ("ConversionTasks", DescribeConversionTaskList.to_query v.conversion_tasks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("conversion_tasks", DescribeConversionTaskList.to_json v.conversion_tasks) - ]) - - let of_json j = - { conversion_tasks = - DescribeConversionTaskList.of_json - (Util.of_option_exn (Json.lookup j "conversion_tasks")) - } -end - -module CreateInstanceExportTaskRequest = struct - type t = - { description : String.t option - ; instance_id : String.t - ; target_environment : ExportEnvironment.t option - ; export_to_s3_task : ExportToS3TaskSpecification.t option - } - - let make ?description ~instance_id ?target_environment ?export_to_s3_task () = - { description; instance_id; target_environment; export_to_s3_task } - - let parse xml = - Some - { description = Util.option_bind (Xml.member "description" xml) String.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; target_environment = - Util.option_bind (Xml.member "targetEnvironment" xml) ExportEnvironment.parse - ; export_to_s3_task = - Util.option_bind (Xml.member "exportToS3" xml) ExportToS3TaskSpecification.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.export_to_s3_task (fun f -> - Query.Pair ("ExportToS3", ExportToS3TaskSpecification.to_query f)) - ; Util.option_map v.target_environment (fun f -> - Query.Pair ("TargetEnvironment", ExportEnvironment.to_query f)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.export_to_s3_task (fun f -> - "export_to_s3_task", ExportToS3TaskSpecification.to_json f) - ; Util.option_map v.target_environment (fun f -> - "target_environment", ExportEnvironment.to_json f) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ]) - - let of_json j = - { description = Util.option_map (Json.lookup j "description") String.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; target_environment = - Util.option_map (Json.lookup j "target_environment") ExportEnvironment.of_json - ; export_to_s3_task = - Util.option_map - (Json.lookup j "export_to_s3_task") - ExportToS3TaskSpecification.of_json - } -end - -module ResetNetworkInterfaceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_id : String.t - ; source_dest_check : String.t option - } - - let make ?dry_run ~network_interface_id ?source_dest_check () = - { dry_run; network_interface_id; source_dest_check } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", String.to_query f)) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.source_dest_check (fun f -> - "source_dest_check", String.to_json f) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") String.of_json - } -end - -module CreateSecurityGroupResult = struct - type t = { group_id : String.t } - - let make ~group_id () = { group_id } - - let parse xml = - Some - { group_id = - Xml.required - "groupId" - (Util.option_bind (Xml.member "groupId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("GroupId", String.to_query v.group_id)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("group_id", String.to_json v.group_id) ]) - - let of_json j = - { group_id = String.of_json (Util.of_option_exn (Json.lookup j "group_id")) } -end - -module DescribeSpotFleetRequestHistoryResponse = struct - type t = - { spot_fleet_request_id : String.t - ; start_time : DateTime.t - ; last_evaluated_time : DateTime.t - ; history_records : HistoryRecords.t - ; next_token : String.t option - } - - let make - ~spot_fleet_request_id - ~start_time - ~last_evaluated_time - ~history_records - ?next_token - () = - { spot_fleet_request_id - ; start_time - ; last_evaluated_time - ; history_records - ; next_token - } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; start_time = - Xml.required - "startTime" - (Util.option_bind (Xml.member "startTime" xml) DateTime.parse) - ; last_evaluated_time = - Xml.required - "lastEvaluatedTime" - (Util.option_bind (Xml.member "lastEvaluatedTime" xml) DateTime.parse) - ; history_records = - Xml.required - "historyRecordSet" - (Util.option_bind (Xml.member "historyRecordSet" xml) HistoryRecords.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("HistoryRecordSet", HistoryRecords.to_query v.history_records)) - ; Some - (Query.Pair ("LastEvaluatedTime", DateTime.to_query v.last_evaluated_time)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("history_records", HistoryRecords.to_json v.history_records) - ; Some ("last_evaluated_time", DateTime.to_json v.last_evaluated_time) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; last_evaluated_time = - DateTime.of_json (Util.of_option_exn (Json.lookup j "last_evaluated_time")) - ; history_records = - HistoryRecords.of_json (Util.of_option_exn (Json.lookup j "history_records")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module CancelReservedInstancesListingRequest = struct - type t = { reserved_instances_listing_id : String.t } - - let make ~reserved_instances_listing_id () = { reserved_instances_listing_id } - - let parse xml = - Some - { reserved_instances_listing_id = - Xml.required - "reservedInstancesListingId" - (Util.option_bind (Xml.member "reservedInstancesListingId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Some (Query.Pair ("IsPublic", (Boolean.to_query v.public))); + Util.option_map v.creation_date + (fun f -> Query.Pair ("CreationDate", (String.to_query f))); + Some (Query.Pair ("ImageOwnerId", (String.to_query v.owner_id))); + Some (Query.Pair ("ImageState", (ImageState.to_query v.state))); + Some (Query.Pair - ( "ReservedInstancesListingId" - , String.to_query v.reserved_instances_listing_id )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_instances_listing_id" - , String.to_json v.reserved_instances_listing_id ) - ]) - - let of_json j = - { reserved_instances_listing_id = - String.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_listing_id")) - } -end - -module DescribeSnapshotsRequest = struct - type t = - { dry_run : Boolean.t option - ; snapshot_ids : SnapshotIdStringList.t - ; owner_ids : OwnerStringList.t - ; restorable_by_user_ids : RestorableByStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make - ?dry_run - ?(snapshot_ids = []) - ?(owner_ids = []) - ?(restorable_by_user_ids = []) - ?(filters = []) - ?next_token - ?max_results - () = - { dry_run - ; snapshot_ids - ; owner_ids - ; restorable_by_user_ids - ; filters - ; next_token - ; max_results - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; snapshot_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "SnapshotId" xml) SnapshotIdStringList.parse) - ; owner_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "Owner" xml) OwnerStringList.parse) - ; restorable_by_user_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "RestorableBy" xml) - RestorableByStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("ImageLocation", (String.to_query v.image_location))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("hypervisor", (HypervisorType.to_json v.hypervisor)); + Some ("tags", (TagList.to_json v.tags)); + Some + ("virtualization_type", + (VirtualizationType.to_json v.virtualization_type)); + Some + ("block_device_mappings", + (BlockDeviceMappingList.to_json v.block_device_mappings)); + Util.option_map v.root_device_name + (fun f -> ("root_device_name", (String.to_json f))); + Some ("root_device_type", (DeviceType.to_json v.root_device_type)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.image_owner_alias + (fun f -> ("image_owner_alias", (String.to_json f))); + Util.option_map v.state_reason + (fun f -> ("state_reason", (StateReason.to_json f))); + Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (String.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (PlatformValues.to_json f))); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Some ("image_type", (ImageTypeValues.to_json v.image_type)); + Some ("architecture", (ArchitectureValues.to_json v.architecture)); + Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Some ("public", (Boolean.to_json v.public)); + Util.option_map v.creation_date + (fun f -> ("creation_date", (String.to_json f))); + Some ("owner_id", (String.to_json v.owner_id)); + Some ("state", (ImageState.to_json v.state)); + Some ("image_location", (String.to_json v.image_location)); + Some ("image_id", (String.to_json v.image_id))]) + let of_json j = + { + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + image_location = + (String.of_json + (Util.of_option_exn (Json.lookup j "image_location"))); + state = + (ImageState.of_json (Util.of_option_exn (Json.lookup j "state"))); + owner_id = + (String.of_json (Util.of_option_exn (Json.lookup j "owner_id"))); + creation_date = + (Util.option_map (Json.lookup j "creation_date") String.of_json); + public = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "public"))); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))); + architecture = + (ArchitectureValues.of_json + (Util.of_option_exn (Json.lookup j "architecture"))); + image_type = + (ImageTypeValues.of_json + (Util.of_option_exn (Json.lookup j "image_type"))); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") PlatformValues.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") String.of_json); + state_reason = + (Util.option_map (Json.lookup j "state_reason") StateReason.of_json); + image_owner_alias = + (Util.option_map (Json.lookup j "image_owner_alias") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + root_device_type = + (DeviceType.of_json + (Util.of_option_exn (Json.lookup j "root_device_type"))); + root_device_name = + (Util.option_map (Json.lookup j "root_device_name") String.of_json); + block_device_mappings = + (BlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + virtualization_type = + (VirtualizationType.of_json + (Util.of_option_exn (Json.lookup j "virtualization_type"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + hypervisor = + (HypervisorType.of_json + (Util.of_option_exn (Json.lookup j "hypervisor"))) + } + end +module PriceScheduleSpecification = + struct + type t = + { + term: Long.t option ; + price: Double.t option ; + currency_code: CurrencyCodeValues.t option } + let make ?term ?price ?currency_code () = + { term; price; currency_code } + let parse xml = + Some + { + term = (Util.option_bind (Xml.member "term" xml) Long.parse); + price = (Util.option_bind (Xml.member "price" xml) Double.parse); + currency_code = + (Util.option_bind (Xml.member "currencyCode" xml) + CurrencyCodeValues.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.currency_code + (fun f -> + Query.Pair ("CurrencyCode", (CurrencyCodeValues.to_query f))); + Util.option_map v.price + (fun f -> Query.Pair ("Price", (Double.to_query f))); + Util.option_map v.term + (fun f -> Query.Pair ("Term", (Long.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.currency_code + (fun f -> ("currency_code", (CurrencyCodeValues.to_json f))); + Util.option_map v.price (fun f -> ("price", (Double.to_json f))); + Util.option_map v.term (fun f -> ("term", (Long.to_json f)))]) + let of_json j = + { + term = (Util.option_map (Json.lookup j "term") Long.of_json); + price = (Util.option_map (Json.lookup j "price") Double.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") + CurrencyCodeValues.of_json) + } + end +module ImportSnapshotTask = + struct + type t = + { + import_task_id: String.t option ; + snapshot_task_detail: SnapshotTaskDetail.t option ; + description: String.t option } + let make ?import_task_id ?snapshot_task_detail ?description () = + { import_task_id; snapshot_task_detail; description } + let parse xml = + Some + { + import_task_id = + (Util.option_bind (Xml.member "importTaskId" xml) String.parse); + snapshot_task_detail = + (Util.option_bind (Xml.member "snapshotTaskDetail" xml) + SnapshotTaskDetail.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.snapshot_task_detail + (fun f -> + Query.Pair + ("SnapshotTaskDetail", (SnapshotTaskDetail.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.snapshot_task_detail + (fun f -> + ("snapshot_task_detail", (SnapshotTaskDetail.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f)))]) + let of_json j = + { + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + snapshot_task_detail = + (Util.option_map (Json.lookup j "snapshot_task_detail") + SnapshotTaskDetail.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module SpotInstanceRequest = + struct + type t = + { + spot_instance_request_id: String.t option ; + spot_price: String.t option ; + type_: SpotInstanceType.t option ; + state: SpotInstanceState.t option ; + fault: SpotInstanceStateFault.t option ; + status: SpotInstanceStatus.t option ; + valid_from: DateTime.t option ; + valid_until: DateTime.t option ; + launch_group: String.t option ; + availability_zone_group: String.t option ; + launch_specification: LaunchSpecification.t option ; + instance_id: String.t option ; + create_time: DateTime.t option ; + product_description: RIProductDescription.t option ; + tags: TagList.t ; + launched_availability_zone: String.t option } + let make ?spot_instance_request_id ?spot_price ?type_ ?state ?fault + ?status ?valid_from ?valid_until ?launch_group + ?availability_zone_group ?launch_specification ?instance_id + ?create_time ?product_description ?(tags= []) + ?launched_availability_zone () = + { + spot_instance_request_id; + spot_price; + type_; + state; + fault; + status; + valid_from; + valid_until; + launch_group; + availability_zone_group; + launch_specification; + instance_id; + create_time; + product_description; + tags; + launched_availability_zone + } + let parse xml = + Some + { + spot_instance_request_id = + (Util.option_bind (Xml.member "spotInstanceRequestId" xml) + String.parse); + spot_price = + (Util.option_bind (Xml.member "spotPrice" xml) String.parse); + type_ = + (Util.option_bind (Xml.member "type" xml) SpotInstanceType.parse); + state = + (Util.option_bind (Xml.member "state" xml) + SpotInstanceState.parse); + fault = + (Util.option_bind (Xml.member "fault" xml) + SpotInstanceStateFault.parse); + status = + (Util.option_bind (Xml.member "status" xml) + SpotInstanceStatus.parse); + valid_from = + (Util.option_bind (Xml.member "validFrom" xml) DateTime.parse); + valid_until = + (Util.option_bind (Xml.member "validUntil" xml) DateTime.parse); + launch_group = + (Util.option_bind (Xml.member "launchGroup" xml) String.parse); + availability_zone_group = + (Util.option_bind (Xml.member "availabilityZoneGroup" xml) + String.parse); + launch_specification = + (Util.option_bind (Xml.member "launchSpecification" xml) + LaunchSpecification.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + create_time = + (Util.option_bind (Xml.member "createTime" xml) DateTime.parse); + product_description = + (Util.option_bind (Xml.member "productDescription" xml) + RIProductDescription.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + launched_availability_zone = + (Util.option_bind (Xml.member "launchedAvailabilityZone" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.launched_availability_zone + (fun f -> + Query.Pair ("LaunchedAvailabilityZone", (String.to_query f))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.product_description + (fun f -> + Query.Pair + ("ProductDescription", (RIProductDescription.to_query f))); + Util.option_map v.create_time + (fun f -> Query.Pair ("CreateTime", (DateTime.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.launch_specification + (fun f -> + Query.Pair + ("LaunchSpecification", (LaunchSpecification.to_query f))); + Util.option_map v.availability_zone_group + (fun f -> + Query.Pair ("AvailabilityZoneGroup", (String.to_query f))); + Util.option_map v.launch_group + (fun f -> Query.Pair ("LaunchGroup", (String.to_query f))); + Util.option_map v.valid_until + (fun f -> Query.Pair ("ValidUntil", (DateTime.to_query f))); + Util.option_map v.valid_from + (fun f -> Query.Pair ("ValidFrom", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (SpotInstanceStatus.to_query f))); + Util.option_map v.fault + (fun f -> + Query.Pair ("Fault", (SpotInstanceStateFault.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (SpotInstanceState.to_query f))); + Util.option_map v.type_ + (fun f -> Query.Pair ("Type", (SpotInstanceType.to_query f))); + Util.option_map v.spot_price + (fun f -> Query.Pair ("SpotPrice", (String.to_query f))); + Util.option_map v.spot_instance_request_id + (fun f -> + Query.Pair ("SpotInstanceRequestId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.launched_availability_zone + (fun f -> ("launched_availability_zone", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.product_description + (fun f -> + ("product_description", (RIProductDescription.to_json f))); + Util.option_map v.create_time + (fun f -> ("create_time", (DateTime.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.launch_specification + (fun f -> + ("launch_specification", (LaunchSpecification.to_json f))); + Util.option_map v.availability_zone_group + (fun f -> ("availability_zone_group", (String.to_json f))); + Util.option_map v.launch_group + (fun f -> ("launch_group", (String.to_json f))); + Util.option_map v.valid_until + (fun f -> ("valid_until", (DateTime.to_json f))); + Util.option_map v.valid_from + (fun f -> ("valid_from", (DateTime.to_json f))); + Util.option_map v.status + (fun f -> ("status", (SpotInstanceStatus.to_json f))); + Util.option_map v.fault + (fun f -> ("fault", (SpotInstanceStateFault.to_json f))); + Util.option_map v.state + (fun f -> ("state", (SpotInstanceState.to_json f))); + Util.option_map v.type_ + (fun f -> ("type_", (SpotInstanceType.to_json f))); + Util.option_map v.spot_price + (fun f -> ("spot_price", (String.to_json f))); + Util.option_map v.spot_instance_request_id + (fun f -> ("spot_instance_request_id", (String.to_json f)))]) + let of_json j = + { + spot_instance_request_id = + (Util.option_map (Json.lookup j "spot_instance_request_id") + String.of_json); + spot_price = + (Util.option_map (Json.lookup j "spot_price") String.of_json); + type_ = + (Util.option_map (Json.lookup j "type_") SpotInstanceType.of_json); + state = + (Util.option_map (Json.lookup j "state") SpotInstanceState.of_json); + fault = + (Util.option_map (Json.lookup j "fault") + SpotInstanceStateFault.of_json); + status = + (Util.option_map (Json.lookup j "status") + SpotInstanceStatus.of_json); + valid_from = + (Util.option_map (Json.lookup j "valid_from") DateTime.of_json); + valid_until = + (Util.option_map (Json.lookup j "valid_until") DateTime.of_json); + launch_group = + (Util.option_map (Json.lookup j "launch_group") String.of_json); + availability_zone_group = + (Util.option_map (Json.lookup j "availability_zone_group") + String.of_json); + launch_specification = + (Util.option_map (Json.lookup j "launch_specification") + LaunchSpecification.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + create_time = + (Util.option_map (Json.lookup j "create_time") DateTime.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + RIProductDescription.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + launched_availability_zone = + (Util.option_map (Json.lookup j "launched_availability_zone") + String.of_json) + } + end +module ExportTask = + struct + type t = + { + export_task_id: String.t ; + description: String.t ; + state: ExportTaskState.t ; + status_message: String.t ; + instance_export_details: InstanceExportDetails.t ; + export_to_s3_task: ExportToS3Task.t } + let make ~export_task_id ~description ~state ~status_message + ~instance_export_details ~export_to_s3_task () = + { + export_task_id; + description; + state; + status_message; + instance_export_details; + export_to_s3_task + } + let parse xml = + Some + { + export_task_id = + (Xml.required "exportTaskId" + (Util.option_bind (Xml.member "exportTaskId" xml) String.parse)); + description = + (Xml.required "description" + (Util.option_bind (Xml.member "description" xml) String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) + ExportTaskState.parse)); + status_message = + (Xml.required "statusMessage" + (Util.option_bind (Xml.member "statusMessage" xml) + String.parse)); + instance_export_details = + (Xml.required "instanceExport" + (Util.option_bind (Xml.member "instanceExport" xml) + InstanceExportDetails.parse)); + export_to_s3_task = + (Xml.required "exportToS3" + (Util.option_bind (Xml.member "exportToS3" xml) + ExportToS3Task.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ExportToS3", + (ExportToS3Task.to_query v.export_to_s3_task))); + Some (Query.Pair - ("RestorableBy", RestorableByStringList.to_query v.restorable_by_user_ids)) - ; Some (Query.Pair ("Owner", OwnerStringList.to_query v.owner_ids)) - ; Some (Query.Pair ("SnapshotId", SnapshotIdStringList.to_query v.snapshot_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some - ( "restorable_by_user_ids" - , RestorableByStringList.to_json v.restorable_by_user_ids ) - ; Some ("owner_ids", OwnerStringList.to_json v.owner_ids) - ; Some ("snapshot_ids", SnapshotIdStringList.to_json v.snapshot_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; snapshot_ids = - SnapshotIdStringList.of_json (Util.of_option_exn (Json.lookup j "snapshot_ids")) - ; owner_ids = OwnerStringList.of_json (Util.of_option_exn (Json.lookup j "owner_ids")) - ; restorable_by_user_ids = - RestorableByStringList.of_json - (Util.of_option_exn (Json.lookup j "restorable_by_user_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module ModifyReservedInstancesRequest = struct - type t = - { client_token : String.t option - ; reserved_instances_ids : ReservedInstancesIdStringList.t - ; target_configurations : ReservedInstancesConfigurationList.t - } - - let make ?client_token ~reserved_instances_ids ~target_configurations () = - { client_token; reserved_instances_ids; target_configurations } - - let parse xml = - Some - { client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; reserved_instances_ids = - Xml.required - "ReservedInstancesId" - (Util.option_bind - (Xml.member "ReservedInstancesId" xml) - ReservedInstancesIdStringList.parse) - ; target_configurations = - Xml.required - "ReservedInstancesConfigurationSetItemType" - (Util.option_bind - (Xml.member "ReservedInstancesConfigurationSetItemType" xml) - ReservedInstancesConfigurationList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("InstanceExport", + (InstanceExportDetails.to_query v.instance_export_details))); + Some (Query.Pair - ( "ReservedInstancesConfigurationSetItemType" - , ReservedInstancesConfigurationList.to_query v.target_configurations )) - ; Some + ("StatusMessage", (String.to_query v.status_message))); + Some (Query.Pair ("State", (ExportTaskState.to_query v.state))); + Some (Query.Pair ("Description", (String.to_query v.description))); + Some + (Query.Pair ("ExportTaskId", (String.to_query v.export_task_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("export_to_s3_task", + (ExportToS3Task.to_json v.export_to_s3_task)); + Some + ("instance_export_details", + (InstanceExportDetails.to_json v.instance_export_details)); + Some ("status_message", (String.to_json v.status_message)); + Some ("state", (ExportTaskState.to_json v.state)); + Some ("description", (String.to_json v.description)); + Some ("export_task_id", (String.to_json v.export_task_id))]) + let of_json j = + { + export_task_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "export_task_id"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + state = + (ExportTaskState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + status_message = + (String.of_json + (Util.of_option_exn (Json.lookup j "status_message"))); + instance_export_details = + (InstanceExportDetails.of_json + (Util.of_option_exn (Json.lookup j "instance_export_details"))); + export_to_s3_task = + (ExportToS3Task.of_json + (Util.of_option_exn (Json.lookup j "export_to_s3_task"))) + } + end +module PrefixList = + struct + type t = + { + prefix_list_id: String.t option ; + prefix_list_name: String.t option ; + cidrs: ValueStringList.t } + let make ?prefix_list_id ?prefix_list_name ?(cidrs= []) () = + { prefix_list_id; prefix_list_name; cidrs } + let parse xml = + Some + { + prefix_list_id = + (Util.option_bind (Xml.member "prefixListId" xml) String.parse); + prefix_list_name = + (Util.option_bind (Xml.member "prefixListName" xml) String.parse); + cidrs = + (Util.of_option [] + (Util.option_bind (Xml.member "cidrSet" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("CidrSet", (ValueStringList.to_query v.cidrs))); + Util.option_map v.prefix_list_name + (fun f -> Query.Pair ("PrefixListName", (String.to_query f))); + Util.option_map v.prefix_list_id + (fun f -> Query.Pair ("PrefixListId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("cidrs", (ValueStringList.to_json v.cidrs)); + Util.option_map v.prefix_list_name + (fun f -> ("prefix_list_name", (String.to_json f))); + Util.option_map v.prefix_list_id + (fun f -> ("prefix_list_id", (String.to_json f)))]) + let of_json j = + { + prefix_list_id = + (Util.option_map (Json.lookup j "prefix_list_id") String.of_json); + prefix_list_name = + (Util.option_map (Json.lookup j "prefix_list_name") String.of_json); + cidrs = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "cidrs"))) + } + end +module InstanceMonitoring = + struct + type t = { + instance_id: String.t option ; + monitoring: Monitoring.t option } + let make ?instance_id ?monitoring () = { instance_id; monitoring } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + monitoring = + (Util.option_bind (Xml.member "monitoring" xml) Monitoring.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.monitoring + (fun f -> Query.Pair ("Monitoring", (Monitoring.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.monitoring + (fun f -> ("monitoring", (Monitoring.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + monitoring = + (Util.option_map (Json.lookup j "monitoring") Monitoring.of_json) + } + end +module SecurityGroup = + struct + type t = + { + owner_id: String.t ; + group_name: String.t ; + group_id: String.t ; + description: String.t ; + ip_permissions: IpPermissionList.t ; + ip_permissions_egress: IpPermissionList.t ; + vpc_id: String.t option ; + tags: TagList.t } + let make ~owner_id ~group_name ~group_id ~description + ?(ip_permissions= []) ?(ip_permissions_egress= []) ?vpc_id ?(tags= + []) () = + { + owner_id; + group_name; + group_id; + description; + ip_permissions; + ip_permissions_egress; + vpc_id; + tags + } + let parse xml = + Some + { + owner_id = + (Xml.required "ownerId" + (Util.option_bind (Xml.member "ownerId" xml) String.parse)); + group_name = + (Xml.required "groupName" + (Util.option_bind (Xml.member "groupName" xml) String.parse)); + group_id = + (Xml.required "groupId" + (Util.option_bind (Xml.member "groupId" xml) String.parse)); + description = + (Xml.required "groupDescription" + (Util.option_bind (Xml.member "groupDescription" xml) + String.parse)); + ip_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "ipPermissions" xml) + IpPermissionList.parse)); + ip_permissions_egress = + (Util.of_option [] + (Util.option_bind (Xml.member "ipPermissionsEgress" xml) + IpPermissionList.parse)); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Some (Query.Pair - ( "ReservedInstancesId" - , ReservedInstancesIdStringList.to_query v.reserved_instances_ids )) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "target_configurations" - , ReservedInstancesConfigurationList.to_json v.target_configurations ) - ; Some - ( "reserved_instances_ids" - , ReservedInstancesIdStringList.to_json v.reserved_instances_ids ) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ]) - - let of_json j = - { client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; reserved_instances_ids = - ReservedInstancesIdStringList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_ids")) - ; target_configurations = - ReservedInstancesConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "target_configurations")) - } -end - -module AssociateRouteTableRequest = struct - type t = - { dry_run : Boolean.t option - ; subnet_id : String.t - ; route_table_id : String.t - } - - let make ?dry_run ~subnet_id ~route_table_id () = { dry_run; subnet_id; route_table_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; subnet_id = - Xml.required - "subnetId" - (Util.option_bind (Xml.member "subnetId" xml) String.parse) - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Some (Query.Pair ("SubnetId", String.to_query v.subnet_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("route_table_id", String.to_json v.route_table_id) - ; Some ("subnet_id", String.to_json v.subnet_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; subnet_id = String.of_json (Util.of_option_exn (Json.lookup j "subnet_id")) - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - } -end - -module AssociateAddressResult = struct - type t = { association_id : String.t option } - - let make ?association_id () = { association_id } - - let parse xml = - Some - { association_id = Util.option_bind (Xml.member "associationId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> - Query.Pair ("AssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> "association_id", String.to_json f) - ]) - - let of_json j = - { association_id = Util.option_map (Json.lookup j "association_id") String.of_json } -end - -module CreateCustomerGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; type_ : GatewayType.t - ; public_ip : String.t - ; bgp_asn : Integer.t - } - - let make ?dry_run ~type_ ~public_ip ~bgp_asn () = { dry_run; type_; public_ip; bgp_asn } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; type_ = - Xml.required "Type" (Util.option_bind (Xml.member "Type" xml) GatewayType.parse) - ; public_ip = - Xml.required - "IpAddress" - (Util.option_bind (Xml.member "IpAddress" xml) String.parse) - ; bgp_asn = - Xml.required "BgpAsn" (Util.option_bind (Xml.member "BgpAsn" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("BgpAsn", Integer.to_query v.bgp_asn)) - ; Some (Query.Pair ("IpAddress", String.to_query v.public_ip)) - ; Some (Query.Pair ("Type", GatewayType.to_query v.type_)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("bgp_asn", Integer.to_json v.bgp_asn) - ; Some ("public_ip", String.to_json v.public_ip) - ; Some ("type_", GatewayType.to_json v.type_) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; type_ = GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; public_ip = String.of_json (Util.of_option_exn (Json.lookup j "public_ip")) - ; bgp_asn = Integer.of_json (Util.of_option_exn (Json.lookup j "bgp_asn")) - } -end - -module DescribeSecurityGroupsRequest = struct - type t = - { dry_run : Boolean.t option - ; group_names : GroupNameStringList.t - ; group_ids : GroupIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(group_names = []) ?(group_ids = []) ?(filters = []) () = - { dry_run; group_names; group_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_names = - Util.of_option - [] - (Util.option_bind (Xml.member "GroupName" xml) GroupNameStringList.parse) - ; group_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "GroupId" xml) GroupIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("GroupId", GroupIdStringList.to_query v.group_ids)) - ; Some (Query.Pair ("GroupName", GroupNameStringList.to_query v.group_names)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("group_ids", GroupIdStringList.to_json v.group_ids) - ; Some ("group_names", GroupNameStringList.to_json v.group_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_names = - GroupNameStringList.of_json (Util.of_option_exn (Json.lookup j "group_names")) - ; group_ids = - GroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "group_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module ReplaceNetworkAclEntryRequest = struct - type t = - { dry_run : Boolean.t option - ; network_acl_id : String.t - ; rule_number : Integer.t - ; protocol : String.t - ; rule_action : RuleAction.t - ; egress : Boolean.t - ; cidr_block : String.t - ; icmp_type_code : IcmpTypeCode.t option - ; port_range : PortRange.t option - } - - let make - ?dry_run - ~network_acl_id - ~rule_number - ~protocol - ~rule_action - ~egress - ~cidr_block - ?icmp_type_code - ?port_range - () = - { dry_run - ; network_acl_id - ; rule_number - ; protocol - ; rule_action - ; egress - ; cidr_block - ; icmp_type_code - ; port_range - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_acl_id = - Xml.required - "networkAclId" - (Util.option_bind (Xml.member "networkAclId" xml) String.parse) - ; rule_number = - Xml.required - "ruleNumber" - (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse) - ; protocol = - Xml.required - "protocol" - (Util.option_bind (Xml.member "protocol" xml) String.parse) - ; rule_action = - Xml.required - "ruleAction" - (Util.option_bind (Xml.member "ruleAction" xml) RuleAction.parse) - ; egress = - Xml.required "egress" (Util.option_bind (Xml.member "egress" xml) Boolean.parse) - ; cidr_block = - Xml.required - "cidrBlock" - (Util.option_bind (Xml.member "cidrBlock" xml) String.parse) - ; icmp_type_code = Util.option_bind (Xml.member "Icmp" xml) IcmpTypeCode.parse - ; port_range = Util.option_bind (Xml.member "portRange" xml) PortRange.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> - Query.Pair ("PortRange", PortRange.to_query f)) - ; Util.option_map v.icmp_type_code (fun f -> - Query.Pair ("Icmp", IcmpTypeCode.to_query f)) - ; Some (Query.Pair ("CidrBlock", String.to_query v.cidr_block)) - ; Some (Query.Pair ("Egress", Boolean.to_query v.egress)) - ; Some (Query.Pair ("RuleAction", RuleAction.to_query v.rule_action)) - ; Some (Query.Pair ("Protocol", String.to_query v.protocol)) - ; Some (Query.Pair ("RuleNumber", Integer.to_query v.rule_number)) - ; Some (Query.Pair ("NetworkAclId", String.to_query v.network_acl_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.port_range (fun f -> "port_range", PortRange.to_json f) - ; Util.option_map v.icmp_type_code (fun f -> - "icmp_type_code", IcmpTypeCode.to_json f) - ; Some ("cidr_block", String.to_json v.cidr_block) - ; Some ("egress", Boolean.to_json v.egress) - ; Some ("rule_action", RuleAction.to_json v.rule_action) - ; Some ("protocol", String.to_json v.protocol) - ; Some ("rule_number", Integer.to_json v.rule_number) - ; Some ("network_acl_id", String.to_json v.network_acl_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_acl_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_acl_id")) - ; rule_number = Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number")) - ; protocol = String.of_json (Util.of_option_exn (Json.lookup j "protocol")) - ; rule_action = RuleAction.of_json (Util.of_option_exn (Json.lookup j "rule_action")) - ; egress = Boolean.of_json (Util.of_option_exn (Json.lookup j "egress")) - ; cidr_block = String.of_json (Util.of_option_exn (Json.lookup j "cidr_block")) - ; icmp_type_code = - Util.option_map (Json.lookup j "icmp_type_code") IcmpTypeCode.of_json - ; port_range = Util.option_map (Json.lookup j "port_range") PortRange.of_json - } -end - -module DescribeFlowLogsRequest = struct - type t = - { flow_log_ids : ValueStringList.t - ; filter : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?(flow_log_ids = []) ?(filter = []) ?next_token ?max_results () = - { flow_log_ids; filter; next_token; max_results } - - let parse xml = - Some - { flow_log_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "FlowLogId" xml) ValueStringList.parse) - ; filter = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filter)) - ; Some (Query.Pair ("FlowLogId", ValueStringList.to_query v.flow_log_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filter", FilterList.to_json v.filter) - ; Some ("flow_log_ids", ValueStringList.to_json v.flow_log_ids) - ]) - - let of_json j = - { flow_log_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "flow_log_ids")) - ; filter = FilterList.of_json (Util.of_option_exn (Json.lookup j "filter")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module RequestSpotInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_price : String.t - ; client_token : String.t option - ; instance_count : Integer.t option - ; type_ : SpotInstanceType.t option - ; valid_from : DateTime.t option - ; valid_until : DateTime.t option - ; launch_group : String.t option - ; availability_zone_group : String.t option - ; launch_specification : RequestSpotLaunchSpecification.t option - } - - let make - ?dry_run - ~spot_price - ?client_token - ?instance_count - ?type_ - ?valid_from - ?valid_until - ?launch_group - ?availability_zone_group - ?launch_specification - () = - { dry_run - ; spot_price - ; client_token - ; instance_count - ; type_ - ; valid_from - ; valid_until - ; launch_group - ; availability_zone_group - ; launch_specification - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_price = - Xml.required - "spotPrice" - (Util.option_bind (Xml.member "spotPrice" xml) String.parse) - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; instance_count = Util.option_bind (Xml.member "instanceCount" xml) Integer.parse - ; type_ = Util.option_bind (Xml.member "type" xml) SpotInstanceType.parse - ; valid_from = Util.option_bind (Xml.member "validFrom" xml) DateTime.parse - ; valid_until = Util.option_bind (Xml.member "validUntil" xml) DateTime.parse - ; launch_group = Util.option_bind (Xml.member "launchGroup" xml) String.parse - ; availability_zone_group = - Util.option_bind (Xml.member "availabilityZoneGroup" xml) String.parse - ; launch_specification = - Util.option_bind - (Xml.member "LaunchSpecification" xml) - RequestSpotLaunchSpecification.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.launch_specification (fun f -> - Query.Pair - ("LaunchSpecification", RequestSpotLaunchSpecification.to_query f)) - ; Util.option_map v.availability_zone_group (fun f -> - Query.Pair ("AvailabilityZoneGroup", String.to_query f)) - ; Util.option_map v.launch_group (fun f -> - Query.Pair ("LaunchGroup", String.to_query f)) - ; Util.option_map v.valid_until (fun f -> - Query.Pair ("ValidUntil", DateTime.to_query f)) - ; Util.option_map v.valid_from (fun f -> - Query.Pair ("ValidFrom", DateTime.to_query f)) - ; Util.option_map v.type_ (fun f -> - Query.Pair ("Type", SpotInstanceType.to_query f)) - ; Util.option_map v.instance_count (fun f -> - Query.Pair ("InstanceCount", Integer.to_query f)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Some (Query.Pair ("SpotPrice", String.to_query v.spot_price)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.launch_specification (fun f -> - "launch_specification", RequestSpotLaunchSpecification.to_json f) - ; Util.option_map v.availability_zone_group (fun f -> - "availability_zone_group", String.to_json f) - ; Util.option_map v.launch_group (fun f -> "launch_group", String.to_json f) - ; Util.option_map v.valid_until (fun f -> "valid_until", DateTime.to_json f) - ; Util.option_map v.valid_from (fun f -> "valid_from", DateTime.to_json f) - ; Util.option_map v.type_ (fun f -> "type_", SpotInstanceType.to_json f) - ; Util.option_map v.instance_count (fun f -> "instance_count", Integer.to_json f) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Some ("spot_price", String.to_json v.spot_price) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_price = String.of_json (Util.of_option_exn (Json.lookup j "spot_price")) - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; instance_count = Util.option_map (Json.lookup j "instance_count") Integer.of_json - ; type_ = Util.option_map (Json.lookup j "type_") SpotInstanceType.of_json - ; valid_from = Util.option_map (Json.lookup j "valid_from") DateTime.of_json - ; valid_until = Util.option_map (Json.lookup j "valid_until") DateTime.of_json - ; launch_group = Util.option_map (Json.lookup j "launch_group") String.of_json - ; availability_zone_group = - Util.option_map (Json.lookup j "availability_zone_group") String.of_json - ; launch_specification = - Util.option_map - (Json.lookup j "launch_specification") - RequestSpotLaunchSpecification.of_json - } -end - -module AssignPrivateIpAddressesRequest = struct - type t = - { network_interface_id : String.t - ; private_ip_addresses : PrivateIpAddressStringList.t - ; secondary_private_ip_address_count : Integer.t option - ; allow_reassignment : Boolean.t option - } - - let make - ~network_interface_id - ?(private_ip_addresses = []) - ?secondary_private_ip_address_count - ?allow_reassignment - () = - { network_interface_id - ; private_ip_addresses - ; secondary_private_ip_address_count - ; allow_reassignment - } - - let parse xml = - Some - { network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; private_ip_addresses = - Util.of_option - [] - (Util.option_bind - (Xml.member "privateIpAddress" xml) - PrivateIpAddressStringList.parse) - ; secondary_private_ip_address_count = - Util.option_bind (Xml.member "secondaryPrivateIpAddressCount" xml) Integer.parse - ; allow_reassignment = - Util.option_bind (Xml.member "allowReassignment" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.allow_reassignment (fun f -> - Query.Pair ("AllowReassignment", Boolean.to_query f)) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - Query.Pair ("SecondaryPrivateIpAddressCount", Integer.to_query f)) - ; Some + ("IpPermissionsEgress", + (IpPermissionList.to_query v.ip_permissions_egress))); + Some (Query.Pair - ( "PrivateIpAddress" - , PrivateIpAddressStringList.to_query v.private_ip_addresses )) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.allow_reassignment (fun f -> - "allow_reassignment", Boolean.to_json f) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - "secondary_private_ip_address_count", Integer.to_json f) - ; Some - ( "private_ip_addresses" - , PrivateIpAddressStringList.to_json v.private_ip_addresses ) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ]) - - let of_json j = - { network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; private_ip_addresses = - PrivateIpAddressStringList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - ; secondary_private_ip_address_count = - Util.option_map - (Json.lookup j "secondary_private_ip_address_count") - Integer.of_json - ; allow_reassignment = - Util.option_map (Json.lookup j "allow_reassignment") Boolean.of_json - } -end - -module CreateFlowLogsResult = struct - type t = - { flow_log_ids : ValueStringList.t - ; client_token : String.t option - ; unsuccessful : UnsuccessfulItemSet.t - } - - let make ?(flow_log_ids = []) ?client_token ?(unsuccessful = []) () = - { flow_log_ids; client_token; unsuccessful } - - let parse xml = - Some - { flow_log_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "flowLogIdSet" xml) ValueStringList.parse) - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; unsuccessful = - Util.of_option - [] - (Util.option_bind (Xml.member "unsuccessful" xml) UnsuccessfulItemSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Unsuccessful", UnsuccessfulItemSet.to_query v.unsuccessful)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Some (Query.Pair ("FlowLogIdSet", ValueStringList.to_query v.flow_log_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("unsuccessful", UnsuccessfulItemSet.to_json v.unsuccessful) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Some ("flow_log_ids", ValueStringList.to_json v.flow_log_ids) - ]) - - let of_json j = - { flow_log_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "flow_log_ids")) - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; unsuccessful = - UnsuccessfulItemSet.of_json (Util.of_option_exn (Json.lookup j "unsuccessful")) - } -end - -module CreateNetworkInterfaceResult = struct - type t = { network_interface : NetworkInterface.t option } - - let make ?network_interface () = { network_interface } - - let parse xml = - Some - { network_interface = - Util.option_bind (Xml.member "networkInterface" xml) NetworkInterface.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.network_interface (fun f -> - Query.Pair ("NetworkInterface", NetworkInterface.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.network_interface (fun f -> - "network_interface", NetworkInterface.to_json f) - ]) - - let of_json j = - { network_interface = - Util.option_map (Json.lookup j "network_interface") NetworkInterface.of_json - } -end - -module RestoreAddressToClassicResult = struct - type t = - { status : Status.t option - ; public_ip : String.t option - } - - let make ?status ?public_ip () = { status; public_ip } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "status" xml) Status.parse - ; public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", Status.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ; Util.option_map v.status (fun f -> "status", Status.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") Status.of_json - ; public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - } -end - -module DescribeRouteTablesResult = struct - type t = { route_tables : RouteTableList.t } - - let make ?(route_tables = []) () = { route_tables } - - let parse xml = - Some - { route_tables = - Util.of_option - [] - (Util.option_bind (Xml.member "routeTableSet" xml) RouteTableList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("RouteTableSet", RouteTableList.to_query v.route_tables)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("route_tables", RouteTableList.to_json v.route_tables) ]) - - let of_json j = - { route_tables = - RouteTableList.of_json (Util.of_option_exn (Json.lookup j "route_tables")) - } -end - -module DescribeSpotDatafeedSubscriptionRequest = struct - type t = { dry_run : Boolean.t option } - - let make ?dry_run () = { dry_run } - - let parse xml = - Some { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) ]) - - let of_json j = { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json } -end - -module DescribeSnapshotAttributeResult = struct - type t = - { snapshot_id : String.t option - ; create_volume_permissions : CreateVolumePermissionList.t - ; product_codes : ProductCodeList.t - } - - let make ?snapshot_id ?(create_volume_permissions = []) ?(product_codes = []) () = - { snapshot_id; create_volume_permissions; product_codes } - - let parse xml = - Some - { snapshot_id = Util.option_bind (Xml.member "snapshotId" xml) String.parse - ; create_volume_permissions = - Util.of_option - [] - (Util.option_bind - (Xml.member "createVolumePermission" xml) - CreateVolumePermissionList.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Some + ("IpPermissions", + (IpPermissionList.to_query v.ip_permissions))); + Some (Query.Pair - ( "CreateVolumePermission" - , CreateVolumePermissionList.to_query v.create_volume_permissions )) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Some - ( "create_volume_permissions" - , CreateVolumePermissionList.to_json v.create_volume_permissions ) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ]) - - let of_json j = - { snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; create_volume_permissions = - CreateVolumePermissionList.of_json - (Util.of_option_exn (Json.lookup j "create_volume_permissions")) - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - } -end - -module DeleteVpnGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_gateway_id : String.t - } - - let make ?dry_run ~vpn_gateway_id () = { dry_run; vpn_gateway_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_gateway_id = - Xml.required - "VpnGatewayId" - (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpnGatewayId", String.to_query v.vpn_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpn_gateway_id", String.to_json v.vpn_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_gateway_id")) - } -end - -module UnassignPrivateIpAddressesRequest = struct - type t = - { network_interface_id : String.t - ; private_ip_addresses : PrivateIpAddressStringList.t - } - - let make ~network_interface_id ~private_ip_addresses () = - { network_interface_id; private_ip_addresses } - - let parse xml = - Some - { network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; private_ip_addresses = - Xml.required - "privateIpAddress" - (Util.option_bind - (Xml.member "privateIpAddress" xml) - PrivateIpAddressStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("GroupDescription", (String.to_query v.description))); + Some (Query.Pair ("GroupId", (String.to_query v.group_id))); + Some (Query.Pair ("GroupName", (String.to_query v.group_name))); + Some (Query.Pair ("OwnerId", (String.to_query v.owner_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Some + ("ip_permissions_egress", + (IpPermissionList.to_json v.ip_permissions_egress)); + Some + ("ip_permissions", (IpPermissionList.to_json v.ip_permissions)); + Some ("description", (String.to_json v.description)); + Some ("group_id", (String.to_json v.group_id)); + Some ("group_name", (String.to_json v.group_name)); + Some ("owner_id", (String.to_json v.owner_id))]) + let of_json j = + { + owner_id = + (String.of_json (Util.of_option_exn (Json.lookup j "owner_id"))); + group_name = + (String.of_json (Util.of_option_exn (Json.lookup j "group_name"))); + group_id = + (String.of_json (Util.of_option_exn (Json.lookup j "group_id"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + ip_permissions = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions"))); + ip_permissions_egress = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions_egress"))); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ActiveInstance = + struct + type t = + { + instance_type: String.t option ; + instance_id: String.t option ; + spot_instance_request_id: String.t option } + let make ?instance_type ?instance_id ?spot_instance_request_id () = + { instance_type; instance_id; spot_instance_request_id } + let parse xml = + Some + { + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + spot_instance_request_id = + (Util.option_bind (Xml.member "spotInstanceRequestId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.spot_instance_request_id + (fun f -> + Query.Pair ("SpotInstanceRequestId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.spot_instance_request_id + (fun f -> ("spot_instance_request_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (String.to_json f)))]) + let of_json j = + { + instance_type = + (Util.option_map (Json.lookup j "instance_type") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + spot_instance_request_id = + (Util.option_map (Json.lookup j "spot_instance_request_id") + String.of_json) + } + end +module InstanceBlockDeviceMappingSpecification = + struct + type t = + { + device_name: String.t option ; + ebs: EbsInstanceBlockDeviceSpecification.t option ; + virtual_name: String.t option ; + no_device: String.t option } + let make ?device_name ?ebs ?virtual_name ?no_device () = + { device_name; ebs; virtual_name; no_device } + let parse xml = + Some + { + device_name = + (Util.option_bind (Xml.member "deviceName" xml) String.parse); + ebs = + (Util.option_bind (Xml.member "ebs" xml) + EbsInstanceBlockDeviceSpecification.parse); + virtual_name = + (Util.option_bind (Xml.member "virtualName" xml) String.parse); + no_device = + (Util.option_bind (Xml.member "noDevice" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> Query.Pair ("NoDevice", (String.to_query f))); + Util.option_map v.virtual_name + (fun f -> Query.Pair ("VirtualName", (String.to_query f))); + Util.option_map v.ebs + (fun f -> + Query.Pair + ("Ebs", (EbsInstanceBlockDeviceSpecification.to_query f))); + Util.option_map v.device_name + (fun f -> Query.Pair ("DeviceName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.no_device + (fun f -> ("no_device", (String.to_json f))); + Util.option_map v.virtual_name + (fun f -> ("virtual_name", (String.to_json f))); + Util.option_map v.ebs + (fun f -> + ("ebs", (EbsInstanceBlockDeviceSpecification.to_json f))); + Util.option_map v.device_name + (fun f -> ("device_name", (String.to_json f)))]) + let of_json j = + { + device_name = + (Util.option_map (Json.lookup j "device_name") String.of_json); + ebs = + (Util.option_map (Json.lookup j "ebs") + EbsInstanceBlockDeviceSpecification.of_json); + virtual_name = + (Util.option_map (Json.lookup j "virtual_name") String.of_json); + no_device = + (Util.option_map (Json.lookup j "no_device") String.of_json) + } + end +module InternetGateway = + struct + type t = + { + internet_gateway_id: String.t ; + attachments: InternetGatewayAttachmentList.t ; + tags: TagList.t } + let make ~internet_gateway_id ?(attachments= []) ?(tags= []) () = + { internet_gateway_id; attachments; tags } + let parse xml = + Some + { + internet_gateway_id = + (Xml.required "internetGatewayId" + (Util.option_bind (Xml.member "internetGatewayId" xml) + String.parse)); + attachments = + (Util.of_option [] + (Util.option_bind (Xml.member "attachmentSet" xml) + InternetGatewayAttachmentList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "PrivateIpAddress" - , PrivateIpAddressStringList.to_query v.private_ip_addresses )) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "private_ip_addresses" - , PrivateIpAddressStringList.to_json v.private_ip_addresses ) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ]) - - let of_json j = - { network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; private_ip_addresses = - PrivateIpAddressStringList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - } -end - -module EnableVpcClassicLinkResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module PurchaseReservedInstancesOfferingResult = struct - type t = { reserved_instances_id : String.t option } - - let make ?reserved_instances_id () = { reserved_instances_id } - - let parse xml = - Some - { reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - } -end - -module ModifyVpcAttributeRequest = struct - type t = - { vpc_id : String.t - ; enable_dns_support : AttributeBooleanValue.t option - ; enable_dns_hostnames : AttributeBooleanValue.t option - } - - let make ~vpc_id ?enable_dns_support ?enable_dns_hostnames () = - { vpc_id; enable_dns_support; enable_dns_hostnames } - - let parse xml = - Some - { vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - ; enable_dns_support = - Util.option_bind (Xml.member "EnableDnsSupport" xml) AttributeBooleanValue.parse - ; enable_dns_hostnames = - Util.option_bind - (Xml.member "EnableDnsHostnames" xml) - AttributeBooleanValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enable_dns_hostnames (fun f -> - Query.Pair ("EnableDnsHostnames", AttributeBooleanValue.to_query f)) - ; Util.option_map v.enable_dns_support (fun f -> - Query.Pair ("EnableDnsSupport", AttributeBooleanValue.to_query f)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enable_dns_hostnames (fun f -> - "enable_dns_hostnames", AttributeBooleanValue.to_json f) - ; Util.option_map v.enable_dns_support (fun f -> - "enable_dns_support", AttributeBooleanValue.to_json f) - ; Some ("vpc_id", String.to_json v.vpc_id) - ]) - - let of_json j = - { vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; enable_dns_support = - Util.option_map (Json.lookup j "enable_dns_support") AttributeBooleanValue.of_json - ; enable_dns_hostnames = - Util.option_map - (Json.lookup j "enable_dns_hostnames") - AttributeBooleanValue.of_json - } -end - -module RejectVpcPeeringConnectionResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module ReplaceNetworkAclAssociationResult = struct - type t = { new_association_id : String.t option } - - let make ?new_association_id () = { new_association_id } - - let parse xml = - Some - { new_association_id = - Util.option_bind (Xml.member "newAssociationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.new_association_id (fun f -> - Query.Pair ("NewAssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.new_association_id (fun f -> - "new_association_id", String.to_json f) - ]) - - let of_json j = - { new_association_id = - Util.option_map (Json.lookup j "new_association_id") String.of_json - } -end - -module ModifyVpcEndpointResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module AttachClassicLinkVpcResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module DeleteSpotDatafeedSubscriptionRequest = struct - type t = { dry_run : Boolean.t option } - - let make ?dry_run () = { dry_run } - - let parse xml = - Some { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) ]) - - let of_json j = { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json } -end - -module TerminateInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - } - - let make ?dry_run ~instance_ids () = { dry_run; instance_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - } -end - -module CreateRouteResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module DeleteRouteTableRequest = struct - type t = - { dry_run : Boolean.t option - ; route_table_id : String.t - } - - let make ?dry_run ~route_table_id () = { dry_run; route_table_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("route_table_id", String.to_json v.route_table_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - } -end - -module CancelSpotFleetRequestsRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_fleet_request_ids : ValueStringList.t - ; terminate_instances : Boolean.t - } - - let make ?dry_run ~spot_fleet_request_ids ~terminate_instances () = - { dry_run; spot_fleet_request_ids; terminate_instances } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_fleet_request_ids = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) ValueStringList.parse) - ; terminate_instances = - Xml.required - "terminateInstances" - (Util.option_bind (Xml.member "terminateInstances" xml) Boolean.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("TerminateInstances", Boolean.to_query v.terminate_instances)) - ; Some + ("AttachmentSet", + (InternetGatewayAttachmentList.to_query v.attachments))); + Some (Query.Pair - ("SpotFleetRequestId", ValueStringList.to_query v.spot_fleet_request_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("terminate_instances", Boolean.to_json v.terminate_instances) - ; Some - ("spot_fleet_request_ids", ValueStringList.to_json v.spot_fleet_request_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_fleet_request_ids = - ValueStringList.of_json - (Util.of_option_exn (Json.lookup j "spot_fleet_request_ids")) - ; terminate_instances = - Boolean.of_json (Util.of_option_exn (Json.lookup j "terminate_instances")) - } -end - -module DeleteVpcEndpointsResult = struct - type t = { unsuccessful : UnsuccessfulItemSet.t } - - let make ?(unsuccessful = []) () = { unsuccessful } - - let parse xml = - Some - { unsuccessful = - Util.of_option - [] - (Util.option_bind (Xml.member "unsuccessful" xml) UnsuccessfulItemSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Unsuccessful", UnsuccessfulItemSet.to_query v.unsuccessful)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("unsuccessful", UnsuccessfulItemSet.to_json v.unsuccessful) ]) - - let of_json j = - { unsuccessful = - UnsuccessfulItemSet.of_json (Util.of_option_exn (Json.lookup j "unsuccessful")) - } -end - -module CancelBundleTaskRequest = struct - type t = - { dry_run : Boolean.t option - ; bundle_id : String.t - } - - let make ?dry_run ~bundle_id () = { dry_run; bundle_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; bundle_id = - Xml.required - "BundleId" - (Util.option_bind (Xml.member "BundleId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("BundleId", String.to_query v.bundle_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("bundle_id", String.to_json v.bundle_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; bundle_id = String.of_json (Util.of_option_exn (Json.lookup j "bundle_id")) - } -end - -module CopyImageResult = struct - type t = { image_id : String.t option } - - let make ?image_id () = { image_id } - - let parse xml = - Some { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> "image_id", String.to_json f) ]) - - let of_json j = { image_id = Util.option_map (Json.lookup j "image_id") String.of_json } -end - -module CreateInstanceExportTaskResult = struct - type t = { export_task : ExportTask.t option } - - let make ?export_task () = { export_task } - - let parse xml = - Some { export_task = Util.option_bind (Xml.member "exportTask" xml) ExportTask.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.export_task (fun f -> - Query.Pair ("ExportTask", ExportTask.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.export_task (fun f -> "export_task", ExportTask.to_json f) ]) - - let of_json j = - { export_task = Util.option_map (Json.lookup j "export_task") ExportTask.of_json } -end - -module CreateVpcEndpointRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - ; service_name : String.t - ; policy_document : String.t option - ; route_table_ids : ValueStringList.t - ; client_token : String.t option - } - - let make - ?dry_run - ~vpc_id - ~service_name - ?policy_document - ?(route_table_ids = []) - ?client_token - () = - { dry_run; vpc_id; service_name; policy_document; route_table_ids; client_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - ; service_name = - Xml.required - "ServiceName" - (Util.option_bind (Xml.member "ServiceName" xml) String.parse) - ; policy_document = Util.option_bind (Xml.member "PolicyDocument" xml) String.parse - ; route_table_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "RouteTableId" xml) ValueStringList.parse) - ; client_token = Util.option_bind (Xml.member "ClientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Some (Query.Pair ("RouteTableId", ValueStringList.to_query v.route_table_ids)) - ; Util.option_map v.policy_document (fun f -> - Query.Pair ("PolicyDocument", String.to_query f)) - ; Some (Query.Pair ("ServiceName", String.to_query v.service_name)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Some ("route_table_ids", ValueStringList.to_json v.route_table_ids) - ; Util.option_map v.policy_document (fun f -> - "policy_document", String.to_json f) - ; Some ("service_name", String.to_json v.service_name) - ; Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; service_name = String.of_json (Util.of_option_exn (Json.lookup j "service_name")) - ; policy_document = Util.option_map (Json.lookup j "policy_document") String.of_json - ; route_table_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "route_table_ids")) - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module DeleteDhcpOptionsRequest = struct - type t = - { dry_run : Boolean.t option - ; dhcp_options_id : String.t - } - - let make ?dry_run ~dhcp_options_id () = { dry_run; dhcp_options_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; dhcp_options_id = - Xml.required - "DhcpOptionsId" - (Util.option_bind (Xml.member "DhcpOptionsId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DhcpOptionsId", String.to_query v.dhcp_options_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("dhcp_options_id", String.to_json v.dhcp_options_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; dhcp_options_id = - String.of_json (Util.of_option_exn (Json.lookup j "dhcp_options_id")) - } -end - -module DescribeImportSnapshotTasksRequest = struct - type t = - { dry_run : Boolean.t option - ; import_task_ids : ImportTaskIdList.t - ; next_token : String.t option - ; max_results : Integer.t option - ; filters : FilterList.t - } - - let make ?dry_run ?(import_task_ids = []) ?next_token ?max_results ?(filters = []) () = - { dry_run; import_task_ids; next_token; max_results; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; import_task_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "ImportTaskId" xml) ImportTaskIdList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filters", FilterList.to_query v.filters)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("ImportTaskId", ImportTaskIdList.to_query v.import_task_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("import_task_ids", ImportTaskIdList.to_json v.import_task_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; import_task_ids = - ImportTaskIdList.of_json (Util.of_option_exn (Json.lookup j "import_task_ids")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module RequestSpotFleetRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_fleet_request_config : SpotFleetRequestConfigData.t - } - - let make ?dry_run ~spot_fleet_request_config () = { dry_run; spot_fleet_request_config } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_fleet_request_config = - Xml.required - "spotFleetRequestConfig" - (Util.option_bind - (Xml.member "spotFleetRequestConfig" xml) - SpotFleetRequestConfigData.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("InternetGatewayId", + (String.to_query v.internet_gateway_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("attachments", + (InternetGatewayAttachmentList.to_json v.attachments)); + Some + ("internet_gateway_id", (String.to_json v.internet_gateway_id))]) + let of_json j = + { + internet_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "internet_gateway_id"))); + attachments = + (InternetGatewayAttachmentList.of_json + (Util.of_option_exn (Json.lookup j "attachments"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module AccountAttributeName = + struct + type t = + | Supported_platforms + | Default_vpc + let str_to_t = + [("default-vpc", Default_vpc); + ("supported-platforms", Supported_platforms)] + let t_to_str = + [(Default_vpc, "default-vpc"); + (Supported_platforms, "supported-platforms")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SpotFleetRequestConfig = + struct + type t = + { + spot_fleet_request_id: String.t ; + spot_fleet_request_state: BatchState.t ; + spot_fleet_request_config: SpotFleetRequestConfigData.t } + let make ~spot_fleet_request_id ~spot_fleet_request_state + ~spot_fleet_request_config () = + { + spot_fleet_request_id; + spot_fleet_request_state; + spot_fleet_request_config + } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + spot_fleet_request_state = + (Xml.required "spotFleetRequestState" + (Util.option_bind (Xml.member "spotFleetRequestState" xml) + BatchState.parse)); + spot_fleet_request_config = + (Xml.required "spotFleetRequestConfig" + (Util.option_bind (Xml.member "spotFleetRequestConfig" xml) + SpotFleetRequestConfigData.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotFleetRequestConfig", + (SpotFleetRequestConfigData.to_query + v.spot_fleet_request_config))); + Some (Query.Pair - ( "SpotFleetRequestConfig" - , SpotFleetRequestConfigData.to_query v.spot_fleet_request_config )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "spot_fleet_request_config" - , SpotFleetRequestConfigData.to_json v.spot_fleet_request_config ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_fleet_request_config = - SpotFleetRequestConfigData.of_json - (Util.of_option_exn (Json.lookup j "spot_fleet_request_config")) - } -end - -module DescribeReservedInstancesListingsResult = struct - type t = { reserved_instances_listings : ReservedInstancesListingList.t } - - let make ?(reserved_instances_listings = []) () = { reserved_instances_listings } - - let parse xml = - Some - { reserved_instances_listings = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesListingsSet" xml) - ReservedInstancesListingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SpotFleetRequestState", + (BatchState.to_query v.spot_fleet_request_state))); + Some (Query.Pair - ( "ReservedInstancesListingsSet" - , ReservedInstancesListingList.to_query v.reserved_instances_listings )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_instances_listings" - , ReservedInstancesListingList.to_json v.reserved_instances_listings ) - ]) - - let of_json j = - { reserved_instances_listings = - ReservedInstancesListingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_listings")) - } -end - -module DeleteSecurityGroupRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t option - ; group_id : String.t option - } - - let make ?dry_run ?group_name ?group_id () = { dry_run; group_name; group_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = Util.option_bind (Xml.member "GroupName" xml) String.parse - ; group_id = Util.option_bind (Xml.member "GroupId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> Query.Pair ("GroupId", String.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group_id (fun f -> "group_id", String.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; group_id = Util.option_map (Json.lookup j "group_id") String.of_json - } -end - -module DeleteVpcEndpointsRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_endpoint_ids : ValueStringList.t - } - - let make ?dry_run ~vpc_endpoint_ids () = { dry_run; vpc_endpoint_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; vpc_endpoint_ids = - Xml.required - "VpcEndpointId" - (Util.option_bind (Xml.member "VpcEndpointId" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("VpcEndpointId", ValueStringList.to_query v.vpc_endpoint_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_endpoint_ids", ValueStringList.to_json v.vpc_endpoint_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_endpoint_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "vpc_endpoint_ids")) - } -end - -module RunInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; image_id : String.t - ; min_count : Integer.t - ; max_count : Integer.t - ; key_name : String.t option - ; security_groups : SecurityGroupStringList.t - ; security_group_ids : SecurityGroupIdStringList.t - ; user_data : String.t option - ; instance_type : InstanceType.t option - ; placement : Placement.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; block_device_mappings : BlockDeviceMappingRequestList.t - ; monitoring : RunInstancesMonitoringEnabled.t option - ; subnet_id : String.t option - ; disable_api_termination : Boolean.t option - ; instance_initiated_shutdown_behavior : ShutdownBehavior.t option - ; private_ip_address : String.t option - ; client_token : String.t option - ; additional_info : String.t option - ; network_interfaces : InstanceNetworkInterfaceSpecificationList.t - ; iam_instance_profile : IamInstanceProfileSpecification.t option - ; ebs_optimized : Boolean.t option - } - - let make - ?dry_run - ~image_id - ~min_count - ~max_count - ?key_name - ?(security_groups = []) - ?(security_group_ids = []) - ?user_data - ?instance_type - ?placement - ?kernel_id - ?ramdisk_id - ?(block_device_mappings = []) - ?monitoring - ?subnet_id - ?disable_api_termination - ?instance_initiated_shutdown_behavior - ?private_ip_address - ?client_token - ?additional_info - ?(network_interfaces = []) - ?iam_instance_profile - ?ebs_optimized - () = - { dry_run - ; image_id - ; min_count - ; max_count - ; key_name - ; security_groups - ; security_group_ids - ; user_data - ; instance_type - ; placement - ; kernel_id - ; ramdisk_id - ; block_device_mappings - ; monitoring - ; subnet_id - ; disable_api_termination - ; instance_initiated_shutdown_behavior - ; private_ip_address - ; client_token - ; additional_info - ; network_interfaces - ; iam_instance_profile - ; ebs_optimized - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - ; min_count = - Xml.required - "MinCount" - (Util.option_bind (Xml.member "MinCount" xml) Integer.parse) - ; max_count = - Xml.required - "MaxCount" - (Util.option_bind (Xml.member "MaxCount" xml) Integer.parse) - ; key_name = Util.option_bind (Xml.member "KeyName" xml) String.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroup" xml) - SecurityGroupStringList.parse) - ; security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupId" xml) - SecurityGroupIdStringList.parse) - ; user_data = Util.option_bind (Xml.member "UserData" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "InstanceType" xml) InstanceType.parse - ; placement = Util.option_bind (Xml.member "Placement" xml) Placement.parse - ; kernel_id = Util.option_bind (Xml.member "KernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "RamdiskId" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "BlockDeviceMapping" xml) - BlockDeviceMappingRequestList.parse) - ; monitoring = - Util.option_bind - (Xml.member "Monitoring" xml) - RunInstancesMonitoringEnabled.parse - ; subnet_id = Util.option_bind (Xml.member "SubnetId" xml) String.parse - ; disable_api_termination = - Util.option_bind (Xml.member "disableApiTermination" xml) Boolean.parse - ; instance_initiated_shutdown_behavior = - Util.option_bind - (Xml.member "instanceInitiatedShutdownBehavior" xml) - ShutdownBehavior.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - ; additional_info = Util.option_bind (Xml.member "additionalInfo" xml) String.parse - ; network_interfaces = - Util.of_option - [] - (Util.option_bind - (Xml.member "networkInterface" xml) - InstanceNetworkInterfaceSpecificationList.parse) - ; iam_instance_profile = - Util.option_bind - (Xml.member "iamInstanceProfile" xml) - IamInstanceProfileSpecification.parse - ; ebs_optimized = Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", Boolean.to_query f)) - ; Util.option_map v.iam_instance_profile (fun f -> - Query.Pair - ("IamInstanceProfile", IamInstanceProfileSpecification.to_query f)) - ; Some + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_fleet_request_config", + (SpotFleetRequestConfigData.to_json + v.spot_fleet_request_config)); + Some + ("spot_fleet_request_state", + (BatchState.to_json v.spot_fleet_request_state)); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + spot_fleet_request_state = + (BatchState.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_state"))); + spot_fleet_request_config = + (SpotFleetRequestConfigData.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_config"))) + } + end +module AvailabilityZone = + struct + type t = + { + zone_name: String.t option ; + state: AvailabilityZoneState.t option ; + region_name: String.t option ; + messages: AvailabilityZoneMessageList.t } + let make ?zone_name ?state ?region_name ?(messages= []) () = + { zone_name; state; region_name; messages } + let parse xml = + Some + { + zone_name = + (Util.option_bind (Xml.member "zoneName" xml) String.parse); + state = + (Util.option_bind (Xml.member "zoneState" xml) + AvailabilityZoneState.parse); + region_name = + (Util.option_bind (Xml.member "regionName" xml) String.parse); + messages = + (Util.of_option [] + (Util.option_bind (Xml.member "messageSet" xml) + AvailabilityZoneMessageList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("MessageSet", + (AvailabilityZoneMessageList.to_query v.messages))); + Util.option_map v.region_name + (fun f -> Query.Pair ("RegionName", (String.to_query f))); + Util.option_map v.state + (fun f -> + Query.Pair ("ZoneState", (AvailabilityZoneState.to_query f))); + Util.option_map v.zone_name + (fun f -> Query.Pair ("ZoneName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("messages", (AvailabilityZoneMessageList.to_json v.messages)); + Util.option_map v.region_name + (fun f -> ("region_name", (String.to_json f))); + Util.option_map v.state + (fun f -> ("state", (AvailabilityZoneState.to_json f))); + Util.option_map v.zone_name + (fun f -> ("zone_name", (String.to_json f)))]) + let of_json j = + { + zone_name = + (Util.option_map (Json.lookup j "zone_name") String.of_json); + state = + (Util.option_map (Json.lookup j "state") + AvailabilityZoneState.of_json); + region_name = + (Util.option_map (Json.lookup j "region_name") String.of_json); + messages = + (AvailabilityZoneMessageList.of_json + (Util.of_option_exn (Json.lookup j "messages"))) + } + end +module CustomerGateway = + struct + type t = + { + customer_gateway_id: String.t ; + state: String.t ; + type_: String.t ; + ip_address: String.t ; + bgp_asn: String.t ; + tags: TagList.t } + let make ~customer_gateway_id ~state ~type_ ~ip_address ~bgp_asn + ?(tags= []) () = + { customer_gateway_id; state; type_; ip_address; bgp_asn; tags } + let parse xml = + Some + { + customer_gateway_id = + (Xml.required "customerGatewayId" + (Util.option_bind (Xml.member "customerGatewayId" xml) + String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) String.parse)); + type_ = + (Xml.required "type" + (Util.option_bind (Xml.member "type" xml) String.parse)); + ip_address = + (Xml.required "ipAddress" + (Util.option_bind (Xml.member "ipAddress" xml) String.parse)); + bgp_asn = + (Xml.required "bgpAsn" + (Util.option_bind (Xml.member "bgpAsn" xml) String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair ("BgpAsn", (String.to_query v.bgp_asn))); + Some (Query.Pair ("IpAddress", (String.to_query v.ip_address))); + Some (Query.Pair ("Type", (String.to_query v.type_))); + Some (Query.Pair ("State", (String.to_query v.state))); + Some (Query.Pair - ( "NetworkInterface" - , InstanceNetworkInterfaceSpecificationList.to_query v.network_interfaces - )) - ; Util.option_map v.additional_info (fun f -> - Query.Pair ("AdditionalInfo", String.to_query f)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - Query.Pair - ("InstanceInitiatedShutdownBehavior", ShutdownBehavior.to_query f)) - ; Util.option_map v.disable_api_termination (fun f -> - Query.Pair ("DisableApiTermination", Boolean.to_query f)) - ; Util.option_map v.subnet_id (fun f -> - Query.Pair ("SubnetId", String.to_query f)) - ; Util.option_map v.monitoring (fun f -> - Query.Pair ("Monitoring", RunInstancesMonitoringEnabled.to_query f)) - ; Some + ("CustomerGatewayId", + (String.to_query v.customer_gateway_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("bgp_asn", (String.to_json v.bgp_asn)); + Some ("ip_address", (String.to_json v.ip_address)); + Some ("type_", (String.to_json v.type_)); + Some ("state", (String.to_json v.state)); + Some + ("customer_gateway_id", (String.to_json v.customer_gateway_id))]) + let of_json j = + { + customer_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "customer_gateway_id"))); + state = (String.of_json (Util.of_option_exn (Json.lookup j "state"))); + type_ = (String.of_json (Util.of_option_exn (Json.lookup j "type_"))); + ip_address = + (String.of_json (Util.of_option_exn (Json.lookup j "ip_address"))); + bgp_asn = + (String.of_json (Util.of_option_exn (Json.lookup j "bgp_asn"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module FlowLog = + struct + type t = + { + creation_time: DateTime.t option ; + flow_log_id: String.t option ; + flow_log_status: String.t option ; + resource_id: String.t option ; + traffic_type: TrafficType.t option ; + log_group_name: String.t option ; + deliver_logs_status: String.t option ; + deliver_logs_error_message: String.t option ; + deliver_logs_permission_arn: String.t option } + let make ?creation_time ?flow_log_id ?flow_log_status ?resource_id + ?traffic_type ?log_group_name ?deliver_logs_status + ?deliver_logs_error_message ?deliver_logs_permission_arn () = + { + creation_time; + flow_log_id; + flow_log_status; + resource_id; + traffic_type; + log_group_name; + deliver_logs_status; + deliver_logs_error_message; + deliver_logs_permission_arn + } + let parse xml = + Some + { + creation_time = + (Util.option_bind (Xml.member "creationTime" xml) DateTime.parse); + flow_log_id = + (Util.option_bind (Xml.member "flowLogId" xml) String.parse); + flow_log_status = + (Util.option_bind (Xml.member "flowLogStatus" xml) String.parse); + resource_id = + (Util.option_bind (Xml.member "resourceId" xml) String.parse); + traffic_type = + (Util.option_bind (Xml.member "trafficType" xml) + TrafficType.parse); + log_group_name = + (Util.option_bind (Xml.member "logGroupName" xml) String.parse); + deliver_logs_status = + (Util.option_bind (Xml.member "deliverLogsStatus" xml) + String.parse); + deliver_logs_error_message = + (Util.option_bind (Xml.member "deliverLogsErrorMessage" xml) + String.parse); + deliver_logs_permission_arn = + (Util.option_bind (Xml.member "deliverLogsPermissionArn" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.deliver_logs_permission_arn + (fun f -> + Query.Pair ("DeliverLogsPermissionArn", (String.to_query f))); + Util.option_map v.deliver_logs_error_message + (fun f -> + Query.Pair ("DeliverLogsErrorMessage", (String.to_query f))); + Util.option_map v.deliver_logs_status + (fun f -> Query.Pair ("DeliverLogsStatus", (String.to_query f))); + Util.option_map v.log_group_name + (fun f -> Query.Pair ("LogGroupName", (String.to_query f))); + Util.option_map v.traffic_type + (fun f -> Query.Pair ("TrafficType", (TrafficType.to_query f))); + Util.option_map v.resource_id + (fun f -> Query.Pair ("ResourceId", (String.to_query f))); + Util.option_map v.flow_log_status + (fun f -> Query.Pair ("FlowLogStatus", (String.to_query f))); + Util.option_map v.flow_log_id + (fun f -> Query.Pair ("FlowLogId", (String.to_query f))); + Util.option_map v.creation_time + (fun f -> Query.Pair ("CreationTime", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.deliver_logs_permission_arn + (fun f -> ("deliver_logs_permission_arn", (String.to_json f))); + Util.option_map v.deliver_logs_error_message + (fun f -> ("deliver_logs_error_message", (String.to_json f))); + Util.option_map v.deliver_logs_status + (fun f -> ("deliver_logs_status", (String.to_json f))); + Util.option_map v.log_group_name + (fun f -> ("log_group_name", (String.to_json f))); + Util.option_map v.traffic_type + (fun f -> ("traffic_type", (TrafficType.to_json f))); + Util.option_map v.resource_id + (fun f -> ("resource_id", (String.to_json f))); + Util.option_map v.flow_log_status + (fun f -> ("flow_log_status", (String.to_json f))); + Util.option_map v.flow_log_id + (fun f -> ("flow_log_id", (String.to_json f))); + Util.option_map v.creation_time + (fun f -> ("creation_time", (DateTime.to_json f)))]) + let of_json j = + { + creation_time = + (Util.option_map (Json.lookup j "creation_time") DateTime.of_json); + flow_log_id = + (Util.option_map (Json.lookup j "flow_log_id") String.of_json); + flow_log_status = + (Util.option_map (Json.lookup j "flow_log_status") String.of_json); + resource_id = + (Util.option_map (Json.lookup j "resource_id") String.of_json); + traffic_type = + (Util.option_map (Json.lookup j "traffic_type") TrafficType.of_json); + log_group_name = + (Util.option_map (Json.lookup j "log_group_name") String.of_json); + deliver_logs_status = + (Util.option_map (Json.lookup j "deliver_logs_status") + String.of_json); + deliver_logs_error_message = + (Util.option_map (Json.lookup j "deliver_logs_error_message") + String.of_json); + deliver_logs_permission_arn = + (Util.option_map (Json.lookup j "deliver_logs_permission_arn") + String.of_json) + } + end +module BundleTask = + struct + type t = + { + instance_id: String.t ; + bundle_id: String.t ; + state: BundleTaskState.t ; + start_time: DateTime.t ; + update_time: DateTime.t ; + storage: Storage.t ; + progress: String.t ; + bundle_task_error: BundleTaskError.t option } + let make ~instance_id ~bundle_id ~state ~start_time ~update_time + ~storage ~progress ?bundle_task_error () = + { + instance_id; + bundle_id; + state; + start_time; + update_time; + storage; + progress; + bundle_task_error + } + let parse xml = + Some + { + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + bundle_id = + (Xml.required "bundleId" + (Util.option_bind (Xml.member "bundleId" xml) String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) + BundleTaskState.parse)); + start_time = + (Xml.required "startTime" + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse)); + update_time = + (Xml.required "updateTime" + (Util.option_bind (Xml.member "updateTime" xml) DateTime.parse)); + storage = + (Xml.required "storage" + (Util.option_bind (Xml.member "storage" xml) Storage.parse)); + progress = + (Xml.required "progress" + (Util.option_bind (Xml.member "progress" xml) String.parse)); + bundle_task_error = + (Util.option_bind (Xml.member "error" xml) BundleTaskError.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.bundle_task_error + (fun f -> Query.Pair ("Error", (BundleTaskError.to_query f))); + Some (Query.Pair ("Progress", (String.to_query v.progress))); + Some (Query.Pair ("Storage", (Storage.to_query v.storage))); + Some + (Query.Pair ("UpdateTime", (DateTime.to_query v.update_time))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Some (Query.Pair ("State", (BundleTaskState.to_query v.state))); + Some (Query.Pair ("BundleId", (String.to_query v.bundle_id))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.bundle_task_error + (fun f -> ("bundle_task_error", (BundleTaskError.to_json f))); + Some ("progress", (String.to_json v.progress)); + Some ("storage", (Storage.to_json v.storage)); + Some ("update_time", (DateTime.to_json v.update_time)); + Some ("start_time", (DateTime.to_json v.start_time)); + Some ("state", (BundleTaskState.to_json v.state)); + Some ("bundle_id", (String.to_json v.bundle_id)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + bundle_id = + (String.of_json (Util.of_option_exn (Json.lookup j "bundle_id"))); + state = + (BundleTaskState.of_json + (Util.of_option_exn (Json.lookup j "state"))); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + update_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "update_time"))); + storage = + (Storage.of_json (Util.of_option_exn (Json.lookup j "storage"))); + progress = + (String.of_json (Util.of_option_exn (Json.lookup j "progress"))); + bundle_task_error = + (Util.option_map (Json.lookup j "bundle_task_error") + BundleTaskError.of_json) + } + end +module VolumeStatusItem = + struct + type t = + { + volume_id: String.t option ; + availability_zone: String.t option ; + volume_status: VolumeStatusInfo.t option ; + events: VolumeStatusEventsList.t ; + actions: VolumeStatusActionsList.t } + let make ?volume_id ?availability_zone ?volume_status ?(events= []) + ?(actions= []) () = + { volume_id; availability_zone; volume_status; events; actions } + let parse xml = + Some + { + volume_id = + (Util.option_bind (Xml.member "volumeId" xml) String.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + volume_status = + (Util.option_bind (Xml.member "volumeStatus" xml) + VolumeStatusInfo.parse); + events = + (Util.of_option [] + (Util.option_bind (Xml.member "eventsSet" xml) + VolumeStatusEventsList.parse)); + actions = + (Util.of_option [] + (Util.option_bind (Xml.member "actionsSet" xml) + VolumeStatusActionsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ActionsSet", (VolumeStatusActionsList.to_query v.actions))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingRequestList.to_query v.block_device_mappings )) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.placement (fun f -> - Query.Pair ("Placement", Placement.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", String.to_query f)) - ; Some + ("EventsSet", (VolumeStatusEventsList.to_query v.events))); + Util.option_map v.volume_status + (fun f -> + Query.Pair ("VolumeStatus", (VolumeStatusInfo.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.volume_id + (fun f -> Query.Pair ("VolumeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("actions", (VolumeStatusActionsList.to_json v.actions)); + Some ("events", (VolumeStatusEventsList.to_json v.events)); + Util.option_map v.volume_status + (fun f -> ("volume_status", (VolumeStatusInfo.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.volume_id + (fun f -> ("volume_id", (String.to_json f)))]) + let of_json j = + { + volume_id = + (Util.option_map (Json.lookup j "volume_id") String.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + volume_status = + (Util.option_map (Json.lookup j "volume_status") + VolumeStatusInfo.of_json); + events = + (VolumeStatusEventsList.of_json + (Util.of_option_exn (Json.lookup j "events"))); + actions = + (VolumeStatusActionsList.of_json + (Util.of_option_exn (Json.lookup j "actions"))) + } + end +module CreateVolumePermissionList = + struct + type t = CreateVolumePermission.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CreateVolumePermission.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list CreateVolumePermission.to_query v + let to_json v = `List (List.map CreateVolumePermission.to_json v) + let of_json j = Json.to_list CreateVolumePermission.of_json j + end +module Volume = + struct + type t = + { + volume_id: String.t ; + size: Integer.t ; + snapshot_id: String.t ; + availability_zone: String.t ; + state: VolumeState.t ; + create_time: DateTime.t ; + attachments: VolumeAttachmentList.t ; + tags: TagList.t ; + volume_type: VolumeType.t ; + iops: Integer.t option ; + encrypted: Boolean.t ; + kms_key_id: String.t option } + let make ~volume_id ~size ~snapshot_id ~availability_zone ~state + ~create_time ?(attachments= []) ?(tags= []) ~volume_type ?iops + ~encrypted ?kms_key_id () = + { + volume_id; + size; + snapshot_id; + availability_zone; + state; + create_time; + attachments; + tags; + volume_type; + iops; + encrypted; + kms_key_id + } + let parse xml = + Some + { + volume_id = + (Xml.required "volumeId" + (Util.option_bind (Xml.member "volumeId" xml) String.parse)); + size = + (Xml.required "size" + (Util.option_bind (Xml.member "size" xml) Integer.parse)); + snapshot_id = + (Xml.required "snapshotId" + (Util.option_bind (Xml.member "snapshotId" xml) String.parse)); + availability_zone = + (Xml.required "availabilityZone" + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse)); + state = + (Xml.required "status" + (Util.option_bind (Xml.member "status" xml) VolumeState.parse)); + create_time = + (Xml.required "createTime" + (Util.option_bind (Xml.member "createTime" xml) DateTime.parse)); + attachments = + (Util.of_option [] + (Util.option_bind (Xml.member "attachmentSet" xml) + VolumeAttachmentList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + volume_type = + (Xml.required "volumeType" + (Util.option_bind (Xml.member "volumeType" xml) + VolumeType.parse)); + iops = (Util.option_bind (Xml.member "iops" xml) Integer.parse); + encrypted = + (Xml.required "encrypted" + (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse)); + kms_key_id = + (Util.option_bind (Xml.member "kmsKeyId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Some (Query.Pair ("Encrypted", (Boolean.to_query v.encrypted))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Some + (Query.Pair ("VolumeType", (VolumeType.to_query v.volume_type))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "SecurityGroupId" - , SecurityGroupIdStringList.to_query v.security_group_ids )) - ; Some + ("AttachmentSet", + (VolumeAttachmentList.to_query v.attachments))); + Some + (Query.Pair ("CreateTime", (DateTime.to_query v.create_time))); + Some (Query.Pair ("Status", (VolumeState.to_query v.state))); + Some (Query.Pair - ("SecurityGroup", SecurityGroupStringList.to_query v.security_groups)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ; Some (Query.Pair ("MaxCount", Integer.to_query v.max_count)) - ; Some (Query.Pair ("MinCount", Integer.to_query v.min_count)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) - ; Util.option_map v.iam_instance_profile (fun f -> - "iam_instance_profile", IamInstanceProfileSpecification.to_json f) - ; Some - ( "network_interfaces" - , InstanceNetworkInterfaceSpecificationList.to_json v.network_interfaces ) - ; Util.option_map v.additional_info (fun f -> - "additional_info", String.to_json f) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - "instance_initiated_shutdown_behavior", ShutdownBehavior.to_json f) - ; Util.option_map v.disable_api_termination (fun f -> - "disable_api_termination", Boolean.to_json f) - ; Util.option_map v.subnet_id (fun f -> "subnet_id", String.to_json f) - ; Util.option_map v.monitoring (fun f -> - "monitoring", RunInstancesMonitoringEnabled.to_json f) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingRequestList.to_json v.block_device_mappings ) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.placement (fun f -> "placement", Placement.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", String.to_json f) - ; Some - ("security_group_ids", SecurityGroupIdStringList.to_json v.security_group_ids) - ; Some ("security_groups", SecurityGroupStringList.to_json v.security_groups) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ; Some ("max_count", Integer.to_json v.max_count) - ; Some ("min_count", Integer.to_json v.min_count) - ; Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; min_count = Integer.of_json (Util.of_option_exn (Json.lookup j "min_count")) - ; max_count = Integer.of_json (Util.of_option_exn (Json.lookup j "max_count")) - ; key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; security_groups = - SecurityGroupStringList.of_json - (Util.of_option_exn (Json.lookup j "security_groups")) - ; security_group_ids = - SecurityGroupIdStringList.of_json - (Util.of_option_exn (Json.lookup j "security_group_ids")) - ; user_data = Util.option_map (Json.lookup j "user_data") String.of_json - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; placement = Util.option_map (Json.lookup j "placement") Placement.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; block_device_mappings = - BlockDeviceMappingRequestList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; monitoring = - Util.option_map (Json.lookup j "monitoring") RunInstancesMonitoringEnabled.of_json - ; subnet_id = Util.option_map (Json.lookup j "subnet_id") String.of_json - ; disable_api_termination = - Util.option_map (Json.lookup j "disable_api_termination") Boolean.of_json - ; instance_initiated_shutdown_behavior = - Util.option_map - (Json.lookup j "instance_initiated_shutdown_behavior") - ShutdownBehavior.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json - ; network_interfaces = - InstanceNetworkInterfaceSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "network_interfaces")) - ; iam_instance_profile = - Util.option_map - (Json.lookup j "iam_instance_profile") - IamInstanceProfileSpecification.of_json - ; ebs_optimized = Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json - } -end - -module StartInstancesResult = struct - type t = { starting_instances : InstanceStateChangeList.t } - - let make ?(starting_instances = []) () = { starting_instances } - - let parse xml = - Some - { starting_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - InstanceStateChangeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id))); + Some (Query.Pair ("Size", (Integer.to_query v.size))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Some ("encrypted", (Boolean.to_json v.encrypted)); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Some ("volume_type", (VolumeType.to_json v.volume_type)); + Some ("tags", (TagList.to_json v.tags)); + Some ("attachments", (VolumeAttachmentList.to_json v.attachments)); + Some ("create_time", (DateTime.to_json v.create_time)); + Some ("state", (VolumeState.to_json v.state)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some ("snapshot_id", (String.to_json v.snapshot_id)); + Some ("size", (Integer.to_json v.size)); + Some ("volume_id", (String.to_json v.volume_id))]) + let of_json j = + { + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + size = (Integer.of_json (Util.of_option_exn (Json.lookup j "size"))); + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + state = + (VolumeState.of_json (Util.of_option_exn (Json.lookup j "state"))); + create_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "create_time"))); + attachments = + (VolumeAttachmentList.of_json + (Util.of_option_exn (Json.lookup j "attachments"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + volume_type = + (VolumeType.of_json + (Util.of_option_exn (Json.lookup j "volume_type"))); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + encrypted = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "encrypted"))); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json) + } + end +module Region = + struct + type t = { + region_name: String.t option ; + endpoint: String.t option } + let make ?region_name ?endpoint () = { region_name; endpoint } + let parse xml = + Some + { + region_name = + (Util.option_bind (Xml.member "regionName" xml) String.parse); + endpoint = + (Util.option_bind (Xml.member "regionEndpoint" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.endpoint + (fun f -> Query.Pair ("RegionEndpoint", (String.to_query f))); + Util.option_map v.region_name + (fun f -> Query.Pair ("RegionName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.endpoint + (fun f -> ("endpoint", (String.to_json f))); + Util.option_map v.region_name + (fun f -> ("region_name", (String.to_json f)))]) + let of_json j = + { + region_name = + (Util.option_map (Json.lookup j "region_name") String.of_json); + endpoint = + (Util.option_map (Json.lookup j "endpoint") String.of_json) + } + end +module Address = + struct + type t = + { + instance_id: String.t option ; + public_ip: String.t option ; + allocation_id: String.t option ; + association_id: String.t option ; + domain: DomainType.t option ; + network_interface_id: String.t option ; + network_interface_owner_id: String.t option ; + private_ip_address: String.t option } + let make ?instance_id ?public_ip ?allocation_id ?association_id + ?domain ?network_interface_id ?network_interface_owner_id + ?private_ip_address () = + { + instance_id; + public_ip; + allocation_id; + association_id; + domain; + network_interface_id; + network_interface_owner_id; + private_ip_address + } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + public_ip = + (Util.option_bind (Xml.member "publicIp" xml) String.parse); + allocation_id = + (Util.option_bind (Xml.member "allocationId" xml) String.parse); + association_id = + (Util.option_bind (Xml.member "associationId" xml) String.parse); + domain = + (Util.option_bind (Xml.member "domain" xml) DomainType.parse); + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + network_interface_owner_id = + (Util.option_bind (Xml.member "networkInterfaceOwnerId" xml) + String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.network_interface_owner_id + (fun f -> + Query.Pair ("NetworkInterfaceOwnerId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (DomainType.to_query f))); + Util.option_map v.association_id + (fun f -> Query.Pair ("AssociationId", (String.to_query f))); + Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.network_interface_owner_id + (fun f -> ("network_interface_owner_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f))); + Util.option_map v.domain + (fun f -> ("domain", (DomainType.to_json f))); + Util.option_map v.association_id + (fun f -> ("association_id", (String.to_json f))); + Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json); + association_id = + (Util.option_map (Json.lookup j "association_id") String.of_json); + domain = + (Util.option_map (Json.lookup j "domain") DomainType.of_json); + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + network_interface_owner_id = + (Util.option_map (Json.lookup j "network_interface_owner_id") + String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json) + } + end +module VpnConnection = + struct + type t = + { + vpn_connection_id: String.t ; + state: VpnState.t ; + customer_gateway_configuration: String.t option ; + type_: GatewayType.t ; + customer_gateway_id: String.t ; + vpn_gateway_id: String.t option ; + tags: TagList.t ; + vgw_telemetry: VgwTelemetryList.t ; + options: VpnConnectionOptions.t option ; + routes: VpnStaticRouteList.t } + let make ~vpn_connection_id ~state ?customer_gateway_configuration + ~type_ ~customer_gateway_id ?vpn_gateway_id ?(tags= []) + ?(vgw_telemetry= []) ?options ?(routes= []) () = + { + vpn_connection_id; + state; + customer_gateway_configuration; + type_; + customer_gateway_id; + vpn_gateway_id; + tags; + vgw_telemetry; + options; + routes + } + let parse xml = + Some + { + vpn_connection_id = + (Xml.required "vpnConnectionId" + (Util.option_bind (Xml.member "vpnConnectionId" xml) + String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) VpnState.parse)); + customer_gateway_configuration = + (Util.option_bind (Xml.member "customerGatewayConfiguration" xml) + String.parse); + type_ = + (Xml.required "type" + (Util.option_bind (Xml.member "type" xml) GatewayType.parse)); + customer_gateway_id = + (Xml.required "customerGatewayId" + (Util.option_bind (Xml.member "customerGatewayId" xml) + String.parse)); + vpn_gateway_id = + (Util.option_bind (Xml.member "vpnGatewayId" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + vgw_telemetry = + (Util.of_option [] + (Util.option_bind (Xml.member "vgwTelemetry" xml) + VgwTelemetryList.parse)); + options = + (Util.option_bind (Xml.member "options" xml) + VpnConnectionOptions.parse); + routes = + (Util.of_option [] + (Util.option_bind (Xml.member "routes" xml) + VpnStaticRouteList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Routes", (VpnStaticRouteList.to_query v.routes))); + Util.option_map v.options + (fun f -> + Query.Pair ("Options", (VpnConnectionOptions.to_query f))); + Some (Query.Pair - ("InstancesSet", InstanceStateChangeList.to_query v.starting_instances)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("starting_instances", InstanceStateChangeList.to_json v.starting_instances) - ]) - - let of_json j = - { starting_instances = - InstanceStateChangeList.of_json - (Util.of_option_exn (Json.lookup j "starting_instances")) - } -end - -module DisableVpcClassicLinkRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - } - - let make ?dry_run ~vpc_id () = { dry_run; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module DeleteNetworkAclEntryRequest = struct - type t = - { dry_run : Boolean.t option - ; network_acl_id : String.t - ; rule_number : Integer.t - ; egress : Boolean.t - } - - let make ?dry_run ~network_acl_id ~rule_number ~egress () = - { dry_run; network_acl_id; rule_number; egress } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_acl_id = - Xml.required - "networkAclId" - (Util.option_bind (Xml.member "networkAclId" xml) String.parse) - ; rule_number = - Xml.required - "ruleNumber" - (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse) - ; egress = - Xml.required "egress" (Util.option_bind (Xml.member "egress" xml) Boolean.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Egress", Boolean.to_query v.egress)) - ; Some (Query.Pair ("RuleNumber", Integer.to_query v.rule_number)) - ; Some (Query.Pair ("NetworkAclId", String.to_query v.network_acl_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("egress", Boolean.to_json v.egress) - ; Some ("rule_number", Integer.to_json v.rule_number) - ; Some ("network_acl_id", String.to_json v.network_acl_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_acl_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_acl_id")) - ; rule_number = Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number")) - ; egress = Boolean.of_json (Util.of_option_exn (Json.lookup j "egress")) - } -end - -module AllocateAddressResult = struct - type t = - { public_ip : String.t option - ; domain : DomainType.t option - ; allocation_id : String.t option - } - - let make ?public_ip ?domain ?allocation_id () = { public_ip; domain; allocation_id } - - let parse xml = - Some - { public_ip = Util.option_bind (Xml.member "publicIp" xml) String.parse - ; domain = Util.option_bind (Xml.member "domain" xml) DomainType.parse - ; allocation_id = Util.option_bind (Xml.member "allocationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ; Util.option_map v.domain (fun f -> - Query.Pair ("Domain", DomainType.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ; Util.option_map v.domain (fun f -> "domain", DomainType.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ]) - - let of_json j = - { public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; domain = Util.option_map (Json.lookup j "domain") DomainType.of_json - ; allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - } -end - -module DescribeImagesRequest = struct - type t = - { dry_run : Boolean.t option - ; image_ids : ImageIdStringList.t - ; owners : OwnerStringList.t - ; executable_users : ExecutableByStringList.t - ; filters : FilterList.t - } - - let make - ?dry_run - ?(image_ids = []) - ?(owners = []) - ?(executable_users = []) - ?(filters = []) - () = - { dry_run; image_ids; owners; executable_users; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "ImageId" xml) ImageIdStringList.parse) - ; owners = - Util.of_option - [] - (Util.option_bind (Xml.member "Owner" xml) OwnerStringList.parse) - ; executable_users = - Util.of_option - [] - (Util.option_bind - (Xml.member "ExecutableBy" xml) - ExecutableByStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("VgwTelemetry", (VgwTelemetryList.to_query v.vgw_telemetry))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.vpn_gateway_id + (fun f -> Query.Pair ("VpnGatewayId", (String.to_query f))); + Some (Query.Pair - ("ExecutableBy", ExecutableByStringList.to_query v.executable_users)) - ; Some (Query.Pair ("Owner", OwnerStringList.to_query v.owners)) - ; Some (Query.Pair ("ImageId", ImageIdStringList.to_query v.image_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("executable_users", ExecutableByStringList.to_json v.executable_users) - ; Some ("owners", OwnerStringList.to_json v.owners) - ; Some ("image_ids", ImageIdStringList.to_json v.image_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_ids = - ImageIdStringList.of_json (Util.of_option_exn (Json.lookup j "image_ids")) - ; owners = OwnerStringList.of_json (Util.of_option_exn (Json.lookup j "owners")) - ; executable_users = - ExecutableByStringList.of_json - (Util.of_option_exn (Json.lookup j "executable_users")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module ReplaceNetworkAclAssociationRequest = struct - type t = - { dry_run : Boolean.t option - ; association_id : String.t - ; network_acl_id : String.t - } - - let make ?dry_run ~association_id ~network_acl_id () = - { dry_run; association_id; network_acl_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; association_id = - Xml.required - "associationId" - (Util.option_bind (Xml.member "associationId" xml) String.parse) - ; network_acl_id = - Xml.required - "networkAclId" - (Util.option_bind (Xml.member "networkAclId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("NetworkAclId", String.to_query v.network_acl_id)) - ; Some (Query.Pair ("AssociationId", String.to_query v.association_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("network_acl_id", String.to_json v.network_acl_id) - ; Some ("association_id", String.to_json v.association_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; association_id = - String.of_json (Util.of_option_exn (Json.lookup j "association_id")) - ; network_acl_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_acl_id")) - } -end - -module DescribeVpcEndpointsRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_endpoint_ids : ValueStringList.t - ; filters : FilterList.t - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?dry_run ?(vpc_endpoint_ids = []) ?(filters = []) ?max_results ?next_token () = - { dry_run; vpc_endpoint_ids; filters; max_results; next_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; vpc_endpoint_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "VpcEndpointId" xml) ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some - (Query.Pair ("VpcEndpointId", ValueStringList.to_query v.vpc_endpoint_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("vpc_endpoint_ids", ValueStringList.to_json v.vpc_endpoint_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_endpoint_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "vpc_endpoint_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeVpcPeeringConnectionsRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_peering_connection_ids : ValueStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(vpc_peering_connection_ids = []) ?(filters = []) () = - { dry_run; vpc_peering_connection_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_peering_connection_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcPeeringConnectionId" xml) - ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("CustomerGatewayId", + (String.to_query v.customer_gateway_id))); + Some (Query.Pair ("Type", (GatewayType.to_query v.type_))); + Util.option_map v.customer_gateway_configuration + (fun f -> + Query.Pair + ("CustomerGatewayConfiguration", (String.to_query f))); + Some (Query.Pair ("State", (VpnState.to_query v.state))); + Some (Query.Pair - ( "VpcPeeringConnectionId" - , ValueStringList.to_query v.vpc_peering_connection_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some - ( "vpc_peering_connection_ids" - , ValueStringList.to_json v.vpc_peering_connection_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_peering_connection_ids = - ValueStringList.of_json - (Util.of_option_exn (Json.lookup j "vpc_peering_connection_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module TerminateInstancesResult = struct - type t = { terminating_instances : InstanceStateChangeList.t } - - let make ?(terminating_instances = []) () = { terminating_instances } - - let parse xml = - Some - { terminating_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - InstanceStateChangeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("VpnConnectionId", (String.to_query v.vpn_connection_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("routes", (VpnStaticRouteList.to_json v.routes)); + Util.option_map v.options + (fun f -> ("options", (VpnConnectionOptions.to_json f))); + Some ("vgw_telemetry", (VgwTelemetryList.to_json v.vgw_telemetry)); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.vpn_gateway_id + (fun f -> ("vpn_gateway_id", (String.to_json f))); + Some + ("customer_gateway_id", (String.to_json v.customer_gateway_id)); + Some ("type_", (GatewayType.to_json v.type_)); + Util.option_map v.customer_gateway_configuration + (fun f -> ("customer_gateway_configuration", (String.to_json f))); + Some ("state", (VpnState.to_json v.state)); + Some ("vpn_connection_id", (String.to_json v.vpn_connection_id))]) + let of_json j = + { + vpn_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_connection_id"))); + state = + (VpnState.of_json (Util.of_option_exn (Json.lookup j "state"))); + customer_gateway_configuration = + (Util.option_map (Json.lookup j "customer_gateway_configuration") + String.of_json); + type_ = + (GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_"))); + customer_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "customer_gateway_id"))); + vpn_gateway_id = + (Util.option_map (Json.lookup j "vpn_gateway_id") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + vgw_telemetry = + (VgwTelemetryList.of_json + (Util.of_option_exn (Json.lookup j "vgw_telemetry"))); + options = + (Util.option_map (Json.lookup j "options") + VpnConnectionOptions.of_json); + routes = + (VpnStaticRouteList.of_json + (Util.of_option_exn (Json.lookup j "routes"))) + } + end +module ReservedInstancesOffering = + struct + type t = + { + reserved_instances_offering_id: String.t option ; + instance_type: InstanceType.t option ; + availability_zone: String.t option ; + duration: Long.t option ; + usage_price: Float.t option ; + fixed_price: Float.t option ; + product_description: RIProductDescription.t option ; + instance_tenancy: Tenancy.t option ; + currency_code: CurrencyCodeValues.t option ; + offering_type: OfferingTypeValues.t option ; + recurring_charges: RecurringChargesList.t ; + marketplace: Boolean.t option ; + pricing_details: PricingDetailsList.t } + let make ?reserved_instances_offering_id ?instance_type + ?availability_zone ?duration ?usage_price ?fixed_price + ?product_description ?instance_tenancy ?currency_code ?offering_type + ?(recurring_charges= []) ?marketplace ?(pricing_details= []) () = + { + reserved_instances_offering_id; + instance_type; + availability_zone; + duration; + usage_price; + fixed_price; + product_description; + instance_tenancy; + currency_code; + offering_type; + recurring_charges; + marketplace; + pricing_details + } + let parse xml = + Some + { + reserved_instances_offering_id = + (Util.option_bind (Xml.member "reservedInstancesOfferingId" xml) + String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + duration = + (Util.option_bind (Xml.member "duration" xml) Long.parse); + usage_price = + (Util.option_bind (Xml.member "usagePrice" xml) Float.parse); + fixed_price = + (Util.option_bind (Xml.member "fixedPrice" xml) Float.parse); + product_description = + (Util.option_bind (Xml.member "productDescription" xml) + RIProductDescription.parse); + instance_tenancy = + (Util.option_bind (Xml.member "instanceTenancy" xml) + Tenancy.parse); + currency_code = + (Util.option_bind (Xml.member "currencyCode" xml) + CurrencyCodeValues.parse); + offering_type = + (Util.option_bind (Xml.member "offeringType" xml) + OfferingTypeValues.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "recurringCharges" xml) + RecurringChargesList.parse)); + marketplace = + (Util.option_bind (Xml.member "marketplace" xml) Boolean.parse); + pricing_details = + (Util.of_option [] + (Util.option_bind (Xml.member "pricingDetailsSet" xml) + PricingDetailsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PricingDetailsSet", + (PricingDetailsList.to_query v.pricing_details))); + Util.option_map v.marketplace + (fun f -> Query.Pair ("Marketplace", (Boolean.to_query f))); + Some (Query.Pair - ("InstancesSet", InstanceStateChangeList.to_query v.terminating_instances)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "terminating_instances" - , InstanceStateChangeList.to_json v.terminating_instances ) - ]) - - let of_json j = - { terminating_instances = - InstanceStateChangeList.of_json - (Util.of_option_exn (Json.lookup j "terminating_instances")) - } -end - -module DescribeMovingAddressesResult = struct - type t = - { moving_address_statuses : MovingAddressStatusSet.t - ; next_token : String.t option - } - - let make ?(moving_address_statuses = []) ?next_token () = - { moving_address_statuses; next_token } - - let parse xml = - Some - { moving_address_statuses = - Util.of_option - [] - (Util.option_bind - (Xml.member "movingAddressStatusSet" xml) - MovingAddressStatusSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("RecurringCharges", + (RecurringChargesList.to_query v.recurring_charges))); + Util.option_map v.offering_type + (fun f -> + Query.Pair ("OfferingType", (OfferingTypeValues.to_query f))); + Util.option_map v.currency_code + (fun f -> + Query.Pair ("CurrencyCode", (CurrencyCodeValues.to_query f))); + Util.option_map v.instance_tenancy + (fun f -> Query.Pair ("InstanceTenancy", (Tenancy.to_query f))); + Util.option_map v.product_description + (fun f -> + Query.Pair + ("ProductDescription", (RIProductDescription.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Float.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Float.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Long.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.reserved_instances_offering_id + (fun f -> + Query.Pair + ("ReservedInstancesOfferingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("pricing_details", + (PricingDetailsList.to_json v.pricing_details)); + Util.option_map v.marketplace + (fun f -> ("marketplace", (Boolean.to_json f))); + Some + ("recurring_charges", + (RecurringChargesList.to_json v.recurring_charges)); + Util.option_map v.offering_type + (fun f -> ("offering_type", (OfferingTypeValues.to_json f))); + Util.option_map v.currency_code + (fun f -> ("currency_code", (CurrencyCodeValues.to_json f))); + Util.option_map v.instance_tenancy + (fun f -> ("instance_tenancy", (Tenancy.to_json f))); + Util.option_map v.product_description + (fun f -> + ("product_description", (RIProductDescription.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Float.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Float.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Long.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.reserved_instances_offering_id + (fun f -> ("reserved_instances_offering_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_offering_id = + (Util.option_map (Json.lookup j "reserved_instances_offering_id") + String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + duration = (Util.option_map (Json.lookup j "duration") Long.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Float.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Float.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + RIProductDescription.of_json); + instance_tenancy = + (Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") + CurrencyCodeValues.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") + OfferingTypeValues.of_json); + recurring_charges = + (RecurringChargesList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))); + marketplace = + (Util.option_map (Json.lookup j "marketplace") Boolean.of_json); + pricing_details = + (PricingDetailsList.of_json + (Util.of_option_exn (Json.lookup j "pricing_details"))) + } + end +module Reservation = + struct + type t = + { + reservation_id: String.t ; + owner_id: String.t ; + requester_id: String.t option ; + groups: GroupIdentifierList.t ; + instances: InstanceList.t } + let make ~reservation_id ~owner_id ?requester_id ?(groups= []) + ?(instances= []) () = + { reservation_id; owner_id; requester_id; groups; instances } + let parse xml = + Some + { + reservation_id = + (Xml.required "reservationId" + (Util.option_bind (Xml.member "reservationId" xml) + String.parse)); + owner_id = + (Xml.required "ownerId" + (Util.option_bind (Xml.member "ownerId" xml) String.parse)); + requester_id = + (Util.option_bind (Xml.member "requesterId" xml) String.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", (InstanceList.to_query v.instances))); + Some (Query.Pair - ( "MovingAddressStatusSet" - , MovingAddressStatusSet.to_query v.moving_address_statuses )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "moving_address_statuses" - , MovingAddressStatusSet.to_json v.moving_address_statuses ) - ]) - - let of_json j = - { moving_address_statuses = - MovingAddressStatusSet.of_json - (Util.of_option_exn (Json.lookup j "moving_address_statuses")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeExportTasksRequest = struct - type t = { export_task_ids : ExportTaskIdStringList.t } - - let make ?(export_task_ids = []) () = { export_task_ids } - - let parse xml = - Some - { export_task_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "exportTaskId" xml) - ExportTaskIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.requester_id + (fun f -> Query.Pair ("RequesterId", (String.to_query f))); + Some (Query.Pair ("OwnerId", (String.to_query v.owner_id))); + Some (Query.Pair - ("ExportTaskId", ExportTaskIdStringList.to_query v.export_task_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("export_task_ids", ExportTaskIdStringList.to_json v.export_task_ids) ]) - - let of_json j = - { export_task_ids = - ExportTaskIdStringList.of_json - (Util.of_option_exn (Json.lookup j "export_task_ids")) - } -end - -module DescribeReservedInstancesOfferingsRequest = struct - type t = - { dry_run : Boolean.t option - ; reserved_instances_offering_ids : ReservedInstancesOfferingIdStringList.t - ; instance_type : InstanceType.t option - ; availability_zone : String.t option - ; product_description : RIProductDescription.t option - ; filters : FilterList.t - ; instance_tenancy : Tenancy.t option - ; offering_type : OfferingTypeValues.t option - ; next_token : String.t option - ; max_results : Integer.t option - ; include_marketplace : Boolean.t option - ; min_duration : Long.t option - ; max_duration : Long.t option - ; max_instance_count : Integer.t option - } - - let make - ?dry_run - ?(reserved_instances_offering_ids = []) - ?instance_type - ?availability_zone - ?product_description - ?(filters = []) - ?instance_tenancy - ?offering_type - ?next_token - ?max_results - ?include_marketplace - ?min_duration - ?max_duration - ?max_instance_count - () = - { dry_run - ; reserved_instances_offering_ids - ; instance_type - ; availability_zone - ; product_description - ; filters - ; instance_tenancy - ; offering_type - ; next_token - ; max_results - ; include_marketplace - ; min_duration - ; max_duration - ; max_instance_count - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; reserved_instances_offering_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedInstancesOfferingId" xml) - ReservedInstancesOfferingIdStringList.parse) - ; instance_type = - Util.option_bind (Xml.member "InstanceType" xml) InstanceType.parse - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; product_description = - Util.option_bind - (Xml.member "ProductDescription" xml) - RIProductDescription.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; instance_tenancy = - Util.option_bind (Xml.member "instanceTenancy" xml) Tenancy.parse - ; offering_type = - Util.option_bind (Xml.member "offeringType" xml) OfferingTypeValues.parse - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - ; include_marketplace = - Util.option_bind (Xml.member "IncludeMarketplace" xml) Boolean.parse - ; min_duration = Util.option_bind (Xml.member "MinDuration" xml) Long.parse - ; max_duration = Util.option_bind (Xml.member "MaxDuration" xml) Long.parse - ; max_instance_count = - Util.option_bind (Xml.member "MaxInstanceCount" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_instance_count (fun f -> - Query.Pair ("MaxInstanceCount", Integer.to_query f)) - ; Util.option_map v.max_duration (fun f -> - Query.Pair ("MaxDuration", Long.to_query f)) - ; Util.option_map v.min_duration (fun f -> - Query.Pair ("MinDuration", Long.to_query f)) - ; Util.option_map v.include_marketplace (fun f -> - Query.Pair ("IncludeMarketplace", Boolean.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", OfferingTypeValues.to_query f)) - ; Util.option_map v.instance_tenancy (fun f -> - Query.Pair ("InstanceTenancy", Tenancy.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", RIProductDescription.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", InstanceType.to_query f)) - ; Some + ("ReservationId", (String.to_query v.reservation_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (InstanceList.to_json v.instances)); + Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.requester_id + (fun f -> ("requester_id", (String.to_json f))); + Some ("owner_id", (String.to_json v.owner_id)); + Some ("reservation_id", (String.to_json v.reservation_id))]) + let of_json j = + { + reservation_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "reservation_id"))); + owner_id = + (String.of_json (Util.of_option_exn (Json.lookup j "owner_id"))); + requester_id = + (Util.option_map (Json.lookup j "requester_id") String.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + instances = + (InstanceList.of_json + (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module VpcPeeringConnection = + struct + type t = + { + accepter_vpc_info: VpcPeeringConnectionVpcInfo.t option ; + expiration_time: DateTime.t option ; + requester_vpc_info: VpcPeeringConnectionVpcInfo.t option ; + status: VpcPeeringConnectionStateReason.t option ; + tags: TagList.t ; + vpc_peering_connection_id: String.t option } + let make ?accepter_vpc_info ?expiration_time ?requester_vpc_info + ?status ?(tags= []) ?vpc_peering_connection_id () = + { + accepter_vpc_info; + expiration_time; + requester_vpc_info; + status; + tags; + vpc_peering_connection_id + } + let parse xml = + Some + { + accepter_vpc_info = + (Util.option_bind (Xml.member "accepterVpcInfo" xml) + VpcPeeringConnectionVpcInfo.parse); + expiration_time = + (Util.option_bind (Xml.member "expirationTime" xml) + DateTime.parse); + requester_vpc_info = + (Util.option_bind (Xml.member "requesterVpcInfo" xml) + VpcPeeringConnectionVpcInfo.parse); + status = + (Util.option_bind (Xml.member "status" xml) + VpcPeeringConnectionStateReason.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + vpc_peering_connection_id = + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> + Query.Pair ("VpcPeeringConnectionId", (String.to_query f))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.status + (fun f -> + Query.Pair + ("Status", (VpcPeeringConnectionStateReason.to_query f))); + Util.option_map v.requester_vpc_info + (fun f -> + Query.Pair + ("RequesterVpcInfo", + (VpcPeeringConnectionVpcInfo.to_query f))); + Util.option_map v.expiration_time + (fun f -> Query.Pair ("ExpirationTime", (DateTime.to_query f))); + Util.option_map v.accepter_vpc_info + (fun f -> + Query.Pair + ("AccepterVpcInfo", + (VpcPeeringConnectionVpcInfo.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> ("vpc_peering_connection_id", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.status + (fun f -> + ("status", (VpcPeeringConnectionStateReason.to_json f))); + Util.option_map v.requester_vpc_info + (fun f -> + ("requester_vpc_info", + (VpcPeeringConnectionVpcInfo.to_json f))); + Util.option_map v.expiration_time + (fun f -> ("expiration_time", (DateTime.to_json f))); + Util.option_map v.accepter_vpc_info + (fun f -> + ("accepter_vpc_info", + (VpcPeeringConnectionVpcInfo.to_json f)))]) + let of_json j = + { + accepter_vpc_info = + (Util.option_map (Json.lookup j "accepter_vpc_info") + VpcPeeringConnectionVpcInfo.of_json); + expiration_time = + (Util.option_map (Json.lookup j "expiration_time") DateTime.of_json); + requester_vpc_info = + (Util.option_map (Json.lookup j "requester_vpc_info") + VpcPeeringConnectionVpcInfo.of_json); + status = + (Util.option_map (Json.lookup j "status") + VpcPeeringConnectionStateReason.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + vpc_peering_connection_id = + (Util.option_map (Json.lookup j "vpc_peering_connection_id") + String.of_json) + } + end +module Vpc = + struct + type t = + { + vpc_id: String.t ; + state: VpcState.t ; + cidr_block: String.t ; + dhcp_options_id: String.t ; + tags: TagList.t ; + instance_tenancy: Tenancy.t ; + is_default: Boolean.t } + let make ~vpc_id ~state ~cidr_block ~dhcp_options_id ?(tags= []) + ~instance_tenancy ~is_default () = + { + vpc_id; + state; + cidr_block; + dhcp_options_id; + tags; + instance_tenancy; + is_default + } + let parse xml = + Some + { + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) VpcState.parse)); + cidr_block = + (Xml.required "cidrBlock" + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse)); + dhcp_options_id = + (Xml.required "dhcpOptionsId" + (Util.option_bind (Xml.member "dhcpOptionsId" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + instance_tenancy = + (Xml.required "instanceTenancy" + (Util.option_bind (Xml.member "instanceTenancy" xml) + Tenancy.parse)); + is_default = + (Xml.required "isDefault" + (Util.option_bind (Xml.member "isDefault" xml) Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("IsDefault", (Boolean.to_query v.is_default))); + Some (Query.Pair - ( "ReservedInstancesOfferingId" - , ReservedInstancesOfferingIdStringList.to_query - v.reserved_instances_offering_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_instance_count (fun f -> - "max_instance_count", Integer.to_json f) - ; Util.option_map v.max_duration (fun f -> "max_duration", Long.to_json f) - ; Util.option_map v.min_duration (fun f -> "min_duration", Long.to_json f) - ; Util.option_map v.include_marketplace (fun f -> - "include_marketplace", Boolean.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.offering_type (fun f -> - "offering_type", OfferingTypeValues.to_json f) - ; Util.option_map v.instance_tenancy (fun f -> - "instance_tenancy", Tenancy.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.product_description (fun f -> - "product_description", RIProductDescription.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", InstanceType.to_json f) - ; Some - ( "reserved_instances_offering_ids" - , ReservedInstancesOfferingIdStringList.to_json - v.reserved_instances_offering_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; reserved_instances_offering_ids = - ReservedInstancesOfferingIdStringList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_offering_ids")) - ; instance_type = Util.option_map (Json.lookup j "instance_type") InstanceType.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") RIProductDescription.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; instance_tenancy = - Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json - ; offering_type = - Util.option_map (Json.lookup j "offering_type") OfferingTypeValues.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; include_marketplace = - Util.option_map (Json.lookup j "include_marketplace") Boolean.of_json - ; min_duration = Util.option_map (Json.lookup j "min_duration") Long.of_json - ; max_duration = Util.option_map (Json.lookup j "max_duration") Long.of_json - ; max_instance_count = - Util.option_map (Json.lookup j "max_instance_count") Integer.of_json - } -end - -module CreateVpcPeeringConnectionResult = struct - type t = { vpc_peering_connection : VpcPeeringConnection.t option } - - let make ?vpc_peering_connection () = { vpc_peering_connection } - - let parse xml = - Some - { vpc_peering_connection = - Util.option_bind - (Xml.member "vpcPeeringConnection" xml) - VpcPeeringConnection.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection (fun f -> - Query.Pair ("VpcPeeringConnection", VpcPeeringConnection.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection (fun f -> - "vpc_peering_connection", VpcPeeringConnection.to_json f) - ]) - - let of_json j = - { vpc_peering_connection = - Util.option_map - (Json.lookup j "vpc_peering_connection") - VpcPeeringConnection.of_json - } -end - -module DescribeInstanceStatusResult = struct - type t = - { instance_statuses : InstanceStatusList.t - ; next_token : String.t option - } - - let make ?(instance_statuses = []) ?next_token () = { instance_statuses; next_token } - - let parse xml = - Some - { instance_statuses = - Util.of_option - [] - (Util.option_bind - (Xml.member "instanceStatusSet" xml) - InstanceStatusList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("InstanceTenancy", (Tenancy.to_query v.instance_tenancy))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ("InstanceStatusSet", InstanceStatusList.to_query v.instance_statuses)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("instance_statuses", InstanceStatusList.to_json v.instance_statuses) - ]) - - let of_json j = - { instance_statuses = - InstanceStatusList.of_json - (Util.of_option_exn (Json.lookup j "instance_statuses")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module CreateReservedInstancesListingResult = struct - type t = { reserved_instances_listings : ReservedInstancesListingList.t } - - let make ?(reserved_instances_listings = []) () = { reserved_instances_listings } - - let parse xml = - Some - { reserved_instances_listings = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesListingsSet" xml) - ReservedInstancesListingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DhcpOptionsId", (String.to_query v.dhcp_options_id))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Some (Query.Pair ("State", (VpcState.to_query v.state))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("is_default", (Boolean.to_json v.is_default)); + Some ("instance_tenancy", (Tenancy.to_json v.instance_tenancy)); + Some ("tags", (TagList.to_json v.tags)); + Some ("dhcp_options_id", (String.to_json v.dhcp_options_id)); + Some ("cidr_block", (String.to_json v.cidr_block)); + Some ("state", (VpcState.to_json v.state)); + Some ("vpc_id", (String.to_json v.vpc_id))]) + let of_json j = + { + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + state = + (VpcState.of_json (Util.of_option_exn (Json.lookup j "state"))); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + dhcp_options_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "dhcp_options_id"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + instance_tenancy = + (Tenancy.of_json + (Util.of_option_exn (Json.lookup j "instance_tenancy"))); + is_default = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "is_default"))) + } + end +module NetworkAcl = + struct + type t = + { + network_acl_id: String.t option ; + vpc_id: String.t option ; + is_default: Boolean.t option ; + entries: NetworkAclEntryList.t ; + associations: NetworkAclAssociationList.t ; + tags: TagList.t } + let make ?network_acl_id ?vpc_id ?is_default ?(entries= []) + ?(associations= []) ?(tags= []) () = + { network_acl_id; vpc_id; is_default; entries; associations; tags } + let parse xml = + Some + { + network_acl_id = + (Util.option_bind (Xml.member "networkAclId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + is_default = + (Util.option_bind (Xml.member "default" xml) Boolean.parse); + entries = + (Util.of_option [] + (Util.option_bind (Xml.member "entrySet" xml) + NetworkAclEntryList.parse)); + associations = + (Util.of_option [] + (Util.option_bind (Xml.member "associationSet" xml) + NetworkAclAssociationList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "ReservedInstancesListingsSet" - , ReservedInstancesListingList.to_query v.reserved_instances_listings )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_instances_listings" - , ReservedInstancesListingList.to_json v.reserved_instances_listings ) - ]) - - let of_json j = - { reserved_instances_listings = - ReservedInstancesListingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_listings")) - } -end - -module DeleteInternetGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; internet_gateway_id : String.t - } - - let make ?dry_run ~internet_gateway_id () = { dry_run; internet_gateway_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; internet_gateway_id = - Xml.required - "internetGatewayId" - (Util.option_bind (Xml.member "internetGatewayId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InternetGatewayId", String.to_query v.internet_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("internet_gateway_id", String.to_json v.internet_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; internet_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "internet_gateway_id")) - } -end - -module DescribeNetworkAclsRequest = struct - type t = - { dry_run : Boolean.t option - ; network_acl_ids : ValueStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(network_acl_ids = []) ?(filters = []) () = - { dry_run; network_acl_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_acl_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "NetworkAclId" xml) ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("NetworkAclId", ValueStringList.to_query v.network_acl_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("network_acl_ids", ValueStringList.to_json v.network_acl_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_acl_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "network_acl_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module CreateVpnConnectionRouteRequest = struct - type t = - { vpn_connection_id : String.t - ; destination_cidr_block : String.t - } - - let make ~vpn_connection_id ~destination_cidr_block () = - { vpn_connection_id; destination_cidr_block } - - let parse xml = - Some - { vpn_connection_id = - Xml.required - "VpnConnectionId" - (Util.option_bind (Xml.member "VpnConnectionId" xml) String.parse) - ; destination_cidr_block = - Xml.required - "DestinationCidrBlock" - (Util.option_bind (Xml.member "DestinationCidrBlock" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DestinationCidrBlock", String.to_query v.destination_cidr_block)) - ; Some (Query.Pair ("VpnConnectionId", String.to_query v.vpn_connection_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("destination_cidr_block", String.to_json v.destination_cidr_block) - ; Some ("vpn_connection_id", String.to_json v.vpn_connection_id) - ]) - - let of_json j = - { vpn_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_connection_id")) - ; destination_cidr_block = - String.of_json (Util.of_option_exn (Json.lookup j "destination_cidr_block")) - } -end - -module ConfirmProductInstanceRequest = struct - type t = - { dry_run : Boolean.t option - ; product_code : String.t - ; instance_id : String.t - } - - let make ?dry_run ~product_code ~instance_id () = { dry_run; product_code; instance_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; product_code = - Xml.required - "ProductCode" - (Util.option_bind (Xml.member "ProductCode" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("ProductCode", String.to_query v.product_code)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Some ("product_code", String.to_json v.product_code) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; product_code = String.of_json (Util.of_option_exn (Json.lookup j "product_code")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module ModifyNetworkInterfaceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_id : String.t - ; description : AttributeValue.t option - ; source_dest_check : AttributeBooleanValue.t option - ; groups : SecurityGroupIdStringList.t - ; attachment : NetworkInterfaceAttachmentChanges.t option - } - - let make - ?dry_run - ~network_interface_id - ?description - ?source_dest_check - ?(groups = []) - ?attachment - () = - { dry_run; network_interface_id; description; source_dest_check; groups; attachment } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; description = Util.option_bind (Xml.member "description" xml) AttributeValue.parse - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) AttributeBooleanValue.parse - ; groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupId" xml) - SecurityGroupIdStringList.parse) - ; attachment = - Util.option_bind - (Xml.member "attachment" xml) - NetworkInterfaceAttachmentChanges.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attachment (fun f -> - Query.Pair ("Attachment", NetworkInterfaceAttachmentChanges.to_query f)) - ; Some - (Query.Pair ("SecurityGroupId", SecurityGroupIdStringList.to_query v.groups)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", AttributeBooleanValue.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", AttributeValue.to_query f)) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attachment (fun f -> - "attachment", NetworkInterfaceAttachmentChanges.to_json f) - ; Some ("groups", SecurityGroupIdStringList.to_json v.groups) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", AttributeBooleanValue.to_json f) - ; Util.option_map v.description (fun f -> - "description", AttributeValue.to_json f) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; description = Util.option_map (Json.lookup j "description") AttributeValue.of_json - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") AttributeBooleanValue.of_json - ; groups = - SecurityGroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; attachment = - Util.option_map - (Json.lookup j "attachment") - NetworkInterfaceAttachmentChanges.of_json - } -end - -module CreateVolumeRequest = struct - type t = - { dry_run : Boolean.t option - ; size : Integer.t option - ; snapshot_id : String.t option - ; availability_zone : String.t - ; volume_type : VolumeType.t option - ; iops : Integer.t option - ; encrypted : Boolean.t option - ; kms_key_id : String.t option - } - - let make - ?dry_run - ?size - ?snapshot_id - ~availability_zone - ?volume_type - ?iops - ?encrypted - ?kms_key_id - () = - { dry_run - ; size - ; snapshot_id - ; availability_zone - ; volume_type - ; iops - ; encrypted - ; kms_key_id - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; size = Util.option_bind (Xml.member "Size" xml) Integer.parse - ; snapshot_id = Util.option_bind (Xml.member "SnapshotId" xml) String.parse - ; availability_zone = - Xml.required - "AvailabilityZone" - (Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse) - ; volume_type = Util.option_bind (Xml.member "VolumeType" xml) VolumeType.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; encrypted = Util.option_bind (Xml.member "encrypted" xml) Boolean.parse - ; kms_key_id = Util.option_bind (Xml.member "KmsKeyId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Util.option_map v.encrypted (fun f -> - Query.Pair ("Encrypted", Boolean.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.volume_type (fun f -> - Query.Pair ("VolumeType", VolumeType.to_query f)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ; Util.option_map v.size (fun f -> Query.Pair ("Size", Integer.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Util.option_map v.encrypted (fun f -> "encrypted", Boolean.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.volume_type (fun f -> "volume_type", VolumeType.to_json f) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) - ; Util.option_map v.size (fun f -> "size", Integer.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; size = Util.option_map (Json.lookup j "size") Integer.of_json - ; snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; volume_type = Util.option_map (Json.lookup j "volume_type") VolumeType.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; encrypted = Util.option_map (Json.lookup j "encrypted") Boolean.of_json - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - } -end - -module DescribeImagesResult = struct - type t = { images : ImageList.t } - - let make ?(images = []) () = { images } - - let parse xml = - Some - { images = - Util.of_option - [] - (Util.option_bind (Xml.member "imagesSet" xml) ImageList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ImagesSet", ImageList.to_query v.images)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("images", ImageList.to_json v.images) ]) - - let of_json j = - { images = ImageList.of_json (Util.of_option_exn (Json.lookup j "images")) } -end - -module EnableVpcClassicLinkRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - } - - let make ?dry_run ~vpc_id () = { dry_run; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module CreateReservedInstancesListingRequest = struct - type t = - { reserved_instances_id : String.t - ; instance_count : Integer.t - ; price_schedules : PriceScheduleSpecificationList.t - ; client_token : String.t - } - - let make ~reserved_instances_id ~instance_count ~price_schedules ~client_token () = - { reserved_instances_id; instance_count; price_schedules; client_token } - - let parse xml = - Some - { reserved_instances_id = - Xml.required - "reservedInstancesId" - (Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse) - ; instance_count = - Xml.required - "instanceCount" - (Util.option_bind (Xml.member "instanceCount" xml) Integer.parse) - ; price_schedules = - Xml.required - "priceSchedules" - (Util.option_bind - (Xml.member "priceSchedules" xml) - PriceScheduleSpecificationList.parse) - ; client_token = - Xml.required - "clientToken" - (Util.option_bind (Xml.member "clientToken" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ClientToken", String.to_query v.client_token)) - ; Some + ("AssociationSet", + (NetworkAclAssociationList.to_query v.associations))); + Some (Query.Pair - ( "PriceSchedules" - , PriceScheduleSpecificationList.to_query v.price_schedules )) - ; Some (Query.Pair ("InstanceCount", Integer.to_query v.instance_count)) - ; Some - (Query.Pair ("ReservedInstancesId", String.to_query v.reserved_instances_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("client_token", String.to_json v.client_token) - ; Some - ("price_schedules", PriceScheduleSpecificationList.to_json v.price_schedules) - ; Some ("instance_count", Integer.to_json v.instance_count) - ; Some ("reserved_instances_id", String.to_json v.reserved_instances_id) - ]) - - let of_json j = - { reserved_instances_id = - String.of_json (Util.of_option_exn (Json.lookup j "reserved_instances_id")) - ; instance_count = - Integer.of_json (Util.of_option_exn (Json.lookup j "instance_count")) - ; price_schedules = - PriceScheduleSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "price_schedules")) - ; client_token = String.of_json (Util.of_option_exn (Json.lookup j "client_token")) - } -end - -module DescribeImportSnapshotTasksResult = struct - type t = - { import_snapshot_tasks : ImportSnapshotTaskList.t - ; next_token : String.t option - } - - let make ?(import_snapshot_tasks = []) ?next_token () = - { import_snapshot_tasks; next_token } - - let parse xml = - Some - { import_snapshot_tasks = - Util.of_option - [] - (Util.option_bind - (Xml.member "importSnapshotTaskSet" xml) - ImportSnapshotTaskList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("EntrySet", (NetworkAclEntryList.to_query v.entries))); + Util.option_map v.is_default + (fun f -> Query.Pair ("Default", (Boolean.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.network_acl_id + (fun f -> Query.Pair ("NetworkAclId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("associations", + (NetworkAclAssociationList.to_json v.associations)); + Some ("entries", (NetworkAclEntryList.to_json v.entries)); + Util.option_map v.is_default + (fun f -> ("is_default", (Boolean.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.network_acl_id + (fun f -> ("network_acl_id", (String.to_json f)))]) + let of_json j = + { + network_acl_id = + (Util.option_map (Json.lookup j "network_acl_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + is_default = + (Util.option_map (Json.lookup j "is_default") Boolean.of_json); + entries = + (NetworkAclEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))); + associations = + (NetworkAclAssociationList.of_json + (Util.of_option_exn (Json.lookup j "associations"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module Subnet = + struct + type t = + { + subnet_id: String.t ; + state: SubnetState.t ; + vpc_id: String.t ; + cidr_block: String.t ; + available_ip_address_count: Integer.t ; + availability_zone: String.t ; + default_for_az: Boolean.t ; + map_public_ip_on_launch: Boolean.t ; + tags: TagList.t } + let make ~subnet_id ~state ~vpc_id ~cidr_block + ~available_ip_address_count ~availability_zone ~default_for_az + ~map_public_ip_on_launch ?(tags= []) () = + { + subnet_id; + state; + vpc_id; + cidr_block; + available_ip_address_count; + availability_zone; + default_for_az; + map_public_ip_on_launch; + tags + } + let parse xml = + Some + { + subnet_id = + (Xml.required "subnetId" + (Util.option_bind (Xml.member "subnetId" xml) String.parse)); + state = + (Xml.required "state" + (Util.option_bind (Xml.member "state" xml) SubnetState.parse)); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)); + cidr_block = + (Xml.required "cidrBlock" + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse)); + available_ip_address_count = + (Xml.required "availableIpAddressCount" + (Util.option_bind (Xml.member "availableIpAddressCount" xml) + Integer.parse)); + availability_zone = + (Xml.required "availabilityZone" + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse)); + default_for_az = + (Xml.required "defaultForAz" + (Util.option_bind (Xml.member "defaultForAz" xml) + Boolean.parse)); + map_public_ip_on_launch = + (Xml.required "mapPublicIpOnLaunch" + (Util.option_bind (Xml.member "mapPublicIpOnLaunch" xml) + Boolean.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some (Query.Pair - ( "ImportSnapshotTaskSet" - , ImportSnapshotTaskList.to_query v.import_snapshot_tasks )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "import_snapshot_tasks" - , ImportSnapshotTaskList.to_json v.import_snapshot_tasks ) - ]) - - let of_json j = - { import_snapshot_tasks = - ImportSnapshotTaskList.of_json - (Util.of_option_exn (Json.lookup j "import_snapshot_tasks")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DisassociateRouteTableRequest = struct - type t = - { dry_run : Boolean.t option - ; association_id : String.t - } - - let make ?dry_run ~association_id () = { dry_run; association_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; association_id = - Xml.required - "associationId" - (Util.option_bind (Xml.member "associationId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AssociationId", String.to_query v.association_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("association_id", String.to_json v.association_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; association_id = - String.of_json (Util.of_option_exn (Json.lookup j "association_id")) - } -end - -module DeleteVpnConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_connection_id : String.t - } - - let make ?dry_run ~vpn_connection_id () = { dry_run; vpn_connection_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_connection_id = - Xml.required - "VpnConnectionId" - (Util.option_bind (Xml.member "VpnConnectionId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpnConnectionId", String.to_query v.vpn_connection_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpn_connection_id", String.to_json v.vpn_connection_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_connection_id")) - } -end - -module CancelSpotInstanceRequestsRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_instance_request_ids : SpotInstanceRequestIdList.t - } - - let make ?dry_run ~spot_instance_request_ids () = { dry_run; spot_instance_request_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_instance_request_ids = - Xml.required - "SpotInstanceRequestId" - (Util.option_bind - (Xml.member "SpotInstanceRequestId" xml) - SpotInstanceRequestIdList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("MapPublicIpOnLaunch", + (Boolean.to_query v.map_public_ip_on_launch))); + Some (Query.Pair - ( "SpotInstanceRequestId" - , SpotInstanceRequestIdList.to_query v.spot_instance_request_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "spot_instance_request_ids" - , SpotInstanceRequestIdList.to_json v.spot_instance_request_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_instance_request_ids = - SpotInstanceRequestIdList.of_json - (Util.of_option_exn (Json.lookup j "spot_instance_request_ids")) - } -end - -module DescribeKeyPairsRequest = struct - type t = - { dry_run : Boolean.t option - ; key_names : KeyNameStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(key_names = []) ?(filters = []) () = { dry_run; key_names; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; key_names = - Util.of_option - [] - (Util.option_bind (Xml.member "KeyName" xml) KeyNameStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("KeyName", KeyNameStringList.to_query v.key_names)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("key_names", KeyNameStringList.to_json v.key_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; key_names = - KeyNameStringList.of_json (Util.of_option_exn (Json.lookup j "key_names")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module RequestSpotInstancesResult = struct - type t = { spot_instance_requests : SpotInstanceRequestList.t } - - let make ?(spot_instance_requests = []) () = { spot_instance_requests } - - let parse xml = - Some - { spot_instance_requests = - Util.of_option - [] - (Util.option_bind - (Xml.member "spotInstanceRequestSet" xml) - SpotInstanceRequestList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DefaultForAz", (Boolean.to_query v.default_for_az))); + Some (Query.Pair - ( "SpotInstanceRequestSet" - , SpotInstanceRequestList.to_query v.spot_instance_requests )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "spot_instance_requests" - , SpotInstanceRequestList.to_json v.spot_instance_requests ) - ]) - - let of_json j = - { spot_instance_requests = - SpotInstanceRequestList.of_json - (Util.of_option_exn (Json.lookup j "spot_instance_requests")) - } -end - -module DescribeReservedInstancesListingsRequest = struct - type t = - { reserved_instances_id : String.t option - ; reserved_instances_listing_id : String.t option - ; filters : FilterList.t - } - - let make ?reserved_instances_id ?reserved_instances_listing_id ?(filters = []) () = - { reserved_instances_id; reserved_instances_listing_id; filters } - - let parse xml = - Some - { reserved_instances_id = - Util.option_bind (Xml.member "reservedInstancesId" xml) String.parse - ; reserved_instances_listing_id = - Util.option_bind (Xml.member "reservedInstancesListingId" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "filters" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filters", FilterList.to_query v.filters)) - ; Util.option_map v.reserved_instances_listing_id (fun f -> - Query.Pair ("ReservedInstancesListingId", String.to_query f)) - ; Util.option_map v.reserved_instances_id (fun f -> - Query.Pair ("ReservedInstancesId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.reserved_instances_listing_id (fun f -> - "reserved_instances_listing_id", String.to_json f) - ; Util.option_map v.reserved_instances_id (fun f -> - "reserved_instances_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_id = - Util.option_map (Json.lookup j "reserved_instances_id") String.of_json - ; reserved_instances_listing_id = - Util.option_map (Json.lookup j "reserved_instances_listing_id") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeSpotPriceHistoryRequest = struct - type t = - { dry_run : Boolean.t option - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; instance_types : InstanceTypeList.t - ; product_descriptions : ProductDescriptionList.t - ; filters : FilterList.t - ; availability_zone : String.t option - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make - ?dry_run - ?start_time - ?end_time - ?(instance_types = []) - ?(product_descriptions = []) - ?(filters = []) - ?availability_zone - ?max_results - ?next_token - () = - { dry_run - ; start_time - ; end_time - ; instance_types - ; product_descriptions - ; filters - ; availability_zone - ; max_results - ; next_token - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; start_time = Util.option_bind (Xml.member "startTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "endTime" xml) DateTime.parse - ; instance_types = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceType" xml) InstanceTypeList.parse) - ; product_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "ProductDescription" xml) - ProductDescriptionList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; availability_zone = - Util.option_bind (Xml.member "availabilityZone" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("AvailabilityZone", (String.to_query v.availability_zone))); + Some (Query.Pair - ( "ProductDescription" - , ProductDescriptionList.to_query v.product_descriptions )) - ; Some (Query.Pair ("InstanceType", InstanceTypeList.to_query v.instance_types)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some - ( "product_descriptions" - , ProductDescriptionList.to_json v.product_descriptions ) - ; Some ("instance_types", InstanceTypeList.to_json v.instance_types) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; instance_types = - InstanceTypeList.of_json (Util.of_option_exn (Json.lookup j "instance_types")) - ; product_descriptions = - ProductDescriptionList.of_json - (Util.of_option_exn (Json.lookup j "product_descriptions")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module MoveAddressToVpcResult = struct - type t = - { allocation_id : String.t option - ; status : Status.t option - } - - let make ?allocation_id ?status () = { allocation_id; status } - - let parse xml = - Some - { allocation_id = Util.option_bind (Xml.member "allocationId" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) Status.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", Status.to_query f)) - ; Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", Status.to_json f) - ; Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ]) - - let of_json j = - { allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") Status.of_json - } -end - -module CancelImportTaskResult = struct - type t = - { import_task_id : String.t option - ; state : String.t option - ; previous_state : String.t option - } - - let make ?import_task_id ?state ?previous_state () = - { import_task_id; state; previous_state } - - let parse xml = - Some - { import_task_id = Util.option_bind (Xml.member "importTaskId" xml) String.parse - ; state = Util.option_bind (Xml.member "state" xml) String.parse - ; previous_state = Util.option_bind (Xml.member "previousState" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.previous_state (fun f -> - Query.Pair ("PreviousState", String.to_query f)) - ; Util.option_map v.state (fun f -> Query.Pair ("State", String.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.previous_state (fun f -> "previous_state", String.to_json f) - ; Util.option_map v.state (fun f -> "state", String.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ]) - - let of_json j = - { import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; state = Util.option_map (Json.lookup j "state") String.of_json - ; previous_state = Util.option_map (Json.lookup j "previous_state") String.of_json - } -end - -module DeleteRouteRequest = struct - type t = - { dry_run : Boolean.t option - ; route_table_id : String.t - ; destination_cidr_block : String.t - } - - let make ?dry_run ~route_table_id ~destination_cidr_block () = - { dry_run; route_table_id; destination_cidr_block } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - ; destination_cidr_block = - Xml.required - "destinationCidrBlock" - (Util.option_bind (Xml.member "destinationCidrBlock" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DestinationCidrBlock", String.to_query v.destination_cidr_block)) - ; Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("destination_cidr_block", String.to_json v.destination_cidr_block) - ; Some ("route_table_id", String.to_json v.route_table_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - ; destination_cidr_block = - String.of_json (Util.of_option_exn (Json.lookup j "destination_cidr_block")) - } -end - -module ResetInstanceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; attribute : InstanceAttributeName.t - } - - let make ?dry_run ~instance_id ~attribute () = { dry_run; instance_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; attribute = - Xml.required - "attribute" - (Util.option_bind (Xml.member "attribute" xml) InstanceAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", InstanceAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", InstanceAttributeName.to_json v.attribute) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; attribute = - InstanceAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module CopySnapshotResult = struct - type t = { snapshot_id : String.t option } - - let make ?snapshot_id () = { snapshot_id } - - let parse xml = - Some { snapshot_id = Util.option_bind (Xml.member "snapshotId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_id (fun f -> - Query.Pair ("SnapshotId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_id (fun f -> "snapshot_id", String.to_json f) ]) - - let of_json j = - { snapshot_id = Util.option_map (Json.lookup j "snapshot_id") String.of_json } -end - -module CreateVpnGatewayResult = struct - type t = { vpn_gateway : VpnGateway.t option } - - let make ?vpn_gateway () = { vpn_gateway } - - let parse xml = - Some { vpn_gateway = Util.option_bind (Xml.member "vpnGateway" xml) VpnGateway.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpn_gateway (fun f -> - Query.Pair ("VpnGateway", VpnGateway.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpn_gateway (fun f -> "vpn_gateway", VpnGateway.to_json f) ]) - - let of_json j = - { vpn_gateway = Util.option_map (Json.lookup j "vpn_gateway") VpnGateway.of_json } -end - -module DeleteVpcRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - } - - let make ?dry_run ~vpc_id () = { dry_run; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module CancelExportTaskRequest = struct - type t = { export_task_id : String.t } - - let make ~export_task_id () = { export_task_id } - - let parse xml = - Some - { export_task_id = - Xml.required - "exportTaskId" - (Util.option_bind (Xml.member "exportTaskId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ExportTaskId", String.to_query v.export_task_id)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("export_task_id", String.to_json v.export_task_id) ]) - - let of_json j = - { export_task_id = - String.of_json (Util.of_option_exn (Json.lookup j "export_task_id")) - } -end - -module DescribeCustomerGatewaysRequest = struct - type t = - { dry_run : Boolean.t option - ; customer_gateway_ids : CustomerGatewayIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(customer_gateway_ids = []) ?(filters = []) () = - { dry_run; customer_gateway_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; customer_gateway_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "CustomerGatewayId" xml) - CustomerGatewayIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("AvailableIpAddressCount", + (Integer.to_query v.available_ip_address_count))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some (Query.Pair ("State", (SubnetState.to_query v.state))); + Some (Query.Pair ("SubnetId", (String.to_query v.subnet_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("map_public_ip_on_launch", + (Boolean.to_json v.map_public_ip_on_launch)); + Some ("default_for_az", (Boolean.to_json v.default_for_az)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Some + ("available_ip_address_count", + (Integer.to_json v.available_ip_address_count)); + Some ("cidr_block", (String.to_json v.cidr_block)); + Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("state", (SubnetState.to_json v.state)); + Some ("subnet_id", (String.to_json v.subnet_id))]) + let of_json j = + { + subnet_id = + (String.of_json (Util.of_option_exn (Json.lookup j "subnet_id"))); + state = + (SubnetState.of_json (Util.of_option_exn (Json.lookup j "state"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + available_ip_address_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "available_ip_address_count"))); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + default_for_az = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "default_for_az"))); + map_public_ip_on_launch = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "map_public_ip_on_launch"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module VpcClassicLink = + struct + type t = + { + vpc_id: String.t option ; + classic_link_enabled: Boolean.t option ; + tags: TagList.t } + let make ?vpc_id ?classic_link_enabled ?(tags= []) () = + { vpc_id; classic_link_enabled; tags } + let parse xml = + Some + { + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + classic_link_enabled = + (Util.option_bind (Xml.member "classicLinkEnabled" xml) + Boolean.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.classic_link_enabled + (fun f -> + Query.Pair ("ClassicLinkEnabled", (Boolean.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.classic_link_enabled + (fun f -> ("classic_link_enabled", (Boolean.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f)))]) + let of_json j = + { + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + classic_link_enabled = + (Util.option_map (Json.lookup j "classic_link_enabled") + Boolean.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ImportImageTask = + struct + type t = + { + import_task_id: String.t option ; + architecture: String.t option ; + license_type: String.t option ; + platform: String.t option ; + hypervisor: String.t option ; + description: String.t option ; + snapshot_details: SnapshotDetailList.t ; + image_id: String.t option ; + progress: String.t option ; + status_message: String.t option ; + status: String.t option } + let make ?import_task_id ?architecture ?license_type ?platform + ?hypervisor ?description ?(snapshot_details= []) ?image_id + ?progress ?status_message ?status () = + { + import_task_id; + architecture; + license_type; + platform; + hypervisor; + description; + snapshot_details; + image_id; + progress; + status_message; + status + } + let parse xml = + Some + { + import_task_id = + (Util.option_bind (Xml.member "importTaskId" xml) String.parse); + architecture = + (Util.option_bind (Xml.member "architecture" xml) String.parse); + license_type = + (Util.option_bind (Xml.member "licenseType" xml) String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) String.parse); + hypervisor = + (Util.option_bind (Xml.member "hypervisor" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + snapshot_details = + (Util.of_option [] + (Util.option_bind (Xml.member "snapshotDetailSet" xml) + SnapshotDetailList.parse)); + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + progress = + (Util.option_bind (Xml.member "progress" xml) String.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.progress + (fun f -> Query.Pair ("Progress", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f))); + Some (Query.Pair - ( "CustomerGatewayId" - , CustomerGatewayIdStringList.to_query v.customer_gateway_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some - ( "customer_gateway_ids" - , CustomerGatewayIdStringList.to_json v.customer_gateway_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; customer_gateway_ids = - CustomerGatewayIdStringList.of_json - (Util.of_option_exn (Json.lookup j "customer_gateway_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeExportTasksResult = struct - type t = { export_tasks : ExportTaskList.t } - - let make ?(export_tasks = []) () = { export_tasks } - - let parse xml = - Some - { export_tasks = - Util.of_option - [] - (Util.option_bind (Xml.member "exportTaskSet" xml) ExportTaskList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ExportTaskSet", ExportTaskList.to_query v.export_tasks)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("export_tasks", ExportTaskList.to_json v.export_tasks) ]) - - let of_json j = - { export_tasks = - ExportTaskList.of_json (Util.of_option_exn (Json.lookup j "export_tasks")) - } -end - -module DescribePrefixListsResult = struct - type t = - { prefix_lists : PrefixListSet.t - ; next_token : String.t option - } - - let make ?(prefix_lists = []) ?next_token () = { prefix_lists; next_token } - - let parse xml = - Some - { prefix_lists = - Util.of_option - [] - (Util.option_bind (Xml.member "prefixListSet" xml) PrefixListSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("PrefixListSet", PrefixListSet.to_query v.prefix_lists)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("prefix_lists", PrefixListSet.to_json v.prefix_lists) - ]) - - let of_json j = - { prefix_lists = - PrefixListSet.of_json (Util.of_option_exn (Json.lookup j "prefix_lists")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module UnmonitorInstancesResult = struct - type t = { instance_monitorings : InstanceMonitoringList.t } - - let make ?(instance_monitorings = []) () = { instance_monitorings } - - let parse xml = - Some - { instance_monitorings = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - InstanceMonitoringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SnapshotDetailSet", + (SnapshotDetailList.to_query v.snapshot_details))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.hypervisor + (fun f -> Query.Pair ("Hypervisor", (String.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (String.to_query f))); + Util.option_map v.license_type + (fun f -> Query.Pair ("LicenseType", (String.to_query f))); + Util.option_map v.architecture + (fun f -> Query.Pair ("Architecture", (String.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.progress + (fun f -> ("progress", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f))); + Some + ("snapshot_details", + (SnapshotDetailList.to_json v.snapshot_details)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.hypervisor + (fun f -> ("hypervisor", (String.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (String.to_json f))); + Util.option_map v.license_type + (fun f -> ("license_type", (String.to_json f))); + Util.option_map v.architecture + (fun f -> ("architecture", (String.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f)))]) + let of_json j = + { + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + architecture = + (Util.option_map (Json.lookup j "architecture") String.of_json); + license_type = + (Util.option_map (Json.lookup j "license_type") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") String.of_json); + hypervisor = + (Util.option_map (Json.lookup j "hypervisor") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + snapshot_details = + (SnapshotDetailList.of_json + (Util.of_option_exn (Json.lookup j "snapshot_details"))); + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + progress = + (Util.option_map (Json.lookup j "progress") String.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module CancelSpotFleetRequestsErrorItem = + struct + type t = + { + spot_fleet_request_id: String.t ; + error: CancelSpotFleetRequestsError.t } + let make ~spot_fleet_request_id ~error () = + { spot_fleet_request_id; error } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + error = + (Xml.required "error" + (Util.option_bind (Xml.member "error" xml) + CancelSpotFleetRequestsError.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Error", (CancelSpotFleetRequestsError.to_query v.error))); + Some (Query.Pair - ("InstancesSet", InstanceMonitoringList.to_query v.instance_monitorings)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "instance_monitorings" - , InstanceMonitoringList.to_json v.instance_monitorings ) - ]) - - let of_json j = - { instance_monitorings = - InstanceMonitoringList.of_json - (Util.of_option_exn (Json.lookup j "instance_monitorings")) - } -end - -module DescribeSecurityGroupsResult = struct - type t = { security_groups : SecurityGroupList.t } - - let make ?(security_groups = []) () = { security_groups } - - let parse xml = - Some - { security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "securityGroupInfo" xml) - SecurityGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("error", (CancelSpotFleetRequestsError.to_json v.error)); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + error = + (CancelSpotFleetRequestsError.of_json + (Util.of_option_exn (Json.lookup j "error"))) + } + end +module CancelSpotFleetRequestsSuccessItem = + struct + type t = + { + spot_fleet_request_id: String.t ; + current_spot_fleet_request_state: BatchState.t ; + previous_spot_fleet_request_state: BatchState.t } + let make ~spot_fleet_request_id ~current_spot_fleet_request_state + ~previous_spot_fleet_request_state () = + { + spot_fleet_request_id; + current_spot_fleet_request_state; + previous_spot_fleet_request_state + } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + current_spot_fleet_request_state = + (Xml.required "currentSpotFleetRequestState" + (Util.option_bind + (Xml.member "currentSpotFleetRequestState" xml) + BatchState.parse)); + previous_spot_fleet_request_state = + (Xml.required "previousSpotFleetRequestState" + (Util.option_bind + (Xml.member "previousSpotFleetRequestState" xml) + BatchState.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PreviousSpotFleetRequestState", + (BatchState.to_query v.previous_spot_fleet_request_state))); + Some (Query.Pair - ("SecurityGroupInfo", SecurityGroupList.to_query v.security_groups)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("security_groups", SecurityGroupList.to_json v.security_groups) ]) - - let of_json j = - { security_groups = - SecurityGroupList.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - } -end - -module DeleteSubnetRequest = struct - type t = - { dry_run : Boolean.t option - ; subnet_id : String.t - } - - let make ?dry_run ~subnet_id () = { dry_run; subnet_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; subnet_id = - Xml.required - "SubnetId" - (Util.option_bind (Xml.member "SubnetId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SubnetId", String.to_query v.subnet_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnet_id", String.to_json v.subnet_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; subnet_id = String.of_json (Util.of_option_exn (Json.lookup j "subnet_id")) - } -end - -module DescribeVpcEndpointServicesResult = struct - type t = - { service_names : ValueStringList.t - ; next_token : String.t option - } - - let make ?(service_names = []) ?next_token () = { service_names; next_token } - - let parse xml = - Some - { service_names = - Util.of_option - [] - (Util.option_bind (Xml.member "serviceNameSet" xml) ValueStringList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("ServiceNameSet", ValueStringList.to_query v.service_names)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("service_names", ValueStringList.to_json v.service_names) - ]) - - let of_json j = - { service_names = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "service_names")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeVpnConnectionsRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_connection_ids : VpnConnectionIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(vpn_connection_ids = []) ?(filters = []) () = - { dry_run; vpn_connection_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_connection_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpnConnectionId" xml) - VpnConnectionIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("CurrentSpotFleetRequestState", + (BatchState.to_query v.current_spot_fleet_request_state))); + Some (Query.Pair - ( "VpnConnectionId" - , VpnConnectionIdStringList.to_query v.vpn_connection_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some - ("vpn_connection_ids", VpnConnectionIdStringList.to_json v.vpn_connection_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_connection_ids = - VpnConnectionIdStringList.of_json - (Util.of_option_exn (Json.lookup j "vpn_connection_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module GetConsoleOutputResult = struct - type t = - { instance_id : String.t option - ; timestamp : DateTime.t option - ; output : String.t option - } - - let make ?instance_id ?timestamp ?output () = { instance_id; timestamp; output } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; timestamp = Util.option_bind (Xml.member "timestamp" xml) DateTime.parse - ; output = Util.option_bind (Xml.member "output" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.output (fun f -> Query.Pair ("Output", String.to_query f)) - ; Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", DateTime.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.output (fun f -> "output", String.to_json f) - ; Util.option_map v.timestamp (fun f -> "timestamp", DateTime.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; timestamp = Util.option_map (Json.lookup j "timestamp") DateTime.of_json - ; output = Util.option_map (Json.lookup j "output") String.of_json - } -end - -module DescribeSpotFleetInstancesResponse = struct - type t = - { spot_fleet_request_id : String.t - ; active_instances : ActiveInstanceSet.t - ; next_token : String.t option - } - - let make ~spot_fleet_request_id ~active_instances ?next_token () = - { spot_fleet_request_id; active_instances; next_token } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; active_instances = - Xml.required - "activeInstanceSet" - (Util.option_bind - (Xml.member "activeInstanceSet" xml) - ActiveInstanceSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("previous_spot_fleet_request_state", + (BatchState.to_json v.previous_spot_fleet_request_state)); + Some + ("current_spot_fleet_request_state", + (BatchState.to_json v.current_spot_fleet_request_state)); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + current_spot_fleet_request_state = + (BatchState.of_json + (Util.of_option_exn + (Json.lookup j "current_spot_fleet_request_state"))); + previous_spot_fleet_request_state = + (BatchState.of_json + (Util.of_option_exn + (Json.lookup j "previous_spot_fleet_request_state"))) + } + end +module AccountAttribute = + struct + type t = + { + attribute_name: String.t option ; + attribute_values: AccountAttributeValueList.t } + let make ?attribute_name ?(attribute_values= []) () = + { attribute_name; attribute_values } + let parse xml = + Some + { + attribute_name = + (Util.option_bind (Xml.member "attributeName" xml) String.parse); + attribute_values = + (Util.of_option [] + (Util.option_bind (Xml.member "attributeValueSet" xml) + AccountAttributeValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AttributeValueSet", + (AccountAttributeValueList.to_query v.attribute_values))); + Util.option_map v.attribute_name + (fun f -> Query.Pair ("AttributeName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("attribute_values", + (AccountAttributeValueList.to_json v.attribute_values)); + Util.option_map v.attribute_name + (fun f -> ("attribute_name", (String.to_json f)))]) + let of_json j = + { + attribute_name = + (Util.option_map (Json.lookup j "attribute_name") String.of_json); + attribute_values = + (AccountAttributeValueList.of_json + (Util.of_option_exn (Json.lookup j "attribute_values"))) + } + end +module SpotPrice = + struct + type t = + { + instance_type: InstanceType.t option ; + product_description: RIProductDescription.t option ; + spot_price: String.t option ; + timestamp: DateTime.t option ; + availability_zone: String.t option } + let make ?instance_type ?product_description ?spot_price ?timestamp + ?availability_zone () = + { + instance_type; + product_description; + spot_price; + timestamp; + availability_zone + } + let parse xml = + Some + { + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + product_description = + (Util.option_bind (Xml.member "productDescription" xml) + RIProductDescription.parse); + spot_price = + (Util.option_bind (Xml.member "spotPrice" xml) String.parse); + timestamp = + (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (DateTime.to_query f))); + Util.option_map v.spot_price + (fun f -> Query.Pair ("SpotPrice", (String.to_query f))); + Util.option_map v.product_description + (fun f -> + Query.Pair + ("ProductDescription", (RIProductDescription.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.timestamp + (fun f -> ("timestamp", (DateTime.to_json f))); + Util.option_map v.spot_price + (fun f -> ("spot_price", (String.to_json f))); + Util.option_map v.product_description + (fun f -> + ("product_description", (RIProductDescription.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f)))]) + let of_json j = + { + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + RIProductDescription.of_json); + spot_price = + (Util.option_map (Json.lookup j "spot_price") String.of_json); + timestamp = + (Util.option_map (Json.lookup j "timestamp") DateTime.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json) + } + end +module ReportInstanceReasonCodes = + struct + type t = + | Instance_stuck_in_state + | Unresponsive + | Not_accepting_credentials + | Password_not_available + | Performance_network + | Performance_instance_store + | Performance_ebs_volume + | Performance_other + | Other + let str_to_t = + [("other", Other); + ("performance-other", Performance_other); + ("performance-ebs-volume", Performance_ebs_volume); + ("performance-instance-store", Performance_instance_store); + ("performance-network", Performance_network); + ("password-not-available", Password_not_available); + ("not-accepting-credentials", Not_accepting_credentials); + ("unresponsive", Unresponsive); + ("instance-stuck-in-state", Instance_stuck_in_state)] + let t_to_str = + [(Other, "other"); + (Performance_other, "performance-other"); + (Performance_ebs_volume, "performance-ebs-volume"); + (Performance_instance_store, "performance-instance-store"); + (Performance_network, "performance-network"); + (Password_not_available, "password-not-available"); + (Not_accepting_credentials, "not-accepting-credentials"); + (Unresponsive, "unresponsive"); + (Instance_stuck_in_state, "instance-stuck-in-state")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DiskImage = + struct + type t = + { + image: DiskImageDetail.t option ; + description: String.t option ; + volume: VolumeDetail.t option } + let make ?image ?description ?volume () = + { image; description; volume } + let parse xml = + Some + { + image = + (Util.option_bind (Xml.member "Image" xml) DiskImageDetail.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + volume = + (Util.option_bind (Xml.member "Volume" xml) VolumeDetail.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.volume + (fun f -> Query.Pair ("Volume", (VolumeDetail.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.image + (fun f -> Query.Pair ("Image", (DiskImageDetail.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.volume + (fun f -> ("volume", (VolumeDetail.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.image + (fun f -> ("image", (DiskImageDetail.to_json f)))]) + let of_json j = + { + image = + (Util.option_map (Json.lookup j "image") DiskImageDetail.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + volume = + (Util.option_map (Json.lookup j "volume") VolumeDetail.of_json) + } + end +module SecurityGroupStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SecurityGroup" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ShutdownBehavior = + struct + type t = + | Stop + | Terminate + let str_to_t = [("terminate", Terminate); ("stop", Stop)] + let t_to_str = [(Terminate, "terminate"); (Stop, "stop")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module UserData = + struct + type t = { + data: String.t option } + let make ?data () = { data } + let parse xml = + Some { data = (Util.option_bind (Xml.member "data" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.data + (fun f -> Query.Pair ("Data", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.data (fun f -> ("data", (String.to_json f)))]) + let of_json j = + { data = (Util.option_map (Json.lookup j "data") String.of_json) } + end +module VpcEndpoint = + struct + type t = + { + vpc_endpoint_id: String.t option ; + vpc_id: String.t option ; + service_name: String.t option ; + state: State.t option ; + policy_document: String.t option ; + route_table_ids: ValueStringList.t ; + creation_timestamp: DateTime.t option } + let make ?vpc_endpoint_id ?vpc_id ?service_name ?state + ?policy_document ?(route_table_ids= []) ?creation_timestamp () = + { + vpc_endpoint_id; + vpc_id; + service_name; + state; + policy_document; + route_table_ids; + creation_timestamp + } + let parse xml = + Some + { + vpc_endpoint_id = + (Util.option_bind (Xml.member "vpcEndpointId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + service_name = + (Util.option_bind (Xml.member "serviceName" xml) String.parse); + state = (Util.option_bind (Xml.member "state" xml) State.parse); + policy_document = + (Util.option_bind (Xml.member "policyDocument" xml) String.parse); + route_table_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "routeTableIdSet" xml) + ValueStringList.parse)); + creation_timestamp = + (Util.option_bind (Xml.member "creationTimestamp" xml) + DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.creation_timestamp + (fun f -> + Query.Pair ("CreationTimestamp", (DateTime.to_query f))); + Some (Query.Pair - ("ActiveInstanceSet", ActiveInstanceSet.to_query v.active_instances)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("active_instances", ActiveInstanceSet.to_json v.active_instances) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; active_instances = - ActiveInstanceSet.of_json (Util.of_option_exn (Json.lookup j "active_instances")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeSnapshotAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; snapshot_id : String.t - ; attribute : SnapshotAttributeName.t - } - - let make ?dry_run ~snapshot_id ~attribute () = { dry_run; snapshot_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; snapshot_id = - Xml.required - "SnapshotId" + ("RouteTableIdSet", + (ValueStringList.to_query v.route_table_ids))); + Util.option_map v.policy_document + (fun f -> Query.Pair ("PolicyDocument", (String.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (State.to_query f))); + Util.option_map v.service_name + (fun f -> Query.Pair ("ServiceName", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.vpc_endpoint_id + (fun f -> Query.Pair ("VpcEndpointId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.creation_timestamp + (fun f -> ("creation_timestamp", (DateTime.to_json f))); + Some + ("route_table_ids", (ValueStringList.to_json v.route_table_ids)); + Util.option_map v.policy_document + (fun f -> ("policy_document", (String.to_json f))); + Util.option_map v.state (fun f -> ("state", (State.to_json f))); + Util.option_map v.service_name + (fun f -> ("service_name", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.vpc_endpoint_id + (fun f -> ("vpc_endpoint_id", (String.to_json f)))]) + let of_json j = + { + vpc_endpoint_id = + (Util.option_map (Json.lookup j "vpc_endpoint_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + service_name = + (Util.option_map (Json.lookup j "service_name") String.of_json); + state = (Util.option_map (Json.lookup j "state") State.of_json); + policy_document = + (Util.option_map (Json.lookup j "policy_document") String.of_json); + route_table_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "route_table_ids"))); + creation_timestamp = + (Util.option_map (Json.lookup j "creation_timestamp") + DateTime.of_json) + } + end +module ImageDiskContainer = + struct + type t = + { + description: String.t option ; + format: String.t option ; + url: String.t option ; + user_bucket: UserBucket.t option ; + device_name: String.t option ; + snapshot_id: String.t option } + let make ?description ?format ?url ?user_bucket ?device_name + ?snapshot_id () = + { description; format; url; user_bucket; device_name; snapshot_id } + let parse xml = + Some + { + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + format = (Util.option_bind (Xml.member "Format" xml) String.parse); + url = (Util.option_bind (Xml.member "Url" xml) String.parse); + user_bucket = + (Util.option_bind (Xml.member "UserBucket" xml) UserBucket.parse); + device_name = + (Util.option_bind (Xml.member "DeviceName" xml) String.parse); + snapshot_id = (Util.option_bind (Xml.member "SnapshotId" xml) String.parse) - ; attribute = - Xml.required - "Attribute" - (Util.option_bind (Xml.member "Attribute" xml) SnapshotAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", SnapshotAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", SnapshotAttributeName.to_json v.attribute) - ; Some ("snapshot_id", String.to_json v.snapshot_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - ; attribute = - SnapshotAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module DeleteVpnConnectionRouteRequest = struct - type t = - { vpn_connection_id : String.t - ; destination_cidr_block : String.t - } - - let make ~vpn_connection_id ~destination_cidr_block () = - { vpn_connection_id; destination_cidr_block } - - let parse xml = - Some - { vpn_connection_id = - Xml.required - "VpnConnectionId" - (Util.option_bind (Xml.member "VpnConnectionId" xml) String.parse) - ; destination_cidr_block = - Xml.required - "DestinationCidrBlock" - (Util.option_bind (Xml.member "DestinationCidrBlock" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DestinationCidrBlock", String.to_query v.destination_cidr_block)) - ; Some (Query.Pair ("VpnConnectionId", String.to_query v.vpn_connection_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("destination_cidr_block", String.to_json v.destination_cidr_block) - ; Some ("vpn_connection_id", String.to_json v.vpn_connection_id) - ]) - - let of_json j = - { vpn_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_connection_id")) - ; destination_cidr_block = - String.of_json (Util.of_option_exn (Json.lookup j "destination_cidr_block")) - } -end - -module CreateSpotDatafeedSubscriptionRequest = struct - type t = - { dry_run : Boolean.t option - ; bucket : String.t - ; prefix : String.t option - } - - let make ?dry_run ~bucket ?prefix () = { dry_run; bucket; prefix } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; bucket = - Xml.required "bucket" (Util.option_bind (Xml.member "bucket" xml) String.parse) - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - } -end - -module DetachClassicLinkVpcRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~instance_id ~vpc_id () = { dry_run; instance_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module AttachClassicLinkVpcRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; vpc_id : String.t - ; groups : GroupIdStringList.t - } - - let make ?dry_run ~instance_id ~vpc_id ~groups () = - { dry_run; instance_id; vpc_id; groups } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - ; groups = - Xml.required - "SecurityGroupId" - (Util.option_bind (Xml.member "SecurityGroupId" xml) GroupIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SecurityGroupId", GroupIdStringList.to_query v.groups)) - ; Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("groups", GroupIdStringList.to_json v.groups) - ; Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - ; groups = GroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "groups")) - } -end - -module ModifyInstanceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; attribute : InstanceAttributeName.t option - ; value : String.t option - ; block_device_mappings : InstanceBlockDeviceMappingSpecificationList.t - ; source_dest_check : AttributeBooleanValue.t option - ; disable_api_termination : AttributeBooleanValue.t option - ; instance_type : AttributeValue.t option - ; kernel : AttributeValue.t option - ; ramdisk : AttributeValue.t option - ; user_data : BlobAttributeValue.t option - ; instance_initiated_shutdown_behavior : AttributeValue.t option - ; groups : GroupIdStringList.t - ; ebs_optimized : AttributeBooleanValue.t option - ; sriov_net_support : AttributeValue.t option - } - - let make - ?dry_run - ~instance_id - ?attribute - ?value - ?(block_device_mappings = []) - ?source_dest_check - ?disable_api_termination - ?instance_type - ?kernel - ?ramdisk - ?user_data - ?instance_initiated_shutdown_behavior - ?(groups = []) - ?ebs_optimized - ?sriov_net_support + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f))); + Util.option_map v.device_name + (fun f -> Query.Pair ("DeviceName", (String.to_query f))); + Util.option_map v.user_bucket + (fun f -> Query.Pair ("UserBucket", (UserBucket.to_query f))); + Util.option_map v.url + (fun f -> Query.Pair ("Url", (String.to_query f))); + Util.option_map v.format + (fun f -> Query.Pair ("Format", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f))); + Util.option_map v.device_name + (fun f -> ("device_name", (String.to_json f))); + Util.option_map v.user_bucket + (fun f -> ("user_bucket", (UserBucket.to_json f))); + Util.option_map v.url (fun f -> ("url", (String.to_json f))); + Util.option_map v.format (fun f -> ("format", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f)))]) + let of_json j = + { + description = + (Util.option_map (Json.lookup j "description") String.of_json); + format = (Util.option_map (Json.lookup j "format") String.of_json); + url = (Util.option_map (Json.lookup j "url") String.of_json); + user_bucket = + (Util.option_map (Json.lookup j "user_bucket") UserBucket.of_json); + device_name = + (Util.option_map (Json.lookup j "device_name") String.of_json); + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json) + } + end +module ClassicLinkInstance = + struct + type t = + { + instance_id: String.t option ; + vpc_id: String.t option ; + groups: GroupIdentifierList.t ; + tags: TagList.t } + let make ?instance_id ?vpc_id ?(groups= []) ?(tags= []) () = + { instance_id; vpc_id; groups; tags } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Some + (Query.Pair + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module Snapshot = + struct + type t = + { + snapshot_id: String.t ; + volume_id: String.t ; + state: SnapshotState.t ; + start_time: DateTime.t ; + progress: String.t ; + owner_id: String.t ; + description: String.t ; + volume_size: Integer.t ; + owner_alias: String.t option ; + tags: TagList.t ; + encrypted: Boolean.t ; + kms_key_id: String.t option } + let make ~snapshot_id ~volume_id ~state ~start_time ~progress + ~owner_id ~description ~volume_size ?owner_alias ?(tags= []) + ~encrypted ?kms_key_id () = + { + snapshot_id; + volume_id; + state; + start_time; + progress; + owner_id; + description; + volume_size; + owner_alias; + tags; + encrypted; + kms_key_id + } + let parse xml = + Some + { + snapshot_id = + (Xml.required "snapshotId" + (Util.option_bind (Xml.member "snapshotId" xml) String.parse)); + volume_id = + (Xml.required "volumeId" + (Util.option_bind (Xml.member "volumeId" xml) String.parse)); + state = + (Xml.required "status" + (Util.option_bind (Xml.member "status" xml) + SnapshotState.parse)); + start_time = + (Xml.required "startTime" + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse)); + progress = + (Xml.required "progress" + (Util.option_bind (Xml.member "progress" xml) String.parse)); + owner_id = + (Xml.required "ownerId" + (Util.option_bind (Xml.member "ownerId" xml) String.parse)); + description = + (Xml.required "description" + (Util.option_bind (Xml.member "description" xml) String.parse)); + volume_size = + (Xml.required "volumeSize" + (Util.option_bind (Xml.member "volumeSize" xml) Integer.parse)); + owner_alias = + (Util.option_bind (Xml.member "ownerAlias" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) TagList.parse)); + encrypted = + (Xml.required "encrypted" + (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse)); + kms_key_id = + (Util.option_bind (Xml.member "kmsKeyId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Some (Query.Pair ("Encrypted", (Boolean.to_query v.encrypted))); + Some (Query.Pair ("TagSet", (TagList.to_query v.tags))); + Util.option_map v.owner_alias + (fun f -> Query.Pair ("OwnerAlias", (String.to_query f))); + Some (Query.Pair ("VolumeSize", (Integer.to_query v.volume_size))); + Some (Query.Pair ("Description", (String.to_query v.description))); + Some (Query.Pair ("OwnerId", (String.to_query v.owner_id))); + Some (Query.Pair ("Progress", (String.to_query v.progress))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Some (Query.Pair ("Status", (SnapshotState.to_query v.state))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Some ("encrypted", (Boolean.to_json v.encrypted)); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.owner_alias + (fun f -> ("owner_alias", (String.to_json f))); + Some ("volume_size", (Integer.to_json v.volume_size)); + Some ("description", (String.to_json v.description)); + Some ("owner_id", (String.to_json v.owner_id)); + Some ("progress", (String.to_json v.progress)); + Some ("start_time", (DateTime.to_json v.start_time)); + Some ("state", (SnapshotState.to_json v.state)); + Some ("volume_id", (String.to_json v.volume_id)); + Some ("snapshot_id", (String.to_json v.snapshot_id))]) + let of_json j = + { + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + state = + (SnapshotState.of_json (Util.of_option_exn (Json.lookup j "state"))); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + progress = + (String.of_json (Util.of_option_exn (Json.lookup j "progress"))); + owner_id = + (String.of_json (Util.of_option_exn (Json.lookup j "owner_id"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + volume_size = + (Integer.of_json (Util.of_option_exn (Json.lookup j "volume_size"))); + owner_alias = + (Util.option_map (Json.lookup j "owner_alias") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + encrypted = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "encrypted"))); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json) + } + end +module NewDhcpConfiguration = + struct + type t = { + key: String.t option ; + values: ValueStringList.t } + let make ?key ?(values= []) () = { key; values } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "key" xml) String.parse); + values = + (Util.of_option [] + (Util.option_bind (Xml.member "Value" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (ValueStringList.to_query v.values))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("values", (ValueStringList.to_json v.values)); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + values = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "values"))) + } + end +module VpcAttributeName = + struct + type t = + | EnableDnsSupport + | EnableDnsHostnames + let str_to_t = + [("enableDnsHostnames", EnableDnsHostnames); + ("enableDnsSupport", EnableDnsSupport)] + let t_to_str = + [(EnableDnsHostnames, "enableDnsHostnames"); + (EnableDnsSupport, "enableDnsSupport")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BlockDeviceMappingRequestList = + struct + type t = BlockDeviceMapping.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BlockDeviceMapping.parse + (Xml.members "BlockDeviceMapping" xml)) + let to_query v = Query.to_query_list BlockDeviceMapping.to_query v + let to_json v = `List (List.map BlockDeviceMapping.to_json v) + let of_json j = Json.to_list BlockDeviceMapping.of_json j + end +module NetworkInterfaceList = + struct + type t = NetworkInterface.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NetworkInterface.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list NetworkInterface.to_query v + let to_json v = `List (List.map NetworkInterface.to_json v) + let of_json j = Json.to_list NetworkInterface.of_json j + end +module TagDescriptionList = + struct + type t = TagDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map TagDescription.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list TagDescription.to_query v + let to_json v = `List (List.map TagDescription.to_json v) + let of_json j = Json.to_list TagDescription.of_json j + end +module DhcpOptionsList = + struct + type t = DhcpOptions.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map DhcpOptions.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list DhcpOptions.to_query v + let to_json v = `List (List.map DhcpOptions.to_json v) + let of_json j = Json.to_list DhcpOptions.of_json j + end +module VpnGatewayList = + struct + type t = VpnGateway.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VpnGateway.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpnGateway.to_query v + let to_json v = `List (List.map VpnGateway.to_json v) + let of_json j = Json.to_list VpnGateway.of_json j + end +module AttributeBooleanValue = + struct + type t = { + value: Boolean.t option } + let make ?value () = { value } + let parse xml = + Some + { value = (Util.option_bind (Xml.member "value" xml) Boolean.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (Boolean.to_json f)))]) + let of_json j = + { value = (Util.option_map (Json.lookup j "value") Boolean.of_json) } + end +module ReservedInstancesModificationList = + struct + type t = ReservedInstancesModification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesModification.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list ReservedInstancesModification.to_query v + let to_json v = `List (List.map ReservedInstancesModification.to_json v) + let of_json j = Json.to_list ReservedInstancesModification.of_json j + end +module ReservedInstancesList = + struct + type t = ReservedInstances.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstances.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ReservedInstances.to_query v + let to_json v = `List (List.map ReservedInstances.to_json v) + let of_json j = Json.to_list ReservedInstances.of_json j + end +module FilterList = + struct + type t = Filter.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Filter.parse (Xml.members "Filter" xml)) + let to_query v = Query.to_query_list Filter.to_query v + let to_json v = `List (List.map Filter.to_json v) + let of_json j = Json.to_list Filter.of_json j + end +module PlacementGroupList = + struct + type t = PlacementGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PlacementGroup.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PlacementGroup.to_query v + let to_json v = `List (List.map PlacementGroup.to_json v) + let of_json j = Json.to_list PlacementGroup.of_json j + end +module KeyPairList = + struct + type t = KeyPairInfo.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map KeyPairInfo.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list KeyPairInfo.to_query v + let to_json v = `List (List.map KeyPairInfo.to_json v) + let of_json j = Json.to_list KeyPairInfo.of_json j + end +module CancelledSpotInstanceRequestList = + struct + type t = CancelledSpotInstanceRequest.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CancelledSpotInstanceRequest.parse (Xml.members "item" xml)) + let to_query v = + Query.to_query_list CancelledSpotInstanceRequest.to_query v + let to_json v = `List (List.map CancelledSpotInstanceRequest.to_json v) + let of_json j = Json.to_list CancelledSpotInstanceRequest.of_json j + end +module SpotDatafeedSubscription = + struct + type t = + { + owner_id: String.t option ; + bucket: String.t option ; + prefix: String.t option ; + state: DatafeedSubscriptionState.t option ; + fault: SpotInstanceStateFault.t option } + let make ?owner_id ?bucket ?prefix ?state ?fault () = + { owner_id; bucket; prefix; state; fault } + let parse xml = + Some + { + owner_id = + (Util.option_bind (Xml.member "ownerId" xml) String.parse); + bucket = (Util.option_bind (Xml.member "bucket" xml) String.parse); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse); + state = + (Util.option_bind (Xml.member "state" xml) + DatafeedSubscriptionState.parse); + fault = + (Util.option_bind (Xml.member "fault" xml) + SpotInstanceStateFault.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.fault + (fun f -> + Query.Pair ("Fault", (SpotInstanceStateFault.to_query f))); + Util.option_map v.state + (fun f -> + Query.Pair ("State", (DatafeedSubscriptionState.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.fault + (fun f -> ("fault", (SpotInstanceStateFault.to_json f))); + Util.option_map v.state + (fun f -> ("state", (DatafeedSubscriptionState.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f)))]) + let of_json j = + { + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + state = + (Util.option_map (Json.lookup j "state") + DatafeedSubscriptionState.of_json); + fault = + (Util.option_map (Json.lookup j "fault") + SpotInstanceStateFault.of_json) + } + end +module LaunchPermissionModifications = + struct + type t = { + add: LaunchPermissionList.t ; + remove: LaunchPermissionList.t } + let make ?(add= []) ?(remove= []) () = { add; remove } + let parse xml = + Some + { + add = + (Util.of_option [] + (Util.option_bind (Xml.member "Add" xml) + LaunchPermissionList.parse)); + remove = + (Util.of_option [] + (Util.option_bind (Xml.member "Remove" xml) + LaunchPermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Remove", (LaunchPermissionList.to_query v.remove))); + Some (Query.Pair ("Add", (LaunchPermissionList.to_query v.add)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("remove", (LaunchPermissionList.to_json v.remove)); + Some ("add", (LaunchPermissionList.to_json v.add))]) + let of_json j = + { + add = + (LaunchPermissionList.of_json + (Util.of_option_exn (Json.lookup j "add"))); + remove = + (LaunchPermissionList.of_json + (Util.of_option_exn (Json.lookup j "remove"))) + } + end +module OperationType = + struct + type t = + | Add + | Remove + let str_to_t = [("remove", Remove); ("add", Add)] + let t_to_str = [(Remove, "remove"); (Add, "add")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ProductCodeStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ProductCode" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module UserGroupStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "UserGroup" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module UserIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "UserId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceAttributeName = + struct + type t = + | InstanceType + | Kernel + | Ramdisk + | UserData + | DisableApiTermination + | InstanceInitiatedShutdownBehavior + | RootDeviceName + | BlockDeviceMapping + | ProductCodes + | SourceDestCheck + | GroupSet + | EbsOptimized + | SriovNetSupport + let str_to_t = + [("sriovNetSupport", SriovNetSupport); + ("ebsOptimized", EbsOptimized); + ("groupSet", GroupSet); + ("sourceDestCheck", SourceDestCheck); + ("productCodes", ProductCodes); + ("blockDeviceMapping", BlockDeviceMapping); + ("rootDeviceName", RootDeviceName); + ("instanceInitiatedShutdownBehavior", + InstanceInitiatedShutdownBehavior); + ("disableApiTermination", DisableApiTermination); + ("userData", UserData); + ("ramdisk", Ramdisk); + ("kernel", Kernel); + ("instanceType", InstanceType)] + let t_to_str = + [(SriovNetSupport, "sriovNetSupport"); + (EbsOptimized, "ebsOptimized"); + (GroupSet, "groupSet"); + (SourceDestCheck, "sourceDestCheck"); + (ProductCodes, "productCodes"); + (BlockDeviceMapping, "blockDeviceMapping"); + (RootDeviceName, "rootDeviceName"); + (InstanceInitiatedShutdownBehavior, + "instanceInitiatedShutdownBehavior"); + (DisableApiTermination, "disableApiTermination"); + (UserData, "userData"); + (Ramdisk, "ramdisk"); + (Kernel, "kernel"); + (InstanceType, "instanceType")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BundleIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "BundleId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DescribeConversionTaskList = + struct + type t = ConversionTask.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ConversionTask.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ConversionTask.to_query v + let to_json v = `List (List.map ConversionTask.to_json v) + let of_json j = Json.to_list ConversionTask.of_json j + end +module ExportToS3TaskSpecification = + struct + type t = + { + disk_image_format: DiskImageFormat.t option ; + container_format: ContainerFormat.t option ; + s3_bucket: String.t option ; + s3_prefix: String.t option } + let make ?disk_image_format ?container_format ?s3_bucket ?s3_prefix + () = { disk_image_format; container_format; s3_bucket; s3_prefix } + let parse xml = + Some + { + disk_image_format = + (Util.option_bind (Xml.member "diskImageFormat" xml) + DiskImageFormat.parse); + container_format = + (Util.option_bind (Xml.member "containerFormat" xml) + ContainerFormat.parse); + s3_bucket = + (Util.option_bind (Xml.member "s3Bucket" xml) String.parse); + s3_prefix = + (Util.option_bind (Xml.member "s3Prefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3_prefix + (fun f -> Query.Pair ("S3Prefix", (String.to_query f))); + Util.option_map v.s3_bucket + (fun f -> Query.Pair ("S3Bucket", (String.to_query f))); + Util.option_map v.container_format + (fun f -> + Query.Pair ("ContainerFormat", (ContainerFormat.to_query f))); + Util.option_map v.disk_image_format + (fun f -> + Query.Pair ("DiskImageFormat", (DiskImageFormat.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3_prefix + (fun f -> ("s3_prefix", (String.to_json f))); + Util.option_map v.s3_bucket + (fun f -> ("s3_bucket", (String.to_json f))); + Util.option_map v.container_format + (fun f -> ("container_format", (ContainerFormat.to_json f))); + Util.option_map v.disk_image_format + (fun f -> ("disk_image_format", (DiskImageFormat.to_json f)))]) + let of_json j = + { + disk_image_format = + (Util.option_map (Json.lookup j "disk_image_format") + DiskImageFormat.of_json); + container_format = + (Util.option_map (Json.lookup j "container_format") + ContainerFormat.of_json); + s3_bucket = + (Util.option_map (Json.lookup j "s3_bucket") String.of_json); + s3_prefix = + (Util.option_map (Json.lookup j "s3_prefix") String.of_json) + } + end +module HistoryRecords = + struct + type t = HistoryRecord.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map HistoryRecord.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list HistoryRecord.to_query v + let to_json v = `List (List.map HistoryRecord.to_json v) + let of_json j = Json.to_list HistoryRecord.of_json j + end +module OwnerStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "Owner" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module RestorableByStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SnapshotIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "SnapshotId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReservedInstancesConfigurationList = + struct + type t = ReservedInstancesConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesConfiguration.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list ReservedInstancesConfiguration.to_query v + let to_json v = `List (List.map ReservedInstancesConfiguration.to_json v) + let of_json j = Json.to_list ReservedInstancesConfiguration.of_json j + end +module ReservedInstancesIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "ReservedInstancesId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module GroupIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "groupId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module GroupNameStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "GroupName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module RequestSpotLaunchSpecification = + struct + type t = + { + image_id: String.t option ; + key_name: String.t option ; + security_groups: ValueStringList.t ; + user_data: String.t option ; + addressing_type: String.t option ; + instance_type: InstanceType.t option ; + placement: SpotPlacement.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappingList.t ; + subnet_id: String.t option ; + network_interfaces: InstanceNetworkInterfaceSpecificationList.t ; + iam_instance_profile: IamInstanceProfileSpecification.t option ; + ebs_optimized: Boolean.t option ; + monitoring: RunInstancesMonitoringEnabled.t option ; + security_group_ids: ValueStringList.t } + let make ?image_id ?key_name ?(security_groups= []) ?user_data + ?addressing_type ?instance_type ?placement ?kernel_id ?ramdisk_id + ?(block_device_mappings= []) ?subnet_id ?(network_interfaces= []) + ?iam_instance_profile ?ebs_optimized ?monitoring + ?(security_group_ids= []) () = + { + image_id; + key_name; + security_groups; + user_data; + addressing_type; + instance_type; + placement; + kernel_id; + ramdisk_id; + block_device_mappings; + subnet_id; + network_interfaces; + iam_instance_profile; + ebs_optimized; + monitoring; + security_group_ids + } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroup" xml) + ValueStringList.parse)); + user_data = + (Util.option_bind (Xml.member "userData" xml) String.parse); + addressing_type = + (Util.option_bind (Xml.member "addressingType" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + placement = + (Util.option_bind (Xml.member "placement" xml) + SpotPlacement.parse); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingList.parse)); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "NetworkInterface" xml) + InstanceNetworkInterfaceSpecificationList.parse)); + iam_instance_profile = + (Util.option_bind (Xml.member "iamInstanceProfile" xml) + IamInstanceProfileSpecification.parse); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse); + monitoring = + (Util.option_bind (Xml.member "monitoring" xml) + RunInstancesMonitoringEnabled.parse); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupId" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SecurityGroupId", + (ValueStringList.to_query v.security_group_ids))); + Util.option_map v.monitoring + (fun f -> + Query.Pair + ("Monitoring", (RunInstancesMonitoringEnabled.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> + Query.Pair + ("IamInstanceProfile", + (IamInstanceProfileSpecification.to_query f))); + Some + (Query.Pair + ("NetworkInterface", + (InstanceNetworkInterfaceSpecificationList.to_query + v.network_interfaces))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Some + (Query.Pair + ("BlockDeviceMapping", + (BlockDeviceMappingList.to_query v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (SpotPlacement.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.addressing_type + (fun f -> Query.Pair ("AddressingType", (String.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some + (Query.Pair + ("SecurityGroup", + (ValueStringList.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("security_group_ids", + (ValueStringList.to_json v.security_group_ids)); + Util.option_map v.monitoring + (fun f -> + ("monitoring", (RunInstancesMonitoringEnabled.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> + ("iam_instance_profile", + (IamInstanceProfileSpecification.to_json f))); + Some + ("network_interfaces", + (InstanceNetworkInterfaceSpecificationList.to_json + v.network_interfaces)); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappingList.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (SpotPlacement.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.addressing_type + (fun f -> ("addressing_type", (String.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("security_groups", (ValueStringList.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + addressing_type = + (Util.option_map (Json.lookup j "addressing_type") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + placement = + (Util.option_map (Json.lookup j "placement") SpotPlacement.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + network_interfaces = + (InstanceNetworkInterfaceSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + IamInstanceProfileSpecification.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json); + monitoring = + (Util.option_map (Json.lookup j "monitoring") + RunInstancesMonitoringEnabled.of_json); + security_group_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))) + } + end +module PrivateIpAddressStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "PrivateIpAddress" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module UnsuccessfulItemSet = + struct + type t = UnsuccessfulItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map UnsuccessfulItem.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list UnsuccessfulItem.to_query v + let to_json v = `List (List.map UnsuccessfulItem.to_json v) + let of_json j = Json.to_list UnsuccessfulItem.of_json j + end +module Status = + struct + type t = + | MoveInProgress + | InVpc + | InClassic + let str_to_t = + [("InClassic", InClassic); + ("InVpc", InVpc); + ("MoveInProgress", MoveInProgress)] + let t_to_str = + [(InClassic, "InClassic"); + (InVpc, "InVpc"); + (MoveInProgress, "MoveInProgress")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RouteTableList = + struct + type t = RouteTable.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map RouteTable.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list RouteTable.to_query v + let to_json v = `List (List.map RouteTable.to_json v) + let of_json j = Json.to_list RouteTable.of_json j + end +module InstanceIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "InstanceId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ImportTaskIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "ImportTaskId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReservedInstancesListingList = + struct + type t = ReservedInstancesListing.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesListing.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ReservedInstancesListing.to_query v + let to_json v = `List (List.map ReservedInstancesListing.to_json v) + let of_json j = Json.to_list ReservedInstancesListing.of_json j + end +module InstanceStateChangeList = + struct + type t = InstanceStateChange.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceStateChange.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceStateChange.to_query v + let to_json v = `List (List.map InstanceStateChange.to_json v) + let of_json j = Json.to_list InstanceStateChange.of_json j + end +module ExecutableByStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "ExecutableBy" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ImageIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ImageId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MovingAddressStatusSet = + struct + type t = MovingAddressStatus.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map MovingAddressStatus.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list MovingAddressStatus.to_query v + let to_json v = `List (List.map MovingAddressStatus.to_json v) + let of_json j = Json.to_list MovingAddressStatus.of_json j + end +module ExportTaskIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "ExportTaskId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReservedInstancesOfferingIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module InstanceStatusList = + struct + type t = InstanceStatus.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceStatus.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceStatus.to_query v + let to_json v = `List (List.map InstanceStatus.to_json v) + let of_json j = Json.to_list InstanceStatus.of_json j + end +module NetworkInterfaceAttachmentChanges = + struct + type t = + { + attachment_id: String.t option ; + delete_on_termination: Boolean.t option } + let make ?attachment_id ?delete_on_termination () = + { attachment_id; delete_on_termination } + let parse xml = + Some + { + attachment_id = + (Util.option_bind (Xml.member "attachmentId" xml) String.parse); + delete_on_termination = + (Util.option_bind (Xml.member "deleteOnTermination" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> + Query.Pair ("DeleteOnTermination", (Boolean.to_query f))); + Util.option_map v.attachment_id + (fun f -> Query.Pair ("AttachmentId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_on_termination + (fun f -> ("delete_on_termination", (Boolean.to_json f))); + Util.option_map v.attachment_id + (fun f -> ("attachment_id", (String.to_json f)))]) + let of_json j = + { + attachment_id = + (Util.option_map (Json.lookup j "attachment_id") String.of_json); + delete_on_termination = + (Util.option_map (Json.lookup j "delete_on_termination") + Boolean.of_json) + } + end +module ImageList = + struct + type t = Image.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Image.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Image.to_query v + let to_json v = `List (List.map Image.to_json v) + let of_json j = Json.to_list Image.of_json j + end +module PriceScheduleSpecificationList = + struct + type t = PriceScheduleSpecification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PriceScheduleSpecification.parse (Xml.members "item" xml)) + let to_query v = + Query.to_query_list PriceScheduleSpecification.to_query v + let to_json v = `List (List.map PriceScheduleSpecification.to_json v) + let of_json j = Json.to_list PriceScheduleSpecification.of_json j + end +module ImportSnapshotTaskList = + struct + type t = ImportSnapshotTask.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ImportSnapshotTask.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ImportSnapshotTask.to_query v + let to_json v = `List (List.map ImportSnapshotTask.to_json v) + let of_json j = Json.to_list ImportSnapshotTask.of_json j + end +module SpotInstanceRequestIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SpotInstanceRequestId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module KeyNameStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "KeyName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SpotInstanceRequestList = + struct + type t = SpotInstanceRequest.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SpotInstanceRequest.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list SpotInstanceRequest.to_query v + let to_json v = `List (List.map SpotInstanceRequest.to_json v) + let of_json j = Json.to_list SpotInstanceRequest.of_json j + end +module InstanceTypeList = + struct + type t = InstanceType.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceType.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceType.to_query v + let to_json v = `List (List.map InstanceType.to_json v) + let of_json j = Json.to_list InstanceType.of_json j + end +module ProductDescriptionList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module CustomerGatewayIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "CustomerGatewayId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ExportTaskList = + struct + type t = ExportTask.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map ExportTask.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ExportTask.to_query v + let to_json v = `List (List.map ExportTask.to_json v) + let of_json j = Json.to_list ExportTask.of_json j + end +module PrefixListSet = + struct + type t = PrefixList.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map PrefixList.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list PrefixList.to_query v + let to_json v = `List (List.map PrefixList.to_json v) + let of_json j = Json.to_list PrefixList.of_json j + end +module InstanceMonitoringList = + struct + type t = InstanceMonitoring.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceMonitoring.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InstanceMonitoring.to_query v + let to_json v = `List (List.map InstanceMonitoring.to_json v) + let of_json j = Json.to_list InstanceMonitoring.of_json j + end +module SecurityGroupList = + struct + type t = SecurityGroup.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map SecurityGroup.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list SecurityGroup.to_query v + let to_json v = `List (List.map SecurityGroup.to_json v) + let of_json j = Json.to_list SecurityGroup.of_json j + end +module VpnConnectionIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "VpnConnectionId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ActiveInstanceSet = + struct + type t = ActiveInstance.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ActiveInstance.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ActiveInstance.to_query v + let to_json v = `List (List.map ActiveInstance.to_json v) + let of_json j = Json.to_list ActiveInstance.of_json j + end +module SnapshotAttributeName = + struct + type t = + | ProductCodes + | CreateVolumePermission + let str_to_t = + [("createVolumePermission", CreateVolumePermission); + ("productCodes", ProductCodes)] + let t_to_str = + [(CreateVolumePermission, "createVolumePermission"); + (ProductCodes, "productCodes")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BlobAttributeValue = + struct + type t = { + value: Blob.t option } + let make ?value () = { value } + let parse xml = + Some { value = (Util.option_bind (Xml.member "value" xml) Blob.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (Blob.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (Blob.to_json f)))]) + let of_json j = + { value = (Util.option_map (Json.lookup j "value") Blob.of_json) } + end +module InstanceBlockDeviceMappingSpecificationList = + struct + type t = InstanceBlockDeviceMappingSpecification.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceBlockDeviceMappingSpecification.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list InstanceBlockDeviceMappingSpecification.to_query v + let to_json v = + `List (List.map InstanceBlockDeviceMappingSpecification.to_json v) + let of_json j = + Json.to_list InstanceBlockDeviceMappingSpecification.of_json j + end +module InternetGatewayList = + struct + type t = InternetGateway.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InternetGateway.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list InternetGateway.to_query v + let to_json v = `List (List.map InternetGateway.to_json v) + let of_json j = Json.to_list InternetGateway.of_json j + end +module NetworkInterfaceIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AccountAttributeNameStringList = + struct + type t = AccountAttributeName.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AccountAttributeName.parse + (Xml.members "attributeName" xml)) + let to_query v = Query.to_query_list AccountAttributeName.to_query v + let to_json v = `List (List.map AccountAttributeName.to_json v) + let of_json j = Json.to_list AccountAttributeName.of_json j + end +module ConversionIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ZoneNameStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ZoneName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module VpnGatewayIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "VpnGatewayId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReservedInstancesModificationIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse + (Xml.members "ReservedInstancesModificationId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SpotFleetRequestConfigSet = + struct + type t = SpotFleetRequestConfig.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SpotFleetRequestConfig.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list SpotFleetRequestConfig.to_query v + let to_json v = `List (List.map SpotFleetRequestConfig.to_json v) + let of_json j = Json.to_list SpotFleetRequestConfig.of_json j + end +module VolumeAttributeName = + struct + type t = + | AutoEnableIO + | ProductCodes + let str_to_t = + [("productCodes", ProductCodes); ("autoEnableIO", AutoEnableIO)] + let t_to_str = + [(ProductCodes, "productCodes"); (AutoEnableIO, "autoEnableIO")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module PlacementGroupStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AvailabilityZoneList = + struct + type t = AvailabilityZone.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AvailabilityZone.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list AvailabilityZone.to_query v + let to_json v = `List (List.map AvailabilityZone.to_json v) + let of_json j = Json.to_list AvailabilityZone.of_json j + end +module CustomerGatewayList = + struct + type t = CustomerGateway.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CustomerGateway.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list CustomerGateway.to_query v + let to_json v = `List (List.map CustomerGateway.to_json v) + let of_json j = Json.to_list CustomerGateway.of_json j + end +module FlowLogSet = + struct + type t = FlowLog.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map FlowLog.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list FlowLog.to_query v + let to_json v = `List (List.map FlowLog.to_json v) + let of_json j = Json.to_list FlowLog.of_json j + end +module BundleTaskList = + struct + type t = BundleTask.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map BundleTask.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list BundleTask.to_query v + let to_json v = `List (List.map BundleTask.to_json v) + let of_json j = Json.to_list BundleTask.of_json j + end +module VolumeStatusList = + struct + type t = VolumeStatusItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VolumeStatusItem.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VolumeStatusItem.to_query v + let to_json v = `List (List.map VolumeStatusItem.to_json v) + let of_json j = Json.to_list VolumeStatusItem.of_json j + end +module SubnetIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "SubnetId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module CreateVolumePermissionModifications = + struct + type t = + { + add: CreateVolumePermissionList.t ; + remove: CreateVolumePermissionList.t } + let make ?(add= []) ?(remove= []) () = { add; remove } + let parse xml = + Some + { + add = + (Util.of_option [] + (Util.option_bind (Xml.member "Add" xml) + CreateVolumePermissionList.parse)); + remove = + (Util.of_option [] + (Util.option_bind (Xml.member "Remove" xml) + CreateVolumePermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Remove", (CreateVolumePermissionList.to_query v.remove))); + Some + (Query.Pair ("Add", (CreateVolumePermissionList.to_query v.add)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("remove", (CreateVolumePermissionList.to_json v.remove)); + Some ("add", (CreateVolumePermissionList.to_json v.add))]) + let of_json j = + { + add = + (CreateVolumePermissionList.of_json + (Util.of_option_exn (Json.lookup j "add"))); + remove = + (CreateVolumePermissionList.of_json + (Util.of_option_exn (Json.lookup j "remove"))) + } + end +module VolumeList = + struct + type t = Volume.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Volume.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Volume.to_query v + let to_json v = `List (List.map Volume.to_json v) + let of_json j = Json.to_list Volume.of_json j + end +module VpcClassicLinkIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "VpcId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module RegionList = + struct + type t = Region.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Region.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Region.to_query v + let to_json v = `List (List.map Region.to_json v) + let of_json j = Json.to_list Region.of_json j + end +module VpnConnectionOptionsSpecification = + struct + type t = { + static_routes_only: Boolean.t option } + let make ?static_routes_only () = { static_routes_only } + let parse xml = + Some + { + static_routes_only = + (Util.option_bind (Xml.member "staticRoutesOnly" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.static_routes_only + (fun f -> Query.Pair ("StaticRoutesOnly", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.static_routes_only + (fun f -> ("static_routes_only", (Boolean.to_json f)))]) + let of_json j = + { + static_routes_only = + (Util.option_map (Json.lookup j "static_routes_only") + Boolean.of_json) + } + end +module ResourceIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AllocationIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AllocationId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module PublicIpStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "PublicIp" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AddressList = + struct + type t = Address.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Address.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Address.to_query v + let to_json v = `List (List.map Address.to_json v) + let of_json j = Json.to_list Address.of_json j + end +module ClientData = + struct + type t = + { + upload_start: DateTime.t option ; + upload_end: DateTime.t option ; + upload_size: Double.t option ; + comment: String.t option } + let make ?upload_start ?upload_end ?upload_size ?comment () = + { upload_start; upload_end; upload_size; comment } + let parse xml = + Some + { + upload_start = + (Util.option_bind (Xml.member "UploadStart" xml) DateTime.parse); + upload_end = + (Util.option_bind (Xml.member "UploadEnd" xml) DateTime.parse); + upload_size = + (Util.option_bind (Xml.member "UploadSize" xml) Double.parse); + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f))); + Util.option_map v.upload_size + (fun f -> Query.Pair ("UploadSize", (Double.to_query f))); + Util.option_map v.upload_end + (fun f -> Query.Pair ("UploadEnd", (DateTime.to_query f))); + Util.option_map v.upload_start + (fun f -> Query.Pair ("UploadStart", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> ("comment", (String.to_json f))); + Util.option_map v.upload_size + (fun f -> ("upload_size", (Double.to_json f))); + Util.option_map v.upload_end + (fun f -> ("upload_end", (DateTime.to_json f))); + Util.option_map v.upload_start + (fun f -> ("upload_start", (DateTime.to_json f)))]) + let of_json j = + { + upload_start = + (Util.option_map (Json.lookup j "upload_start") DateTime.of_json); + upload_end = + (Util.option_map (Json.lookup j "upload_end") DateTime.of_json); + upload_size = + (Util.option_map (Json.lookup j "upload_size") Double.of_json); + comment = (Util.option_map (Json.lookup j "comment") String.of_json) + } + end +module SnapshotDiskContainer = + struct + type t = + { + description: String.t option ; + format: String.t option ; + url: String.t option ; + user_bucket: UserBucket.t option } + let make ?description ?format ?url ?user_bucket () = + { description; format; url; user_bucket } + let parse xml = + Some + { + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + format = (Util.option_bind (Xml.member "Format" xml) String.parse); + url = (Util.option_bind (Xml.member "Url" xml) String.parse); + user_bucket = + (Util.option_bind (Xml.member "UserBucket" xml) UserBucket.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.user_bucket + (fun f -> Query.Pair ("UserBucket", (UserBucket.to_query f))); + Util.option_map v.url + (fun f -> Query.Pair ("Url", (String.to_query f))); + Util.option_map v.format + (fun f -> Query.Pair ("Format", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.user_bucket + (fun f -> ("user_bucket", (UserBucket.to_json f))); + Util.option_map v.url (fun f -> ("url", (String.to_json f))); + Util.option_map v.format (fun f -> ("format", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f)))]) + let of_json j = + { + description = + (Util.option_map (Json.lookup j "description") String.of_json); + format = (Util.option_map (Json.lookup j "format") String.of_json); + url = (Util.option_map (Json.lookup j "url") String.of_json); + user_bucket = + (Util.option_map (Json.lookup j "user_bucket") UserBucket.of_json) + } + end +module VpnConnectionList = + struct + type t = VpnConnection.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VpnConnection.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpnConnection.to_query v + let to_json v = `List (List.map VpnConnection.to_json v) + let of_json j = Json.to_list VpnConnection.of_json j + end +module ReservedInstancesOfferingList = + struct + type t = ReservedInstancesOffering.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedInstancesOffering.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ReservedInstancesOffering.to_query v + let to_json v = `List (List.map ReservedInstancesOffering.to_json v) + let of_json j = Json.to_list ReservedInstancesOffering.of_json j + end +module ReservationList = + struct + type t = Reservation.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Reservation.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Reservation.to_query v + let to_json v = `List (List.map Reservation.to_json v) + let of_json j = Json.to_list Reservation.of_json j + end +module VolumeIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "VolumeId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module RegionNameStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "RegionName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module VpcPeeringConnectionList = + struct + type t = VpcPeeringConnection.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VpcPeeringConnection.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpcPeeringConnection.to_query v + let to_json v = `List (List.map VpcPeeringConnection.to_json v) + let of_json j = Json.to_list VpcPeeringConnection.of_json j + end +module VpcList = + struct + type t = Vpc.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Vpc.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Vpc.to_query v + let to_json v = `List (List.map Vpc.to_json v) + let of_json j = Json.to_list Vpc.of_json j + end +module NetworkAclList = + struct + type t = NetworkAcl.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map NetworkAcl.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list NetworkAcl.to_query v + let to_json v = `List (List.map NetworkAcl.to_json v) + let of_json j = Json.to_list NetworkAcl.of_json j + end +module SubnetList = + struct + type t = Subnet.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Subnet.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Subnet.to_query v + let to_json v = `List (List.map Subnet.to_json v) + let of_json j = Json.to_list Subnet.of_json j + end +module VpcClassicLinkList = + struct + type t = VpcClassicLink.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VpcClassicLink.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpcClassicLink.to_query v + let to_json v = `List (List.map VpcClassicLink.to_json v) + let of_json j = Json.to_list VpcClassicLink.of_json j + end +module ImportImageTaskList = + struct + type t = ImportImageTask.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ImportImageTask.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ImportImageTask.to_query v + let to_json v = `List (List.map ImportImageTask.to_json v) + let of_json j = Json.to_list ImportImageTask.of_json j + end +module FlowLogsResourceType = + struct + type t = + | VPC + | Subnet + | NetworkInterface + let str_to_t = + [("NetworkInterface", NetworkInterface); + ("Subnet", Subnet); + ("VPC", VPC)] + let t_to_str = + [(NetworkInterface, "NetworkInterface"); + (Subnet, "Subnet"); + (VPC, "VPC")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module CancelSpotFleetRequestsErrorSet = + struct + type t = CancelSpotFleetRequestsErrorItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CancelSpotFleetRequestsErrorItem.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list CancelSpotFleetRequestsErrorItem.to_query v + let to_json v = + `List (List.map CancelSpotFleetRequestsErrorItem.to_json v) + let of_json j = Json.to_list CancelSpotFleetRequestsErrorItem.of_json j + end +module CancelSpotFleetRequestsSuccessSet = + struct + type t = CancelSpotFleetRequestsSuccessItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CancelSpotFleetRequestsSuccessItem.parse + (Xml.members "item" xml)) + let to_query v = + Query.to_query_list CancelSpotFleetRequestsSuccessItem.to_query v + let to_json v = + `List (List.map CancelSpotFleetRequestsSuccessItem.to_json v) + let of_json j = Json.to_list CancelSpotFleetRequestsSuccessItem.of_json j + end +module AccountAttributeList = + struct + type t = AccountAttribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AccountAttribute.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list AccountAttribute.to_query v + let to_json v = `List (List.map AccountAttribute.to_json v) + let of_json j = Json.to_list AccountAttribute.of_json j + end +module DhcpOptionsIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "DhcpOptionsId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SpotPriceHistoryList = + struct + type t = SpotPrice.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map SpotPrice.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list SpotPrice.to_query v + let to_json v = `List (List.map SpotPrice.to_json v) + let of_json j = Json.to_list SpotPrice.of_json j + end +module ReasonCodesList = + struct + type t = ReportInstanceReasonCodes.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReportInstanceReasonCodes.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ReportInstanceReasonCodes.to_query v + let to_json v = `List (List.map ReportInstanceReasonCodes.to_json v) + let of_json j = Json.to_list ReportInstanceReasonCodes.of_json j + end +module ReportStatusType = + struct + type t = + | Ok + | Impaired + let str_to_t = [("impaired", Impaired); ("ok", Ok)] + let t_to_str = [(Impaired, "impaired"); (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module VpcIdStringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "VpcId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DiskImageList = + struct + type t = DiskImage.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map DiskImage.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list DiskImage.to_query v + let to_json v = `List (List.map DiskImage.to_json v) + let of_json j = Json.to_list DiskImage.of_json j + end +module ImportInstanceLaunchSpecification = + struct + type t = + { + architecture: ArchitectureValues.t option ; + group_names: SecurityGroupStringList.t ; + group_ids: SecurityGroupIdStringList.t ; + additional_info: String.t option ; + user_data: UserData.t option ; + instance_type: InstanceType.t option ; + placement: Placement.t option ; + monitoring: Boolean.t option ; + subnet_id: String.t option ; + instance_initiated_shutdown_behavior: ShutdownBehavior.t option ; + private_ip_address: String.t option } + let make ?architecture ?(group_names= []) ?(group_ids= []) + ?additional_info ?user_data ?instance_type ?placement ?monitoring + ?subnet_id ?instance_initiated_shutdown_behavior ?private_ip_address () = - { dry_run - ; instance_id - ; attribute - ; value - ; block_device_mappings - ; source_dest_check - ; disable_api_termination - ; instance_type - ; kernel - ; ramdisk - ; user_data - ; instance_initiated_shutdown_behavior - ; groups - ; ebs_optimized - ; sriov_net_support - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; attribute = - Util.option_bind (Xml.member "attribute" xml) InstanceAttributeName.parse - ; value = Util.option_bind (Xml.member "value" xml) String.parse - ; block_device_mappings = - Util.of_option - [] + { + architecture; + group_names; + group_ids; + additional_info; + user_data; + instance_type; + placement; + monitoring; + subnet_id; + instance_initiated_shutdown_behavior; + private_ip_address + } + let parse xml = + Some + { + architecture = + (Util.option_bind (Xml.member "architecture" xml) + ArchitectureValues.parse); + group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "GroupName" xml) + SecurityGroupStringList.parse)); + group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "GroupId" xml) + SecurityGroupIdStringList.parse)); + additional_info = + (Util.option_bind (Xml.member "additionalInfo" xml) String.parse); + user_data = + (Util.option_bind (Xml.member "userData" xml) UserData.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + InstanceType.parse); + placement = + (Util.option_bind (Xml.member "placement" xml) Placement.parse); + monitoring = + (Util.option_bind (Xml.member "monitoring" xml) Boolean.parse); + subnet_id = + (Util.option_bind (Xml.member "subnetId" xml) String.parse); + instance_initiated_shutdown_behavior = (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - InstanceBlockDeviceMappingSpecificationList.parse) - ; source_dest_check = - Util.option_bind (Xml.member "SourceDestCheck" xml) AttributeBooleanValue.parse - ; disable_api_termination = - Util.option_bind - (Xml.member "disableApiTermination" xml) - AttributeBooleanValue.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) AttributeValue.parse - ; kernel = Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse - ; ramdisk = Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse - ; user_data = Util.option_bind (Xml.member "userData" xml) BlobAttributeValue.parse - ; instance_initiated_shutdown_behavior = - Util.option_bind - (Xml.member "instanceInitiatedShutdownBehavior" xml) - AttributeValue.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "GroupId" xml) GroupIdStringList.parse) - ; ebs_optimized = - Util.option_bind (Xml.member "ebsOptimized" xml) AttributeBooleanValue.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) AttributeValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", AttributeValue.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", AttributeBooleanValue.to_query f)) - ; Some (Query.Pair ("GroupId", GroupIdStringList.to_query v.groups)) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - Query.Pair ("InstanceInitiatedShutdownBehavior", AttributeValue.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", BlobAttributeValue.to_query f)) - ; Util.option_map v.ramdisk (fun f -> - Query.Pair ("Ramdisk", AttributeValue.to_query f)) - ; Util.option_map v.kernel (fun f -> - Query.Pair ("Kernel", AttributeValue.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", AttributeValue.to_query f)) - ; Util.option_map v.disable_api_termination (fun f -> - Query.Pair ("DisableApiTermination", AttributeBooleanValue.to_query f)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", AttributeBooleanValue.to_query f)) - ; Some + (Xml.member "instanceInitiatedShutdownBehavior" xml) + ShutdownBehavior.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + Query.Pair + ("InstanceInitiatedShutdownBehavior", + (ShutdownBehavior.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.monitoring + (fun f -> Query.Pair ("Monitoring", (Boolean.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (Placement.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (UserData.to_query f))); + Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); + Some (Query.Pair - ( "BlockDeviceMapping" - , InstanceBlockDeviceMappingSpecificationList.to_query - v.block_device_mappings )) - ; Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", InstanceAttributeName.to_query f)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", AttributeValue.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> - "ebs_optimized", AttributeBooleanValue.to_json f) - ; Some ("groups", GroupIdStringList.to_json v.groups) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - "instance_initiated_shutdown_behavior", AttributeValue.to_json f) - ; Util.option_map v.user_data (fun f -> - "user_data", BlobAttributeValue.to_json f) - ; Util.option_map v.ramdisk (fun f -> "ramdisk", AttributeValue.to_json f) - ; Util.option_map v.kernel (fun f -> "kernel", AttributeValue.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", AttributeValue.to_json f) - ; Util.option_map v.disable_api_termination (fun f -> - "disable_api_termination", AttributeBooleanValue.to_json f) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", AttributeBooleanValue.to_json f) - ; Some - ( "block_device_mappings" - , InstanceBlockDeviceMappingSpecificationList.to_json v.block_device_mappings - ) - ; Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.attribute (fun f -> - "attribute", InstanceAttributeName.to_json f) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; attribute = - Util.option_map (Json.lookup j "attribute") InstanceAttributeName.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - ; block_device_mappings = - InstanceBlockDeviceMappingSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") AttributeBooleanValue.of_json - ; disable_api_termination = - Util.option_map - (Json.lookup j "disable_api_termination") - AttributeBooleanValue.of_json - ; instance_type = - Util.option_map (Json.lookup j "instance_type") AttributeValue.of_json - ; kernel = Util.option_map (Json.lookup j "kernel") AttributeValue.of_json - ; ramdisk = Util.option_map (Json.lookup j "ramdisk") AttributeValue.of_json - ; user_data = Util.option_map (Json.lookup j "user_data") BlobAttributeValue.of_json - ; instance_initiated_shutdown_behavior = - Util.option_map - (Json.lookup j "instance_initiated_shutdown_behavior") - AttributeValue.of_json - ; groups = GroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; ebs_optimized = - Util.option_map (Json.lookup j "ebs_optimized") AttributeBooleanValue.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") AttributeValue.of_json - } -end - -module DeleteFlowLogsRequest = struct - type t = { flow_log_ids : ValueStringList.t } - - let make ~flow_log_ids () = { flow_log_ids } - - let parse xml = - Some - { flow_log_ids = - Xml.required - "FlowLogId" - (Util.option_bind (Xml.member "FlowLogId" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("FlowLogId", ValueStringList.to_query v.flow_log_ids)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("flow_log_ids", ValueStringList.to_json v.flow_log_ids) ]) - - let of_json j = - { flow_log_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "flow_log_ids")) - } -end - -module EnableVgwRoutePropagationRequest = struct - type t = - { route_table_id : String.t - ; gateway_id : String.t - } - - let make ~route_table_id ~gateway_id () = { route_table_id; gateway_id } - - let parse xml = - Some - { route_table_id = - Xml.required - "RouteTableId" - (Util.option_bind (Xml.member "RouteTableId" xml) String.parse) - ; gateway_id = - Xml.required - "GatewayId" - (Util.option_bind (Xml.member "GatewayId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("GatewayId", String.to_query v.gateway_id)) - ; Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("gateway_id", String.to_json v.gateway_id) - ; Some ("route_table_id", String.to_json v.route_table_id) - ]) - - let of_json j = - { route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - ; gateway_id = String.of_json (Util.of_option_exn (Json.lookup j "gateway_id")) - } -end - -module DescribeInternetGatewaysResult = struct - type t = { internet_gateways : InternetGatewayList.t } - - let make ?(internet_gateways = []) () = { internet_gateways } - - let parse xml = - Some - { internet_gateways = - Util.of_option - [] - (Util.option_bind - (Xml.member "internetGatewaySet" xml) - InternetGatewayList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("GroupId", (SecurityGroupIdStringList.to_query v.group_ids))); + Some (Query.Pair - ("InternetGatewaySet", InternetGatewayList.to_query v.internet_gateways)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("internet_gateways", InternetGatewayList.to_json v.internet_gateways) ]) - - let of_json j = - { internet_gateways = - InternetGatewayList.of_json - (Util.of_option_exn (Json.lookup j "internet_gateways")) - } -end - -module DescribeNetworkInterfacesRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_ids : NetworkInterfaceIdList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(network_interface_ids = []) ?(filters = []) () = - { dry_run; network_interface_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "NetworkInterfaceId" xml) - NetworkInterfaceIdList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("GroupName", + (SecurityGroupStringList.to_query v.group_names))); + Util.option_map v.architecture + (fun f -> + Query.Pair ("Architecture", (ArchitectureValues.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + ("instance_initiated_shutdown_behavior", + (ShutdownBehavior.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.monitoring + (fun f -> ("monitoring", (Boolean.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (Placement.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (UserData.to_json f))); + Util.option_map v.additional_info + (fun f -> ("additional_info", (String.to_json f))); + Some + ("group_ids", (SecurityGroupIdStringList.to_json v.group_ids)); + Some + ("group_names", (SecurityGroupStringList.to_json v.group_names)); + Util.option_map v.architecture + (fun f -> ("architecture", (ArchitectureValues.to_json f)))]) + let of_json j = + { + architecture = + (Util.option_map (Json.lookup j "architecture") + ArchitectureValues.of_json); + group_names = + (SecurityGroupStringList.of_json + (Util.of_option_exn (Json.lookup j "group_names"))); + group_ids = + (SecurityGroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "group_ids"))); + additional_info = + (Util.option_map (Json.lookup j "additional_info") String.of_json); + user_data = + (Util.option_map (Json.lookup j "user_data") UserData.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + placement = + (Util.option_map (Json.lookup j "placement") Placement.of_json); + monitoring = + (Util.option_map (Json.lookup j "monitoring") Boolean.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + instance_initiated_shutdown_behavior = + (Util.option_map + (Json.lookup j "instance_initiated_shutdown_behavior") + ShutdownBehavior.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json) + } + end +module VpcEndpointSet = + struct + type t = VpcEndpoint.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VpcEndpoint.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list VpcEndpoint.to_query v + let to_json v = `List (List.map VpcEndpoint.to_json v) + let of_json j = Json.to_list VpcEndpoint.of_json j + end +module ImageDiskContainerList = + struct + type t = ImageDiskContainer.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ImageDiskContainer.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ImageDiskContainer.to_query v + let to_json v = `List (List.map ImageDiskContainer.to_json v) + let of_json j = Json.to_list ImageDiskContainer.of_json j + end +module ClassicLinkInstanceList = + struct + type t = ClassicLinkInstance.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ClassicLinkInstance.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list ClassicLinkInstance.to_query v + let to_json v = `List (List.map ClassicLinkInstance.to_json v) + let of_json j = Json.to_list ClassicLinkInstance.of_json j + end +module ImageAttributeName = + struct + type t = + | Description + | Kernel + | Ramdisk + | LaunchPermission + | ProductCodes + | BlockDeviceMapping + | SriovNetSupport + let str_to_t = + [("sriovNetSupport", SriovNetSupport); + ("blockDeviceMapping", BlockDeviceMapping); + ("productCodes", ProductCodes); + ("launchPermission", LaunchPermission); + ("ramdisk", Ramdisk); + ("kernel", Kernel); + ("description", Description)] + let t_to_str = + [(SriovNetSupport, "sriovNetSupport"); + (BlockDeviceMapping, "blockDeviceMapping"); + (ProductCodes, "productCodes"); + (LaunchPermission, "launchPermission"); + (Ramdisk, "ramdisk"); + (Kernel, "kernel"); + (Description, "description")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module SnapshotList = + struct + type t = Snapshot.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Snapshot.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list Snapshot.to_query v + let to_json v = `List (List.map Snapshot.to_json v) + let of_json j = Json.to_list Snapshot.of_json j + end +module NetworkInterfaceAttribute = + struct + type t = + | Description + | GroupSet + | SourceDestCheck + | Attachment + let str_to_t = + [("attachment", Attachment); + ("sourceDestCheck", SourceDestCheck); + ("groupSet", GroupSet); + ("description", Description)] + let t_to_str = + [(Attachment, "attachment"); + (SourceDestCheck, "sourceDestCheck"); + (GroupSet, "groupSet"); + (Description, "description")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ReservedInstanceLimitPrice = + struct + type t = + { + amount: Double.t option ; + currency_code: CurrencyCodeValues.t option } + let make ?amount ?currency_code () = { amount; currency_code } + let parse xml = + Some + { + amount = (Util.option_bind (Xml.member "amount" xml) Double.parse); + currency_code = + (Util.option_bind (Xml.member "currencyCode" xml) + CurrencyCodeValues.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.currency_code + (fun f -> + Query.Pair ("CurrencyCode", (CurrencyCodeValues.to_query f))); + Util.option_map v.amount + (fun f -> Query.Pair ("Amount", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.currency_code + (fun f -> ("currency_code", (CurrencyCodeValues.to_json f))); + Util.option_map v.amount (fun f -> ("amount", (Double.to_json f)))]) + let of_json j = + { + amount = (Util.option_map (Json.lookup j "amount") Double.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") + CurrencyCodeValues.of_json) + } + end +module ResetImageAttributeName = + struct + type t = + | LaunchPermission + let str_to_t = [("launchPermission", LaunchPermission)] + let t_to_str = [(LaunchPermission, "launchPermission")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module NewDhcpConfigurationList = + struct + type t = NewDhcpConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NewDhcpConfiguration.parse (Xml.members "item" xml)) + let to_query v = Query.to_query_list NewDhcpConfiguration.to_query v + let to_json v = `List (List.map NewDhcpConfiguration.to_json v) + let of_json j = Json.to_list NewDhcpConfiguration.of_json j + end +module DescribeVpcAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_id: String.t ; + attribute: VpcAttributeName.t option } + let make ?dry_run ~vpc_id ?attribute () = + { dry_run; vpc_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)); + attribute = + (Util.option_bind (Xml.member "Attribute" xml) + VpcAttributeName.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> + Query.Pair ("Attribute", (VpcAttributeName.to_query f))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> ("attribute", (VpcAttributeName.to_json f))); + Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") + VpcAttributeName.of_json) + } + end +module DeleteNetworkAclRequest = + struct + type t = { + dry_run: Boolean.t option ; + network_acl_id: String.t } + let make ?dry_run ~network_acl_id () = { dry_run; network_acl_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_acl_id = + (Xml.required "networkAclId" + (Util.option_bind (Xml.member "networkAclId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NetworkAclId", (String.to_query v.network_acl_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("network_acl_id", (String.to_json v.network_acl_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_acl_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_acl_id"))) + } + end +module CreateImageRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + name: String.t ; + description: String.t option ; + no_reboot: Boolean.t option ; + block_device_mappings: BlockDeviceMappingRequestList.t } + let make ?dry_run ~instance_id ~name ?description ?no_reboot + ?(block_device_mappings= []) () = + { + dry_run; + instance_id; + name; + description; + no_reboot; + block_device_mappings + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + name = + (Xml.required "name" + (Util.option_bind (Xml.member "name" xml) String.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + no_reboot = + (Util.option_bind (Xml.member "noReboot" xml) Boolean.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingRequestList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("BlockDeviceMapping", + (BlockDeviceMappingRequestList.to_query + v.block_device_mappings))); + Util.option_map v.no_reboot + (fun f -> Query.Pair ("NoReboot", (Boolean.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("block_device_mappings", + (BlockDeviceMappingRequestList.to_json + v.block_device_mappings)); + Util.option_map v.no_reboot + (fun f -> ("no_reboot", (Boolean.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("name", (String.to_json v.name)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + no_reboot = + (Util.option_map (Json.lookup j "no_reboot") Boolean.of_json); + block_device_mappings = + (BlockDeviceMappingRequestList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))) + } + end +module DescribeNetworkInterfacesResult = + struct + type t = { + network_interfaces: NetworkInterfaceList.t } + let make ?(network_interfaces= []) () = { network_interfaces } + let parse xml = + Some + { + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "networkInterfaceSet" xml) + NetworkInterfaceList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NetworkInterfaceSet", + (NetworkInterfaceList.to_query v.network_interfaces)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("network_interfaces", + (NetworkInterfaceList.to_json v.network_interfaces))]) + let of_json j = + { + network_interfaces = + (NetworkInterfaceList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))) + } + end +module CreateVpcRequest = + struct + type t = + { + dry_run: Boolean.t option ; + cidr_block: String.t ; + instance_tenancy: Tenancy.t option } + let make ?dry_run ~cidr_block ?instance_tenancy () = + { dry_run; cidr_block; instance_tenancy } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + cidr_block = + (Xml.required "CidrBlock" + (Util.option_bind (Xml.member "CidrBlock" xml) String.parse)); + instance_tenancy = + (Util.option_bind (Xml.member "instanceTenancy" xml) + Tenancy.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_tenancy + (fun f -> Query.Pair ("InstanceTenancy", (Tenancy.to_query f))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_tenancy + (fun f -> ("instance_tenancy", (Tenancy.to_json f))); + Some ("cidr_block", (String.to_json v.cidr_block)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + instance_tenancy = + (Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json) + } + end +module DescribeTagsResult = + struct + type t = { + tags: TagDescriptionList.t ; + next_token: String.t option } + let make ?(tags= []) ?next_token () = { tags; next_token } + let parse xml = + Some + { + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tagSet" xml) + TagDescriptionList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("TagSet", (TagDescriptionList.to_query v.tags)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("tags", (TagDescriptionList.to_json v.tags))]) + let of_json j = + { + tags = + (TagDescriptionList.of_json + (Util.of_option_exn (Json.lookup j "tags"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeDhcpOptionsResult = + struct + type t = { + dhcp_options: DhcpOptionsList.t } + let make ?(dhcp_options= []) () = { dhcp_options } + let parse xml = + Some + { + dhcp_options = + (Util.of_option [] + (Util.option_bind (Xml.member "dhcpOptionsSet" xml) + DhcpOptionsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DhcpOptionsSet", + (DhcpOptionsList.to_query v.dhcp_options)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("dhcp_options", (DhcpOptionsList.to_json v.dhcp_options))]) + let of_json j = + { + dhcp_options = + (DhcpOptionsList.of_json + (Util.of_option_exn (Json.lookup j "dhcp_options"))) + } + end +module DescribeVpnGatewaysResult = + struct + type t = { + vpn_gateways: VpnGatewayList.t } + let make ?(vpn_gateways= []) () = { vpn_gateways } + let parse xml = + Some + { + vpn_gateways = + (Util.of_option [] + (Util.option_bind (Xml.member "vpnGatewaySet" xml) + VpnGatewayList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpnGatewaySet", (VpnGatewayList.to_query v.vpn_gateways)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpn_gateways", (VpnGatewayList.to_json v.vpn_gateways))]) + let of_json j = + { + vpn_gateways = + (VpnGatewayList.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateways"))) + } + end +module CreateImageResult = + struct + type t = { + image_id: String.t option } + let make ?image_id () = { image_id } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json) + } + end +module CreateNetworkAclRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpc_id: String.t } + let make ?dry_run ~vpc_id () = { dry_run; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module AuthorizeSecurityGroupEgressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_id: String.t ; + source_security_group_name: String.t option ; + source_security_group_owner_id: String.t option ; + ip_protocol: String.t option ; + from_port: Integer.t option ; + to_port: Integer.t option ; + cidr_ip: String.t option ; + ip_permissions: IpPermissionList.t } + let make ?dry_run ~group_id ?source_security_group_name + ?source_security_group_owner_id ?ip_protocol ?from_port ?to_port + ?cidr_ip ?(ip_permissions= []) () = + { + dry_run; + group_id; + source_security_group_name; + source_security_group_owner_id; + ip_protocol; + from_port; + to_port; + cidr_ip; + ip_permissions + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_id = + (Xml.required "groupId" + (Util.option_bind (Xml.member "groupId" xml) String.parse)); + source_security_group_name = + (Util.option_bind (Xml.member "sourceSecurityGroupName" xml) + String.parse); + source_security_group_owner_id = + (Util.option_bind (Xml.member "sourceSecurityGroupOwnerId" xml) + String.parse); + ip_protocol = + (Util.option_bind (Xml.member "ipProtocol" xml) String.parse); + from_port = + (Util.option_bind (Xml.member "fromPort" xml) Integer.parse); + to_port = + (Util.option_bind (Xml.member "toPort" xml) Integer.parse); + cidr_ip = (Util.option_bind (Xml.member "cidrIp" xml) String.parse); + ip_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "ipPermissions" xml) + IpPermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("IpPermissions", + (IpPermissionList.to_query v.ip_permissions))); + Util.option_map v.cidr_ip + (fun f -> Query.Pair ("CidrIp", (String.to_query f))); + Util.option_map v.to_port + (fun f -> Query.Pair ("ToPort", (Integer.to_query f))); + Util.option_map v.from_port + (fun f -> Query.Pair ("FromPort", (Integer.to_query f))); + Util.option_map v.ip_protocol + (fun f -> Query.Pair ("IpProtocol", (String.to_query f))); + Util.option_map v.source_security_group_owner_id + (fun f -> + Query.Pair + ("SourceSecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.source_security_group_name + (fun f -> + Query.Pair ("SourceSecurityGroupName", (String.to_query f))); + Some (Query.Pair ("GroupId", (String.to_query v.group_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("ip_permissions", (IpPermissionList.to_json v.ip_permissions)); + Util.option_map v.cidr_ip + (fun f -> ("cidr_ip", (String.to_json f))); + Util.option_map v.to_port + (fun f -> ("to_port", (Integer.to_json f))); + Util.option_map v.from_port + (fun f -> ("from_port", (Integer.to_json f))); + Util.option_map v.ip_protocol + (fun f -> ("ip_protocol", (String.to_json f))); + Util.option_map v.source_security_group_owner_id + (fun f -> ("source_security_group_owner_id", (String.to_json f))); + Util.option_map v.source_security_group_name + (fun f -> ("source_security_group_name", (String.to_json f))); + Some ("group_id", (String.to_json v.group_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_id = + (String.of_json (Util.of_option_exn (Json.lookup j "group_id"))); + source_security_group_name = + (Util.option_map (Json.lookup j "source_security_group_name") + String.of_json); + source_security_group_owner_id = + (Util.option_map (Json.lookup j "source_security_group_owner_id") + String.of_json); + ip_protocol = + (Util.option_map (Json.lookup j "ip_protocol") String.of_json); + from_port = + (Util.option_map (Json.lookup j "from_port") Integer.of_json); + to_port = (Util.option_map (Json.lookup j "to_port") Integer.of_json); + cidr_ip = (Util.option_map (Json.lookup j "cidr_ip") String.of_json); + ip_permissions = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions"))) + } + end +module CopyImageRequest = + struct + type t = + { + dry_run: Boolean.t option ; + source_region: String.t ; + source_image_id: String.t ; + name: String.t ; + description: String.t option ; + client_token: String.t option } + let make ?dry_run ~source_region ~source_image_id ~name ?description + ?client_token () = + { + dry_run; + source_region; + source_image_id; + name; + description; + client_token + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + source_region = + (Xml.required "SourceRegion" + (Util.option_bind (Xml.member "SourceRegion" xml) String.parse)); + source_image_id = + (Xml.required "SourceImageId" + (Util.option_bind (Xml.member "SourceImageId" xml) + String.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + client_token = + (Util.option_bind (Xml.member "ClientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair - ( "NetworkInterfaceId" - , NetworkInterfaceIdList.to_query v.network_interface_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some - ( "network_interface_ids" - , NetworkInterfaceIdList.to_json v.network_interface_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_ids = - NetworkInterfaceIdList.of_json - (Util.of_option_exn (Json.lookup j "network_interface_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeAccountAttributesRequest = struct - type t = - { dry_run : Boolean.t option - ; attribute_names : AccountAttributeNameStringList.t - } - - let make ?dry_run ?(attribute_names = []) () = { dry_run; attribute_names } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; attribute_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "attributeName" xml) - AccountAttributeNameStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SourceImageId", (String.to_query v.source_image_id))); + Some + (Query.Pair ("SourceRegion", (String.to_query v.source_region))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("name", (String.to_json v.name)); + Some ("source_image_id", (String.to_json v.source_image_id)); + Some ("source_region", (String.to_json v.source_region)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + source_region = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_region"))); + source_image_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_image_id"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module DescribeNetworkInterfaceAttributeResult = + struct + type t = + { + network_interface_id: String.t option ; + description: AttributeValue.t option ; + source_dest_check: AttributeBooleanValue.t option ; + groups: GroupIdentifierList.t ; + attachment: NetworkInterfaceAttachment.t option } + let make ?network_interface_id ?description ?source_dest_check + ?(groups= []) ?attachment () = + { + network_interface_id; + description; + source_dest_check; + groups; + attachment + } + let parse xml = + Some + { + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + description = + (Util.option_bind (Xml.member "description" xml) + AttributeValue.parse); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + AttributeBooleanValue.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)); + attachment = + (Util.option_bind (Xml.member "attachment" xml) + NetworkInterfaceAttachment.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attachment + (fun f -> + Query.Pair + ("Attachment", (NetworkInterfaceAttachment.to_query f))); + Some (Query.Pair - ( "AttributeName" - , AccountAttributeNameStringList.to_query v.attribute_names )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("attribute_names", AccountAttributeNameStringList.to_json v.attribute_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; attribute_names = - AccountAttributeNameStringList.of_json - (Util.of_option_exn (Json.lookup j "attribute_names")) - } -end - -module DescribeConversionTasksRequest = struct - type t = - { dry_run : Boolean.t option - ; filters : FilterList.t - ; conversion_task_ids : ConversionIdStringList.t - } - - let make ?dry_run ?(filters = []) ?(conversion_task_ids = []) () = - { dry_run; filters; conversion_task_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "filter" xml) FilterList.parse) - ; conversion_task_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "conversionTaskId" xml) - ConversionIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.source_dest_check + (fun f -> + Query.Pair + ("SourceDestCheck", (AttributeBooleanValue.to_query f))); + Util.option_map v.description + (fun f -> + Query.Pair ("Description", (AttributeValue.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attachment + (fun f -> + ("attachment", (NetworkInterfaceAttachment.to_json f))); + Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.source_dest_check + (fun f -> + ("source_dest_check", (AttributeBooleanValue.to_json f))); + Util.option_map v.description + (fun f -> ("description", (AttributeValue.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f)))]) + let of_json j = + { + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") + AttributeValue.of_json); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + AttributeBooleanValue.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + attachment = + (Util.option_map (Json.lookup j "attachment") + NetworkInterfaceAttachment.of_json) + } + end +module DescribeReservedInstancesModificationsResult = + struct + type t = + { + reserved_instances_modifications: ReservedInstancesModificationList.t ; + next_token: String.t option } + let make ?(reserved_instances_modifications= []) ?next_token () = + { reserved_instances_modifications; next_token } + let parse xml = + Some + { + reserved_instances_modifications = + (Util.of_option [] + (Util.option_bind + (Xml.member "reservedInstancesModificationsSet" xml) + ReservedInstancesModificationList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("ConversionTaskId", ConversionIdStringList.to_query v.conversion_task_ids)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("conversion_task_ids", ConversionIdStringList.to_json v.conversion_task_ids) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; conversion_task_ids = - ConversionIdStringList.of_json - (Util.of_option_exn (Json.lookup j "conversion_task_ids")) - } -end - -module ModifyVpcEndpointRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_endpoint_id : String.t - ; reset_policy : Boolean.t option - ; policy_document : String.t option - ; add_route_table_ids : ValueStringList.t - ; remove_route_table_ids : ValueStringList.t - } - - let make - ?dry_run - ~vpc_endpoint_id - ?reset_policy - ?policy_document - ?(add_route_table_ids = []) - ?(remove_route_table_ids = []) - () = - { dry_run - ; vpc_endpoint_id - ; reset_policy - ; policy_document - ; add_route_table_ids - ; remove_route_table_ids - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; vpc_endpoint_id = - Xml.required - "VpcEndpointId" - (Util.option_bind (Xml.member "VpcEndpointId" xml) String.parse) - ; reset_policy = Util.option_bind (Xml.member "ResetPolicy" xml) Boolean.parse - ; policy_document = Util.option_bind (Xml.member "PolicyDocument" xml) String.parse - ; add_route_table_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "AddRouteTableId" xml) ValueStringList.parse) - ; remove_route_table_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "RemoveRouteTableId" xml) ValueStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ReservedInstancesModificationsSet", + (ReservedInstancesModificationList.to_query + v.reserved_instances_modifications)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("reserved_instances_modifications", + (ReservedInstancesModificationList.to_json + v.reserved_instances_modifications))]) + let of_json j = + { + reserved_instances_modifications = + (ReservedInstancesModificationList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_modifications"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeReservedInstancesResult = + struct + type t = { + reserved_instances: ReservedInstancesList.t } + let make ?(reserved_instances= []) () = { reserved_instances } + let parse xml = + Some + { + reserved_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "reservedInstancesSet" xml) + ReservedInstancesList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesSet", + (ReservedInstancesList.to_query v.reserved_instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_instances", + (ReservedInstancesList.to_json v.reserved_instances))]) + let of_json j = + { + reserved_instances = + (ReservedInstancesList.of_json + (Util.of_option_exn (Json.lookup j "reserved_instances"))) + } + end +module CreateNetworkAclEntryRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_acl_id: String.t ; + rule_number: Integer.t ; + protocol: String.t ; + rule_action: RuleAction.t ; + egress: Boolean.t ; + cidr_block: String.t ; + icmp_type_code: IcmpTypeCode.t option ; + port_range: PortRange.t option } + let make ?dry_run ~network_acl_id ~rule_number ~protocol ~rule_action + ~egress ~cidr_block ?icmp_type_code ?port_range () = + { + dry_run; + network_acl_id; + rule_number; + protocol; + rule_action; + egress; + cidr_block; + icmp_type_code; + port_range + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_acl_id = + (Xml.required "networkAclId" + (Util.option_bind (Xml.member "networkAclId" xml) String.parse)); + rule_number = + (Xml.required "ruleNumber" + (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse)); + protocol = + (Xml.required "protocol" + (Util.option_bind (Xml.member "protocol" xml) String.parse)); + rule_action = + (Xml.required "ruleAction" + (Util.option_bind (Xml.member "ruleAction" xml) + RuleAction.parse)); + egress = + (Xml.required "egress" + (Util.option_bind (Xml.member "egress" xml) Boolean.parse)); + cidr_block = + (Xml.required "cidrBlock" + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse)); + icmp_type_code = + (Util.option_bind (Xml.member "Icmp" xml) IcmpTypeCode.parse); + port_range = + (Util.option_bind (Xml.member "portRange" xml) PortRange.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> Query.Pair ("PortRange", (PortRange.to_query f))); + Util.option_map v.icmp_type_code + (fun f -> Query.Pair ("Icmp", (IcmpTypeCode.to_query f))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Some (Query.Pair ("Egress", (Boolean.to_query v.egress))); + Some + (Query.Pair ("RuleAction", (RuleAction.to_query v.rule_action))); + Some (Query.Pair ("Protocol", (String.to_query v.protocol))); + Some (Query.Pair ("RuleNumber", (Integer.to_query v.rule_number))); + Some + (Query.Pair ("NetworkAclId", (String.to_query v.network_acl_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> ("port_range", (PortRange.to_json f))); + Util.option_map v.icmp_type_code + (fun f -> ("icmp_type_code", (IcmpTypeCode.to_json f))); + Some ("cidr_block", (String.to_json v.cidr_block)); + Some ("egress", (Boolean.to_json v.egress)); + Some ("rule_action", (RuleAction.to_json v.rule_action)); + Some ("protocol", (String.to_json v.protocol)); + Some ("rule_number", (Integer.to_json v.rule_number)); + Some ("network_acl_id", (String.to_json v.network_acl_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_acl_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_acl_id"))); + rule_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number"))); + protocol = + (String.of_json (Util.of_option_exn (Json.lookup j "protocol"))); + rule_action = + (RuleAction.of_json + (Util.of_option_exn (Json.lookup j "rule_action"))); + egress = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "egress"))); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + icmp_type_code = + (Util.option_map (Json.lookup j "icmp_type_code") + IcmpTypeCode.of_json); + port_range = + (Util.option_map (Json.lookup j "port_range") PortRange.of_json) + } + end +module DescribeTagsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + filters: FilterList.t ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?dry_run ?(filters= []) ?max_results ?next_token () = + { dry_run; filters; max_results; next_token } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribePlacementGroupsResult = + struct + type t = { + placement_groups: PlacementGroupList.t } + let make ?(placement_groups= []) () = { placement_groups } + let parse xml = + Some + { + placement_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "placementGroupSet" xml) + PlacementGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PlacementGroupSet", + (PlacementGroupList.to_query v.placement_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("placement_groups", + (PlacementGroupList.to_json v.placement_groups))]) + let of_json j = + { + placement_groups = + (PlacementGroupList.of_json + (Util.of_option_exn (Json.lookup j "placement_groups"))) + } + end +module CreateSubnetRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_id: String.t ; + cidr_block: String.t ; + availability_zone: String.t option } + let make ?dry_run ~vpc_id ~cidr_block ?availability_zone () = + { dry_run; vpc_id; cidr_block; availability_zone } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)); + cidr_block = + (Xml.required "CidrBlock" + (Util.option_bind (Xml.member "CidrBlock" xml) String.parse)); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Some ("cidr_block", (String.to_json v.cidr_block)); + Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json) + } + end +module DeletePlacementGroupRequest = + struct + type t = { + dry_run: Boolean.t option ; + group_name: String.t } + let make ?dry_run ~group_name () = { dry_run; group_name } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Xml.required "groupName" + (Util.option_bind (Xml.member "groupName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("GroupName", (String.to_query v.group_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("group_name", (String.to_json v.group_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (String.of_json (Util.of_option_exn (Json.lookup j "group_name"))) + } + end +module DescribeKeyPairsResult = + struct + type t = { + key_pairs: KeyPairList.t } + let make ?(key_pairs= []) () = { key_pairs } + let parse xml = + Some + { + key_pairs = + (Util.of_option [] + (Util.option_bind (Xml.member "keySet" xml) KeyPairList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("KeySet", (KeyPairList.to_query v.key_pairs)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("key_pairs", (KeyPairList.to_json v.key_pairs))]) + let of_json j = + { + key_pairs = + (KeyPairList.of_json + (Util.of_option_exn (Json.lookup j "key_pairs"))) + } + end +module CancelSpotInstanceRequestsResult = + struct + type t = + { + cancelled_spot_instance_requests: CancelledSpotInstanceRequestList.t } + let make ?(cancelled_spot_instance_requests= []) () = + { cancelled_spot_instance_requests } + let parse xml = + Some + { + cancelled_spot_instance_requests = + (Util.of_option [] + (Util.option_bind (Xml.member "spotInstanceRequestSet" xml) + CancelledSpotInstanceRequestList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotInstanceRequestSet", + (CancelledSpotInstanceRequestList.to_query + v.cancelled_spot_instance_requests)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cancelled_spot_instance_requests", + (CancelledSpotInstanceRequestList.to_json + v.cancelled_spot_instance_requests))]) + let of_json j = + { + cancelled_spot_instance_requests = + (CancelledSpotInstanceRequestList.of_json + (Util.of_option_exn + (Json.lookup j "cancelled_spot_instance_requests"))) + } + end +module CreateSpotDatafeedSubscriptionResult = + struct + type t = { + spot_datafeed_subscription: SpotDatafeedSubscription.t option } + let make ?spot_datafeed_subscription () = { spot_datafeed_subscription } + let parse xml = + Some + { + spot_datafeed_subscription = + (Util.option_bind (Xml.member "spotDatafeedSubscription" xml) + SpotDatafeedSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.spot_datafeed_subscription + (fun f -> + Query.Pair + ("SpotDatafeedSubscription", + (SpotDatafeedSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.spot_datafeed_subscription + (fun f -> + ("spot_datafeed_subscription", + (SpotDatafeedSubscription.to_json f)))]) + let of_json j = + { + spot_datafeed_subscription = + (Util.option_map (Json.lookup j "spot_datafeed_subscription") + SpotDatafeedSubscription.of_json) + } + end +module ModifyImageAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_id: String.t ; + attribute: String.t option ; + operation_type: OperationType.t option ; + user_ids: UserIdStringList.t ; + user_groups: UserGroupStringList.t ; + product_codes: ProductCodeStringList.t ; + value: String.t option ; + launch_permission: LaunchPermissionModifications.t option ; + description: AttributeValue.t option } + let make ?dry_run ~image_id ?attribute ?operation_type ?(user_ids= + []) ?(user_groups= []) ?(product_codes= []) ?value + ?launch_permission ?description () = + { + dry_run; + image_id; + attribute; + operation_type; + user_ids; + user_groups; + product_codes; + value; + launch_permission; + description + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)); + attribute = + (Util.option_bind (Xml.member "Attribute" xml) String.parse); + operation_type = + (Util.option_bind (Xml.member "OperationType" xml) + OperationType.parse); + user_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "UserId" xml) + UserIdStringList.parse)); + user_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "UserGroup" xml) + UserGroupStringList.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "ProductCode" xml) + ProductCodeStringList.parse)); + value = (Util.option_bind (Xml.member "Value" xml) String.parse); + launch_permission = + (Util.option_bind (Xml.member "LaunchPermission" xml) + LaunchPermissionModifications.parse); + description = + (Util.option_bind (Xml.member "Description" xml) + AttributeValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> + Query.Pair ("Description", (AttributeValue.to_query f))); + Util.option_map v.launch_permission + (fun f -> + Query.Pair + ("LaunchPermission", + (LaunchPermissionModifications.to_query f))); + Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Some (Query.Pair - ("RemoveRouteTableId", ValueStringList.to_query v.remove_route_table_ids)) - ; Some + ("ProductCode", + (ProductCodeStringList.to_query v.product_codes))); + Some (Query.Pair - ("AddRouteTableId", ValueStringList.to_query v.add_route_table_ids)) - ; Util.option_map v.policy_document (fun f -> - Query.Pair ("PolicyDocument", String.to_query f)) - ; Util.option_map v.reset_policy (fun f -> - Query.Pair ("ResetPolicy", Boolean.to_query f)) - ; Some (Query.Pair ("VpcEndpointId", String.to_query v.vpc_endpoint_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("remove_route_table_ids", ValueStringList.to_json v.remove_route_table_ids) - ; Some ("add_route_table_ids", ValueStringList.to_json v.add_route_table_ids) - ; Util.option_map v.policy_document (fun f -> - "policy_document", String.to_json f) - ; Util.option_map v.reset_policy (fun f -> "reset_policy", Boolean.to_json f) - ; Some ("vpc_endpoint_id", String.to_json v.vpc_endpoint_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_endpoint_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpc_endpoint_id")) - ; reset_policy = Util.option_map (Json.lookup j "reset_policy") Boolean.of_json - ; policy_document = Util.option_map (Json.lookup j "policy_document") String.of_json - ; add_route_table_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "add_route_table_ids")) - ; remove_route_table_ids = - ValueStringList.of_json - (Util.of_option_exn (Json.lookup j "remove_route_table_ids")) - } -end - -module ModifyVolumeAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - ; auto_enable_i_o : AttributeBooleanValue.t option - } - - let make ?dry_run ~volume_id ?auto_enable_i_o () = - { dry_run; volume_id; auto_enable_i_o } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - ; auto_enable_i_o = - Util.option_bind (Xml.member "AutoEnableIO" xml) AttributeBooleanValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.auto_enable_i_o (fun f -> - Query.Pair ("AutoEnableIO", AttributeBooleanValue.to_query f)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.auto_enable_i_o (fun f -> - "auto_enable_i_o", AttributeBooleanValue.to_json f) - ; Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; auto_enable_i_o = - Util.option_map (Json.lookup j "auto_enable_i_o") AttributeBooleanValue.of_json - } -end - -module AttachVpnGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_gateway_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~vpn_gateway_id ~vpc_id () = { dry_run; vpn_gateway_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_gateway_id = - Xml.required - "VpnGatewayId" - (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse) - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("VpnGatewayId", String.to_query v.vpn_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("vpn_gateway_id", String.to_json v.vpn_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_gateway_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module AcceptVpcPeeringConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_peering_connection_id : String.t option - } - - let make ?dry_run ?vpc_peering_connection_id () = { dry_run; vpc_peering_connection_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_peering_connection_id = - Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - Query.Pair ("VpcPeeringConnectionId", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - "vpc_peering_connection_id", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_peering_connection_id = - Util.option_map (Json.lookup j "vpc_peering_connection_id") String.of_json - } -end - -module ResetSnapshotAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; snapshot_id : String.t - ; attribute : SnapshotAttributeName.t - } - - let make ?dry_run ~snapshot_id ~attribute () = { dry_run; snapshot_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; snapshot_id = - Xml.required - "SnapshotId" - (Util.option_bind (Xml.member "SnapshotId" xml) String.parse) - ; attribute = - Xml.required - "Attribute" - (Util.option_bind (Xml.member "Attribute" xml) SnapshotAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", SnapshotAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", SnapshotAttributeName.to_json v.attribute) - ; Some ("snapshot_id", String.to_json v.snapshot_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - ; attribute = - SnapshotAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module DescribeAvailabilityZonesRequest = struct - type t = - { dry_run : Boolean.t option - ; zone_names : ZoneNameStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(zone_names = []) ?(filters = []) () = - { dry_run; zone_names; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; zone_names = - Util.of_option - [] - (Util.option_bind (Xml.member "ZoneName" xml) ZoneNameStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("ZoneName", ZoneNameStringList.to_query v.zone_names)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("zone_names", ZoneNameStringList.to_json v.zone_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; zone_names = - ZoneNameStringList.of_json (Util.of_option_exn (Json.lookup j "zone_names")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module StopInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - ; force : Boolean.t option - } - - let make ?dry_run ~instance_ids ?force () = { dry_run; instance_ids; force } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - ; force = Util.option_bind (Xml.member "force" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> Query.Pair ("Force", Boolean.to_query f)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> "force", Boolean.to_json f) - ; Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; force = Util.option_map (Json.lookup j "force") Boolean.of_json - } -end - -module DescribeImportImageTasksRequest = struct - type t = - { dry_run : Boolean.t option - ; import_task_ids : ImportTaskIdList.t - ; next_token : String.t option - ; max_results : Integer.t option - ; filters : FilterList.t - } - - let make ?dry_run ?(import_task_ids = []) ?next_token ?max_results ?(filters = []) () = - { dry_run; import_task_ids; next_token; max_results; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; import_task_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "ImportTaskId" xml) ImportTaskIdList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filters", FilterList.to_query v.filters)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("ImportTaskId", ImportTaskIdList.to_query v.import_task_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("import_task_ids", ImportTaskIdList.to_json v.import_task_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; import_task_ids = - ImportTaskIdList.of_json (Util.of_option_exn (Json.lookup j "import_task_ids")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ?(instance_ids = []) ?(filters = []) ?next_token ?max_results () = - { dry_run; instance_ids; filters; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module DescribeVpnGatewaysRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_gateway_ids : VpnGatewayIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(vpn_gateway_ids = []) ?(filters = []) () = - { dry_run; vpn_gateway_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_gateway_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpnGatewayId" xml) - VpnGatewayIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("UserGroup", (UserGroupStringList.to_query v.user_groups))); + Some + (Query.Pair ("UserId", (UserIdStringList.to_query v.user_ids))); + Util.option_map v.operation_type + (fun f -> + Query.Pair ("OperationType", (OperationType.to_query f))); + Util.option_map v.attribute + (fun f -> Query.Pair ("Attribute", (String.to_query f))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (AttributeValue.to_json f))); + Util.option_map v.launch_permission + (fun f -> + ("launch_permission", + (LaunchPermissionModifications.to_json f))); + Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Some + ("product_codes", + (ProductCodeStringList.to_json v.product_codes)); + Some ("user_groups", (UserGroupStringList.to_json v.user_groups)); + Some ("user_ids", (UserIdStringList.to_json v.user_ids)); + Util.option_map v.operation_type + (fun f -> ("operation_type", (OperationType.to_json f))); + Util.option_map v.attribute + (fun f -> ("attribute", (String.to_json f))); + Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") String.of_json); + operation_type = + (Util.option_map (Json.lookup j "operation_type") + OperationType.of_json); + user_ids = + (UserIdStringList.of_json + (Util.of_option_exn (Json.lookup j "user_ids"))); + user_groups = + (UserGroupStringList.of_json + (Util.of_option_exn (Json.lookup j "user_groups"))); + product_codes = + (ProductCodeStringList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))); + value = (Util.option_map (Json.lookup j "value") String.of_json); + launch_permission = + (Util.option_map (Json.lookup j "launch_permission") + LaunchPermissionModifications.of_json); + description = + (Util.option_map (Json.lookup j "description") + AttributeValue.of_json) + } + end +module DescribeInstanceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + attribute: InstanceAttributeName.t } + let make ?dry_run ~instance_id ~attribute () = + { dry_run; instance_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + attribute = + (Xml.required "attribute" + (Util.option_bind (Xml.member "attribute" xml) + InstanceAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", (InstanceAttributeName.to_query v.attribute))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (InstanceAttributeName.to_json v.attribute)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + attribute = + (InstanceAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module DescribeBundleTasksRequest = + struct + type t = + { + dry_run: Boolean.t option ; + bundle_ids: BundleIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(bundle_ids= []) ?(filters= []) () = + { dry_run; bundle_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + bundle_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "BundleId" xml) + BundleIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ("VpnGatewayId", VpnGatewayIdStringList.to_query v.vpn_gateway_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("vpn_gateway_ids", VpnGatewayIdStringList.to_json v.vpn_gateway_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_gateway_ids = - VpnGatewayIdStringList.of_json - (Util.of_option_exn (Json.lookup j "vpn_gateway_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module UnmonitorInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - } - - let make ?dry_run ~instance_ids () = { dry_run; instance_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - } -end - -module ImportKeyPairRequest = struct - type t = - { dry_run : Boolean.t option - ; key_name : String.t - ; public_key_material : Blob.t - } - - let make ?dry_run ~key_name ~public_key_material () = - { dry_run; key_name; public_key_material } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; key_name = - Xml.required - "keyName" - (Util.option_bind (Xml.member "keyName" xml) String.parse) - ; public_key_material = - Xml.required - "publicKeyMaterial" - (Util.option_bind (Xml.member "publicKeyMaterial" xml) Blob.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PublicKeyMaterial", Blob.to_query v.public_key_material)) - ; Some (Query.Pair ("KeyName", String.to_query v.key_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("public_key_material", Blob.to_json v.public_key_material) - ; Some ("key_name", String.to_json v.key_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; key_name = String.of_json (Util.of_option_exn (Json.lookup j "key_name")) - ; public_key_material = - Blob.of_json (Util.of_option_exn (Json.lookup j "public_key_material")) - } -end - -module DescribeSpotFleetRequestsRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_fleet_request_ids : ValueStringList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ?(spot_fleet_request_ids = []) ?next_token ?max_results () = - { dry_run; spot_fleet_request_ids; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_fleet_request_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "spotFleetRequestId" xml) ValueStringList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("BundleId", (BundleIdStringList.to_query v.bundle_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("bundle_ids", (BundleIdStringList.to_json v.bundle_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + bundle_ids = + (BundleIdStringList.of_json + (Util.of_option_exn (Json.lookup j "bundle_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeConversionTasksResult = + struct + type t = { + conversion_tasks: DescribeConversionTaskList.t } + let make ?(conversion_tasks= []) () = { conversion_tasks } + let parse xml = + Some + { + conversion_tasks = + (Util.of_option [] + (Util.option_bind (Xml.member "conversionTasks" xml) + DescribeConversionTaskList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ConversionTasks", + (DescribeConversionTaskList.to_query v.conversion_tasks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("conversion_tasks", + (DescribeConversionTaskList.to_json v.conversion_tasks))]) + let of_json j = + { + conversion_tasks = + (DescribeConversionTaskList.of_json + (Util.of_option_exn (Json.lookup j "conversion_tasks"))) + } + end +module CreateInstanceExportTaskRequest = + struct + type t = + { + description: String.t option ; + instance_id: String.t ; + target_environment: ExportEnvironment.t option ; + export_to_s3_task: ExportToS3TaskSpecification.t option } + let make ?description ~instance_id ?target_environment + ?export_to_s3_task () = + { description; instance_id; target_environment; export_to_s3_task } + let parse xml = + Some + { + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + target_environment = + (Util.option_bind (Xml.member "targetEnvironment" xml) + ExportEnvironment.parse); + export_to_s3_task = + (Util.option_bind (Xml.member "exportToS3" xml) + ExportToS3TaskSpecification.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.export_to_s3_task + (fun f -> + Query.Pair + ("ExportToS3", (ExportToS3TaskSpecification.to_query f))); + Util.option_map v.target_environment + (fun f -> + Query.Pair + ("TargetEnvironment", (ExportEnvironment.to_query f))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.export_to_s3_task + (fun f -> + ("export_to_s3_task", + (ExportToS3TaskSpecification.to_json f))); + Util.option_map v.target_environment + (fun f -> ("target_environment", (ExportEnvironment.to_json f))); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f)))]) + let of_json j = + { + description = + (Util.option_map (Json.lookup j "description") String.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + target_environment = + (Util.option_map (Json.lookup j "target_environment") + ExportEnvironment.of_json); + export_to_s3_task = + (Util.option_map (Json.lookup j "export_to_s3_task") + ExportToS3TaskSpecification.of_json) + } + end +module ResetNetworkInterfaceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_interface_id: String.t ; + source_dest_check: String.t option } + let make ?dry_run ~network_interface_id ?source_dest_check () = + { dry_run; network_interface_id; source_dest_check } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.source_dest_check + (fun f -> Query.Pair ("SourceDestCheck", (String.to_query f))); + Some (Query.Pair - ("SpotFleetRequestId", ValueStringList.to_query v.spot_fleet_request_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ("spot_fleet_request_ids", ValueStringList.to_json v.spot_fleet_request_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_fleet_request_ids = - ValueStringList.of_json - (Util.of_option_exn (Json.lookup j "spot_fleet_request_ids")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module DescribeSpotDatafeedSubscriptionResult = struct - type t = { spot_datafeed_subscription : SpotDatafeedSubscription.t option } - - let make ?spot_datafeed_subscription () = { spot_datafeed_subscription } - - let parse xml = - Some - { spot_datafeed_subscription = - Util.option_bind - (Xml.member "spotDatafeedSubscription" xml) - SpotDatafeedSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.spot_datafeed_subscription (fun f -> - Query.Pair ("SpotDatafeedSubscription", SpotDatafeedSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.spot_datafeed_subscription (fun f -> - "spot_datafeed_subscription", SpotDatafeedSubscription.to_json f) - ]) - - let of_json j = - { spot_datafeed_subscription = - Util.option_map - (Json.lookup j "spot_datafeed_subscription") - SpotDatafeedSubscription.of_json - } -end - -module RevokeSecurityGroupEgressRequest = struct - type t = - { dry_run : Boolean.t option - ; group_id : String.t - ; source_security_group_name : String.t option - ; source_security_group_owner_id : String.t option - ; ip_protocol : String.t option - ; from_port : Integer.t option - ; to_port : Integer.t option - ; cidr_ip : String.t option - ; ip_permissions : IpPermissionList.t - } - - let make - ?dry_run - ~group_id - ?source_security_group_name - ?source_security_group_owner_id - ?ip_protocol - ?from_port - ?to_port - ?cidr_ip - ?(ip_permissions = []) - () = - { dry_run - ; group_id - ; source_security_group_name - ; source_security_group_owner_id - ; ip_protocol - ; from_port - ; to_port - ; cidr_ip - ; ip_permissions - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_id = - Xml.required - "groupId" - (Util.option_bind (Xml.member "groupId" xml) String.parse) - ; source_security_group_name = - Util.option_bind (Xml.member "sourceSecurityGroupName" xml) String.parse - ; source_security_group_owner_id = - Util.option_bind (Xml.member "sourceSecurityGroupOwnerId" xml) String.parse - ; ip_protocol = Util.option_bind (Xml.member "ipProtocol" xml) String.parse - ; from_port = Util.option_bind (Xml.member "fromPort" xml) Integer.parse - ; to_port = Util.option_bind (Xml.member "toPort" xml) Integer.parse - ; cidr_ip = Util.option_bind (Xml.member "cidrIp" xml) String.parse - ; ip_permissions = - Util.of_option - [] - (Util.option_bind (Xml.member "ipPermissions" xml) IpPermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IpPermissions", IpPermissionList.to_query v.ip_permissions)) - ; Util.option_map v.cidr_ip (fun f -> Query.Pair ("CidrIp", String.to_query f)) - ; Util.option_map v.to_port (fun f -> Query.Pair ("ToPort", Integer.to_query f)) - ; Util.option_map v.from_port (fun f -> - Query.Pair ("FromPort", Integer.to_query f)) - ; Util.option_map v.ip_protocol (fun f -> - Query.Pair ("IpProtocol", String.to_query f)) - ; Util.option_map v.source_security_group_owner_id (fun f -> - Query.Pair ("SourceSecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.source_security_group_name (fun f -> - Query.Pair ("SourceSecurityGroupName", String.to_query f)) - ; Some (Query.Pair ("GroupId", String.to_query v.group_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("ip_permissions", IpPermissionList.to_json v.ip_permissions) - ; Util.option_map v.cidr_ip (fun f -> "cidr_ip", String.to_json f) - ; Util.option_map v.to_port (fun f -> "to_port", Integer.to_json f) - ; Util.option_map v.from_port (fun f -> "from_port", Integer.to_json f) - ; Util.option_map v.ip_protocol (fun f -> "ip_protocol", String.to_json f) - ; Util.option_map v.source_security_group_owner_id (fun f -> - "source_security_group_owner_id", String.to_json f) - ; Util.option_map v.source_security_group_name (fun f -> - "source_security_group_name", String.to_json f) - ; Some ("group_id", String.to_json v.group_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_id = String.of_json (Util.of_option_exn (Json.lookup j "group_id")) - ; source_security_group_name = - Util.option_map (Json.lookup j "source_security_group_name") String.of_json - ; source_security_group_owner_id = - Util.option_map (Json.lookup j "source_security_group_owner_id") String.of_json - ; ip_protocol = Util.option_map (Json.lookup j "ip_protocol") String.of_json - ; from_port = Util.option_map (Json.lookup j "from_port") Integer.of_json - ; to_port = Util.option_map (Json.lookup j "to_port") Integer.of_json - ; cidr_ip = Util.option_map (Json.lookup j "cidr_ip") String.of_json - ; ip_permissions = - IpPermissionList.of_json (Util.of_option_exn (Json.lookup j "ip_permissions")) - } -end - -module DescribeInternetGatewaysRequest = struct - type t = - { dry_run : Boolean.t option - ; internet_gateway_ids : ValueStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(internet_gateway_ids = []) ?(filters = []) () = - { dry_run; internet_gateway_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; internet_gateway_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "internetGatewayId" xml) ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("NetworkInterfaceId", + (String.to_query v.network_interface_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.source_dest_check + (fun f -> ("source_dest_check", (String.to_json f))); + Some + ("network_interface_id", + (String.to_json v.network_interface_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") String.of_json) + } + end +module CreateSecurityGroupResult = + struct + type t = { + group_id: String.t } + let make ~group_id () = { group_id } + let parse xml = + Some + { + group_id = + (Xml.required "groupId" + (Util.option_bind (Xml.member "groupId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("GroupId", (String.to_query v.group_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("group_id", (String.to_json v.group_id))]) + let of_json j = + { + group_id = + (String.of_json (Util.of_option_exn (Json.lookup j "group_id"))) + } + end +module DescribeSpotFleetRequestHistoryResponse = + struct + type t = + { + spot_fleet_request_id: String.t ; + start_time: DateTime.t ; + last_evaluated_time: DateTime.t ; + history_records: HistoryRecords.t ; + next_token: String.t option } + let make ~spot_fleet_request_id ~start_time ~last_evaluated_time + ~history_records ?next_token () = + { + spot_fleet_request_id; + start_time; + last_evaluated_time; + history_records; + next_token + } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + start_time = + (Xml.required "startTime" + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse)); + last_evaluated_time = + (Xml.required "lastEvaluatedTime" + (Util.option_bind (Xml.member "lastEvaluatedTime" xml) + DateTime.parse)); + history_records = + (Xml.required "historyRecordSet" + (Util.option_bind (Xml.member "historyRecordSet" xml) + HistoryRecords.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("InternetGatewayId", ValueStringList.to_query v.internet_gateway_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("internet_gateway_ids", ValueStringList.to_json v.internet_gateway_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; internet_gateway_ids = - ValueStringList.of_json - (Util.of_option_exn (Json.lookup j "internet_gateway_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DeleteVpcPeeringConnectionResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module DescribeReservedInstancesModificationsRequest = struct - type t = - { reserved_instances_modification_ids : ReservedInstancesModificationIdStringList.t - ; next_token : String.t option - ; filters : FilterList.t - } - - let make ?(reserved_instances_modification_ids = []) ?next_token ?(filters = []) () = - { reserved_instances_modification_ids; next_token; filters } - - let parse xml = - Some - { reserved_instances_modification_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedInstancesModificationId" xml) - ReservedInstancesModificationIdStringList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("HistoryRecordSet", + (HistoryRecords.to_query v.history_records))); + Some (Query.Pair - ( "ReservedInstancesModificationId" - , ReservedInstancesModificationIdStringList.to_query - v.reserved_instances_modification_ids )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "reserved_instances_modification_ids" - , ReservedInstancesModificationIdStringList.to_json - v.reserved_instances_modification_ids ) - ]) - - let of_json j = - { reserved_instances_modification_ids = - ReservedInstancesModificationIdStringList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_modification_ids")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeSpotFleetRequestsResponse = struct - type t = - { spot_fleet_request_configs : SpotFleetRequestConfigSet.t - ; next_token : String.t option - } - - let make ~spot_fleet_request_configs ?next_token () = - { spot_fleet_request_configs; next_token } - - let parse xml = - Some - { spot_fleet_request_configs = - Xml.required - "spotFleetRequestConfigSet" - (Util.option_bind - (Xml.member "spotFleetRequestConfigSet" xml) - SpotFleetRequestConfigSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("LastEvaluatedTime", + (DateTime.to_query v.last_evaluated_time))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Some (Query.Pair - ( "SpotFleetRequestConfigSet" - , SpotFleetRequestConfigSet.to_query v.spot_fleet_request_configs )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "spot_fleet_request_configs" - , SpotFleetRequestConfigSet.to_json v.spot_fleet_request_configs ) - ]) - - let of_json j = - { spot_fleet_request_configs = - SpotFleetRequestConfigSet.of_json - (Util.of_option_exn (Json.lookup j "spot_fleet_request_configs")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ImportVolumeResult = struct - type t = { conversion_task : ConversionTask.t option } - - let make ?conversion_task () = { conversion_task } - - let parse xml = - Some - { conversion_task = - Util.option_bind (Xml.member "conversionTask" xml) ConversionTask.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.conversion_task (fun f -> - Query.Pair ("ConversionTask", ConversionTask.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.conversion_task (fun f -> - "conversion_task", ConversionTask.to_json f) - ]) - - let of_json j = - { conversion_task = - Util.option_map (Json.lookup j "conversion_task") ConversionTask.of_json - } -end - -module DescribeVolumeAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - ; attribute : VolumeAttributeName.t option - } - - let make ?dry_run ~volume_id ?attribute () = { dry_run; volume_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - ; attribute = - Util.option_bind (Xml.member "Attribute" xml) VolumeAttributeName.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", VolumeAttributeName.to_query f)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> - "attribute", VolumeAttributeName.to_json f) - ; Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; attribute = Util.option_map (Json.lookup j "attribute") VolumeAttributeName.of_json - } -end - -module CreateNetworkAclResult = struct - type t = { network_acl : NetworkAcl.t option } - - let make ?network_acl () = { network_acl } - - let parse xml = - Some { network_acl = Util.option_bind (Xml.member "networkAcl" xml) NetworkAcl.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.network_acl (fun f -> - Query.Pair ("NetworkAcl", NetworkAcl.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.network_acl (fun f -> "network_acl", NetworkAcl.to_json f) ]) - - let of_json j = - { network_acl = Util.option_map (Json.lookup j "network_acl") NetworkAcl.of_json } -end - -module CreateRouteTableResult = struct - type t = { route_table : RouteTable.t option } - - let make ?route_table () = { route_table } - - let parse xml = - Some { route_table = Util.option_bind (Xml.member "routeTable" xml) RouteTable.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.route_table (fun f -> - Query.Pair ("RouteTable", RouteTable.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.route_table (fun f -> "route_table", RouteTable.to_json f) ]) - - let of_json j = - { route_table = Util.option_map (Json.lookup j "route_table") RouteTable.of_json } -end - -module DescribeSpotInstanceRequestsRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_instance_request_ids : SpotInstanceRequestIdList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(spot_instance_request_ids = []) ?(filters = []) () = - { dry_run; spot_instance_request_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_instance_request_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SpotInstanceRequestId" xml) - SpotInstanceRequestIdList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("history_records", (HistoryRecords.to_json v.history_records)); + Some + ("last_evaluated_time", + (DateTime.to_json v.last_evaluated_time)); + Some ("start_time", (DateTime.to_json v.start_time)); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + last_evaluated_time = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "last_evaluated_time"))); + history_records = + (HistoryRecords.of_json + (Util.of_option_exn (Json.lookup j "history_records"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module CancelReservedInstancesListingRequest = + struct + type t = { + reserved_instances_listing_id: String.t } + let make ~reserved_instances_listing_id () = + { reserved_instances_listing_id } + let parse xml = + Some + { + reserved_instances_listing_id = + (Xml.required "reservedInstancesListingId" + (Util.option_bind + (Xml.member "reservedInstancesListingId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesListingId", + (String.to_query v.reserved_instances_listing_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_instances_listing_id", + (String.to_json v.reserved_instances_listing_id))]) + let of_json j = + { + reserved_instances_listing_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_listing_id"))) + } + end +module DescribeSnapshotsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + snapshot_ids: SnapshotIdStringList.t ; + owner_ids: OwnerStringList.t ; + restorable_by_user_ids: RestorableByStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(snapshot_ids= []) ?(owner_ids= []) + ?(restorable_by_user_ids= []) ?(filters= []) ?next_token + ?max_results () = + { + dry_run; + snapshot_ids; + owner_ids; + restorable_by_user_ids; + filters; + next_token; + max_results + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + snapshot_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SnapshotId" xml) + SnapshotIdStringList.parse)); + owner_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "Owner" xml) + OwnerStringList.parse)); + restorable_by_user_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "RestorableBy" xml) + RestorableByStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "SpotInstanceRequestId" - , SpotInstanceRequestIdList.to_query v.spot_instance_request_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some - ( "spot_instance_request_ids" - , SpotInstanceRequestIdList.to_json v.spot_instance_request_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_instance_request_ids = - SpotInstanceRequestIdList.of_json - (Util.of_option_exn (Json.lookup j "spot_instance_request_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DeleteNetworkInterfaceRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_id : String.t - } - - let make ?dry_run ~network_interface_id () = { dry_run; network_interface_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("network_interface_id", String.to_json v.network_interface_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - } -end - -module DescribePlacementGroupsRequest = struct - type t = - { dry_run : Boolean.t option - ; group_names : PlacementGroupStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(group_names = []) ?(filters = []) () = - { dry_run; group_names; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_names = - Util.of_option - [] - (Util.option_bind (Xml.member "groupName" xml) PlacementGroupStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some - (Query.Pair ("GroupName", PlacementGroupStringList.to_query v.group_names)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("group_names", PlacementGroupStringList.to_json v.group_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_names = - PlacementGroupStringList.of_json - (Util.of_option_exn (Json.lookup j "group_names")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeAvailabilityZonesResult = struct - type t = { availability_zones : AvailabilityZoneList.t } - - let make ?(availability_zones = []) () = { availability_zones } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "availabilityZoneInfo" xml) - AvailabilityZoneList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("RestorableBy", + (RestorableByStringList.to_query v.restorable_by_user_ids))); + Some + (Query.Pair ("Owner", (OwnerStringList.to_query v.owner_ids))); + Some (Query.Pair - ( "AvailabilityZoneInfo" - , AvailabilityZoneList.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("availability_zones", AvailabilityZoneList.to_json v.availability_zones) - ]) - - let of_json j = - { availability_zones = - AvailabilityZoneList.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - } -end - -module StartInstancesRequest = struct - type t = - { instance_ids : InstanceIdStringList.t - ; additional_info : String.t option - ; dry_run : Boolean.t option - } - - let make ~instance_ids ?additional_info ?dry_run () = - { instance_ids; additional_info; dry_run } - - let parse xml = - Some - { instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - ; additional_info = Util.option_bind (Xml.member "additionalInfo" xml) String.parse - ; dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ; Util.option_map v.additional_info (fun f -> - Query.Pair ("AdditionalInfo", String.to_query f)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ; Util.option_map v.additional_info (fun f -> - "additional_info", String.to_json f) - ; Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ]) - - let of_json j = - { instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json - ; dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - } -end - -module ImportImageResult = struct - type t = - { import_task_id : String.t option - ; architecture : String.t option - ; license_type : String.t option - ; platform : String.t option - ; hypervisor : String.t option - ; description : String.t option - ; snapshot_details : SnapshotDetailList.t - ; image_id : String.t option - ; progress : String.t option - ; status_message : String.t option - ; status : String.t option - } - - let make - ?import_task_id - ?architecture - ?license_type - ?platform - ?hypervisor - ?description - ?(snapshot_details = []) - ?image_id - ?progress - ?status_message - ?status - () = - { import_task_id - ; architecture - ; license_type - ; platform - ; hypervisor - ; description - ; snapshot_details - ; image_id - ; progress - ; status_message - ; status - } - - let parse xml = - Some - { import_task_id = Util.option_bind (Xml.member "importTaskId" xml) String.parse - ; architecture = Util.option_bind (Xml.member "architecture" xml) String.parse - ; license_type = Util.option_bind (Xml.member "licenseType" xml) String.parse - ; platform = Util.option_bind (Xml.member "platform" xml) String.parse - ; hypervisor = Util.option_bind (Xml.member "hypervisor" xml) String.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; snapshot_details = - Util.of_option - [] - (Util.option_bind - (Xml.member "snapshotDetailSet" xml) - SnapshotDetailList.parse) - ; image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; progress = Util.option_bind (Xml.member "progress" xml) String.parse - ; status_message = Util.option_bind (Xml.member "statusMessage" xml) String.parse - ; status = Util.option_bind (Xml.member "status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.status_message (fun f -> - Query.Pair ("StatusMessage", String.to_query f)) - ; Util.option_map v.progress (fun f -> - Query.Pair ("Progress", String.to_query f)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ; Some + ("SnapshotId", + (SnapshotIdStringList.to_query v.snapshot_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("restorable_by_user_ids", + (RestorableByStringList.to_json v.restorable_by_user_ids)); + Some ("owner_ids", (OwnerStringList.to_json v.owner_ids)); + Some + ("snapshot_ids", (SnapshotIdStringList.to_json v.snapshot_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + snapshot_ids = + (SnapshotIdStringList.of_json + (Util.of_option_exn (Json.lookup j "snapshot_ids"))); + owner_ids = + (OwnerStringList.of_json + (Util.of_option_exn (Json.lookup j "owner_ids"))); + restorable_by_user_ids = + (RestorableByStringList.of_json + (Util.of_option_exn (Json.lookup j "restorable_by_user_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module ModifyReservedInstancesRequest = + struct + type t = + { + client_token: String.t option ; + reserved_instances_ids: ReservedInstancesIdStringList.t ; + target_configurations: ReservedInstancesConfigurationList.t } + let make ?client_token ~reserved_instances_ids ~target_configurations + () = { client_token; reserved_instances_ids; target_configurations } + let parse xml = + Some + { + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + reserved_instances_ids = + (Xml.required "ReservedInstancesId" + (Util.option_bind (Xml.member "ReservedInstancesId" xml) + ReservedInstancesIdStringList.parse)); + target_configurations = + (Xml.required "ReservedInstancesConfigurationSetItemType" + (Util.option_bind + (Xml.member "ReservedInstancesConfigurationSetItemType" xml) + ReservedInstancesConfigurationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesConfigurationSetItemType", + (ReservedInstancesConfigurationList.to_query + v.target_configurations))); + Some (Query.Pair - ("SnapshotDetailSet", SnapshotDetailList.to_query v.snapshot_details)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.hypervisor (fun f -> - Query.Pair ("Hypervisor", String.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", String.to_query f)) - ; Util.option_map v.license_type (fun f -> - Query.Pair ("LicenseType", String.to_query f)) - ; Util.option_map v.architecture (fun f -> - Query.Pair ("Architecture", String.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.status_message (fun f -> "status_message", String.to_json f) - ; Util.option_map v.progress (fun f -> "progress", String.to_json f) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ; Some ("snapshot_details", SnapshotDetailList.to_json v.snapshot_details) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.hypervisor (fun f -> "hypervisor", String.to_json f) - ; Util.option_map v.platform (fun f -> "platform", String.to_json f) - ; Util.option_map v.license_type (fun f -> "license_type", String.to_json f) - ; Util.option_map v.architecture (fun f -> "architecture", String.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ]) - - let of_json j = - { import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; architecture = Util.option_map (Json.lookup j "architecture") String.of_json - ; license_type = Util.option_map (Json.lookup j "license_type") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") String.of_json - ; hypervisor = Util.option_map (Json.lookup j "hypervisor") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; snapshot_details = - SnapshotDetailList.of_json (Util.of_option_exn (Json.lookup j "snapshot_details")) - ; image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; progress = Util.option_map (Json.lookup j "progress") String.of_json - ; status_message = Util.option_map (Json.lookup j "status_message") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module DescribeCustomerGatewaysResult = struct - type t = { customer_gateways : CustomerGatewayList.t } - - let make ?(customer_gateways = []) () = { customer_gateways } - - let parse xml = - Some - { customer_gateways = - Util.of_option - [] - (Util.option_bind - (Xml.member "customerGatewaySet" xml) - CustomerGatewayList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ReservedInstancesId", + (ReservedInstancesIdStringList.to_query + v.reserved_instances_ids))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("target_configurations", + (ReservedInstancesConfigurationList.to_json + v.target_configurations)); + Some + ("reserved_instances_ids", + (ReservedInstancesIdStringList.to_json + v.reserved_instances_ids)); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f)))]) + let of_json j = + { + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + reserved_instances_ids = + (ReservedInstancesIdStringList.of_json + (Util.of_option_exn (Json.lookup j "reserved_instances_ids"))); + target_configurations = + (ReservedInstancesConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "target_configurations"))) + } + end +module AssociateRouteTableRequest = + struct + type t = + { + dry_run: Boolean.t option ; + subnet_id: String.t ; + route_table_id: String.t } + let make ?dry_run ~subnet_id ~route_table_id () = + { dry_run; subnet_id; route_table_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + subnet_id = + (Xml.required "subnetId" + (Util.option_bind (Xml.member "subnetId" xml) String.parse)); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RouteTableId", (String.to_query v.route_table_id))); + Some (Query.Pair ("SubnetId", (String.to_query v.subnet_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("route_table_id", (String.to_json v.route_table_id)); + Some ("subnet_id", (String.to_json v.subnet_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + subnet_id = + (String.of_json (Util.of_option_exn (Json.lookup j "subnet_id"))); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))) + } + end +module AssociateAddressResult = + struct + type t = { + association_id: String.t option } + let make ?association_id () = { association_id } + let parse xml = + Some + { + association_id = + (Util.option_bind (Xml.member "associationId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> Query.Pair ("AssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> ("association_id", (String.to_json f)))]) + let of_json j = + { + association_id = + (Util.option_map (Json.lookup j "association_id") String.of_json) + } + end +module CreateCustomerGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + type_: GatewayType.t ; + public_ip: String.t ; + bgp_asn: Integer.t } + let make ?dry_run ~type_ ~public_ip ~bgp_asn () = + { dry_run; type_; public_ip; bgp_asn } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + type_ = + (Xml.required "Type" + (Util.option_bind (Xml.member "Type" xml) GatewayType.parse)); + public_ip = + (Xml.required "IpAddress" + (Util.option_bind (Xml.member "IpAddress" xml) String.parse)); + bgp_asn = + (Xml.required "BgpAsn" + (Util.option_bind (Xml.member "BgpAsn" xml) Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("BgpAsn", (Integer.to_query v.bgp_asn))); + Some (Query.Pair ("IpAddress", (String.to_query v.public_ip))); + Some (Query.Pair ("Type", (GatewayType.to_query v.type_))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("bgp_asn", (Integer.to_json v.bgp_asn)); + Some ("public_ip", (String.to_json v.public_ip)); + Some ("type_", (GatewayType.to_json v.type_)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + type_ = + (GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_"))); + public_ip = + (String.of_json (Util.of_option_exn (Json.lookup j "public_ip"))); + bgp_asn = + (Integer.of_json (Util.of_option_exn (Json.lookup j "bgp_asn"))) + } + end +module DescribeSecurityGroupsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_names: GroupNameStringList.t ; + group_ids: GroupIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(group_names= []) ?(group_ids= []) ?(filters= []) + () = { dry_run; group_names; group_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "GroupName" xml) + GroupNameStringList.parse)); + group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "GroupId" xml) + GroupIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ("CustomerGatewaySet", CustomerGatewayList.to_query v.customer_gateways)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("customer_gateways", CustomerGatewayList.to_json v.customer_gateways) ]) - - let of_json j = - { customer_gateways = - CustomerGatewayList.of_json - (Util.of_option_exn (Json.lookup j "customer_gateways")) - } -end - -module DescribeVpcEndpointServicesRequest = struct - type t = - { dry_run : Boolean.t option - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?dry_run ?max_results ?next_token () = { dry_run; max_results; next_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeSpotFleetRequestHistoryRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_fleet_request_id : String.t - ; event_type : EventType.t option - ; start_time : DateTime.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make - ?dry_run - ~spot_fleet_request_id - ?event_type - ~start_time - ?next_token - ?max_results - () = - { dry_run; spot_fleet_request_id; event_type; start_time; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; event_type = Util.option_bind (Xml.member "eventType" xml) EventType.parse - ; start_time = - Xml.required - "startTime" - (Util.option_bind (Xml.member "startTime" xml) DateTime.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("StartTime", DateTime.to_query v.start_time)) - ; Util.option_map v.event_type (fun f -> - Query.Pair ("EventType", EventType.to_query f)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("start_time", DateTime.to_json v.start_time) - ; Util.option_map v.event_type (fun f -> "event_type", EventType.to_json f) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; event_type = Util.option_map (Json.lookup j "event_type") EventType.of_json - ; start_time = DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module DeleteVolumeRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - } - - let make ?dry_run ~volume_id () = { dry_run; volume_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - } -end - -module DescribeFlowLogsResult = struct - type t = - { flow_logs : FlowLogSet.t - ; next_token : String.t option - } - - let make ?(flow_logs = []) ?next_token () = { flow_logs; next_token } - - let parse xml = - Some - { flow_logs = - Util.of_option - [] - (Util.option_bind (Xml.member "flowLogSet" xml) FlowLogSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("FlowLogSet", FlowLogSet.to_query v.flow_logs)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("flow_logs", FlowLogSet.to_json v.flow_logs) - ]) - - let of_json j = - { flow_logs = FlowLogSet.of_json (Util.of_option_exn (Json.lookup j "flow_logs")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeBundleTasksResult = struct - type t = { bundle_tasks : BundleTaskList.t } - - let make ?(bundle_tasks = []) () = { bundle_tasks } - - let parse xml = - Some - { bundle_tasks = - Util.of_option - [] - (Util.option_bind - (Xml.member "bundleInstanceTasksSet" xml) - BundleTaskList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("BundleInstanceTasksSet", BundleTaskList.to_query v.bundle_tasks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("bundle_tasks", BundleTaskList.to_json v.bundle_tasks) ]) - - let of_json j = - { bundle_tasks = - BundleTaskList.of_json (Util.of_option_exn (Json.lookup j "bundle_tasks")) - } -end - -module DescribeVolumeStatusResult = struct - type t = - { volume_statuses : VolumeStatusList.t - ; next_token : String.t option - } - - let make ?(volume_statuses = []) ?next_token () = { volume_statuses; next_token } - - let parse xml = - Some - { volume_statuses = - Util.of_option - [] - (Util.option_bind (Xml.member "volumeStatusSet" xml) VolumeStatusList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("VolumeStatusSet", VolumeStatusList.to_query v.volume_statuses)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("volume_statuses", VolumeStatusList.to_json v.volume_statuses) - ]) - - let of_json j = - { volume_statuses = - VolumeStatusList.of_json (Util.of_option_exn (Json.lookup j "volume_statuses")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeSubnetsRequest = struct - type t = - { dry_run : Boolean.t option - ; subnet_ids : SubnetIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(subnet_ids = []) ?(filters = []) () = - { dry_run; subnet_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; subnet_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "SubnetId" xml) SubnetIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("SubnetId", SubnetIdStringList.to_query v.subnet_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("subnet_ids", SubnetIdStringList.to_json v.subnet_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; subnet_ids = - SubnetIdStringList.of_json (Util.of_option_exn (Json.lookup j "subnet_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module ImportKeyPairResult = struct - type t = - { key_name : String.t option - ; key_fingerprint : String.t option - } - - let make ?key_name ?key_fingerprint () = { key_name; key_fingerprint } - - let parse xml = - Some - { key_name = Util.option_bind (Xml.member "keyName" xml) String.parse - ; key_fingerprint = Util.option_bind (Xml.member "keyFingerprint" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.key_fingerprint (fun f -> - Query.Pair ("KeyFingerprint", String.to_query f)) - ; Util.option_map v.key_name (fun f -> Query.Pair ("KeyName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.key_fingerprint (fun f -> - "key_fingerprint", String.to_json f) - ; Util.option_map v.key_name (fun f -> "key_name", String.to_json f) - ]) - - let of_json j = - { key_name = Util.option_map (Json.lookup j "key_name") String.of_json - ; key_fingerprint = Util.option_map (Json.lookup j "key_fingerprint") String.of_json - } -end - -module CreateKeyPairRequest = struct - type t = - { dry_run : Boolean.t option - ; key_name : String.t - } - - let make ?dry_run ~key_name () = { dry_run; key_name } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; key_name = - Xml.required - "KeyName" - (Util.option_bind (Xml.member "KeyName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("KeyName", String.to_query v.key_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("key_name", String.to_json v.key_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; key_name = String.of_json (Util.of_option_exn (Json.lookup j "key_name")) - } -end - -module DisassociateAddressRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ip : String.t option - ; association_id : String.t option - } - - let make ?dry_run ?public_ip ?association_id () = { dry_run; public_ip; association_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ip = Util.option_bind (Xml.member "PublicIp" xml) String.parse - ; association_id = Util.option_bind (Xml.member "AssociationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> - Query.Pair ("AssociationId", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> "association_id", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; association_id = Util.option_map (Json.lookup j "association_id") String.of_json - } -end - -module DisableVpcClassicLinkResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module ReplaceRouteRequest = struct - type t = - { dry_run : Boolean.t option - ; route_table_id : String.t - ; destination_cidr_block : String.t - ; gateway_id : String.t option - ; instance_id : String.t option - ; network_interface_id : String.t option - ; vpc_peering_connection_id : String.t option - } - - let make - ?dry_run - ~route_table_id - ~destination_cidr_block - ?gateway_id - ?instance_id - ?network_interface_id - ?vpc_peering_connection_id - () = - { dry_run - ; route_table_id - ; destination_cidr_block - ; gateway_id - ; instance_id - ; network_interface_id - ; vpc_peering_connection_id - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - ; destination_cidr_block = - Xml.required - "destinationCidrBlock" - (Util.option_bind (Xml.member "destinationCidrBlock" xml) String.parse) - ; gateway_id = Util.option_bind (Xml.member "gatewayId" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; vpc_peering_connection_id = - Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - Query.Pair ("VpcPeeringConnectionId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.gateway_id (fun f -> - Query.Pair ("GatewayId", String.to_query f)) - ; Some - (Query.Pair ("DestinationCidrBlock", String.to_query v.destination_cidr_block)) - ; Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - "vpc_peering_connection_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.gateway_id (fun f -> "gateway_id", String.to_json f) - ; Some ("destination_cidr_block", String.to_json v.destination_cidr_block) - ; Some ("route_table_id", String.to_json v.route_table_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - ; destination_cidr_block = - String.of_json (Util.of_option_exn (Json.lookup j "destination_cidr_block")) - ; gateway_id = Util.option_map (Json.lookup j "gateway_id") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; vpc_peering_connection_id = - Util.option_map (Json.lookup j "vpc_peering_connection_id") String.of_json - } -end - -module DeleteFlowLogsResult = struct - type t = { unsuccessful : UnsuccessfulItemSet.t } - - let make ?(unsuccessful = []) () = { unsuccessful } - - let parse xml = - Some - { unsuccessful = - Util.of_option - [] - (Util.option_bind (Xml.member "unsuccessful" xml) UnsuccessfulItemSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Unsuccessful", UnsuccessfulItemSet.to_query v.unsuccessful)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("unsuccessful", UnsuccessfulItemSet.to_json v.unsuccessful) ]) - - let of_json j = - { unsuccessful = - UnsuccessfulItemSet.of_json (Util.of_option_exn (Json.lookup j "unsuccessful")) - } -end - -module GetConsoleOutputRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - } - - let make ?dry_run ~instance_id () = { dry_run; instance_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module AttachVpnGatewayResult = struct - type t = { vpc_attachment : VpcAttachment.t option } - - let make ?vpc_attachment () = { vpc_attachment } - - let parse xml = - Some - { vpc_attachment = - Util.option_bind (Xml.member "attachment" xml) VpcAttachment.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_attachment (fun f -> - Query.Pair ("Attachment", VpcAttachment.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_attachment (fun f -> - "vpc_attachment", VpcAttachment.to_json f) - ]) - - let of_json j = - { vpc_attachment = - Util.option_map (Json.lookup j "vpc_attachment") VpcAttachment.of_json - } -end - -module ImageAttribute = struct - type t = - { image_id : String.t option - ; launch_permissions : LaunchPermissionList.t - ; product_codes : ProductCodeList.t - ; kernel_id : AttributeValue.t option - ; ramdisk_id : AttributeValue.t option - ; description : AttributeValue.t option - ; sriov_net_support : AttributeValue.t option - ; block_device_mappings : BlockDeviceMappingList.t - } - - let make - ?image_id - ?(launch_permissions = []) - ?(product_codes = []) - ?kernel_id - ?ramdisk_id - ?description - ?sriov_net_support - ?(block_device_mappings = []) - () = - { image_id - ; launch_permissions - ; product_codes - ; kernel_id - ; ramdisk_id - ; description - ; sriov_net_support - ; block_device_mappings - } - - let parse xml = - Some - { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse - ; launch_permissions = - Util.of_option - [] - (Util.option_bind - (Xml.member "launchPermission" xml) - LaunchPermissionList.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - ; kernel_id = Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse - ; description = Util.option_bind (Xml.member "description" xml) AttributeValue.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) AttributeValue.parse - ; block_device_mappings = - Util.of_option - [] + ("GroupId", (GroupIdStringList.to_query v.group_ids))); + Some + (Query.Pair + ("GroupName", (GroupNameStringList.to_query v.group_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("group_ids", (GroupIdStringList.to_json v.group_ids)); + Some ("group_names", (GroupNameStringList.to_json v.group_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_names = + (GroupNameStringList.of_json + (Util.of_option_exn (Json.lookup j "group_names"))); + group_ids = + (GroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "group_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module ReplaceNetworkAclEntryRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_acl_id: String.t ; + rule_number: Integer.t ; + protocol: String.t ; + rule_action: RuleAction.t ; + egress: Boolean.t ; + cidr_block: String.t ; + icmp_type_code: IcmpTypeCode.t option ; + port_range: PortRange.t option } + let make ?dry_run ~network_acl_id ~rule_number ~protocol ~rule_action + ~egress ~cidr_block ?icmp_type_code ?port_range () = + { + dry_run; + network_acl_id; + rule_number; + protocol; + rule_action; + egress; + cidr_block; + icmp_type_code; + port_range + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_acl_id = + (Xml.required "networkAclId" + (Util.option_bind (Xml.member "networkAclId" xml) String.parse)); + rule_number = + (Xml.required "ruleNumber" + (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse)); + protocol = + (Xml.required "protocol" + (Util.option_bind (Xml.member "protocol" xml) String.parse)); + rule_action = + (Xml.required "ruleAction" + (Util.option_bind (Xml.member "ruleAction" xml) + RuleAction.parse)); + egress = + (Xml.required "egress" + (Util.option_bind (Xml.member "egress" xml) Boolean.parse)); + cidr_block = + (Xml.required "cidrBlock" + (Util.option_bind (Xml.member "cidrBlock" xml) String.parse)); + icmp_type_code = + (Util.option_bind (Xml.member "Icmp" xml) IcmpTypeCode.parse); + port_range = + (Util.option_bind (Xml.member "portRange" xml) PortRange.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> Query.Pair ("PortRange", (PortRange.to_query f))); + Util.option_map v.icmp_type_code + (fun f -> Query.Pair ("Icmp", (IcmpTypeCode.to_query f))); + Some (Query.Pair ("CidrBlock", (String.to_query v.cidr_block))); + Some (Query.Pair ("Egress", (Boolean.to_query v.egress))); + Some + (Query.Pair ("RuleAction", (RuleAction.to_query v.rule_action))); + Some (Query.Pair ("Protocol", (String.to_query v.protocol))); + Some (Query.Pair ("RuleNumber", (Integer.to_query v.rule_number))); + Some + (Query.Pair ("NetworkAclId", (String.to_query v.network_acl_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.port_range + (fun f -> ("port_range", (PortRange.to_json f))); + Util.option_map v.icmp_type_code + (fun f -> ("icmp_type_code", (IcmpTypeCode.to_json f))); + Some ("cidr_block", (String.to_json v.cidr_block)); + Some ("egress", (Boolean.to_json v.egress)); + Some ("rule_action", (RuleAction.to_json v.rule_action)); + Some ("protocol", (String.to_json v.protocol)); + Some ("rule_number", (Integer.to_json v.rule_number)); + Some ("network_acl_id", (String.to_json v.network_acl_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_acl_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_acl_id"))); + rule_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number"))); + protocol = + (String.of_json (Util.of_option_exn (Json.lookup j "protocol"))); + rule_action = + (RuleAction.of_json + (Util.of_option_exn (Json.lookup j "rule_action"))); + egress = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "egress"))); + cidr_block = + (String.of_json (Util.of_option_exn (Json.lookup j "cidr_block"))); + icmp_type_code = + (Util.option_map (Json.lookup j "icmp_type_code") + IcmpTypeCode.of_json); + port_range = + (Util.option_map (Json.lookup j "port_range") PortRange.of_json) + } + end +module DescribeFlowLogsRequest = + struct + type t = + { + flow_log_ids: ValueStringList.t ; + filter: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?(flow_log_ids= []) ?(filter= []) ?next_token ?max_results + () = { flow_log_ids; filter; next_token; max_results } + let parse xml = + Some + { + flow_log_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "FlowLogId" xml) + ValueStringList.parse)); + filter = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filter))); + Some + (Query.Pair + ("FlowLogId", (ValueStringList.to_query v.flow_log_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filter", (FilterList.to_json v.filter)); + Some ("flow_log_ids", (ValueStringList.to_json v.flow_log_ids))]) + let of_json j = + { + flow_log_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "flow_log_ids"))); + filter = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filter"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module RequestSpotInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_price: String.t ; + client_token: String.t option ; + instance_count: Integer.t option ; + type_: SpotInstanceType.t option ; + valid_from: DateTime.t option ; + valid_until: DateTime.t option ; + launch_group: String.t option ; + availability_zone_group: String.t option ; + launch_specification: RequestSpotLaunchSpecification.t option } + let make ?dry_run ~spot_price ?client_token ?instance_count ?type_ + ?valid_from ?valid_until ?launch_group ?availability_zone_group + ?launch_specification () = + { + dry_run; + spot_price; + client_token; + instance_count; + type_; + valid_from; + valid_until; + launch_group; + availability_zone_group; + launch_specification + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_price = + (Xml.required "spotPrice" + (Util.option_bind (Xml.member "spotPrice" xml) String.parse)); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + instance_count = + (Util.option_bind (Xml.member "instanceCount" xml) Integer.parse); + type_ = + (Util.option_bind (Xml.member "type" xml) SpotInstanceType.parse); + valid_from = + (Util.option_bind (Xml.member "validFrom" xml) DateTime.parse); + valid_until = + (Util.option_bind (Xml.member "validUntil" xml) DateTime.parse); + launch_group = + (Util.option_bind (Xml.member "launchGroup" xml) String.parse); + availability_zone_group = + (Util.option_bind (Xml.member "availabilityZoneGroup" xml) + String.parse); + launch_specification = + (Util.option_bind (Xml.member "LaunchSpecification" xml) + RequestSpotLaunchSpecification.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.launch_specification + (fun f -> + Query.Pair + ("LaunchSpecification", + (RequestSpotLaunchSpecification.to_query f))); + Util.option_map v.availability_zone_group + (fun f -> + Query.Pair ("AvailabilityZoneGroup", (String.to_query f))); + Util.option_map v.launch_group + (fun f -> Query.Pair ("LaunchGroup", (String.to_query f))); + Util.option_map v.valid_until + (fun f -> Query.Pair ("ValidUntil", (DateTime.to_query f))); + Util.option_map v.valid_from + (fun f -> Query.Pair ("ValidFrom", (DateTime.to_query f))); + Util.option_map v.type_ + (fun f -> Query.Pair ("Type", (SpotInstanceType.to_query f))); + Util.option_map v.instance_count + (fun f -> Query.Pair ("InstanceCount", (Integer.to_query f))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Some (Query.Pair ("SpotPrice", (String.to_query v.spot_price))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.launch_specification + (fun f -> + ("launch_specification", + (RequestSpotLaunchSpecification.to_json f))); + Util.option_map v.availability_zone_group + (fun f -> ("availability_zone_group", (String.to_json f))); + Util.option_map v.launch_group + (fun f -> ("launch_group", (String.to_json f))); + Util.option_map v.valid_until + (fun f -> ("valid_until", (DateTime.to_json f))); + Util.option_map v.valid_from + (fun f -> ("valid_from", (DateTime.to_json f))); + Util.option_map v.type_ + (fun f -> ("type_", (SpotInstanceType.to_json f))); + Util.option_map v.instance_count + (fun f -> ("instance_count", (Integer.to_json f))); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Some ("spot_price", (String.to_json v.spot_price)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_price = + (String.of_json (Util.of_option_exn (Json.lookup j "spot_price"))); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + instance_count = + (Util.option_map (Json.lookup j "instance_count") Integer.of_json); + type_ = + (Util.option_map (Json.lookup j "type_") SpotInstanceType.of_json); + valid_from = + (Util.option_map (Json.lookup j "valid_from") DateTime.of_json); + valid_until = + (Util.option_map (Json.lookup j "valid_until") DateTime.of_json); + launch_group = + (Util.option_map (Json.lookup j "launch_group") String.of_json); + availability_zone_group = + (Util.option_map (Json.lookup j "availability_zone_group") + String.of_json); + launch_specification = + (Util.option_map (Json.lookup j "launch_specification") + RequestSpotLaunchSpecification.of_json) + } + end +module AssignPrivateIpAddressesRequest = + struct + type t = + { + network_interface_id: String.t ; + private_ip_addresses: PrivateIpAddressStringList.t ; + secondary_private_ip_address_count: Integer.t option ; + allow_reassignment: Boolean.t option } + let make ~network_interface_id ?(private_ip_addresses= []) + ?secondary_private_ip_address_count ?allow_reassignment () = + { + network_interface_id; + private_ip_addresses; + secondary_private_ip_address_count; + allow_reassignment + } + let parse xml = + Some + { + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + private_ip_addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "privateIpAddress" xml) + PrivateIpAddressStringList.parse)); + secondary_private_ip_address_count = (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - BlockDeviceMappingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "secondaryPrivateIpAddressCount" xml) + Integer.parse); + allow_reassignment = + (Util.option_bind (Xml.member "allowReassignment" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.allow_reassignment + (fun f -> + Query.Pair ("AllowReassignment", (Boolean.to_query f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + Query.Pair + ("SecondaryPrivateIpAddressCount", (Integer.to_query f))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", AttributeValue.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", AttributeValue.to_query f)) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("Ramdisk", AttributeValue.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("Kernel", AttributeValue.to_query f)) - ; Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Some + ("PrivateIpAddress", + (PrivateIpAddressStringList.to_query v.private_ip_addresses))); + Some (Query.Pair - ("LaunchPermission", LaunchPermissionList.to_query v.launch_permissions)) - ; Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "block_device_mappings" - , BlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", AttributeValue.to_json f) - ; Util.option_map v.description (fun f -> - "description", AttributeValue.to_json f) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", AttributeValue.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", AttributeValue.to_json f) - ; Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Some ("launch_permissions", LaunchPermissionList.to_json v.launch_permissions) - ; Util.option_map v.image_id (fun f -> "image_id", String.to_json f) - ]) - - let of_json j = - { image_id = Util.option_map (Json.lookup j "image_id") String.of_json - ; launch_permissions = - LaunchPermissionList.of_json - (Util.of_option_exn (Json.lookup j "launch_permissions")) - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") AttributeValue.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") AttributeValue.of_json - ; description = Util.option_map (Json.lookup j "description") AttributeValue.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") AttributeValue.of_json - ; block_device_mappings = - BlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - } -end - -module DetachClassicLinkVpcResult = struct - type t = { return : Boolean.t option } - - let make ?return () = { return } - - let parse xml = - Some { return = Util.option_bind (Xml.member "return" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) ]) - - let of_json j = { return = Util.option_map (Json.lookup j "return") Boolean.of_json } -end - -module CreateVpnConnectionResult = struct - type t = { vpn_connection : VpnConnection.t option } - - let make ?vpn_connection () = { vpn_connection } - - let parse xml = - Some - { vpn_connection = - Util.option_bind (Xml.member "vpnConnection" xml) VpnConnection.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpn_connection (fun f -> - Query.Pair ("VpnConnection", VpnConnection.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpn_connection (fun f -> - "vpn_connection", VpnConnection.to_json f) - ]) - - let of_json j = - { vpn_connection = - Util.option_map (Json.lookup j "vpn_connection") VpnConnection.of_json - } -end - -module DeleteSnapshotRequest = struct - type t = - { dry_run : Boolean.t option - ; snapshot_id : String.t - } - - let make ?dry_run ~snapshot_id () = { dry_run; snapshot_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; snapshot_id = - Xml.required - "SnapshotId" - (Util.option_bind (Xml.member "SnapshotId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("snapshot_id", String.to_json v.snapshot_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - } -end - -module KeyPair = struct - type t = - { key_name : String.t - ; key_fingerprint : String.t - ; key_material : String.t - } - - let make ~key_name ~key_fingerprint ~key_material () = - { key_name; key_fingerprint; key_material } - - let parse xml = - Some - { key_name = - Xml.required - "keyName" - (Util.option_bind (Xml.member "keyName" xml) String.parse) - ; key_fingerprint = - Xml.required - "keyFingerprint" - (Util.option_bind (Xml.member "keyFingerprint" xml) String.parse) - ; key_material = - Xml.required - "keyMaterial" - (Util.option_bind (Xml.member "keyMaterial" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("KeyMaterial", String.to_query v.key_material)) - ; Some (Query.Pair ("KeyFingerprint", String.to_query v.key_fingerprint)) - ; Some (Query.Pair ("KeyName", String.to_query v.key_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("key_material", String.to_json v.key_material) - ; Some ("key_fingerprint", String.to_json v.key_fingerprint) - ; Some ("key_name", String.to_json v.key_name) - ]) - - let of_json j = - { key_name = String.of_json (Util.of_option_exn (Json.lookup j "key_name")) - ; key_fingerprint = - String.of_json (Util.of_option_exn (Json.lookup j "key_fingerprint")) - ; key_material = String.of_json (Util.of_option_exn (Json.lookup j "key_material")) - } -end - -module RestoreAddressToClassicRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ip : String.t - } - - let make ?dry_run ~public_ip () = { dry_run; public_ip } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ip = - Xml.required - "publicIp" + ("NetworkInterfaceId", + (String.to_query v.network_interface_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.allow_reassignment + (fun f -> ("allow_reassignment", (Boolean.to_json f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + ("secondary_private_ip_address_count", (Integer.to_json f))); + Some + ("private_ip_addresses", + (PrivateIpAddressStringList.to_json v.private_ip_addresses)); + Some + ("network_interface_id", + (String.to_json v.network_interface_id))]) + let of_json j = + { + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + private_ip_addresses = + (PrivateIpAddressStringList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))); + secondary_private_ip_address_count = + (Util.option_map + (Json.lookup j "secondary_private_ip_address_count") + Integer.of_json); + allow_reassignment = + (Util.option_map (Json.lookup j "allow_reassignment") + Boolean.of_json) + } + end +module CreateFlowLogsResult = + struct + type t = + { + flow_log_ids: ValueStringList.t ; + client_token: String.t option ; + unsuccessful: UnsuccessfulItemSet.t } + let make ?(flow_log_ids= []) ?client_token ?(unsuccessful= []) () = + { flow_log_ids; client_token; unsuccessful } + let parse xml = + Some + { + flow_log_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "flowLogIdSet" xml) + ValueStringList.parse)); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + unsuccessful = + (Util.of_option [] + (Util.option_bind (Xml.member "unsuccessful" xml) + UnsuccessfulItemSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Unsuccessful", + (UnsuccessfulItemSet.to_query v.unsuccessful))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Some + (Query.Pair + ("FlowLogIdSet", (ValueStringList.to_query v.flow_log_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("unsuccessful", (UnsuccessfulItemSet.to_json v.unsuccessful)); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Some ("flow_log_ids", (ValueStringList.to_json v.flow_log_ids))]) + let of_json j = + { + flow_log_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "flow_log_ids"))); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + unsuccessful = + (UnsuccessfulItemSet.of_json + (Util.of_option_exn (Json.lookup j "unsuccessful"))) + } + end +module CreateNetworkInterfaceResult = + struct + type t = { + network_interface: NetworkInterface.t option } + let make ?network_interface () = { network_interface } + let parse xml = + Some + { + network_interface = + (Util.option_bind (Xml.member "networkInterface" xml) + NetworkInterface.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.network_interface + (fun f -> + Query.Pair + ("NetworkInterface", (NetworkInterface.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.network_interface + (fun f -> ("network_interface", (NetworkInterface.to_json f)))]) + let of_json j = + { + network_interface = + (Util.option_map (Json.lookup j "network_interface") + NetworkInterface.of_json) + } + end +module RestoreAddressToClassicResult = + struct + type t = { + status: Status.t option ; + public_ip: String.t option } + let make ?status ?public_ip () = { status; public_ip } + let parse xml = + Some + { + status = (Util.option_bind (Xml.member "status" xml) Status.parse); + public_ip = (Util.option_bind (Xml.member "publicIp" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PublicIp", String.to_query v.public_ip)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("public_ip", String.to_json v.public_ip) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ip = String.of_json (Util.of_option_exn (Json.lookup j "public_ip")) - } -end - -module DeleteVpcPeeringConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_peering_connection_id : String.t - } - - let make ?dry_run ~vpc_peering_connection_id () = { dry_run; vpc_peering_connection_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_peering_connection_id = - Xml.required - "vpcPeeringConnectionId" - (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (Status.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (Status.to_json f)))]) + let of_json j = + { + status = (Util.option_map (Json.lookup j "status") Status.of_json); + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json) + } + end +module DescribeRouteTablesResult = + struct + type t = { + route_tables: RouteTableList.t } + let make ?(route_tables= []) () = { route_tables } + let parse xml = + Some + { + route_tables = + (Util.of_option [] + (Util.option_bind (Xml.member "routeTableSet" xml) + RouteTableList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RouteTableSet", (RouteTableList.to_query v.route_tables)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("route_tables", (RouteTableList.to_json v.route_tables))]) + let of_json j = + { + route_tables = + (RouteTableList.of_json + (Util.of_option_exn (Json.lookup j "route_tables"))) + } + end +module DescribeSpotDatafeedSubscriptionRequest = + struct + type t = { + dry_run: Boolean.t option } + let make ?dry_run () = { dry_run } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json) + } + end +module DescribeSnapshotAttributeResult = + struct + type t = + { + snapshot_id: String.t option ; + create_volume_permissions: CreateVolumePermissionList.t ; + product_codes: ProductCodeList.t } + let make ?snapshot_id ?(create_volume_permissions= []) ?(product_codes= + []) () = { snapshot_id; create_volume_permissions; product_codes } + let parse xml = + Some + { + snapshot_id = + (Util.option_bind (Xml.member "snapshotId" xml) String.parse); + create_volume_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "createVolumePermission" xml) + CreateVolumePermissionList.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Some (Query.Pair - ("VpcPeeringConnectionId", String.to_query v.vpc_peering_connection_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_peering_connection_id", String.to_json v.vpc_peering_connection_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_peering_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpc_peering_connection_id")) - } -end - -module CreateCustomerGatewayResult = struct - type t = { customer_gateway : CustomerGateway.t option } - - let make ?customer_gateway () = { customer_gateway } - - let parse xml = - Some - { customer_gateway = - Util.option_bind (Xml.member "customerGateway" xml) CustomerGateway.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.customer_gateway (fun f -> - Query.Pair ("CustomerGateway", CustomerGateway.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.customer_gateway (fun f -> - "customer_gateway", CustomerGateway.to_json f) - ]) - - let of_json j = - { customer_gateway = - Util.option_map (Json.lookup j "customer_gateway") CustomerGateway.of_json - } -end - -module ModifyReservedInstancesResult = struct - type t = { reserved_instances_modification_id : String.t option } - - let make ?reserved_instances_modification_id () = { reserved_instances_modification_id } - - let parse xml = - Some - { reserved_instances_modification_id = - Util.option_bind (Xml.member "reservedInstancesModificationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_modification_id (fun f -> - Query.Pair ("ReservedInstancesModificationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reserved_instances_modification_id (fun f -> - "reserved_instances_modification_id", String.to_json f) - ]) - - let of_json j = - { reserved_instances_modification_id = - Util.option_map - (Json.lookup j "reserved_instances_modification_id") - String.of_json - } -end - -module DescribeSpotInstanceRequestsResult = struct - type t = { spot_instance_requests : SpotInstanceRequestList.t } - - let make ?(spot_instance_requests = []) () = { spot_instance_requests } - - let parse xml = - Some - { spot_instance_requests = - Util.of_option - [] - (Util.option_bind - (Xml.member "spotInstanceRequestSet" xml) - SpotInstanceRequestList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CreateVolumePermission", + (CreateVolumePermissionList.to_query + v.create_volume_permissions))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Some + ("create_volume_permissions", + (CreateVolumePermissionList.to_json + v.create_volume_permissions)); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f)))]) + let of_json j = + { + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + create_volume_permissions = + (CreateVolumePermissionList.of_json + (Util.of_option_exn (Json.lookup j "create_volume_permissions"))); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))) + } + end +module DeleteVpnGatewayRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpn_gateway_id: String.t } + let make ?dry_run ~vpn_gateway_id () = { dry_run; vpn_gateway_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_gateway_id = + (Xml.required "VpnGatewayId" + (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpnGatewayId", (String.to_query v.vpn_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpn_gateway_id", (String.to_json v.vpn_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateway_id"))) + } + end +module UnassignPrivateIpAddressesRequest = + struct + type t = + { + network_interface_id: String.t ; + private_ip_addresses: PrivateIpAddressStringList.t } + let make ~network_interface_id ~private_ip_addresses () = + { network_interface_id; private_ip_addresses } + let parse xml = + Some + { + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + private_ip_addresses = + (Xml.required "privateIpAddress" + (Util.option_bind (Xml.member "privateIpAddress" xml) + PrivateIpAddressStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PrivateIpAddress", + (PrivateIpAddressStringList.to_query + v.private_ip_addresses))); + Some (Query.Pair - ( "SpotInstanceRequestSet" - , SpotInstanceRequestList.to_query v.spot_instance_requests )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "spot_instance_requests" - , SpotInstanceRequestList.to_json v.spot_instance_requests ) - ]) - - let of_json j = - { spot_instance_requests = - SpotInstanceRequestList.of_json - (Util.of_option_exn (Json.lookup j "spot_instance_requests")) - } -end - -module ModifySnapshotAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; snapshot_id : String.t - ; attribute : SnapshotAttributeName.t option - ; operation_type : OperationType.t option - ; user_ids : UserIdStringList.t - ; group_names : GroupNameStringList.t - ; create_volume_permission : CreateVolumePermissionModifications.t option - } - - let make - ?dry_run - ~snapshot_id - ?attribute - ?operation_type - ?(user_ids = []) - ?(group_names = []) - ?create_volume_permission - () = - { dry_run - ; snapshot_id - ; attribute - ; operation_type - ; user_ids - ; group_names - ; create_volume_permission - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; snapshot_id = - Xml.required - "SnapshotId" - (Util.option_bind (Xml.member "SnapshotId" xml) String.parse) - ; attribute = - Util.option_bind (Xml.member "Attribute" xml) SnapshotAttributeName.parse - ; operation_type = - Util.option_bind (Xml.member "OperationType" xml) OperationType.parse - ; user_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "UserId" xml) UserIdStringList.parse) - ; group_names = - Util.of_option - [] - (Util.option_bind (Xml.member "UserGroup" xml) GroupNameStringList.parse) - ; create_volume_permission = - Util.option_bind - (Xml.member "CreateVolumePermission" xml) - CreateVolumePermissionModifications.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.create_volume_permission (fun f -> - Query.Pair - ("CreateVolumePermission", CreateVolumePermissionModifications.to_query f)) - ; Some (Query.Pair ("UserGroup", GroupNameStringList.to_query v.group_names)) - ; Some (Query.Pair ("UserId", UserIdStringList.to_query v.user_ids)) - ; Util.option_map v.operation_type (fun f -> - Query.Pair ("OperationType", OperationType.to_query f)) - ; Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", SnapshotAttributeName.to_query f)) - ; Some (Query.Pair ("SnapshotId", String.to_query v.snapshot_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.create_volume_permission (fun f -> - "create_volume_permission", CreateVolumePermissionModifications.to_json f) - ; Some ("group_names", GroupNameStringList.to_json v.group_names) - ; Some ("user_ids", UserIdStringList.to_json v.user_ids) - ; Util.option_map v.operation_type (fun f -> - "operation_type", OperationType.to_json f) - ; Util.option_map v.attribute (fun f -> - "attribute", SnapshotAttributeName.to_json f) - ; Some ("snapshot_id", String.to_json v.snapshot_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; snapshot_id = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id")) - ; attribute = - Util.option_map (Json.lookup j "attribute") SnapshotAttributeName.of_json - ; operation_type = - Util.option_map (Json.lookup j "operation_type") OperationType.of_json - ; user_ids = UserIdStringList.of_json (Util.of_option_exn (Json.lookup j "user_ids")) - ; group_names = - GroupNameStringList.of_json (Util.of_option_exn (Json.lookup j "group_names")) - ; create_volume_permission = - Util.option_map - (Json.lookup j "create_volume_permission") - CreateVolumePermissionModifications.of_json - } -end - -module ReleaseAddressRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ip : String.t option - ; allocation_id : String.t option - } - - let make ?dry_run ?public_ip ?allocation_id () = { dry_run; public_ip; allocation_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ip = Util.option_bind (Xml.member "PublicIp" xml) String.parse - ; allocation_id = Util.option_bind (Xml.member "AllocationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - } -end - -module ImportSnapshotResult = struct - type t = - { import_task_id : String.t option - ; snapshot_task_detail : SnapshotTaskDetail.t option - ; description : String.t option - } - - let make ?import_task_id ?snapshot_task_detail ?description () = - { import_task_id; snapshot_task_detail; description } - - let parse xml = - Some - { import_task_id = Util.option_bind (Xml.member "importTaskId" xml) String.parse - ; snapshot_task_detail = - Util.option_bind (Xml.member "snapshotTaskDetail" xml) SnapshotTaskDetail.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.snapshot_task_detail (fun f -> - Query.Pair ("SnapshotTaskDetail", SnapshotTaskDetail.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.snapshot_task_detail (fun f -> - "snapshot_task_detail", SnapshotTaskDetail.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ]) - - let of_json j = - { import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; snapshot_task_detail = - Util.option_map (Json.lookup j "snapshot_task_detail") SnapshotTaskDetail.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module DescribeVolumesResult = struct - type t = - { volumes : VolumeList.t - ; next_token : String.t option - } - - let make ?(volumes = []) ?next_token () = { volumes; next_token } - - let parse xml = - Some - { volumes = - Util.of_option - [] - (Util.option_bind (Xml.member "volumeSet" xml) VolumeList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("VolumeSet", VolumeList.to_query v.volumes)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("volumes", VolumeList.to_json v.volumes) - ]) - - let of_json j = - { volumes = VolumeList.of_json (Util.of_option_exn (Json.lookup j "volumes")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module AcceptVpcPeeringConnectionResult = struct - type t = { vpc_peering_connection : VpcPeeringConnection.t option } - - let make ?vpc_peering_connection () = { vpc_peering_connection } - - let parse xml = - Some - { vpc_peering_connection = - Util.option_bind - (Xml.member "vpcPeeringConnection" xml) - VpcPeeringConnection.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection (fun f -> - Query.Pair ("VpcPeeringConnection", VpcPeeringConnection.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection (fun f -> - "vpc_peering_connection", VpcPeeringConnection.to_json f) - ]) - - let of_json j = - { vpc_peering_connection = - Util.option_map - (Json.lookup j "vpc_peering_connection") - VpcPeeringConnection.of_json - } -end - -module AttachNetworkInterfaceResult = struct - type t = { attachment_id : String.t option } - - let make ?attachment_id () = { attachment_id } - - let parse xml = - Some { attachment_id = Util.option_bind (Xml.member "attachmentId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attachment_id (fun f -> - Query.Pair ("AttachmentId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attachment_id (fun f -> "attachment_id", String.to_json f) ]) - - let of_json j = - { attachment_id = Util.option_map (Json.lookup j "attachment_id") String.of_json } -end - -module DescribeReservedInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; reserved_instances_ids : ReservedInstancesIdStringList.t - ; filters : FilterList.t - ; offering_type : OfferingTypeValues.t option - } - - let make ?dry_run ?(reserved_instances_ids = []) ?(filters = []) ?offering_type () = - { dry_run; reserved_instances_ids; filters; offering_type } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; reserved_instances_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedInstancesId" xml) - ReservedInstancesIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; offering_type = - Util.option_bind (Xml.member "offeringType" xml) OfferingTypeValues.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", OfferingTypeValues.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + ("NetworkInterfaceId", + (String.to_query v.network_interface_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("private_ip_addresses", + (PrivateIpAddressStringList.to_json v.private_ip_addresses)); + Some + ("network_interface_id", + (String.to_json v.network_interface_id))]) + let of_json j = + { + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + private_ip_addresses = + (PrivateIpAddressStringList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))) + } + end +module EnableVpcClassicLinkResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module PurchaseReservedInstancesOfferingResult = + struct + type t = { + reserved_instances_id: String.t option } + let make ?reserved_instances_id () = { reserved_instances_id } + let parse xml = + Some + { + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json) + } + end +module ModifyVpcAttributeRequest = + struct + type t = + { + vpc_id: String.t ; + enable_dns_support: AttributeBooleanValue.t option ; + enable_dns_hostnames: AttributeBooleanValue.t option } + let make ~vpc_id ?enable_dns_support ?enable_dns_hostnames () = + { vpc_id; enable_dns_support; enable_dns_hostnames } + let parse xml = + Some + { + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)); + enable_dns_support = + (Util.option_bind (Xml.member "EnableDnsSupport" xml) + AttributeBooleanValue.parse); + enable_dns_hostnames = + (Util.option_bind (Xml.member "EnableDnsHostnames" xml) + AttributeBooleanValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enable_dns_hostnames + (fun f -> + Query.Pair + ("EnableDnsHostnames", (AttributeBooleanValue.to_query f))); + Util.option_map v.enable_dns_support + (fun f -> + Query.Pair + ("EnableDnsSupport", (AttributeBooleanValue.to_query f))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enable_dns_hostnames + (fun f -> + ("enable_dns_hostnames", (AttributeBooleanValue.to_json f))); + Util.option_map v.enable_dns_support + (fun f -> + ("enable_dns_support", (AttributeBooleanValue.to_json f))); + Some ("vpc_id", (String.to_json v.vpc_id))]) + let of_json j = + { + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + enable_dns_support = + (Util.option_map (Json.lookup j "enable_dns_support") + AttributeBooleanValue.of_json); + enable_dns_hostnames = + (Util.option_map (Json.lookup j "enable_dns_hostnames") + AttributeBooleanValue.of_json) + } + end +module RejectVpcPeeringConnectionResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module ReplaceNetworkAclAssociationResult = + struct + type t = { + new_association_id: String.t option } + let make ?new_association_id () = { new_association_id } + let parse xml = + Some + { + new_association_id = + (Util.option_bind (Xml.member "newAssociationId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.new_association_id + (fun f -> Query.Pair ("NewAssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.new_association_id + (fun f -> ("new_association_id", (String.to_json f)))]) + let of_json j = + { + new_association_id = + (Util.option_map (Json.lookup j "new_association_id") + String.of_json) + } + end +module ModifyVpcEndpointResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module AttachClassicLinkVpcResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module DeleteSpotDatafeedSubscriptionRequest = + struct + type t = { + dry_run: Boolean.t option } + let make ?dry_run () = { dry_run } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json) + } + end +module TerminateInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t } + let make ?dry_run ~instance_ids () = { dry_run; instance_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))) + } + end +module CreateRouteResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module DeleteRouteTableRequest = + struct + type t = { + dry_run: Boolean.t option ; + route_table_id: String.t } + let make ?dry_run ~route_table_id () = { dry_run; route_table_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RouteTableId", (String.to_query v.route_table_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("route_table_id", (String.to_json v.route_table_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))) + } + end +module CancelSpotFleetRequestsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_fleet_request_ids: ValueStringList.t ; + terminate_instances: Boolean.t } + let make ?dry_run ~spot_fleet_request_ids ~terminate_instances () = + { dry_run; spot_fleet_request_ids; terminate_instances } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_fleet_request_ids = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + ValueStringList.parse)); + terminate_instances = + (Xml.required "terminateInstances" + (Util.option_bind (Xml.member "terminateInstances" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TerminateInstances", + (Boolean.to_query v.terminate_instances))); + Some (Query.Pair - ( "ReservedInstancesId" - , ReservedInstancesIdStringList.to_query v.reserved_instances_ids )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.offering_type (fun f -> - "offering_type", OfferingTypeValues.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some - ( "reserved_instances_ids" - , ReservedInstancesIdStringList.to_json v.reserved_instances_ids ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; reserved_instances_ids = - ReservedInstancesIdStringList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; offering_type = - Util.option_map (Json.lookup j "offering_type") OfferingTypeValues.of_json - } -end - -module DescribeVpcClassicLinkRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_ids : VpcClassicLinkIdList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(vpc_ids = []) ?(filters = []) () = { dry_run; vpc_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "VpcId" xml) VpcClassicLinkIdList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("VpcId", VpcClassicLinkIdList.to_query v.vpc_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("vpc_ids", VpcClassicLinkIdList.to_json v.vpc_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_ids = - VpcClassicLinkIdList.of_json (Util.of_option_exn (Json.lookup j "vpc_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeRegionsResult = struct - type t = { regions : RegionList.t } - - let make ?(regions = []) () = { regions } - - let parse xml = - Some - { regions = - Util.of_option - [] - (Util.option_bind (Xml.member "regionInfo" xml) RegionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("RegionInfo", RegionList.to_query v.regions)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("regions", RegionList.to_json v.regions) ]) - - let of_json j = - { regions = RegionList.of_json (Util.of_option_exn (Json.lookup j "regions")) } -end - -module CreateVpnConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; type_ : String.t - ; customer_gateway_id : String.t - ; vpn_gateway_id : String.t - ; options : VpnConnectionOptionsSpecification.t option - } - - let make ?dry_run ~type_ ~customer_gateway_id ~vpn_gateway_id ?options () = - { dry_run; type_; customer_gateway_id; vpn_gateway_id; options } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; type_ = - Xml.required "Type" (Util.option_bind (Xml.member "Type" xml) String.parse) - ; customer_gateway_id = - Xml.required - "CustomerGatewayId" - (Util.option_bind (Xml.member "CustomerGatewayId" xml) String.parse) - ; vpn_gateway_id = - Xml.required - "VpnGatewayId" - (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse) - ; options = - Util.option_bind - (Xml.member "options" xml) - VpnConnectionOptionsSpecification.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.options (fun f -> - Query.Pair ("Options", VpnConnectionOptionsSpecification.to_query f)) - ; Some (Query.Pair ("VpnGatewayId", String.to_query v.vpn_gateway_id)) - ; Some (Query.Pair ("CustomerGatewayId", String.to_query v.customer_gateway_id)) - ; Some (Query.Pair ("Type", String.to_query v.type_)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.options (fun f -> - "options", VpnConnectionOptionsSpecification.to_json f) - ; Some ("vpn_gateway_id", String.to_json v.vpn_gateway_id) - ; Some ("customer_gateway_id", String.to_json v.customer_gateway_id) - ; Some ("type_", String.to_json v.type_) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; type_ = String.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; customer_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "customer_gateway_id")) - ; vpn_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_gateway_id")) - ; options = - Util.option_map - (Json.lookup j "options") - VpnConnectionOptionsSpecification.of_json - } -end - -module CreateVpnGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; type_ : GatewayType.t - ; availability_zone : String.t option - } - - let make ?dry_run ~type_ ?availability_zone () = { dry_run; type_; availability_zone } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; type_ = - Xml.required "Type" (Util.option_bind (Xml.member "Type" xml) GatewayType.parse) - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Some (Query.Pair ("Type", GatewayType.to_query v.type_)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Some ("type_", GatewayType.to_json v.type_) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; type_ = GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - } -end - -module RegisterImageResult = struct - type t = { image_id : String.t option } - - let make ?image_id () = { image_id } - - let parse xml = - Some { image_id = Util.option_bind (Xml.member "imageId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> Query.Pair ("ImageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.image_id (fun f -> "image_id", String.to_json f) ]) - - let of_json j = { image_id = Util.option_map (Json.lookup j "image_id") String.of_json } -end - -module AttachVolumeRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - ; instance_id : String.t - ; device : String.t - } - - let make ?dry_run ~volume_id ~instance_id ~device () = - { dry_run; volume_id; instance_id; device } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; device = - Xml.required "Device" (Util.option_bind (Xml.member "Device" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Device", String.to_query v.device)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("device", String.to_json v.device) - ; Some ("instance_id", String.to_json v.instance_id) - ; Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; device = String.of_json (Util.of_option_exn (Json.lookup j "device")) - } -end - -module CancelReservedInstancesListingResult = struct - type t = { reserved_instances_listings : ReservedInstancesListingList.t } - - let make ?(reserved_instances_listings = []) () = { reserved_instances_listings } - - let parse xml = - Some - { reserved_instances_listings = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesListingsSet" xml) - ReservedInstancesListingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SpotFleetRequestId", + (ValueStringList.to_query v.spot_fleet_request_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("terminate_instances", + (Boolean.to_json v.terminate_instances)); + Some + ("spot_fleet_request_ids", + (ValueStringList.to_json v.spot_fleet_request_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_fleet_request_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_ids"))); + terminate_instances = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "terminate_instances"))) + } + end +module DeleteVpcEndpointsResult = + struct + type t = { + unsuccessful: UnsuccessfulItemSet.t } + let make ?(unsuccessful= []) () = { unsuccessful } + let parse xml = + Some + { + unsuccessful = + (Util.of_option [] + (Util.option_bind (Xml.member "unsuccessful" xml) + UnsuccessfulItemSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Unsuccessful", + (UnsuccessfulItemSet.to_query v.unsuccessful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("unsuccessful", (UnsuccessfulItemSet.to_json v.unsuccessful))]) + let of_json j = + { + unsuccessful = + (UnsuccessfulItemSet.of_json + (Util.of_option_exn (Json.lookup j "unsuccessful"))) + } + end +module CancelBundleTaskRequest = + struct + type t = { + dry_run: Boolean.t option ; + bundle_id: String.t } + let make ?dry_run ~bundle_id () = { dry_run; bundle_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + bundle_id = + (Xml.required "BundleId" + (Util.option_bind (Xml.member "BundleId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("BundleId", (String.to_query v.bundle_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("bundle_id", (String.to_json v.bundle_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + bundle_id = + (String.of_json (Util.of_option_exn (Json.lookup j "bundle_id"))) + } + end +module CopyImageResult = + struct + type t = { + image_id: String.t option } + let make ?image_id () = { image_id } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json) + } + end +module CreateInstanceExportTaskResult = + struct + type t = { + export_task: ExportTask.t option } + let make ?export_task () = { export_task } + let parse xml = + Some + { + export_task = + (Util.option_bind (Xml.member "exportTask" xml) ExportTask.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.export_task + (fun f -> Query.Pair ("ExportTask", (ExportTask.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.export_task + (fun f -> ("export_task", (ExportTask.to_json f)))]) + let of_json j = + { + export_task = + (Util.option_map (Json.lookup j "export_task") ExportTask.of_json) + } + end +module CreateVpcEndpointRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_id: String.t ; + service_name: String.t ; + policy_document: String.t option ; + route_table_ids: ValueStringList.t ; + client_token: String.t option } + let make ?dry_run ~vpc_id ~service_name ?policy_document + ?(route_table_ids= []) ?client_token () = + { + dry_run; + vpc_id; + service_name; + policy_document; + route_table_ids; + client_token + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)); + service_name = + (Xml.required "ServiceName" + (Util.option_bind (Xml.member "ServiceName" xml) String.parse)); + policy_document = + (Util.option_bind (Xml.member "PolicyDocument" xml) String.parse); + route_table_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "RouteTableId" xml) + ValueStringList.parse)); + client_token = + (Util.option_bind (Xml.member "ClientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Some (Query.Pair - ( "ReservedInstancesListingsSet" - , ReservedInstancesListingList.to_query v.reserved_instances_listings )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_instances_listings" - , ReservedInstancesListingList.to_json v.reserved_instances_listings ) - ]) - - let of_json j = - { reserved_instances_listings = - ReservedInstancesListingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_listings")) - } -end - -module CreateTagsRequest = struct - type t = - { dry_run : Boolean.t option - ; resources : ResourceIdList.t - ; tags : TagList.t - } - - let make ?dry_run ~resources ~tags () = { dry_run; resources; tags } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; resources = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) ResourceIdList.parse) - ; tags = Xml.required "Tag" (Util.option_bind (Xml.member "Tag" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tag", TagList.to_query v.tags)) - ; Some (Query.Pair ("ResourceId", ResourceIdList.to_query v.resources)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("resources", ResourceIdList.to_json v.resources) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; resources = ResourceIdList.of_json (Util.of_option_exn (Json.lookup j "resources")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CreateDhcpOptionsResult = struct - type t = { dhcp_options : DhcpOptions.t option } - - let make ?dhcp_options () = { dhcp_options } - - let parse xml = - Some - { dhcp_options = Util.option_bind (Xml.member "dhcpOptions" xml) DhcpOptions.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dhcp_options (fun f -> - Query.Pair ("DhcpOptions", DhcpOptions.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dhcp_options (fun f -> "dhcp_options", DhcpOptions.to_json f) - ]) - - let of_json j = - { dhcp_options = Util.option_map (Json.lookup j "dhcp_options") DhcpOptions.of_json } -end - -module CreatePlacementGroupRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t - ; strategy : PlacementStrategy.t - } - - let make ?dry_run ~group_name ~strategy () = { dry_run; group_name; strategy } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = - Xml.required - "groupName" - (Util.option_bind (Xml.member "groupName" xml) String.parse) - ; strategy = - Xml.required - "strategy" - (Util.option_bind (Xml.member "strategy" xml) PlacementStrategy.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Strategy", PlacementStrategy.to_query v.strategy)) - ; Some (Query.Pair ("GroupName", String.to_query v.group_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("strategy", PlacementStrategy.to_json v.strategy) - ; Some ("group_name", String.to_json v.group_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = String.of_json (Util.of_option_exn (Json.lookup j "group_name")) - ; strategy = PlacementStrategy.of_json (Util.of_option_exn (Json.lookup j "strategy")) - } -end - -module ConfirmProductInstanceResult = struct - type t = - { owner_id : String.t option - ; return : Boolean.t option - } - - let make ?owner_id ?return () = { owner_id; return } - - let parse xml = - Some - { owner_id = Util.option_bind (Xml.member "ownerId" xml) String.parse - ; return = Util.option_bind (Xml.member "return" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> Query.Pair ("Return", Boolean.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.return (fun f -> "return", Boolean.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ]) - - let of_json j = - { owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; return = Util.option_map (Json.lookup j "return") Boolean.of_json - } -end - -module AssociateAddressRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t option - ; public_ip : String.t option - ; allocation_id : String.t option - ; network_interface_id : String.t option - ; private_ip_address : String.t option - ; allow_reassociation : Boolean.t option - } - - let make - ?dry_run - ?instance_id - ?public_ip - ?allocation_id - ?network_interface_id - ?private_ip_address - ?allow_reassociation - () = - { dry_run - ; instance_id - ; public_ip - ; allocation_id - ; network_interface_id - ; private_ip_address - ; allow_reassociation - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; public_ip = Util.option_bind (Xml.member "PublicIp" xml) String.parse - ; allocation_id = Util.option_bind (Xml.member "AllocationId" xml) String.parse - ; network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; allow_reassociation = - Util.option_bind (Xml.member "allowReassociation" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.allow_reassociation (fun f -> - Query.Pair ("AllowReassociation", Boolean.to_query f)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ; Util.option_map v.allocation_id (fun f -> - Query.Pair ("AllocationId", String.to_query f)) - ; Util.option_map v.public_ip (fun f -> - Query.Pair ("PublicIp", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.allow_reassociation (fun f -> - "allow_reassociation", Boolean.to_json f) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ; Util.option_map v.allocation_id (fun f -> "allocation_id", String.to_json f) - ; Util.option_map v.public_ip (fun f -> "public_ip", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; public_ip = Util.option_map (Json.lookup j "public_ip") String.of_json - ; allocation_id = Util.option_map (Json.lookup j "allocation_id") String.of_json - ; network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; allow_reassociation = - Util.option_map (Json.lookup j "allow_reassociation") Boolean.of_json - } -end - -module CreateRouteRequest = struct - type t = - { dry_run : Boolean.t option - ; route_table_id : String.t - ; destination_cidr_block : String.t - ; gateway_id : String.t option - ; instance_id : String.t option - ; network_interface_id : String.t option - ; vpc_peering_connection_id : String.t option - } - - let make - ?dry_run - ~route_table_id - ~destination_cidr_block - ?gateway_id - ?instance_id - ?network_interface_id - ?vpc_peering_connection_id - () = - { dry_run - ; route_table_id - ; destination_cidr_block - ; gateway_id - ; instance_id - ; network_interface_id - ; vpc_peering_connection_id - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - ; destination_cidr_block = - Xml.required - "destinationCidrBlock" - (Util.option_bind (Xml.member "destinationCidrBlock" xml) String.parse) - ; gateway_id = Util.option_bind (Xml.member "gatewayId" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; network_interface_id = - Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse - ; vpc_peering_connection_id = - Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - Query.Pair ("VpcPeeringConnectionId", String.to_query f)) - ; Util.option_map v.network_interface_id (fun f -> - Query.Pair ("NetworkInterfaceId", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.gateway_id (fun f -> - Query.Pair ("GatewayId", String.to_query f)) - ; Some - (Query.Pair ("DestinationCidrBlock", String.to_query v.destination_cidr_block)) - ; Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_peering_connection_id (fun f -> - "vpc_peering_connection_id", String.to_json f) - ; Util.option_map v.network_interface_id (fun f -> - "network_interface_id", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.gateway_id (fun f -> "gateway_id", String.to_json f) - ; Some ("destination_cidr_block", String.to_json v.destination_cidr_block) - ; Some ("route_table_id", String.to_json v.route_table_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - ; destination_cidr_block = - String.of_json (Util.of_option_exn (Json.lookup j "destination_cidr_block")) - ; gateway_id = Util.option_map (Json.lookup j "gateway_id") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; network_interface_id = - Util.option_map (Json.lookup j "network_interface_id") String.of_json - ; vpc_peering_connection_id = - Util.option_map (Json.lookup j "vpc_peering_connection_id") String.of_json - } -end - -module RejectVpcPeeringConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_peering_connection_id : String.t - } - - let make ?dry_run ~vpc_peering_connection_id () = { dry_run; vpc_peering_connection_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_peering_connection_id = - Xml.required - "vpcPeeringConnectionId" - (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("RouteTableId", + (ValueStringList.to_query v.route_table_ids))); + Util.option_map v.policy_document + (fun f -> Query.Pair ("PolicyDocument", (String.to_query f))); + Some + (Query.Pair ("ServiceName", (String.to_query v.service_name))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Some + ("route_table_ids", (ValueStringList.to_json v.route_table_ids)); + Util.option_map v.policy_document + (fun f -> ("policy_document", (String.to_json f))); + Some ("service_name", (String.to_json v.service_name)); + Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + service_name = + (String.of_json (Util.of_option_exn (Json.lookup j "service_name"))); + policy_document = + (Util.option_map (Json.lookup j "policy_document") String.of_json); + route_table_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "route_table_ids"))); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module DeleteDhcpOptionsRequest = + struct + type t = { + dry_run: Boolean.t option ; + dhcp_options_id: String.t } + let make ?dry_run ~dhcp_options_id () = { dry_run; dhcp_options_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + dhcp_options_id = + (Xml.required "DhcpOptionsId" + (Util.option_bind (Xml.member "DhcpOptionsId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DhcpOptionsId", (String.to_query v.dhcp_options_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("dhcp_options_id", (String.to_json v.dhcp_options_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + dhcp_options_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "dhcp_options_id"))) + } + end +module DescribeImportSnapshotTasksRequest = + struct + type t = + { + dry_run: Boolean.t option ; + import_task_ids: ImportTaskIdList.t ; + next_token: String.t option ; + max_results: Integer.t option ; + filters: FilterList.t } + let make ?dry_run ?(import_task_ids= []) ?next_token ?max_results + ?(filters= []) () = + { dry_run; import_task_ids; next_token; max_results; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + import_task_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "ImportTaskId" xml) + ImportTaskIdList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filters", (FilterList.to_query v.filters))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ("VpcPeeringConnectionId", String.to_query v.vpc_peering_connection_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_peering_connection_id", String.to_json v.vpc_peering_connection_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_peering_connection_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpc_peering_connection_id")) - } -end - -module AllocateAddressRequest = struct - type t = - { dry_run : Boolean.t option - ; domain : DomainType.t option - } - - let make ?dry_run ?domain () = { dry_run; domain } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; domain = Util.option_bind (Xml.member "Domain" xml) DomainType.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.domain (fun f -> - Query.Pair ("Domain", DomainType.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.domain (fun f -> "domain", DomainType.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; domain = Util.option_map (Json.lookup j "domain") DomainType.of_json - } -end - -module DescribeAddressesRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ips : PublicIpStringList.t - ; filters : FilterList.t - ; allocation_ids : AllocationIdList.t - } - - let make ?dry_run ?(public_ips = []) ?(filters = []) ?(allocation_ids = []) () = - { dry_run; public_ips; filters; allocation_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ips = - Util.of_option - [] - (Util.option_bind (Xml.member "PublicIp" xml) PublicIpStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; allocation_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "AllocationId" xml) AllocationIdList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AllocationId", AllocationIdList.to_query v.allocation_ids)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("PublicIp", PublicIpStringList.to_query v.public_ips)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("allocation_ids", AllocationIdList.to_json v.allocation_ids) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("public_ips", PublicIpStringList.to_json v.public_ips) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ips = - PublicIpStringList.of_json (Util.of_option_exn (Json.lookup j "public_ips")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; allocation_ids = - AllocationIdList.of_json (Util.of_option_exn (Json.lookup j "allocation_ids")) - } -end - -module BundleInstanceResult = struct - type t = { bundle_task : BundleTask.t option } - - let make ?bundle_task () = { bundle_task } - - let parse xml = - Some - { bundle_task = - Util.option_bind (Xml.member "bundleInstanceTask" xml) BundleTask.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.bundle_task (fun f -> - Query.Pair ("BundleInstanceTask", BundleTask.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.bundle_task (fun f -> "bundle_task", BundleTask.to_json f) ]) - - let of_json j = - { bundle_task = Util.option_map (Json.lookup j "bundle_task") BundleTask.of_json } -end - -module CreateRouteTableRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t - } - - let make ?dry_run ~vpc_id () = { dry_run; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module DetachVolumeRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - ; instance_id : String.t option - ; device : String.t option - ; force : Boolean.t option - } - - let make ?dry_run ~volume_id ?instance_id ?device ?force () = - { dry_run; volume_id; instance_id; device; force } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; device = Util.option_bind (Xml.member "Device" xml) String.parse - ; force = Util.option_bind (Xml.member "Force" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> Query.Pair ("Force", Boolean.to_query f)) - ; Util.option_map v.device (fun f -> Query.Pair ("Device", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> "force", Boolean.to_json f) - ; Util.option_map v.device (fun f -> "device", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; device = Util.option_map (Json.lookup j "device") String.of_json - ; force = Util.option_map (Json.lookup j "force") Boolean.of_json - } -end - -module InstanceAttribute = struct - type t = - { instance_id : String.t option - ; instance_type : AttributeValue.t option - ; kernel_id : AttributeValue.t option - ; ramdisk_id : AttributeValue.t option - ; user_data : AttributeValue.t option - ; disable_api_termination : AttributeBooleanValue.t option - ; instance_initiated_shutdown_behavior : AttributeValue.t option - ; root_device_name : AttributeValue.t option - ; block_device_mappings : InstanceBlockDeviceMappingList.t - ; product_codes : ProductCodeList.t - ; ebs_optimized : AttributeBooleanValue.t option - ; sriov_net_support : AttributeValue.t option - ; source_dest_check : AttributeBooleanValue.t option - ; groups : GroupIdentifierList.t - } - - let make - ?instance_id - ?instance_type - ?kernel_id - ?ramdisk_id - ?user_data - ?disable_api_termination - ?instance_initiated_shutdown_behavior - ?root_device_name - ?(block_device_mappings = []) - ?(product_codes = []) - ?ebs_optimized - ?sriov_net_support - ?source_dest_check - ?(groups = []) - () = - { instance_id - ; instance_type - ; kernel_id - ; ramdisk_id - ; user_data - ; disable_api_termination - ; instance_initiated_shutdown_behavior - ; root_device_name - ; block_device_mappings - ; product_codes - ; ebs_optimized - ; sriov_net_support - ; source_dest_check - ; groups - } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "instanceId" xml) String.parse - ; instance_type = - Util.option_bind (Xml.member "instanceType" xml) AttributeValue.parse - ; kernel_id = Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse - ; user_data = Util.option_bind (Xml.member "userData" xml) AttributeValue.parse - ; disable_api_termination = - Util.option_bind - (Xml.member "disableApiTermination" xml) - AttributeBooleanValue.parse - ; instance_initiated_shutdown_behavior = - Util.option_bind - (Xml.member "instanceInitiatedShutdownBehavior" xml) - AttributeValue.parse - ; root_device_name = - Util.option_bind (Xml.member "rootDeviceName" xml) AttributeValue.parse - ; block_device_mappings = - Util.of_option - [] + ("ImportTaskId", + (ImportTaskIdList.to_query v.import_task_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("import_task_ids", + (ImportTaskIdList.to_json v.import_task_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + import_task_ids = + (ImportTaskIdList.of_json + (Util.of_option_exn (Json.lookup j "import_task_ids"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module RequestSpotFleetRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_fleet_request_config: SpotFleetRequestConfigData.t } + let make ?dry_run ~spot_fleet_request_config () = + { dry_run; spot_fleet_request_config } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_fleet_request_config = + (Xml.required "spotFleetRequestConfig" + (Util.option_bind (Xml.member "spotFleetRequestConfig" xml) + SpotFleetRequestConfigData.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotFleetRequestConfig", + (SpotFleetRequestConfigData.to_query + v.spot_fleet_request_config))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_fleet_request_config", + (SpotFleetRequestConfigData.to_json + v.spot_fleet_request_config)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_fleet_request_config = + (SpotFleetRequestConfigData.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_config"))) + } + end +module DescribeReservedInstancesListingsResult = + struct + type t = { + reserved_instances_listings: ReservedInstancesListingList.t } + let make ?(reserved_instances_listings= []) () = + { reserved_instances_listings } + let parse xml = + Some + { + reserved_instances_listings = + (Util.of_option [] + (Util.option_bind + (Xml.member "reservedInstancesListingsSet" xml) + ReservedInstancesListingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesListingsSet", + (ReservedInstancesListingList.to_query + v.reserved_instances_listings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_instances_listings", + (ReservedInstancesListingList.to_json + v.reserved_instances_listings))]) + let of_json j = + { + reserved_instances_listings = + (ReservedInstancesListingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_listings"))) + } + end +module DeleteSecurityGroupRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_name: String.t option ; + group_id: String.t option } + let make ?dry_run ?group_name ?group_id () = + { dry_run; group_name; group_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Util.option_bind (Xml.member "GroupName" xml) String.parse); + group_id = + (Util.option_bind (Xml.member "GroupId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> Query.Pair ("GroupId", (String.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group_id + (fun f -> ("group_id", (String.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + group_id = + (Util.option_map (Json.lookup j "group_id") String.of_json) + } + end +module DeleteVpcEndpointsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_endpoint_ids: ValueStringList.t } + let make ?dry_run ~vpc_endpoint_ids () = { dry_run; vpc_endpoint_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + vpc_endpoint_ids = + (Xml.required "VpcEndpointId" + (Util.option_bind (Xml.member "VpcEndpointId" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcEndpointId", + (ValueStringList.to_query v.vpc_endpoint_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_endpoint_ids", + (ValueStringList.to_json v.vpc_endpoint_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_endpoint_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "vpc_endpoint_ids"))) + } + end +module RunInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_id: String.t ; + min_count: Integer.t ; + max_count: Integer.t ; + key_name: String.t option ; + security_groups: SecurityGroupStringList.t ; + security_group_ids: SecurityGroupIdStringList.t ; + user_data: String.t option ; + instance_type: InstanceType.t option ; + placement: Placement.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + block_device_mappings: BlockDeviceMappingRequestList.t ; + monitoring: RunInstancesMonitoringEnabled.t option ; + subnet_id: String.t option ; + disable_api_termination: Boolean.t option ; + instance_initiated_shutdown_behavior: ShutdownBehavior.t option ; + private_ip_address: String.t option ; + client_token: String.t option ; + additional_info: String.t option ; + network_interfaces: InstanceNetworkInterfaceSpecificationList.t ; + iam_instance_profile: IamInstanceProfileSpecification.t option ; + ebs_optimized: Boolean.t option } + let make ?dry_run ~image_id ~min_count ~max_count ?key_name + ?(security_groups= []) ?(security_group_ids= []) ?user_data + ?instance_type ?placement ?kernel_id ?ramdisk_id + ?(block_device_mappings= []) ?monitoring ?subnet_id + ?disable_api_termination ?instance_initiated_shutdown_behavior + ?private_ip_address ?client_token ?additional_info + ?(network_interfaces= []) ?iam_instance_profile ?ebs_optimized () = + { + dry_run; + image_id; + min_count; + max_count; + key_name; + security_groups; + security_group_ids; + user_data; + instance_type; + placement; + kernel_id; + ramdisk_id; + block_device_mappings; + monitoring; + subnet_id; + disable_api_termination; + instance_initiated_shutdown_behavior; + private_ip_address; + client_token; + additional_info; + network_interfaces; + iam_instance_profile; + ebs_optimized + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)); + min_count = + (Xml.required "MinCount" + (Util.option_bind (Xml.member "MinCount" xml) Integer.parse)); + max_count = + (Xml.required "MaxCount" + (Util.option_bind (Xml.member "MaxCount" xml) Integer.parse)); + key_name = + (Util.option_bind (Xml.member "KeyName" xml) String.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroup" xml) + SecurityGroupStringList.parse)); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupId" xml) + SecurityGroupIdStringList.parse)); + user_data = + (Util.option_bind (Xml.member "UserData" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "InstanceType" xml) + InstanceType.parse); + placement = + (Util.option_bind (Xml.member "Placement" xml) Placement.parse); + kernel_id = + (Util.option_bind (Xml.member "KernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "RamdiskId" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "BlockDeviceMapping" xml) + BlockDeviceMappingRequestList.parse)); + monitoring = + (Util.option_bind (Xml.member "Monitoring" xml) + RunInstancesMonitoringEnabled.parse); + subnet_id = + (Util.option_bind (Xml.member "SubnetId" xml) String.parse); + disable_api_termination = + (Util.option_bind (Xml.member "disableApiTermination" xml) + Boolean.parse); + instance_initiated_shutdown_behavior = (Util.option_bind - (Xml.member "blockDeviceMapping" xml) - InstanceBlockDeviceMappingList.parse) - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - ; ebs_optimized = - Util.option_bind (Xml.member "ebsOptimized" xml) AttributeBooleanValue.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) AttributeValue.parse - ; source_dest_check = - Util.option_bind (Xml.member "sourceDestCheck" xml) AttributeBooleanValue.parse - ; groups = - Util.of_option - [] - (Util.option_bind (Xml.member "groupSet" xml) GroupIdentifierList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("GroupSet", GroupIdentifierList.to_query v.groups)) - ; Util.option_map v.source_dest_check (fun f -> - Query.Pair ("SourceDestCheck", AttributeBooleanValue.to_query f)) - ; Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", AttributeValue.to_query f)) - ; Util.option_map v.ebs_optimized (fun f -> - Query.Pair ("EbsOptimized", AttributeBooleanValue.to_query f)) - ; Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Some + (Xml.member "instanceInitiatedShutdownBehavior" xml) + ShutdownBehavior.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse); + additional_info = + (Util.option_bind (Xml.member "additionalInfo" xml) String.parse); + network_interfaces = + (Util.of_option [] + (Util.option_bind (Xml.member "networkInterface" xml) + InstanceNetworkInterfaceSpecificationList.parse)); + iam_instance_profile = + (Util.option_bind (Xml.member "iamInstanceProfile" xml) + IamInstanceProfileSpecification.parse); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.ebs_optimized + (fun f -> Query.Pair ("EbsOptimized", (Boolean.to_query f))); + Util.option_map v.iam_instance_profile + (fun f -> + Query.Pair + ("IamInstanceProfile", + (IamInstanceProfileSpecification.to_query f))); + Some (Query.Pair - ( "BlockDeviceMapping" - , InstanceBlockDeviceMappingList.to_query v.block_device_mappings )) - ; Util.option_map v.root_device_name (fun f -> - Query.Pair ("RootDeviceName", AttributeValue.to_query f)) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - Query.Pair ("InstanceInitiatedShutdownBehavior", AttributeValue.to_query f)) - ; Util.option_map v.disable_api_termination (fun f -> - Query.Pair ("DisableApiTermination", AttributeBooleanValue.to_query f)) - ; Util.option_map v.user_data (fun f -> - Query.Pair ("UserData", AttributeValue.to_query f)) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("Ramdisk", AttributeValue.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("Kernel", AttributeValue.to_query f)) - ; Util.option_map v.instance_type (fun f -> - Query.Pair ("InstanceType", AttributeValue.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("groups", GroupIdentifierList.to_json v.groups) - ; Util.option_map v.source_dest_check (fun f -> - "source_dest_check", AttributeBooleanValue.to_json f) - ; Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", AttributeValue.to_json f) - ; Util.option_map v.ebs_optimized (fun f -> - "ebs_optimized", AttributeBooleanValue.to_json f) - ; Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Some - ( "block_device_mappings" - , InstanceBlockDeviceMappingList.to_json v.block_device_mappings ) - ; Util.option_map v.root_device_name (fun f -> - "root_device_name", AttributeValue.to_json f) - ; Util.option_map v.instance_initiated_shutdown_behavior (fun f -> - "instance_initiated_shutdown_behavior", AttributeValue.to_json f) - ; Util.option_map v.disable_api_termination (fun f -> - "disable_api_termination", AttributeBooleanValue.to_json f) - ; Util.option_map v.user_data (fun f -> "user_data", AttributeValue.to_json f) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", AttributeValue.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", AttributeValue.to_json f) - ; Util.option_map v.instance_type (fun f -> - "instance_type", AttributeValue.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; instance_type = - Util.option_map (Json.lookup j "instance_type") AttributeValue.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") AttributeValue.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") AttributeValue.of_json - ; user_data = Util.option_map (Json.lookup j "user_data") AttributeValue.of_json - ; disable_api_termination = - Util.option_map - (Json.lookup j "disable_api_termination") - AttributeBooleanValue.of_json - ; instance_initiated_shutdown_behavior = - Util.option_map - (Json.lookup j "instance_initiated_shutdown_behavior") - AttributeValue.of_json - ; root_device_name = - Util.option_map (Json.lookup j "root_device_name") AttributeValue.of_json - ; block_device_mappings = - InstanceBlockDeviceMappingList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - ; ebs_optimized = - Util.option_map (Json.lookup j "ebs_optimized") AttributeBooleanValue.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") AttributeValue.of_json - ; source_dest_check = - Util.option_map (Json.lookup j "source_dest_check") AttributeBooleanValue.of_json - ; groups = GroupIdentifierList.of_json (Util.of_option_exn (Json.lookup j "groups")) - } -end - -module DescribeAddressesResult = struct - type t = { addresses : AddressList.t } - - let make ?(addresses = []) () = { addresses } - - let parse xml = - Some - { addresses = - Util.of_option - [] - (Util.option_bind (Xml.member "addressesSet" xml) AddressList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AddressesSet", AddressList.to_query v.addresses)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("addresses", AddressList.to_json v.addresses) ]) - - let of_json j = - { addresses = AddressList.of_json (Util.of_option_exn (Json.lookup j "addresses")) } -end - -module DescribeRouteTablesRequest = struct - type t = - { dry_run : Boolean.t option - ; route_table_ids : ValueStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(route_table_ids = []) ?(filters = []) () = - { dry_run; route_table_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; route_table_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "RouteTableId" xml) ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("RouteTableId", ValueStringList.to_query v.route_table_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("route_table_ids", ValueStringList.to_json v.route_table_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; route_table_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "route_table_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module ImportSnapshotRequest = struct - type t = - { dry_run : Boolean.t option - ; description : String.t option - ; disk_container : SnapshotDiskContainer.t option - ; client_data : ClientData.t option - ; client_token : String.t option - ; role_name : String.t option - } - - let make ?dry_run ?description ?disk_container ?client_data ?client_token ?role_name () - = - { dry_run; description; disk_container; client_data; client_token; role_name } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; disk_container = - Util.option_bind (Xml.member "DiskContainer" xml) SnapshotDiskContainer.parse - ; client_data = Util.option_bind (Xml.member "ClientData" xml) ClientData.parse - ; client_token = Util.option_bind (Xml.member "ClientToken" xml) String.parse - ; role_name = Util.option_bind (Xml.member "RoleName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.role_name (fun f -> - Query.Pair ("RoleName", String.to_query f)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.client_data (fun f -> - Query.Pair ("ClientData", ClientData.to_query f)) - ; Util.option_map v.disk_container (fun f -> - Query.Pair ("DiskContainer", SnapshotDiskContainer.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.role_name (fun f -> "role_name", String.to_json f) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.client_data (fun f -> "client_data", ClientData.to_json f) - ; Util.option_map v.disk_container (fun f -> - "disk_container", SnapshotDiskContainer.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; disk_container = - Util.option_map (Json.lookup j "disk_container") SnapshotDiskContainer.of_json - ; client_data = Util.option_map (Json.lookup j "client_data") ClientData.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; role_name = Util.option_map (Json.lookup j "role_name") String.of_json - } -end - -module CreateSubnetResult = struct - type t = { subnet : Subnet.t option } - - let make ?subnet () = { subnet } - - let parse xml = - Some { subnet = Util.option_bind (Xml.member "subnet" xml) Subnet.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subnet (fun f -> Query.Pair ("Subnet", Subnet.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subnet (fun f -> "subnet", Subnet.to_json f) ]) - - let of_json j = { subnet = Util.option_map (Json.lookup j "subnet") Subnet.of_json } -end - -module StopInstancesResult = struct - type t = { stopping_instances : InstanceStateChangeList.t } - - let make ?(stopping_instances = []) () = { stopping_instances } - - let parse xml = - Some - { stopping_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - InstanceStateChangeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("NetworkInterface", + (InstanceNetworkInterfaceSpecificationList.to_query + v.network_interfaces))); + Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + Query.Pair + ("InstanceInitiatedShutdownBehavior", + (ShutdownBehavior.to_query f))); + Util.option_map v.disable_api_termination + (fun f -> + Query.Pair ("DisableApiTermination", (Boolean.to_query f))); + Util.option_map v.subnet_id + (fun f -> Query.Pair ("SubnetId", (String.to_query f))); + Util.option_map v.monitoring + (fun f -> + Query.Pair + ("Monitoring", (RunInstancesMonitoringEnabled.to_query f))); + Some (Query.Pair - ("InstancesSet", InstanceStateChangeList.to_query v.stopping_instances)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("stopping_instances", InstanceStateChangeList.to_json v.stopping_instances) - ]) - - let of_json j = - { stopping_instances = - InstanceStateChangeList.of_json - (Util.of_option_exn (Json.lookup j "stopping_instances")) - } -end - -module RequestSpotFleetResponse = struct - type t = { spot_fleet_request_id : String.t } - - let make ~spot_fleet_request_id () = { spot_fleet_request_id } - - let parse xml = - Some - { spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) ]) - - let of_json j = - { spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - } -end - -module DescribeVpnConnectionsResult = struct - type t = { vpn_connections : VpnConnectionList.t } - - let make ?(vpn_connections = []) () = { vpn_connections } - - let parse xml = - Some - { vpn_connections = - Util.of_option - [] - (Util.option_bind (Xml.member "vpnConnectionSet" xml) VpnConnectionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("VpnConnectionSet", VpnConnectionList.to_query v.vpn_connections)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpn_connections", VpnConnectionList.to_json v.vpn_connections) ]) - - let of_json j = - { vpn_connections = - VpnConnectionList.of_json (Util.of_option_exn (Json.lookup j "vpn_connections")) - } -end - -module DescribeReservedInstancesOfferingsResult = struct - type t = - { reserved_instances_offerings : ReservedInstancesOfferingList.t - ; next_token : String.t option - } - - let make ?(reserved_instances_offerings = []) ?next_token () = - { reserved_instances_offerings; next_token } - - let parse xml = - Some - { reserved_instances_offerings = - Util.of_option - [] - (Util.option_bind - (Xml.member "reservedInstancesOfferingsSet" xml) - ReservedInstancesOfferingList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("BlockDeviceMapping", + (BlockDeviceMappingRequestList.to_query + v.block_device_mappings))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.placement + (fun f -> Query.Pair ("Placement", (Placement.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (String.to_query f))); + Some (Query.Pair - ( "ReservedInstancesOfferingsSet" - , ReservedInstancesOfferingList.to_query v.reserved_instances_offerings )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "reserved_instances_offerings" - , ReservedInstancesOfferingList.to_json v.reserved_instances_offerings ) - ]) - - let of_json j = - { reserved_instances_offerings = - ReservedInstancesOfferingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_offerings")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module AssociateDhcpOptionsRequest = struct - type t = - { dry_run : Boolean.t option - ; dhcp_options_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~dhcp_options_id ~vpc_id () = { dry_run; dhcp_options_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; dhcp_options_id = - Xml.required - "DhcpOptionsId" - (Util.option_bind (Xml.member "DhcpOptionsId" xml) String.parse) - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("DhcpOptionsId", String.to_query v.dhcp_options_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("dhcp_options_id", String.to_json v.dhcp_options_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; dhcp_options_id = - String.of_json (Util.of_option_exn (Json.lookup j "dhcp_options_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module DeleteKeyPairRequest = struct - type t = - { dry_run : Boolean.t option - ; key_name : String.t - } - - let make ?dry_run ~key_name () = { dry_run; key_name } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; key_name = - Xml.required - "KeyName" - (Util.option_bind (Xml.member "KeyName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("KeyName", String.to_query v.key_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("key_name", String.to_json v.key_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; key_name = String.of_json (Util.of_option_exn (Json.lookup j "key_name")) - } -end - -module DescribeInstancesResult = struct - type t = - { reservations : ReservationList.t - ; next_token : String.t option - } - - let make ?(reservations = []) ?next_token () = { reservations; next_token } - - let parse xml = - Some - { reservations = - Util.of_option - [] - (Util.option_bind (Xml.member "reservationSet" xml) ReservationList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("ReservationSet", ReservationList.to_query v.reservations)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("reservations", ReservationList.to_json v.reservations) - ]) - - let of_json j = - { reservations = - ReservationList.of_json (Util.of_option_exn (Json.lookup j "reservations")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module GetPasswordDataResult = struct - type t = - { instance_id : String.t - ; timestamp : DateTime.t - ; password_data : String.t - } - - let make ~instance_id ~timestamp ~password_data () = - { instance_id; timestamp; password_data } - - let parse xml = - Some - { instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; timestamp = - Xml.required - "timestamp" - (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse) - ; password_data = - Xml.required - "passwordData" - (Util.option_bind (Xml.member "passwordData" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PasswordData", String.to_query v.password_data)) - ; Some (Query.Pair ("Timestamp", DateTime.to_query v.timestamp)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("password_data", String.to_json v.password_data) - ; Some ("timestamp", DateTime.to_json v.timestamp) - ; Some ("instance_id", String.to_json v.instance_id) - ]) - - let of_json j = - { instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; timestamp = DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp")) - ; password_data = String.of_json (Util.of_option_exn (Json.lookup j "password_data")) - } -end - -module CreateVpcResult = struct - type t = { vpc : Vpc.t option } - - let make ?vpc () = { vpc } - - let parse xml = Some { vpc = Util.option_bind (Xml.member "vpc" xml) Vpc.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc (fun f -> Query.Pair ("Vpc", Vpc.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Util.option_map v.vpc (fun f -> "vpc", Vpc.to_json f) ]) - - let of_json j = { vpc = Util.option_map (Json.lookup j "vpc") Vpc.of_json } -end - -module DescribeVolumesRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_ids : VolumeIdStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ?(volume_ids = []) ?(filters = []) ?next_token ?max_results () = - { dry_run; volume_ids; filters; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "VolumeId" xml) VolumeIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("VolumeId", VolumeIdStringList.to_query v.volume_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("volume_ids", VolumeIdStringList.to_json v.volume_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_ids = - VolumeIdStringList.of_json (Util.of_option_exn (Json.lookup j "volume_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module MonitorInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - } - - let make ?dry_run ~instance_ids () = { dry_run; instance_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - } -end - -module DescribeRegionsRequest = struct - type t = - { dry_run : Boolean.t option - ; region_names : RegionNameStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(region_names = []) ?(filters = []) () = - { dry_run; region_names; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; region_names = - Util.of_option - [] - (Util.option_bind (Xml.member "RegionName" xml) RegionNameStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("RegionName", RegionNameStringList.to_query v.region_names)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("region_names", RegionNameStringList.to_json v.region_names) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; region_names = - RegionNameStringList.of_json (Util.of_option_exn (Json.lookup j "region_names")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module ModifySubnetAttributeRequest = struct - type t = - { subnet_id : String.t - ; map_public_ip_on_launch : AttributeBooleanValue.t option - } - - let make ~subnet_id ?map_public_ip_on_launch () = { subnet_id; map_public_ip_on_launch } - - let parse xml = - Some - { subnet_id = - Xml.required - "subnetId" - (Util.option_bind (Xml.member "subnetId" xml) String.parse) - ; map_public_ip_on_launch = - Util.option_bind - (Xml.member "MapPublicIpOnLaunch" xml) - AttributeBooleanValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.map_public_ip_on_launch (fun f -> - Query.Pair ("MapPublicIpOnLaunch", AttributeBooleanValue.to_query f)) - ; Some (Query.Pair ("SubnetId", String.to_query v.subnet_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.map_public_ip_on_launch (fun f -> - "map_public_ip_on_launch", AttributeBooleanValue.to_json f) - ; Some ("subnet_id", String.to_json v.subnet_id) - ]) - - let of_json j = - { subnet_id = String.of_json (Util.of_option_exn (Json.lookup j "subnet_id")) - ; map_public_ip_on_launch = - Util.option_map - (Json.lookup j "map_public_ip_on_launch") - AttributeBooleanValue.of_json - } -end - -module ImportInstanceResult = struct - type t = { conversion_task : ConversionTask.t option } - - let make ?conversion_task () = { conversion_task } - - let parse xml = - Some - { conversion_task = - Util.option_bind (Xml.member "conversionTask" xml) ConversionTask.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.conversion_task (fun f -> - Query.Pair ("ConversionTask", ConversionTask.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.conversion_task (fun f -> - "conversion_task", ConversionTask.to_json f) - ]) - - let of_json j = - { conversion_task = - Util.option_map (Json.lookup j "conversion_task") ConversionTask.of_json - } -end - -module RegisterImageRequest = struct - type t = - { dry_run : Boolean.t option - ; image_location : String.t option - ; name : String.t - ; description : String.t option - ; architecture : ArchitectureValues.t option - ; kernel_id : String.t option - ; ramdisk_id : String.t option - ; root_device_name : String.t option - ; block_device_mappings : BlockDeviceMappingRequestList.t - ; virtualization_type : String.t option - ; sriov_net_support : String.t option - } - - let make - ?dry_run - ?image_location - ~name - ?description - ?architecture - ?kernel_id - ?ramdisk_id - ?root_device_name - ?(block_device_mappings = []) - ?virtualization_type - ?sriov_net_support - () = - { dry_run - ; image_location - ; name - ; description - ; architecture - ; kernel_id - ; ramdisk_id - ; root_device_name - ; block_device_mappings - ; virtualization_type - ; sriov_net_support - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_location = Util.option_bind (Xml.member "ImageLocation" xml) String.parse - ; name = Xml.required "name" (Util.option_bind (Xml.member "name" xml) String.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; architecture = - Util.option_bind (Xml.member "architecture" xml) ArchitectureValues.parse - ; kernel_id = Util.option_bind (Xml.member "kernelId" xml) String.parse - ; ramdisk_id = Util.option_bind (Xml.member "ramdiskId" xml) String.parse - ; root_device_name = Util.option_bind (Xml.member "rootDeviceName" xml) String.parse - ; block_device_mappings = - Util.of_option - [] - (Util.option_bind - (Xml.member "BlockDeviceMapping" xml) - BlockDeviceMappingRequestList.parse) - ; virtualization_type = - Util.option_bind (Xml.member "virtualizationType" xml) String.parse - ; sriov_net_support = - Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - Query.Pair ("SriovNetSupport", String.to_query f)) - ; Util.option_map v.virtualization_type (fun f -> - Query.Pair ("VirtualizationType", String.to_query f)) - ; Some + ("SecurityGroupId", + (SecurityGroupIdStringList.to_query v.security_group_ids))); + Some (Query.Pair - ( "BlockDeviceMapping" - , BlockDeviceMappingRequestList.to_query v.block_device_mappings )) - ; Util.option_map v.root_device_name (fun f -> - Query.Pair ("RootDeviceName", String.to_query f)) - ; Util.option_map v.ramdisk_id (fun f -> - Query.Pair ("RamdiskId", String.to_query f)) - ; Util.option_map v.kernel_id (fun f -> - Query.Pair ("KernelId", String.to_query f)) - ; Util.option_map v.architecture (fun f -> - Query.Pair ("Architecture", ArchitectureValues.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ; Util.option_map v.image_location (fun f -> - Query.Pair ("ImageLocation", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.sriov_net_support (fun f -> - "sriov_net_support", String.to_json f) - ; Util.option_map v.virtualization_type (fun f -> - "virtualization_type", String.to_json f) - ; Some - ( "block_device_mappings" - , BlockDeviceMappingRequestList.to_json v.block_device_mappings ) - ; Util.option_map v.root_device_name (fun f -> - "root_device_name", String.to_json f) - ; Util.option_map v.ramdisk_id (fun f -> "ramdisk_id", String.to_json f) - ; Util.option_map v.kernel_id (fun f -> "kernel_id", String.to_json f) - ; Util.option_map v.architecture (fun f -> - "architecture", ArchitectureValues.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("name", String.to_json v.name) - ; Util.option_map v.image_location (fun f -> "image_location", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_location = Util.option_map (Json.lookup j "image_location") String.of_json - ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; architecture = - Util.option_map (Json.lookup j "architecture") ArchitectureValues.of_json - ; kernel_id = Util.option_map (Json.lookup j "kernel_id") String.of_json - ; ramdisk_id = Util.option_map (Json.lookup j "ramdisk_id") String.of_json - ; root_device_name = Util.option_map (Json.lookup j "root_device_name") String.of_json - ; block_device_mappings = - BlockDeviceMappingRequestList.of_json - (Util.of_option_exn (Json.lookup j "block_device_mappings")) - ; virtualization_type = - Util.option_map (Json.lookup j "virtualization_type") String.of_json - ; sriov_net_support = - Util.option_map (Json.lookup j "sriov_net_support") String.of_json - } -end - -module CreateSecurityGroupRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t - ; description : String.t - ; vpc_id : String.t option - } - - let make ?dry_run ~group_name ~description ?vpc_id () = - { dry_run; group_name; description; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = - Xml.required - "GroupName" - (Util.option_bind (Xml.member "GroupName" xml) String.parse) - ; description = - Xml.required - "GroupDescription" - (Util.option_bind (Xml.member "GroupDescription" xml) String.parse) - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Some (Query.Pair ("GroupDescription", String.to_query v.description)) - ; Some (Query.Pair ("GroupName", String.to_query v.group_name)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Some ("description", String.to_json v.description) - ; Some ("group_name", String.to_json v.group_name) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = String.of_json (Util.of_option_exn (Json.lookup j "group_name")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - } -end - -module DescribeVpcPeeringConnectionsResult = struct - type t = { vpc_peering_connections : VpcPeeringConnectionList.t } - - let make ?(vpc_peering_connections = []) () = { vpc_peering_connections } - - let parse xml = - Some - { vpc_peering_connections = - Util.of_option - [] - (Util.option_bind - (Xml.member "vpcPeeringConnectionSet" xml) - VpcPeeringConnectionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SecurityGroup", + (SecurityGroupStringList.to_query v.security_groups))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f))); + Some (Query.Pair ("MaxCount", (Integer.to_query v.max_count))); + Some (Query.Pair ("MinCount", (Integer.to_query v.min_count))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (Boolean.to_json f))); + Util.option_map v.iam_instance_profile + (fun f -> + ("iam_instance_profile", + (IamInstanceProfileSpecification.to_json f))); + Some + ("network_interfaces", + (InstanceNetworkInterfaceSpecificationList.to_json + v.network_interfaces)); + Util.option_map v.additional_info + (fun f -> ("additional_info", (String.to_json f))); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + ("instance_initiated_shutdown_behavior", + (ShutdownBehavior.to_json f))); + Util.option_map v.disable_api_termination + (fun f -> ("disable_api_termination", (Boolean.to_json f))); + Util.option_map v.subnet_id + (fun f -> ("subnet_id", (String.to_json f))); + Util.option_map v.monitoring + (fun f -> + ("monitoring", (RunInstancesMonitoringEnabled.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappingRequestList.to_json v.block_device_mappings)); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.placement + (fun f -> ("placement", (Placement.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (String.to_json f))); + Some + ("security_group_ids", + (SecurityGroupIdStringList.to_json v.security_group_ids)); + Some + ("security_groups", + (SecurityGroupStringList.to_json v.security_groups)); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f))); + Some ("max_count", (Integer.to_json v.max_count)); + Some ("min_count", (Integer.to_json v.min_count)); + Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + min_count = + (Integer.of_json (Util.of_option_exn (Json.lookup j "min_count"))); + max_count = + (Integer.of_json (Util.of_option_exn (Json.lookup j "max_count"))); + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + security_groups = + (SecurityGroupStringList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + security_group_ids = + (SecurityGroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))); + user_data = + (Util.option_map (Json.lookup j "user_data") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + placement = + (Util.option_map (Json.lookup j "placement") Placement.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + block_device_mappings = + (BlockDeviceMappingRequestList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + monitoring = + (Util.option_map (Json.lookup j "monitoring") + RunInstancesMonitoringEnabled.of_json); + subnet_id = + (Util.option_map (Json.lookup j "subnet_id") String.of_json); + disable_api_termination = + (Util.option_map (Json.lookup j "disable_api_termination") + Boolean.of_json); + instance_initiated_shutdown_behavior = + (Util.option_map + (Json.lookup j "instance_initiated_shutdown_behavior") + ShutdownBehavior.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + additional_info = + (Util.option_map (Json.lookup j "additional_info") String.of_json); + network_interfaces = + (InstanceNetworkInterfaceSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "network_interfaces"))); + iam_instance_profile = + (Util.option_map (Json.lookup j "iam_instance_profile") + IamInstanceProfileSpecification.of_json); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") Boolean.of_json) + } + end +module StartInstancesResult = + struct + type t = { + starting_instances: InstanceStateChangeList.t } + let make ?(starting_instances= []) () = { starting_instances } + let parse xml = + Some + { + starting_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceStateChangeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", + (InstanceStateChangeList.to_query v.starting_instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("starting_instances", + (InstanceStateChangeList.to_json v.starting_instances))]) + let of_json j = + { + starting_instances = + (InstanceStateChangeList.of_json + (Util.of_option_exn (Json.lookup j "starting_instances"))) + } + end +module DisableVpcClassicLinkRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpc_id: String.t } + let make ?dry_run ~vpc_id () = { dry_run; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module DeleteNetworkAclEntryRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_acl_id: String.t ; + rule_number: Integer.t ; + egress: Boolean.t } + let make ?dry_run ~network_acl_id ~rule_number ~egress () = + { dry_run; network_acl_id; rule_number; egress } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_acl_id = + (Xml.required "networkAclId" + (Util.option_bind (Xml.member "networkAclId" xml) String.parse)); + rule_number = + (Xml.required "ruleNumber" + (Util.option_bind (Xml.member "ruleNumber" xml) Integer.parse)); + egress = + (Xml.required "egress" + (Util.option_bind (Xml.member "egress" xml) Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Egress", (Boolean.to_query v.egress))); + Some (Query.Pair ("RuleNumber", (Integer.to_query v.rule_number))); + Some + (Query.Pair ("NetworkAclId", (String.to_query v.network_acl_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("egress", (Boolean.to_json v.egress)); + Some ("rule_number", (Integer.to_json v.rule_number)); + Some ("network_acl_id", (String.to_json v.network_acl_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_acl_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_acl_id"))); + rule_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "rule_number"))); + egress = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "egress"))) + } + end +module AllocateAddressResult = + struct + type t = + { + public_ip: String.t option ; + domain: DomainType.t option ; + allocation_id: String.t option } + let make ?public_ip ?domain ?allocation_id () = + { public_ip; domain; allocation_id } + let parse xml = + Some + { + public_ip = + (Util.option_bind (Xml.member "publicIp" xml) String.parse); + domain = + (Util.option_bind (Xml.member "domain" xml) DomainType.parse); + allocation_id = + (Util.option_bind (Xml.member "allocationId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (DomainType.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f))); + Util.option_map v.domain + (fun f -> ("domain", (DomainType.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f)))]) + let of_json j = + { + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + domain = + (Util.option_map (Json.lookup j "domain") DomainType.of_json); + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json) + } + end +module DescribeImagesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_ids: ImageIdStringList.t ; + owners: OwnerStringList.t ; + executable_users: ExecutableByStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(image_ids= []) ?(owners= []) ?(executable_users= + []) ?(filters= []) () = + { dry_run; image_ids; owners; executable_users; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "ImageId" xml) + ImageIdStringList.parse)); + owners = + (Util.of_option [] + (Util.option_bind (Xml.member "Owner" xml) + OwnerStringList.parse)); + executable_users = + (Util.of_option [] + (Util.option_bind (Xml.member "ExecutableBy" xml) + ExecutableByStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "VpcPeeringConnectionSet" - , VpcPeeringConnectionList.to_query v.vpc_peering_connections )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "vpc_peering_connections" - , VpcPeeringConnectionList.to_json v.vpc_peering_connections ) - ]) - - let of_json j = - { vpc_peering_connections = - VpcPeeringConnectionList.of_json - (Util.of_option_exn (Json.lookup j "vpc_peering_connections")) - } -end - -module DescribeVolumeAttributeResult = struct - type t = - { volume_id : String.t option - ; auto_enable_i_o : AttributeBooleanValue.t option - ; product_codes : ProductCodeList.t - } - - let make ?volume_id ?auto_enable_i_o ?(product_codes = []) () = - { volume_id; auto_enable_i_o; product_codes } - - let parse xml = - Some - { volume_id = Util.option_bind (Xml.member "volumeId" xml) String.parse - ; auto_enable_i_o = - Util.option_bind (Xml.member "autoEnableIO" xml) AttributeBooleanValue.parse - ; product_codes = - Util.of_option - [] - (Util.option_bind (Xml.member "productCodes" xml) ProductCodeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ProductCodes", ProductCodeList.to_query v.product_codes)) - ; Util.option_map v.auto_enable_i_o (fun f -> - Query.Pair ("AutoEnableIO", AttributeBooleanValue.to_query f)) - ; Util.option_map v.volume_id (fun f -> - Query.Pair ("VolumeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("product_codes", ProductCodeList.to_json v.product_codes) - ; Util.option_map v.auto_enable_i_o (fun f -> - "auto_enable_i_o", AttributeBooleanValue.to_json f) - ; Util.option_map v.volume_id (fun f -> "volume_id", String.to_json f) - ]) - - let of_json j = - { volume_id = Util.option_map (Json.lookup j "volume_id") String.of_json - ; auto_enable_i_o = - Util.option_map (Json.lookup j "auto_enable_i_o") AttributeBooleanValue.of_json - ; product_codes = - ProductCodeList.of_json (Util.of_option_exn (Json.lookup j "product_codes")) - } -end - -module DescribeVpcsResult = struct - type t = { vpcs : VpcList.t } - - let make ?(vpcs = []) () = { vpcs } - - let parse xml = - Some - { vpcs = - Util.of_option [] (Util.option_bind (Xml.member "vpcSet" xml) VpcList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("VpcSet", VpcList.to_query v.vpcs)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("vpcs", VpcList.to_json v.vpcs) ]) - - let of_json j = { vpcs = VpcList.of_json (Util.of_option_exn (Json.lookup j "vpcs")) } -end - -module DescribePrefixListsRequest = struct - type t = - { dry_run : Boolean.t option - ; prefix_list_ids : ValueStringList.t - ; filters : FilterList.t - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?dry_run ?(prefix_list_ids = []) ?(filters = []) ?max_results ?next_token () = - { dry_run; prefix_list_ids; filters; max_results; next_token } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; prefix_list_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "PrefixListId" xml) ValueStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("PrefixListId", ValueStringList.to_query v.prefix_list_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("prefix_list_ids", ValueStringList.to_json v.prefix_list_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; prefix_list_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "prefix_list_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeNetworkAclsResult = struct - type t = { network_acls : NetworkAclList.t } - - let make ?(network_acls = []) () = { network_acls } - - let parse xml = - Some - { network_acls = - Util.of_option - [] - (Util.option_bind (Xml.member "networkAclSet" xml) NetworkAclList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("NetworkAclSet", NetworkAclList.to_query v.network_acls)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("network_acls", NetworkAclList.to_json v.network_acls) ]) - - let of_json j = - { network_acls = - NetworkAclList.of_json (Util.of_option_exn (Json.lookup j "network_acls")) - } -end - -module DescribeSubnetsResult = struct - type t = { subnets : SubnetList.t } - - let make ?(subnets = []) () = { subnets } - - let parse xml = - Some - { subnets = - Util.of_option - [] - (Util.option_bind (Xml.member "subnetSet" xml) SubnetList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SubnetSet", SubnetList.to_query v.subnets)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("subnets", SubnetList.to_json v.subnets) ]) - - let of_json j = - { subnets = SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets")) } -end - -module CancelBundleTaskResult = struct - type t = { bundle_task : BundleTask.t option } - - let make ?bundle_task () = { bundle_task } - - let parse xml = - Some - { bundle_task = - Util.option_bind (Xml.member "bundleInstanceTask" xml) BundleTask.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.bundle_task (fun f -> - Query.Pair ("BundleInstanceTask", BundleTask.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.bundle_task (fun f -> "bundle_task", BundleTask.to_json f) ]) - - let of_json j = - { bundle_task = Util.option_map (Json.lookup j "bundle_task") BundleTask.of_json } -end - -module DetachInternetGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; internet_gateway_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~internet_gateway_id ~vpc_id () = - { dry_run; internet_gateway_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; internet_gateway_id = - Xml.required - "internetGatewayId" - (Util.option_bind (Xml.member "internetGatewayId" xml) String.parse) - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("InternetGatewayId", String.to_query v.internet_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("internet_gateway_id", String.to_json v.internet_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; internet_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "internet_gateway_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module CancelConversionRequest = struct - type t = - { dry_run : Boolean.t option - ; conversion_task_id : String.t - ; reason_message : String.t option - } - - let make ?dry_run ~conversion_task_id ?reason_message () = - { dry_run; conversion_task_id; reason_message } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; conversion_task_id = - Xml.required - "conversionTaskId" - (Util.option_bind (Xml.member "conversionTaskId" xml) String.parse) - ; reason_message = Util.option_bind (Xml.member "reasonMessage" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reason_message (fun f -> - Query.Pair ("ReasonMessage", String.to_query f)) - ; Some (Query.Pair ("ConversionTaskId", String.to_query v.conversion_task_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reason_message (fun f -> "reason_message", String.to_json f) - ; Some ("conversion_task_id", String.to_json v.conversion_task_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; conversion_task_id = - String.of_json (Util.of_option_exn (Json.lookup j "conversion_task_id")) - ; reason_message = Util.option_map (Json.lookup j "reason_message") String.of_json - } -end - -module AttachInternetGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; internet_gateway_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~internet_gateway_id ~vpc_id () = - { dry_run; internet_gateway_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; internet_gateway_id = - Xml.required - "internetGatewayId" - (Util.option_bind (Xml.member "internetGatewayId" xml) String.parse) - ; vpc_id = - Xml.required "vpcId" (Util.option_bind (Xml.member "vpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("InternetGatewayId", String.to_query v.internet_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("internet_gateway_id", String.to_json v.internet_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; internet_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "internet_gateway_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module DescribeVpcClassicLinkResult = struct - type t = { vpcs : VpcClassicLinkList.t } - - let make ?(vpcs = []) () = { vpcs } - - let parse xml = - Some - { vpcs = - Util.of_option - [] - (Util.option_bind (Xml.member "vpcSet" xml) VpcClassicLinkList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcSet", VpcClassicLinkList.to_query v.vpcs)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("vpcs", VpcClassicLinkList.to_json v.vpcs) ]) - - let of_json j = - { vpcs = VpcClassicLinkList.of_json (Util.of_option_exn (Json.lookup j "vpcs")) } -end - -module DescribeImportImageTasksResult = struct - type t = - { import_image_tasks : ImportImageTaskList.t - ; next_token : String.t option - } - - let make ?(import_image_tasks = []) ?next_token () = { import_image_tasks; next_token } - - let parse xml = - Some - { import_image_tasks = - Util.of_option - [] - (Util.option_bind - (Xml.member "importImageTaskSet" xml) - ImportImageTaskList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + ("ExecutableBy", + (ExecutableByStringList.to_query v.executable_users))); + Some (Query.Pair ("Owner", (OwnerStringList.to_query v.owners))); + Some (Query.Pair - ("ImportImageTaskSet", ImportImageTaskList.to_query v.import_image_tasks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("import_image_tasks", ImportImageTaskList.to_json v.import_image_tasks) - ]) - - let of_json j = - { import_image_tasks = - ImportImageTaskList.of_json - (Util.of_option_exn (Json.lookup j "import_image_tasks")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module CreateFlowLogsRequest = struct - type t = - { resource_ids : ValueStringList.t - ; resource_type : FlowLogsResourceType.t - ; traffic_type : TrafficType.t - ; log_group_name : String.t - ; deliver_logs_permission_arn : String.t - ; client_token : String.t option - } - - let make - ~resource_ids - ~resource_type - ~traffic_type - ~log_group_name - ~deliver_logs_permission_arn - ?client_token - () = - { resource_ids - ; resource_type - ; traffic_type - ; log_group_name - ; deliver_logs_permission_arn - ; client_token - } - - let parse xml = - Some - { resource_ids = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) ValueStringList.parse) - ; resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) FlowLogsResourceType.parse) - ; traffic_type = - Xml.required - "TrafficType" - (Util.option_bind (Xml.member "TrafficType" xml) TrafficType.parse) - ; log_group_name = - Xml.required - "LogGroupName" - (Util.option_bind (Xml.member "LogGroupName" xml) String.parse) - ; deliver_logs_permission_arn = - Xml.required - "DeliverLogsPermissionArn" - (Util.option_bind (Xml.member "DeliverLogsPermissionArn" xml) String.parse) - ; client_token = Util.option_bind (Xml.member "ClientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Some + ("ImageId", (ImageIdStringList.to_query v.image_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("executable_users", + (ExecutableByStringList.to_json v.executable_users)); + Some ("owners", (OwnerStringList.to_json v.owners)); + Some ("image_ids", (ImageIdStringList.to_json v.image_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_ids = + (ImageIdStringList.of_json + (Util.of_option_exn (Json.lookup j "image_ids"))); + owners = + (OwnerStringList.of_json + (Util.of_option_exn (Json.lookup j "owners"))); + executable_users = + (ExecutableByStringList.of_json + (Util.of_option_exn (Json.lookup j "executable_users"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module ReplaceNetworkAclAssociationRequest = + struct + type t = + { + dry_run: Boolean.t option ; + association_id: String.t ; + network_acl_id: String.t } + let make ?dry_run ~association_id ~network_acl_id () = + { dry_run; association_id; network_acl_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + association_id = + (Xml.required "associationId" + (Util.option_bind (Xml.member "associationId" xml) + String.parse)); + network_acl_id = + (Xml.required "networkAclId" + (Util.option_bind (Xml.member "networkAclId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NetworkAclId", (String.to_query v.network_acl_id))); + Some (Query.Pair - ("DeliverLogsPermissionArn", String.to_query v.deliver_logs_permission_arn)) - ; Some (Query.Pair ("LogGroupName", String.to_query v.log_group_name)) - ; Some (Query.Pair ("TrafficType", TrafficType.to_query v.traffic_type)) - ; Some - (Query.Pair ("ResourceType", FlowLogsResourceType.to_query v.resource_type)) - ; Some (Query.Pair ("ResourceId", ValueStringList.to_query v.resource_ids)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Some - ("deliver_logs_permission_arn", String.to_json v.deliver_logs_permission_arn) - ; Some ("log_group_name", String.to_json v.log_group_name) - ; Some ("traffic_type", TrafficType.to_json v.traffic_type) - ; Some ("resource_type", FlowLogsResourceType.to_json v.resource_type) - ; Some ("resource_ids", ValueStringList.to_json v.resource_ids) - ]) - - let of_json j = - { resource_ids = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "resource_ids")) - ; resource_type = - FlowLogsResourceType.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; traffic_type = - TrafficType.of_json (Util.of_option_exn (Json.lookup j "traffic_type")) - ; log_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "log_group_name")) - ; deliver_logs_permission_arn = - String.of_json (Util.of_option_exn (Json.lookup j "deliver_logs_permission_arn")) - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module CancelSpotFleetRequestsResponse = struct - type t = - { unsuccessful_fleet_requests : CancelSpotFleetRequestsErrorSet.t - ; successful_fleet_requests : CancelSpotFleetRequestsSuccessSet.t - } - - let make ?(unsuccessful_fleet_requests = []) ?(successful_fleet_requests = []) () = - { unsuccessful_fleet_requests; successful_fleet_requests } - - let parse xml = - Some - { unsuccessful_fleet_requests = - Util.of_option - [] - (Util.option_bind - (Xml.member "unsuccessfulFleetRequestSet" xml) - CancelSpotFleetRequestsErrorSet.parse) - ; successful_fleet_requests = - Util.of_option - [] - (Util.option_bind - (Xml.member "successfulFleetRequestSet" xml) - CancelSpotFleetRequestsSuccessSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AssociationId", (String.to_query v.association_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("network_acl_id", (String.to_json v.network_acl_id)); + Some ("association_id", (String.to_json v.association_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + association_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "association_id"))); + network_acl_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_acl_id"))) + } + end +module DescribeVpcEndpointsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_endpoint_ids: ValueStringList.t ; + filters: FilterList.t ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?dry_run ?(vpc_endpoint_ids= []) ?(filters= []) ?max_results + ?next_token () = + { dry_run; vpc_endpoint_ids; filters; max_results; next_token } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + vpc_endpoint_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcEndpointId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "SuccessfulFleetRequestSet" - , CancelSpotFleetRequestsSuccessSet.to_query v.successful_fleet_requests - )) - ; Some + ("VpcEndpointId", + (ValueStringList.to_query v.vpc_endpoint_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("vpc_endpoint_ids", + (ValueStringList.to_json v.vpc_endpoint_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_endpoint_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "vpc_endpoint_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeVpcPeeringConnectionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_peering_connection_ids: ValueStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(vpc_peering_connection_ids= []) ?(filters= []) () + = { dry_run; vpc_peering_connection_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_peering_connection_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcPeeringConnectionId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "UnsuccessfulFleetRequestSet" - , CancelSpotFleetRequestsErrorSet.to_query v.unsuccessful_fleet_requests - )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "successful_fleet_requests" - , CancelSpotFleetRequestsSuccessSet.to_json v.successful_fleet_requests ) - ; Some - ( "unsuccessful_fleet_requests" - , CancelSpotFleetRequestsErrorSet.to_json v.unsuccessful_fleet_requests ) - ]) - - let of_json j = - { unsuccessful_fleet_requests = - CancelSpotFleetRequestsErrorSet.of_json - (Util.of_option_exn (Json.lookup j "unsuccessful_fleet_requests")) - ; successful_fleet_requests = - CancelSpotFleetRequestsSuccessSet.of_json - (Util.of_option_exn (Json.lookup j "successful_fleet_requests")) - } -end - -module CreateSnapshotRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - ; description : String.t option - } - - let make ?dry_run ~volume_id ?description () = { dry_run; volume_id; description } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "VolumeId" - (Util.option_bind (Xml.member "VolumeId" xml) String.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module DescribeAccountAttributesResult = struct - type t = { account_attributes : AccountAttributeList.t } - - let make ?(account_attributes = []) () = { account_attributes } - - let parse xml = - Some - { account_attributes = - Util.of_option - [] - (Util.option_bind - (Xml.member "accountAttributeSet" xml) - AccountAttributeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("VpcPeeringConnectionId", + (ValueStringList.to_query v.vpc_peering_connection_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("vpc_peering_connection_ids", + (ValueStringList.to_json v.vpc_peering_connection_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_peering_connection_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "vpc_peering_connection_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module TerminateInstancesResult = + struct + type t = { + terminating_instances: InstanceStateChangeList.t } + let make ?(terminating_instances= []) () = { terminating_instances } + let parse xml = + Some + { + terminating_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceStateChangeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", + (InstanceStateChangeList.to_query v.terminating_instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("terminating_instances", + (InstanceStateChangeList.to_json v.terminating_instances))]) + let of_json j = + { + terminating_instances = + (InstanceStateChangeList.of_json + (Util.of_option_exn (Json.lookup j "terminating_instances"))) + } + end +module DescribeMovingAddressesResult = + struct + type t = + { + moving_address_statuses: MovingAddressStatusSet.t ; + next_token: String.t option } + let make ?(moving_address_statuses= []) ?next_token () = + { moving_address_statuses; next_token } + let parse xml = + Some + { + moving_address_statuses = + (Util.of_option [] + (Util.option_bind (Xml.member "movingAddressStatusSet" xml) + MovingAddressStatusSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("MovingAddressStatusSet", + (MovingAddressStatusSet.to_query v.moving_address_statuses)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("moving_address_statuses", + (MovingAddressStatusSet.to_json v.moving_address_statuses))]) + let of_json j = + { + moving_address_statuses = + (MovingAddressStatusSet.of_json + (Util.of_option_exn (Json.lookup j "moving_address_statuses"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeExportTasksRequest = + struct + type t = { + export_task_ids: ExportTaskIdStringList.t } + let make ?(export_task_ids= []) () = { export_task_ids } + let parse xml = + Some + { + export_task_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "exportTaskId" xml) + ExportTaskIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ExportTaskId", + (ExportTaskIdStringList.to_query v.export_task_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("export_task_ids", + (ExportTaskIdStringList.to_json v.export_task_ids))]) + let of_json j = + { + export_task_ids = + (ExportTaskIdStringList.of_json + (Util.of_option_exn (Json.lookup j "export_task_ids"))) + } + end +module DescribeReservedInstancesOfferingsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + reserved_instances_offering_ids: + ReservedInstancesOfferingIdStringList.t ; + instance_type: InstanceType.t option ; + availability_zone: String.t option ; + product_description: RIProductDescription.t option ; + filters: FilterList.t ; + instance_tenancy: Tenancy.t option ; + offering_type: OfferingTypeValues.t option ; + next_token: String.t option ; + max_results: Integer.t option ; + include_marketplace: Boolean.t option ; + min_duration: Long.t option ; + max_duration: Long.t option ; + max_instance_count: Integer.t option } + let make ?dry_run ?(reserved_instances_offering_ids= []) ?instance_type + ?availability_zone ?product_description ?(filters= []) + ?instance_tenancy ?offering_type ?next_token ?max_results + ?include_marketplace ?min_duration ?max_duration ?max_instance_count + () = + { + dry_run; + reserved_instances_offering_ids; + instance_type; + availability_zone; + product_description; + filters; + instance_tenancy; + offering_type; + next_token; + max_results; + include_marketplace; + min_duration; + max_duration; + max_instance_count + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + reserved_instances_offering_ids = + (Util.of_option [] + (Util.option_bind + (Xml.member "ReservedInstancesOfferingId" xml) + ReservedInstancesOfferingIdStringList.parse)); + instance_type = + (Util.option_bind (Xml.member "InstanceType" xml) + InstanceType.parse); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + RIProductDescription.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + instance_tenancy = + (Util.option_bind (Xml.member "instanceTenancy" xml) + Tenancy.parse); + offering_type = + (Util.option_bind (Xml.member "offeringType" xml) + OfferingTypeValues.parse); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse); + include_marketplace = + (Util.option_bind (Xml.member "IncludeMarketplace" xml) + Boolean.parse); + min_duration = + (Util.option_bind (Xml.member "MinDuration" xml) Long.parse); + max_duration = + (Util.option_bind (Xml.member "MaxDuration" xml) Long.parse); + max_instance_count = + (Util.option_bind (Xml.member "MaxInstanceCount" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_instance_count + (fun f -> Query.Pair ("MaxInstanceCount", (Integer.to_query f))); + Util.option_map v.max_duration + (fun f -> Query.Pair ("MaxDuration", (Long.to_query f))); + Util.option_map v.min_duration + (fun f -> Query.Pair ("MinDuration", (Long.to_query f))); + Util.option_map v.include_marketplace + (fun f -> + Query.Pair ("IncludeMarketplace", (Boolean.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.offering_type + (fun f -> + Query.Pair ("OfferingType", (OfferingTypeValues.to_query f))); + Util.option_map v.instance_tenancy + (fun f -> Query.Pair ("InstanceTenancy", (Tenancy.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Util.option_map v.product_description + (fun f -> + Query.Pair + ("ProductDescription", (RIProductDescription.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.instance_type + (fun f -> Query.Pair ("InstanceType", (InstanceType.to_query f))); + Some + (Query.Pair + ("ReservedInstancesOfferingId", + (ReservedInstancesOfferingIdStringList.to_query + v.reserved_instances_offering_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_instance_count + (fun f -> ("max_instance_count", (Integer.to_json f))); + Util.option_map v.max_duration + (fun f -> ("max_duration", (Long.to_json f))); + Util.option_map v.min_duration + (fun f -> ("min_duration", (Long.to_json f))); + Util.option_map v.include_marketplace + (fun f -> ("include_marketplace", (Boolean.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (OfferingTypeValues.to_json f))); + Util.option_map v.instance_tenancy + (fun f -> ("instance_tenancy", (Tenancy.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.product_description + (fun f -> + ("product_description", (RIProductDescription.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (InstanceType.to_json f))); + Some + ("reserved_instances_offering_ids", + (ReservedInstancesOfferingIdStringList.to_json + v.reserved_instances_offering_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + reserved_instances_offering_ids = + (ReservedInstancesOfferingIdStringList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_offering_ids"))); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + InstanceType.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + RIProductDescription.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + instance_tenancy = + (Util.option_map (Json.lookup j "instance_tenancy") Tenancy.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") + OfferingTypeValues.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + include_marketplace = + (Util.option_map (Json.lookup j "include_marketplace") + Boolean.of_json); + min_duration = + (Util.option_map (Json.lookup j "min_duration") Long.of_json); + max_duration = + (Util.option_map (Json.lookup j "max_duration") Long.of_json); + max_instance_count = + (Util.option_map (Json.lookup j "max_instance_count") + Integer.of_json) + } + end +module CreateVpcPeeringConnectionResult = + struct + type t = { + vpc_peering_connection: VpcPeeringConnection.t option } + let make ?vpc_peering_connection () = { vpc_peering_connection } + let parse xml = + Some + { + vpc_peering_connection = + (Util.option_bind (Xml.member "vpcPeeringConnection" xml) + VpcPeeringConnection.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection + (fun f -> + Query.Pair + ("VpcPeeringConnection", + (VpcPeeringConnection.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection + (fun f -> + ("vpc_peering_connection", (VpcPeeringConnection.to_json f)))]) + let of_json j = + { + vpc_peering_connection = + (Util.option_map (Json.lookup j "vpc_peering_connection") + VpcPeeringConnection.of_json) + } + end +module DescribeInstanceStatusResult = + struct + type t = + { + instance_statuses: InstanceStatusList.t ; + next_token: String.t option } + let make ?(instance_statuses= []) ?next_token () = + { instance_statuses; next_token } + let parse xml = + Some + { + instance_statuses = + (Util.of_option [] + (Util.option_bind (Xml.member "instanceStatusSet" xml) + InstanceStatusList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("InstanceStatusSet", + (InstanceStatusList.to_query v.instance_statuses)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("instance_statuses", + (InstanceStatusList.to_json v.instance_statuses))]) + let of_json j = + { + instance_statuses = + (InstanceStatusList.of_json + (Util.of_option_exn (Json.lookup j "instance_statuses"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module CreateReservedInstancesListingResult = + struct + type t = { + reserved_instances_listings: ReservedInstancesListingList.t } + let make ?(reserved_instances_listings= []) () = + { reserved_instances_listings } + let parse xml = + Some + { + reserved_instances_listings = + (Util.of_option [] + (Util.option_bind + (Xml.member "reservedInstancesListingsSet" xml) + ReservedInstancesListingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesListingsSet", + (ReservedInstancesListingList.to_query + v.reserved_instances_listings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_instances_listings", + (ReservedInstancesListingList.to_json + v.reserved_instances_listings))]) + let of_json j = + { + reserved_instances_listings = + (ReservedInstancesListingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_listings"))) + } + end +module DeleteInternetGatewayRequest = + struct + type t = { + dry_run: Boolean.t option ; + internet_gateway_id: String.t } + let make ?dry_run ~internet_gateway_id () = + { dry_run; internet_gateway_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + internet_gateway_id = + (Xml.required "internetGatewayId" + (Util.option_bind (Xml.member "internetGatewayId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InternetGatewayId", + (String.to_query v.internet_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("internet_gateway_id", (String.to_json v.internet_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + internet_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "internet_gateway_id"))) + } + end +module DescribeNetworkAclsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_acl_ids: ValueStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(network_acl_ids= []) ?(filters= []) () = + { dry_run; network_acl_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_acl_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "NetworkAclId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("NetworkAclId", + (ValueStringList.to_query v.network_acl_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("network_acl_ids", (ValueStringList.to_json v.network_acl_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_acl_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "network_acl_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module CreateVpnConnectionRouteRequest = + struct + type t = { + vpn_connection_id: String.t ; + destination_cidr_block: String.t } + let make ~vpn_connection_id ~destination_cidr_block () = + { vpn_connection_id; destination_cidr_block } + let parse xml = + Some + { + vpn_connection_id = + (Xml.required "VpnConnectionId" + (Util.option_bind (Xml.member "VpnConnectionId" xml) + String.parse)); + destination_cidr_block = + (Xml.required "DestinationCidrBlock" + (Util.option_bind (Xml.member "DestinationCidrBlock" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DestinationCidrBlock", + (String.to_query v.destination_cidr_block))); + Some + (Query.Pair + ("VpnConnectionId", (String.to_query v.vpn_connection_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("destination_cidr_block", + (String.to_json v.destination_cidr_block)); + Some ("vpn_connection_id", (String.to_json v.vpn_connection_id))]) + let of_json j = + { + vpn_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_connection_id"))); + destination_cidr_block = + (String.of_json + (Util.of_option_exn (Json.lookup j "destination_cidr_block"))) + } + end +module ConfirmProductInstanceRequest = + struct + type t = + { + dry_run: Boolean.t option ; + product_code: String.t ; + instance_id: String.t } + let make ?dry_run ~product_code ~instance_id () = + { dry_run; product_code; instance_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + product_code = + (Xml.required "ProductCode" + (Util.option_bind (Xml.member "ProductCode" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some + (Query.Pair ("ProductCode", (String.to_query v.product_code))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Some ("product_code", (String.to_json v.product_code)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + product_code = + (String.of_json (Util.of_option_exn (Json.lookup j "product_code"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) + } + end +module ModifyNetworkInterfaceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_interface_id: String.t ; + description: AttributeValue.t option ; + source_dest_check: AttributeBooleanValue.t option ; + groups: SecurityGroupIdStringList.t ; + attachment: NetworkInterfaceAttachmentChanges.t option } + let make ?dry_run ~network_interface_id ?description + ?source_dest_check ?(groups= []) ?attachment () = + { + dry_run; + network_interface_id; + description; + source_dest_check; + groups; + attachment + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + description = + (Util.option_bind (Xml.member "description" xml) + AttributeValue.parse); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + AttributeBooleanValue.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupId" xml) + SecurityGroupIdStringList.parse)); + attachment = + (Util.option_bind (Xml.member "attachment" xml) + NetworkInterfaceAttachmentChanges.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attachment + (fun f -> + Query.Pair + ("Attachment", + (NetworkInterfaceAttachmentChanges.to_query f))); + Some + (Query.Pair + ("SecurityGroupId", + (SecurityGroupIdStringList.to_query v.groups))); + Util.option_map v.source_dest_check + (fun f -> + Query.Pair + ("SourceDestCheck", (AttributeBooleanValue.to_query f))); + Util.option_map v.description + (fun f -> + Query.Pair ("Description", (AttributeValue.to_query f))); + Some + (Query.Pair + ("NetworkInterfaceId", + (String.to_query v.network_interface_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attachment + (fun f -> + ("attachment", + (NetworkInterfaceAttachmentChanges.to_json f))); + Some ("groups", (SecurityGroupIdStringList.to_json v.groups)); + Util.option_map v.source_dest_check + (fun f -> + ("source_dest_check", (AttributeBooleanValue.to_json f))); + Util.option_map v.description + (fun f -> ("description", (AttributeValue.to_json f))); + Some + ("network_interface_id", + (String.to_json v.network_interface_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + description = + (Util.option_map (Json.lookup j "description") + AttributeValue.of_json); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + AttributeBooleanValue.of_json); + groups = + (SecurityGroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + attachment = + (Util.option_map (Json.lookup j "attachment") + NetworkInterfaceAttachmentChanges.of_json) + } + end +module CreateVolumeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + size: Integer.t option ; + snapshot_id: String.t option ; + availability_zone: String.t ; + volume_type: VolumeType.t option ; + iops: Integer.t option ; + encrypted: Boolean.t option ; + kms_key_id: String.t option } + let make ?dry_run ?size ?snapshot_id ~availability_zone ?volume_type + ?iops ?encrypted ?kms_key_id () = + { + dry_run; + size; + snapshot_id; + availability_zone; + volume_type; + iops; + encrypted; + kms_key_id + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + size = (Util.option_bind (Xml.member "Size" xml) Integer.parse); + snapshot_id = + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse); + availability_zone = + (Xml.required "AvailabilityZone" + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse)); + volume_type = + (Util.option_bind (Xml.member "VolumeType" xml) VolumeType.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + encrypted = + (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse); + kms_key_id = + (Util.option_bind (Xml.member "KmsKeyId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Util.option_map v.encrypted + (fun f -> Query.Pair ("Encrypted", (Boolean.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.volume_type + (fun f -> Query.Pair ("VolumeType", (VolumeType.to_query f))); + Some + (Query.Pair + ("AvailabilityZone", (String.to_query v.availability_zone))); + Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f))); + Util.option_map v.size + (fun f -> Query.Pair ("Size", (Integer.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Util.option_map v.encrypted + (fun f -> ("encrypted", (Boolean.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.volume_type + (fun f -> ("volume_type", (VolumeType.to_json f))); + Some ("availability_zone", (String.to_json v.availability_zone)); + Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f))); + Util.option_map v.size (fun f -> ("size", (Integer.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + size = (Util.option_map (Json.lookup j "size") Integer.of_json); + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + volume_type = + (Util.option_map (Json.lookup j "volume_type") VolumeType.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + encrypted = + (Util.option_map (Json.lookup j "encrypted") Boolean.of_json); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json) + } + end +module DescribeImagesResult = + struct + type t = { + images: ImageList.t } + let make ?(images= []) () = { images } + let parse xml = + Some + { + images = + (Util.of_option [] + (Util.option_bind (Xml.member "imagesSet" xml) ImageList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("ImagesSet", (ImageList.to_query v.images)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("images", (ImageList.to_json v.images))]) + let of_json j = + { + images = + (ImageList.of_json (Util.of_option_exn (Json.lookup j "images"))) + } + end +module EnableVpcClassicLinkRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpc_id: String.t } + let make ?dry_run ~vpc_id () = { dry_run; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module CreateReservedInstancesListingRequest = + struct + type t = + { + reserved_instances_id: String.t ; + instance_count: Integer.t ; + price_schedules: PriceScheduleSpecificationList.t ; + client_token: String.t } + let make ~reserved_instances_id ~instance_count ~price_schedules + ~client_token () = + { reserved_instances_id; instance_count; price_schedules; client_token + } + let parse xml = + Some + { + reserved_instances_id = + (Xml.required "reservedInstancesId" + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse)); + instance_count = + (Xml.required "instanceCount" + (Util.option_bind (Xml.member "instanceCount" xml) + Integer.parse)); + price_schedules = + (Xml.required "priceSchedules" + (Util.option_bind (Xml.member "priceSchedules" xml) + PriceScheduleSpecificationList.parse)); + client_token = + (Xml.required "clientToken" + (Util.option_bind (Xml.member "clientToken" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ClientToken", (String.to_query v.client_token))); + Some + (Query.Pair + ("PriceSchedules", + (PriceScheduleSpecificationList.to_query v.price_schedules))); + Some + (Query.Pair + ("InstanceCount", (Integer.to_query v.instance_count))); + Some + (Query.Pair + ("ReservedInstancesId", + (String.to_query v.reserved_instances_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("client_token", (String.to_json v.client_token)); + Some + ("price_schedules", + (PriceScheduleSpecificationList.to_json v.price_schedules)); + Some ("instance_count", (Integer.to_json v.instance_count)); + Some + ("reserved_instances_id", + (String.to_json v.reserved_instances_id))]) + let of_json j = + { + reserved_instances_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "reserved_instances_id"))); + instance_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_count"))); + price_schedules = + (PriceScheduleSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "price_schedules"))); + client_token = + (String.of_json (Util.of_option_exn (Json.lookup j "client_token"))) + } + end +module DescribeImportSnapshotTasksResult = + struct + type t = + { + import_snapshot_tasks: ImportSnapshotTaskList.t ; + next_token: String.t option } + let make ?(import_snapshot_tasks= []) ?next_token () = + { import_snapshot_tasks; next_token } + let parse xml = + Some + { + import_snapshot_tasks = + (Util.of_option [] + (Util.option_bind (Xml.member "importSnapshotTaskSet" xml) + ImportSnapshotTaskList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ImportSnapshotTaskSet", + (ImportSnapshotTaskList.to_query v.import_snapshot_tasks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("import_snapshot_tasks", + (ImportSnapshotTaskList.to_json v.import_snapshot_tasks))]) + let of_json j = + { + import_snapshot_tasks = + (ImportSnapshotTaskList.of_json + (Util.of_option_exn (Json.lookup j "import_snapshot_tasks"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DisassociateRouteTableRequest = + struct + type t = { + dry_run: Boolean.t option ; + association_id: String.t } + let make ?dry_run ~association_id () = { dry_run; association_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + association_id = + (Xml.required "associationId" + (Util.option_bind (Xml.member "associationId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AssociationId", (String.to_query v.association_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("association_id", (String.to_json v.association_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + association_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "association_id"))) + } + end +module DeleteVpnConnectionRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpn_connection_id: String.t } + let make ?dry_run ~vpn_connection_id () = + { dry_run; vpn_connection_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_connection_id = + (Xml.required "VpnConnectionId" + (Util.option_bind (Xml.member "VpnConnectionId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpnConnectionId", (String.to_query v.vpn_connection_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpn_connection_id", (String.to_json v.vpn_connection_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_connection_id"))) + } + end +module CancelSpotInstanceRequestsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_instance_request_ids: SpotInstanceRequestIdList.t } + let make ?dry_run ~spot_instance_request_ids () = + { dry_run; spot_instance_request_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_instance_request_ids = + (Xml.required "SpotInstanceRequestId" + (Util.option_bind (Xml.member "SpotInstanceRequestId" xml) + SpotInstanceRequestIdList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotInstanceRequestId", + (SpotInstanceRequestIdList.to_query + v.spot_instance_request_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_instance_request_ids", + (SpotInstanceRequestIdList.to_json + v.spot_instance_request_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_instance_request_ids = + (SpotInstanceRequestIdList.of_json + (Util.of_option_exn (Json.lookup j "spot_instance_request_ids"))) + } + end +module DescribeKeyPairsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + key_names: KeyNameStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(key_names= []) ?(filters= []) () = + { dry_run; key_names; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + key_names = + (Util.of_option [] + (Util.option_bind (Xml.member "KeyName" xml) + KeyNameStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("KeyName", (KeyNameStringList.to_query v.key_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("key_names", (KeyNameStringList.to_json v.key_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + key_names = + (KeyNameStringList.of_json + (Util.of_option_exn (Json.lookup j "key_names"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module RequestSpotInstancesResult = + struct + type t = { + spot_instance_requests: SpotInstanceRequestList.t } + let make ?(spot_instance_requests= []) () = { spot_instance_requests } + let parse xml = + Some + { + spot_instance_requests = + (Util.of_option [] + (Util.option_bind (Xml.member "spotInstanceRequestSet" xml) + SpotInstanceRequestList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotInstanceRequestSet", + (SpotInstanceRequestList.to_query v.spot_instance_requests)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_instance_requests", + (SpotInstanceRequestList.to_json v.spot_instance_requests))]) + let of_json j = + { + spot_instance_requests = + (SpotInstanceRequestList.of_json + (Util.of_option_exn (Json.lookup j "spot_instance_requests"))) + } + end +module DescribeReservedInstancesListingsRequest = + struct + type t = + { + reserved_instances_id: String.t option ; + reserved_instances_listing_id: String.t option ; + filters: FilterList.t } + let make ?reserved_instances_id ?reserved_instances_listing_id + ?(filters= []) () = + { reserved_instances_id; reserved_instances_listing_id; filters } + let parse xml = + Some + { + reserved_instances_id = + (Util.option_bind (Xml.member "reservedInstancesId" xml) + String.parse); + reserved_instances_listing_id = + (Util.option_bind (Xml.member "reservedInstancesListingId" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "filters" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filters", (FilterList.to_query v.filters))); + Util.option_map v.reserved_instances_listing_id + (fun f -> + Query.Pair + ("ReservedInstancesListingId", (String.to_query f))); + Util.option_map v.reserved_instances_id + (fun f -> + Query.Pair ("ReservedInstancesId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.reserved_instances_listing_id + (fun f -> ("reserved_instances_listing_id", (String.to_json f))); + Util.option_map v.reserved_instances_id + (fun f -> ("reserved_instances_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_id = + (Util.option_map (Json.lookup j "reserved_instances_id") + String.of_json); + reserved_instances_listing_id = + (Util.option_map (Json.lookup j "reserved_instances_listing_id") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeSpotPriceHistoryRequest = + struct + type t = + { + dry_run: Boolean.t option ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + instance_types: InstanceTypeList.t ; + product_descriptions: ProductDescriptionList.t ; + filters: FilterList.t ; + availability_zone: String.t option ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?dry_run ?start_time ?end_time ?(instance_types= []) + ?(product_descriptions= []) ?(filters= []) ?availability_zone + ?max_results ?next_token () = + { + dry_run; + start_time; + end_time; + instance_types; + product_descriptions; + filters; + availability_zone; + max_results; + next_token + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + start_time = + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "endTime" xml) DateTime.parse); + instance_types = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceType" xml) + InstanceTypeList.parse)); + product_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "ProductDescription" xml) + ProductDescriptionList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + availability_zone = + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("ProductDescription", + (ProductDescriptionList.to_query v.product_descriptions))); + Some + (Query.Pair + ("InstanceType", + (InstanceTypeList.to_query v.instance_types))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("product_descriptions", + (ProductDescriptionList.to_json v.product_descriptions)); + Some + ("instance_types", (InstanceTypeList.to_json v.instance_types)); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + instance_types = + (InstanceTypeList.of_json + (Util.of_option_exn (Json.lookup j "instance_types"))); + product_descriptions = + (ProductDescriptionList.of_json + (Util.of_option_exn (Json.lookup j "product_descriptions"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module MoveAddressToVpcResult = + struct + type t = { + allocation_id: String.t option ; + status: Status.t option } + let make ?allocation_id ?status () = { allocation_id; status } + let parse xml = + Some + { + allocation_id = + (Util.option_bind (Xml.member "allocationId" xml) String.parse); + status = (Util.option_bind (Xml.member "status" xml) Status.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (Status.to_query f))); + Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (Status.to_json f))); + Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f)))]) + let of_json j = + { + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json); + status = (Util.option_map (Json.lookup j "status") Status.of_json) + } + end +module CancelImportTaskResult = + struct + type t = + { + import_task_id: String.t option ; + state: String.t option ; + previous_state: String.t option } + let make ?import_task_id ?state ?previous_state () = + { import_task_id; state; previous_state } + let parse xml = + Some + { + import_task_id = + (Util.option_bind (Xml.member "importTaskId" xml) String.parse); + state = (Util.option_bind (Xml.member "state" xml) String.parse); + previous_state = + (Util.option_bind (Xml.member "previousState" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.previous_state + (fun f -> Query.Pair ("PreviousState", (String.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (String.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.previous_state + (fun f -> ("previous_state", (String.to_json f))); + Util.option_map v.state (fun f -> ("state", (String.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f)))]) + let of_json j = + { + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + state = (Util.option_map (Json.lookup j "state") String.of_json); + previous_state = + (Util.option_map (Json.lookup j "previous_state") String.of_json) + } + end +module DeleteRouteRequest = + struct + type t = + { + dry_run: Boolean.t option ; + route_table_id: String.t ; + destination_cidr_block: String.t } + let make ?dry_run ~route_table_id ~destination_cidr_block () = + { dry_run; route_table_id; destination_cidr_block } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)); + destination_cidr_block = + (Xml.required "destinationCidrBlock" + (Util.option_bind (Xml.member "destinationCidrBlock" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DestinationCidrBlock", + (String.to_query v.destination_cidr_block))); + Some + (Query.Pair ("RouteTableId", (String.to_query v.route_table_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("destination_cidr_block", + (String.to_json v.destination_cidr_block)); + Some ("route_table_id", (String.to_json v.route_table_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))); + destination_cidr_block = + (String.of_json + (Util.of_option_exn (Json.lookup j "destination_cidr_block"))) + } + end +module ResetInstanceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + attribute: InstanceAttributeName.t } + let make ?dry_run ~instance_id ~attribute () = + { dry_run; instance_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + attribute = + (Xml.required "attribute" + (Util.option_bind (Xml.member "attribute" xml) + InstanceAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", (InstanceAttributeName.to_query v.attribute))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (InstanceAttributeName.to_json v.attribute)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + attribute = + (InstanceAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module CopySnapshotResult = + struct + type t = { + snapshot_id: String.t option } + let make ?snapshot_id () = { snapshot_id } + let parse xml = + Some + { + snapshot_id = + (Util.option_bind (Xml.member "snapshotId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_id + (fun f -> Query.Pair ("SnapshotId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_id + (fun f -> ("snapshot_id", (String.to_json f)))]) + let of_json j = + { + snapshot_id = + (Util.option_map (Json.lookup j "snapshot_id") String.of_json) + } + end +module CreateVpnGatewayResult = + struct + type t = { + vpn_gateway: VpnGateway.t option } + let make ?vpn_gateway () = { vpn_gateway } + let parse xml = + Some + { + vpn_gateway = + (Util.option_bind (Xml.member "vpnGateway" xml) VpnGateway.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpn_gateway + (fun f -> Query.Pair ("VpnGateway", (VpnGateway.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpn_gateway + (fun f -> ("vpn_gateway", (VpnGateway.to_json f)))]) + let of_json j = + { + vpn_gateway = + (Util.option_map (Json.lookup j "vpn_gateway") VpnGateway.of_json) + } + end +module DeleteVpcRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpc_id: String.t } + let make ?dry_run ~vpc_id () = { dry_run; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module CancelExportTaskRequest = + struct + type t = { + export_task_id: String.t } + let make ~export_task_id () = { export_task_id } + let parse xml = + Some + { + export_task_id = + (Xml.required "exportTaskId" + (Util.option_bind (Xml.member "exportTaskId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ExportTaskId", (String.to_query v.export_task_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("export_task_id", (String.to_json v.export_task_id))]) + let of_json j = + { + export_task_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "export_task_id"))) + } + end +module DescribeCustomerGatewaysRequest = + struct + type t = + { + dry_run: Boolean.t option ; + customer_gateway_ids: CustomerGatewayIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(customer_gateway_ids= []) ?(filters= []) () = + { dry_run; customer_gateway_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + customer_gateway_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "CustomerGatewayId" xml) + CustomerGatewayIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("CustomerGatewayId", + (CustomerGatewayIdStringList.to_query + v.customer_gateway_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("customer_gateway_ids", + (CustomerGatewayIdStringList.to_json v.customer_gateway_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + customer_gateway_ids = + (CustomerGatewayIdStringList.of_json + (Util.of_option_exn (Json.lookup j "customer_gateway_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeExportTasksResult = + struct + type t = { + export_tasks: ExportTaskList.t } + let make ?(export_tasks= []) () = { export_tasks } + let parse xml = + Some + { + export_tasks = + (Util.of_option [] + (Util.option_bind (Xml.member "exportTaskSet" xml) + ExportTaskList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ExportTaskSet", (ExportTaskList.to_query v.export_tasks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("export_tasks", (ExportTaskList.to_json v.export_tasks))]) + let of_json j = + { + export_tasks = + (ExportTaskList.of_json + (Util.of_option_exn (Json.lookup j "export_tasks"))) + } + end +module DescribePrefixListsResult = + struct + type t = { + prefix_lists: PrefixListSet.t ; + next_token: String.t option } + let make ?(prefix_lists= []) ?next_token () = + { prefix_lists; next_token } + let parse xml = + Some + { + prefix_lists = + (Util.of_option [] + (Util.option_bind (Xml.member "prefixListSet" xml) + PrefixListSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("PrefixListSet", (PrefixListSet.to_query v.prefix_lists)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("prefix_lists", (PrefixListSet.to_json v.prefix_lists))]) + let of_json j = + { + prefix_lists = + (PrefixListSet.of_json + (Util.of_option_exn (Json.lookup j "prefix_lists"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module UnmonitorInstancesResult = + struct + type t = { + instance_monitorings: InstanceMonitoringList.t } + let make ?(instance_monitorings= []) () = { instance_monitorings } + let parse xml = + Some + { + instance_monitorings = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceMonitoringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", + (InstanceMonitoringList.to_query v.instance_monitorings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_monitorings", + (InstanceMonitoringList.to_json v.instance_monitorings))]) + let of_json j = + { + instance_monitorings = + (InstanceMonitoringList.of_json + (Util.of_option_exn (Json.lookup j "instance_monitorings"))) + } + end +module DescribeSecurityGroupsResult = + struct + type t = { + security_groups: SecurityGroupList.t } + let make ?(security_groups= []) () = { security_groups } + let parse xml = + Some + { + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "securityGroupInfo" xml) + SecurityGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SecurityGroupInfo", + (SecurityGroupList.to_query v.security_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("security_groups", + (SecurityGroupList.to_json v.security_groups))]) + let of_json j = + { + security_groups = + (SecurityGroupList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))) + } + end +module DeleteSubnetRequest = + struct + type t = { + dry_run: Boolean.t option ; + subnet_id: String.t } + let make ?dry_run ~subnet_id () = { dry_run; subnet_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + subnet_id = + (Xml.required "SubnetId" + (Util.option_bind (Xml.member "SubnetId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("SubnetId", (String.to_query v.subnet_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnet_id", (String.to_json v.subnet_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + subnet_id = + (String.of_json (Util.of_option_exn (Json.lookup j "subnet_id"))) + } + end +module DescribeVpcEndpointServicesResult = + struct + type t = { + service_names: ValueStringList.t ; + next_token: String.t option } + let make ?(service_names= []) ?next_token () = + { service_names; next_token } + let parse xml = + Some + { + service_names = + (Util.of_option [] + (Util.option_bind (Xml.member "serviceNameSet" xml) + ValueStringList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ServiceNameSet", + (ValueStringList.to_query v.service_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("service_names", (ValueStringList.to_json v.service_names))]) + let of_json j = + { + service_names = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "service_names"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeVpnConnectionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpn_connection_ids: VpnConnectionIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(vpn_connection_ids= []) ?(filters= []) () = + { dry_run; vpn_connection_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_connection_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpnConnectionId" xml) + VpnConnectionIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ("AccountAttributeSet", AccountAttributeList.to_query v.account_attributes)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("account_attributes", AccountAttributeList.to_json v.account_attributes) - ]) - - let of_json j = - { account_attributes = - AccountAttributeList.of_json - (Util.of_option_exn (Json.lookup j "account_attributes")) - } -end - -module ReplaceRouteTableAssociationResult = struct - type t = { new_association_id : String.t option } - - let make ?new_association_id () = { new_association_id } - - let parse xml = - Some - { new_association_id = - Util.option_bind (Xml.member "newAssociationId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.new_association_id (fun f -> - Query.Pair ("NewAssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.new_association_id (fun f -> - "new_association_id", String.to_json f) - ]) - - let of_json j = - { new_association_id = - Util.option_map (Json.lookup j "new_association_id") String.of_json - } -end - -module DescribeVolumeStatusRequest = struct - type t = - { dry_run : Boolean.t option - ; volume_ids : VolumeIdStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ?(volume_ids = []) ?(filters = []) ?next_token ?max_results () = - { dry_run; volume_ids; filters; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "VolumeId" xml) VolumeIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("VolumeId", VolumeIdStringList.to_query v.volume_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("volume_ids", VolumeIdStringList.to_json v.volume_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_ids = - VolumeIdStringList.of_json (Util.of_option_exn (Json.lookup j "volume_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module DescribeDhcpOptionsRequest = struct - type t = - { dry_run : Boolean.t option - ; dhcp_options_ids : DhcpOptionsIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(dhcp_options_ids = []) ?(filters = []) () = - { dry_run; dhcp_options_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; dhcp_options_ids = - Util.of_option - [] + ("VpnConnectionId", + (VpnConnectionIdStringList.to_query v.vpn_connection_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("vpn_connection_ids", + (VpnConnectionIdStringList.to_json v.vpn_connection_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_connection_ids = + (VpnConnectionIdStringList.of_json + (Util.of_option_exn (Json.lookup j "vpn_connection_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module GetConsoleOutputResult = + struct + type t = + { + instance_id: String.t option ; + timestamp: DateTime.t option ; + output: String.t option } + let make ?instance_id ?timestamp ?output () = + { instance_id; timestamp; output } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + timestamp = + (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse); + output = (Util.option_bind (Xml.member "output" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.output + (fun f -> Query.Pair ("Output", (String.to_query f))); + Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (DateTime.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.output + (fun f -> ("output", (String.to_json f))); + Util.option_map v.timestamp + (fun f -> ("timestamp", (DateTime.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + timestamp = + (Util.option_map (Json.lookup j "timestamp") DateTime.of_json); + output = (Util.option_map (Json.lookup j "output") String.of_json) + } + end +module DescribeSpotFleetInstancesResponse = + struct + type t = + { + spot_fleet_request_id: String.t ; + active_instances: ActiveInstanceSet.t ; + next_token: String.t option } + let make ~spot_fleet_request_id ~active_instances ?next_token () = + { spot_fleet_request_id; active_instances; next_token } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + active_instances = + (Xml.required "activeInstanceSet" + (Util.option_bind (Xml.member "activeInstanceSet" xml) + ActiveInstanceSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ActiveInstanceSet", + (ActiveInstanceSet.to_query v.active_instances))); + Some + (Query.Pair + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("active_instances", + (ActiveInstanceSet.to_json v.active_instances)); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + active_instances = + (ActiveInstanceSet.of_json + (Util.of_option_exn (Json.lookup j "active_instances"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeSnapshotAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + snapshot_id: String.t ; + attribute: SnapshotAttributeName.t } + let make ?dry_run ~snapshot_id ~attribute () = + { dry_run; snapshot_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + snapshot_id = + (Xml.required "SnapshotId" + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse)); + attribute = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + SnapshotAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", (SnapshotAttributeName.to_query v.attribute))); + Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (SnapshotAttributeName.to_json v.attribute)); + Some ("snapshot_id", (String.to_json v.snapshot_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))); + attribute = + (SnapshotAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module DeleteVpnConnectionRouteRequest = + struct + type t = { + vpn_connection_id: String.t ; + destination_cidr_block: String.t } + let make ~vpn_connection_id ~destination_cidr_block () = + { vpn_connection_id; destination_cidr_block } + let parse xml = + Some + { + vpn_connection_id = + (Xml.required "VpnConnectionId" + (Util.option_bind (Xml.member "VpnConnectionId" xml) + String.parse)); + destination_cidr_block = + (Xml.required "DestinationCidrBlock" + (Util.option_bind (Xml.member "DestinationCidrBlock" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DestinationCidrBlock", + (String.to_query v.destination_cidr_block))); + Some + (Query.Pair + ("VpnConnectionId", (String.to_query v.vpn_connection_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("destination_cidr_block", + (String.to_json v.destination_cidr_block)); + Some ("vpn_connection_id", (String.to_json v.vpn_connection_id))]) + let of_json j = + { + vpn_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_connection_id"))); + destination_cidr_block = + (String.of_json + (Util.of_option_exn (Json.lookup j "destination_cidr_block"))) + } + end +module CreateSpotDatafeedSubscriptionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + bucket: String.t ; + prefix: String.t option } + let make ?dry_run ~bucket ?prefix () = { dry_run; bucket; prefix } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + bucket = + (Xml.required "bucket" + (Util.option_bind (Xml.member "bucket" xml) String.parse)); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> ("prefix", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json) + } + end +module DetachClassicLinkVpcRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~instance_id ~vpc_id () = + { dry_run; instance_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module AttachClassicLinkVpcRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + vpc_id: String.t ; + groups: GroupIdStringList.t } + let make ?dry_run ~instance_id ~vpc_id ~groups () = + { dry_run; instance_id; vpc_id; groups } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)); + groups = + (Xml.required "SecurityGroupId" + (Util.option_bind (Xml.member "SecurityGroupId" xml) + GroupIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SecurityGroupId", (GroupIdStringList.to_query v.groups))); + Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("groups", (GroupIdStringList.to_json v.groups)); + Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))); + groups = + (GroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "groups"))) + } + end +module ModifyInstanceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + attribute: InstanceAttributeName.t option ; + value: String.t option ; + block_device_mappings: InstanceBlockDeviceMappingSpecificationList.t ; + source_dest_check: AttributeBooleanValue.t option ; + disable_api_termination: AttributeBooleanValue.t option ; + instance_type: AttributeValue.t option ; + kernel: AttributeValue.t option ; + ramdisk: AttributeValue.t option ; + user_data: BlobAttributeValue.t option ; + instance_initiated_shutdown_behavior: AttributeValue.t option ; + groups: GroupIdStringList.t ; + ebs_optimized: AttributeBooleanValue.t option ; + sriov_net_support: AttributeValue.t option } + let make ?dry_run ~instance_id ?attribute ?value + ?(block_device_mappings= []) ?source_dest_check + ?disable_api_termination ?instance_type ?kernel ?ramdisk ?user_data + ?instance_initiated_shutdown_behavior ?(groups= []) ?ebs_optimized + ?sriov_net_support () = + { + dry_run; + instance_id; + attribute; + value; + block_device_mappings; + source_dest_check; + disable_api_termination; + instance_type; + kernel; + ramdisk; + user_data; + instance_initiated_shutdown_behavior; + groups; + ebs_optimized; + sriov_net_support + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + attribute = + (Util.option_bind (Xml.member "attribute" xml) + InstanceAttributeName.parse); + value = (Util.option_bind (Xml.member "value" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + InstanceBlockDeviceMappingSpecificationList.parse)); + source_dest_check = + (Util.option_bind (Xml.member "SourceDestCheck" xml) + AttributeBooleanValue.parse); + disable_api_termination = + (Util.option_bind (Xml.member "disableApiTermination" xml) + AttributeBooleanValue.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + AttributeValue.parse); + kernel = + (Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse); + ramdisk = + (Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse); + user_data = + (Util.option_bind (Xml.member "userData" xml) + BlobAttributeValue.parse); + instance_initiated_shutdown_behavior = (Util.option_bind - (Xml.member "DhcpOptionsId" xml) - DhcpOptionsIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some + (Xml.member "instanceInitiatedShutdownBehavior" xml) + AttributeValue.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "GroupId" xml) + GroupIdStringList.parse)); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) + AttributeBooleanValue.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) + AttributeValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> + Query.Pair ("SriovNetSupport", (AttributeValue.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> + Query.Pair + ("EbsOptimized", (AttributeBooleanValue.to_query f))); + Some + (Query.Pair ("GroupId", (GroupIdStringList.to_query v.groups))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + Query.Pair + ("InstanceInitiatedShutdownBehavior", + (AttributeValue.to_query f))); + Util.option_map v.user_data + (fun f -> + Query.Pair ("UserData", (BlobAttributeValue.to_query f))); + Util.option_map v.ramdisk + (fun f -> Query.Pair ("Ramdisk", (AttributeValue.to_query f))); + Util.option_map v.kernel + (fun f -> Query.Pair ("Kernel", (AttributeValue.to_query f))); + Util.option_map v.instance_type + (fun f -> + Query.Pair ("InstanceType", (AttributeValue.to_query f))); + Util.option_map v.disable_api_termination + (fun f -> + Query.Pair + ("DisableApiTermination", + (AttributeBooleanValue.to_query f))); + Util.option_map v.source_dest_check + (fun f -> + Query.Pair + ("SourceDestCheck", (AttributeBooleanValue.to_query f))); + Some + (Query.Pair + ("BlockDeviceMapping", + (InstanceBlockDeviceMappingSpecificationList.to_query + v.block_device_mappings))); + Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.attribute + (fun f -> + Query.Pair ("Attribute", (InstanceAttributeName.to_query f))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (AttributeValue.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (AttributeBooleanValue.to_json f))); + Some ("groups", (GroupIdStringList.to_json v.groups)); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + ("instance_initiated_shutdown_behavior", + (AttributeValue.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (BlobAttributeValue.to_json f))); + Util.option_map v.ramdisk + (fun f -> ("ramdisk", (AttributeValue.to_json f))); + Util.option_map v.kernel + (fun f -> ("kernel", (AttributeValue.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (AttributeValue.to_json f))); + Util.option_map v.disable_api_termination + (fun f -> + ("disable_api_termination", + (AttributeBooleanValue.to_json f))); + Util.option_map v.source_dest_check + (fun f -> + ("source_dest_check", (AttributeBooleanValue.to_json f))); + Some + ("block_device_mappings", + (InstanceBlockDeviceMappingSpecificationList.to_json + v.block_device_mappings)); + Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.attribute + (fun f -> ("attribute", (InstanceAttributeName.to_json f))); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") + InstanceAttributeName.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json); + block_device_mappings = + (InstanceBlockDeviceMappingSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + AttributeBooleanValue.of_json); + disable_api_termination = + (Util.option_map (Json.lookup j "disable_api_termination") + AttributeBooleanValue.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + AttributeValue.of_json); + kernel = + (Util.option_map (Json.lookup j "kernel") AttributeValue.of_json); + ramdisk = + (Util.option_map (Json.lookup j "ramdisk") AttributeValue.of_json); + user_data = + (Util.option_map (Json.lookup j "user_data") + BlobAttributeValue.of_json); + instance_initiated_shutdown_behavior = + (Util.option_map + (Json.lookup j "instance_initiated_shutdown_behavior") + AttributeValue.of_json); + groups = + (GroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") + AttributeBooleanValue.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") + AttributeValue.of_json) + } + end +module DeleteFlowLogsRequest = + struct + type t = { + flow_log_ids: ValueStringList.t } + let make ~flow_log_ids () = { flow_log_ids } + let parse xml = + Some + { + flow_log_ids = + (Xml.required "FlowLogId" + (Util.option_bind (Xml.member "FlowLogId" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("FlowLogId", (ValueStringList.to_query v.flow_log_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("flow_log_ids", (ValueStringList.to_json v.flow_log_ids))]) + let of_json j = + { + flow_log_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "flow_log_ids"))) + } + end +module EnableVgwRoutePropagationRequest = + struct + type t = { + route_table_id: String.t ; + gateway_id: String.t } + let make ~route_table_id ~gateway_id () = + { route_table_id; gateway_id } + let parse xml = + Some + { + route_table_id = + (Xml.required "RouteTableId" + (Util.option_bind (Xml.member "RouteTableId" xml) String.parse)); + gateway_id = + (Xml.required "GatewayId" + (Util.option_bind (Xml.member "GatewayId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("GatewayId", (String.to_query v.gateway_id))); + Some + (Query.Pair ("RouteTableId", (String.to_query v.route_table_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("gateway_id", (String.to_json v.gateway_id)); + Some ("route_table_id", (String.to_json v.route_table_id))]) + let of_json j = + { + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))); + gateway_id = + (String.of_json (Util.of_option_exn (Json.lookup j "gateway_id"))) + } + end +module DescribeInternetGatewaysResult = + struct + type t = { + internet_gateways: InternetGatewayList.t } + let make ?(internet_gateways= []) () = { internet_gateways } + let parse xml = + Some + { + internet_gateways = + (Util.of_option [] + (Util.option_bind (Xml.member "internetGatewaySet" xml) + InternetGatewayList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InternetGatewaySet", + (InternetGatewayList.to_query v.internet_gateways)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("internet_gateways", + (InternetGatewayList.to_json v.internet_gateways))]) + let of_json j = + { + internet_gateways = + (InternetGatewayList.of_json + (Util.of_option_exn (Json.lookup j "internet_gateways"))) + } + end +module DescribeNetworkInterfacesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_interface_ids: NetworkInterfaceIdList.t ; + filters: FilterList.t } + let make ?dry_run ?(network_interface_ids= []) ?(filters= []) () = + { dry_run; network_interface_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "NetworkInterfaceId" xml) + NetworkInterfaceIdList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("NetworkInterfaceId", + (NetworkInterfaceIdList.to_query v.network_interface_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("network_interface_ids", + (NetworkInterfaceIdList.to_json v.network_interface_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_ids = + (NetworkInterfaceIdList.of_json + (Util.of_option_exn (Json.lookup j "network_interface_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeAccountAttributesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + attribute_names: AccountAttributeNameStringList.t } + let make ?dry_run ?(attribute_names= []) () = + { dry_run; attribute_names } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + attribute_names = + (Util.of_option [] + (Util.option_bind (Xml.member "attributeName" xml) + AccountAttributeNameStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AttributeName", + (AccountAttributeNameStringList.to_query v.attribute_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("attribute_names", + (AccountAttributeNameStringList.to_json v.attribute_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + attribute_names = + (AccountAttributeNameStringList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))) + } + end +module DescribeConversionTasksRequest = + struct + type t = + { + dry_run: Boolean.t option ; + filters: FilterList.t ; + conversion_task_ids: ConversionIdStringList.t } + let make ?dry_run ?(filters= []) ?(conversion_task_ids= []) () = + { dry_run; filters; conversion_task_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "filter" xml) FilterList.parse)); + conversion_task_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "conversionTaskId" xml) + ConversionIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ConversionTaskId", + (ConversionIdStringList.to_query v.conversion_task_ids))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("conversion_task_ids", + (ConversionIdStringList.to_json v.conversion_task_ids)); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + conversion_task_ids = + (ConversionIdStringList.of_json + (Util.of_option_exn (Json.lookup j "conversion_task_ids"))) + } + end +module ModifyVpcEndpointRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_endpoint_id: String.t ; + reset_policy: Boolean.t option ; + policy_document: String.t option ; + add_route_table_ids: ValueStringList.t ; + remove_route_table_ids: ValueStringList.t } + let make ?dry_run ~vpc_endpoint_id ?reset_policy ?policy_document + ?(add_route_table_ids= []) ?(remove_route_table_ids= []) () = + { + dry_run; + vpc_endpoint_id; + reset_policy; + policy_document; + add_route_table_ids; + remove_route_table_ids + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + vpc_endpoint_id = + (Xml.required "VpcEndpointId" + (Util.option_bind (Xml.member "VpcEndpointId" xml) + String.parse)); + reset_policy = + (Util.option_bind (Xml.member "ResetPolicy" xml) Boolean.parse); + policy_document = + (Util.option_bind (Xml.member "PolicyDocument" xml) String.parse); + add_route_table_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "AddRouteTableId" xml) + ValueStringList.parse)); + remove_route_table_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "RemoveRouteTableId" xml) + ValueStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RemoveRouteTableId", + (ValueStringList.to_query v.remove_route_table_ids))); + Some + (Query.Pair + ("AddRouteTableId", + (ValueStringList.to_query v.add_route_table_ids))); + Util.option_map v.policy_document + (fun f -> Query.Pair ("PolicyDocument", (String.to_query f))); + Util.option_map v.reset_policy + (fun f -> Query.Pair ("ResetPolicy", (Boolean.to_query f))); + Some + (Query.Pair + ("VpcEndpointId", (String.to_query v.vpc_endpoint_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("remove_route_table_ids", + (ValueStringList.to_json v.remove_route_table_ids)); + Some + ("add_route_table_ids", + (ValueStringList.to_json v.add_route_table_ids)); + Util.option_map v.policy_document + (fun f -> ("policy_document", (String.to_json f))); + Util.option_map v.reset_policy + (fun f -> ("reset_policy", (Boolean.to_json f))); + Some ("vpc_endpoint_id", (String.to_json v.vpc_endpoint_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_endpoint_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpc_endpoint_id"))); + reset_policy = + (Util.option_map (Json.lookup j "reset_policy") Boolean.of_json); + policy_document = + (Util.option_map (Json.lookup j "policy_document") String.of_json); + add_route_table_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "add_route_table_ids"))); + remove_route_table_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "remove_route_table_ids"))) + } + end +module ModifyVolumeAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_id: String.t ; + auto_enable_i_o: AttributeBooleanValue.t option } + let make ?dry_run ~volume_id ?auto_enable_i_o () = + { dry_run; volume_id; auto_enable_i_o } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)); + auto_enable_i_o = + (Util.option_bind (Xml.member "AutoEnableIO" xml) + AttributeBooleanValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.auto_enable_i_o + (fun f -> + Query.Pair + ("AutoEnableIO", (AttributeBooleanValue.to_query f))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.auto_enable_i_o + (fun f -> + ("auto_enable_i_o", (AttributeBooleanValue.to_json f))); + Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + auto_enable_i_o = + (Util.option_map (Json.lookup j "auto_enable_i_o") + AttributeBooleanValue.of_json) + } + end +module AttachVpnGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpn_gateway_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~vpn_gateway_id ~vpc_id () = + { dry_run; vpn_gateway_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_gateway_id = + (Xml.required "VpnGatewayId" + (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse)); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some + (Query.Pair ("VpnGatewayId", (String.to_query v.vpn_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("vpn_gateway_id", (String.to_json v.vpn_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateway_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module AcceptVpcPeeringConnectionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_peering_connection_id: String.t option } + let make ?dry_run ?vpc_peering_connection_id () = + { dry_run; vpc_peering_connection_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_peering_connection_id = + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> + Query.Pair ("VpcPeeringConnectionId", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> ("vpc_peering_connection_id", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_peering_connection_id = + (Util.option_map (Json.lookup j "vpc_peering_connection_id") + String.of_json) + } + end +module ResetSnapshotAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + snapshot_id: String.t ; + attribute: SnapshotAttributeName.t } + let make ?dry_run ~snapshot_id ~attribute () = + { dry_run; snapshot_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + snapshot_id = + (Xml.required "SnapshotId" + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse)); + attribute = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + SnapshotAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", (SnapshotAttributeName.to_query v.attribute))); + Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (SnapshotAttributeName.to_json v.attribute)); + Some ("snapshot_id", (String.to_json v.snapshot_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))); + attribute = + (SnapshotAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module DescribeAvailabilityZonesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + zone_names: ZoneNameStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(zone_names= []) ?(filters= []) () = + { dry_run; zone_names; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + zone_names = + (Util.of_option [] + (Util.option_bind (Xml.member "ZoneName" xml) + ZoneNameStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("ZoneName", (ZoneNameStringList.to_query v.zone_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("zone_names", (ZoneNameStringList.to_json v.zone_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + zone_names = + (ZoneNameStringList.of_json + (Util.of_option_exn (Json.lookup j "zone_names"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module StopInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t ; + force: Boolean.t option } + let make ?dry_run ~instance_ids ?force () = + { dry_run; instance_ids; force } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)); + force = (Util.option_bind (Xml.member "force" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.force + (fun f -> Query.Pair ("Force", (Boolean.to_query f))); + Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.force (fun f -> ("force", (Boolean.to_json f))); + Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + force = (Util.option_map (Json.lookup j "force") Boolean.of_json) + } + end +module DescribeImportImageTasksRequest = + struct + type t = + { + dry_run: Boolean.t option ; + import_task_ids: ImportTaskIdList.t ; + next_token: String.t option ; + max_results: Integer.t option ; + filters: FilterList.t } + let make ?dry_run ?(import_task_ids= []) ?next_token ?max_results + ?(filters= []) () = + { dry_run; import_task_ids; next_token; max_results; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + import_task_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "ImportTaskId" xml) + ImportTaskIdList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filters", (FilterList.to_query v.filters))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ImportTaskId", + (ImportTaskIdList.to_query v.import_task_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("import_task_ids", + (ImportTaskIdList.to_json v.import_task_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + import_task_ids = + (ImportTaskIdList.of_json + (Util.of_option_exn (Json.lookup j "import_task_ids"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(instance_ids= []) ?(filters= []) ?next_token + ?max_results () = + { dry_run; instance_ids; filters; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module DescribeVpnGatewaysRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpn_gateway_ids: VpnGatewayIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(vpn_gateway_ids= []) ?(filters= []) () = + { dry_run; vpn_gateway_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_gateway_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpnGatewayId" xml) + VpnGatewayIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("VpnGatewayId", + (VpnGatewayIdStringList.to_query v.vpn_gateway_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("vpn_gateway_ids", + (VpnGatewayIdStringList.to_json v.vpn_gateway_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_gateway_ids = + (VpnGatewayIdStringList.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateway_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module UnmonitorInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t } + let make ?dry_run ~instance_ids () = { dry_run; instance_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))) + } + end +module ImportKeyPairRequest = + struct + type t = + { + dry_run: Boolean.t option ; + key_name: String.t ; + public_key_material: Blob.t } + let make ?dry_run ~key_name ~public_key_material () = + { dry_run; key_name; public_key_material } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + key_name = + (Xml.required "keyName" + (Util.option_bind (Xml.member "keyName" xml) String.parse)); + public_key_material = + (Xml.required "publicKeyMaterial" + (Util.option_bind (Xml.member "publicKeyMaterial" xml) + Blob.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PublicKeyMaterial", (Blob.to_query v.public_key_material))); + Some (Query.Pair ("KeyName", (String.to_query v.key_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("public_key_material", (Blob.to_json v.public_key_material)); + Some ("key_name", (String.to_json v.key_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + key_name = + (String.of_json (Util.of_option_exn (Json.lookup j "key_name"))); + public_key_material = + (Blob.of_json + (Util.of_option_exn (Json.lookup j "public_key_material"))) + } + end +module DescribeSpotFleetRequestsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_fleet_request_ids: ValueStringList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(spot_fleet_request_ids= []) ?next_token + ?max_results () = + { dry_run; spot_fleet_request_ids; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_fleet_request_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + ValueStringList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("SpotFleetRequestId", + (ValueStringList.to_query v.spot_fleet_request_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("spot_fleet_request_ids", + (ValueStringList.to_json v.spot_fleet_request_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_fleet_request_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_ids"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module DescribeSpotDatafeedSubscriptionResult = + struct + type t = { + spot_datafeed_subscription: SpotDatafeedSubscription.t option } + let make ?spot_datafeed_subscription () = { spot_datafeed_subscription } + let parse xml = + Some + { + spot_datafeed_subscription = + (Util.option_bind (Xml.member "spotDatafeedSubscription" xml) + SpotDatafeedSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.spot_datafeed_subscription + (fun f -> + Query.Pair + ("SpotDatafeedSubscription", + (SpotDatafeedSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.spot_datafeed_subscription + (fun f -> + ("spot_datafeed_subscription", + (SpotDatafeedSubscription.to_json f)))]) + let of_json j = + { + spot_datafeed_subscription = + (Util.option_map (Json.lookup j "spot_datafeed_subscription") + SpotDatafeedSubscription.of_json) + } + end +module RevokeSecurityGroupEgressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_id: String.t ; + source_security_group_name: String.t option ; + source_security_group_owner_id: String.t option ; + ip_protocol: String.t option ; + from_port: Integer.t option ; + to_port: Integer.t option ; + cidr_ip: String.t option ; + ip_permissions: IpPermissionList.t } + let make ?dry_run ~group_id ?source_security_group_name + ?source_security_group_owner_id ?ip_protocol ?from_port ?to_port + ?cidr_ip ?(ip_permissions= []) () = + { + dry_run; + group_id; + source_security_group_name; + source_security_group_owner_id; + ip_protocol; + from_port; + to_port; + cidr_ip; + ip_permissions + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_id = + (Xml.required "groupId" + (Util.option_bind (Xml.member "groupId" xml) String.parse)); + source_security_group_name = + (Util.option_bind (Xml.member "sourceSecurityGroupName" xml) + String.parse); + source_security_group_owner_id = + (Util.option_bind (Xml.member "sourceSecurityGroupOwnerId" xml) + String.parse); + ip_protocol = + (Util.option_bind (Xml.member "ipProtocol" xml) String.parse); + from_port = + (Util.option_bind (Xml.member "fromPort" xml) Integer.parse); + to_port = + (Util.option_bind (Xml.member "toPort" xml) Integer.parse); + cidr_ip = (Util.option_bind (Xml.member "cidrIp" xml) String.parse); + ip_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "ipPermissions" xml) + IpPermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("IpPermissions", + (IpPermissionList.to_query v.ip_permissions))); + Util.option_map v.cidr_ip + (fun f -> Query.Pair ("CidrIp", (String.to_query f))); + Util.option_map v.to_port + (fun f -> Query.Pair ("ToPort", (Integer.to_query f))); + Util.option_map v.from_port + (fun f -> Query.Pair ("FromPort", (Integer.to_query f))); + Util.option_map v.ip_protocol + (fun f -> Query.Pair ("IpProtocol", (String.to_query f))); + Util.option_map v.source_security_group_owner_id + (fun f -> + Query.Pair + ("SourceSecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.source_security_group_name + (fun f -> + Query.Pair ("SourceSecurityGroupName", (String.to_query f))); + Some (Query.Pair ("GroupId", (String.to_query v.group_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("ip_permissions", (IpPermissionList.to_json v.ip_permissions)); + Util.option_map v.cidr_ip + (fun f -> ("cidr_ip", (String.to_json f))); + Util.option_map v.to_port + (fun f -> ("to_port", (Integer.to_json f))); + Util.option_map v.from_port + (fun f -> ("from_port", (Integer.to_json f))); + Util.option_map v.ip_protocol + (fun f -> ("ip_protocol", (String.to_json f))); + Util.option_map v.source_security_group_owner_id + (fun f -> ("source_security_group_owner_id", (String.to_json f))); + Util.option_map v.source_security_group_name + (fun f -> ("source_security_group_name", (String.to_json f))); + Some ("group_id", (String.to_json v.group_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_id = + (String.of_json (Util.of_option_exn (Json.lookup j "group_id"))); + source_security_group_name = + (Util.option_map (Json.lookup j "source_security_group_name") + String.of_json); + source_security_group_owner_id = + (Util.option_map (Json.lookup j "source_security_group_owner_id") + String.of_json); + ip_protocol = + (Util.option_map (Json.lookup j "ip_protocol") String.of_json); + from_port = + (Util.option_map (Json.lookup j "from_port") Integer.of_json); + to_port = (Util.option_map (Json.lookup j "to_port") Integer.of_json); + cidr_ip = (Util.option_map (Json.lookup j "cidr_ip") String.of_json); + ip_permissions = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions"))) + } + end +module DescribeInternetGatewaysRequest = + struct + type t = + { + dry_run: Boolean.t option ; + internet_gateway_ids: ValueStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(internet_gateway_ids= []) ?(filters= []) () = + { dry_run; internet_gateway_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + internet_gateway_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "internetGatewayId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("InternetGatewayId", + (ValueStringList.to_query v.internet_gateway_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("internet_gateway_ids", + (ValueStringList.to_json v.internet_gateway_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + internet_gateway_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "internet_gateway_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DeleteVpcPeeringConnectionResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module DescribeReservedInstancesModificationsRequest = + struct + type t = + { + reserved_instances_modification_ids: + ReservedInstancesModificationIdStringList.t ; + next_token: String.t option ; + filters: FilterList.t } + let make ?(reserved_instances_modification_ids= []) ?next_token + ?(filters= []) () = + { reserved_instances_modification_ids; next_token; filters } + let parse xml = + Some + { + reserved_instances_modification_ids = + (Util.of_option [] + (Util.option_bind + (Xml.member "ReservedInstancesModificationId" xml) + ReservedInstancesModificationIdStringList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ReservedInstancesModificationId", + (ReservedInstancesModificationIdStringList.to_query + v.reserved_instances_modification_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("reserved_instances_modification_ids", + (ReservedInstancesModificationIdStringList.to_json + v.reserved_instances_modification_ids))]) + let of_json j = + { + reserved_instances_modification_ids = + (ReservedInstancesModificationIdStringList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_modification_ids"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeSpotFleetRequestsResponse = + struct + type t = + { + spot_fleet_request_configs: SpotFleetRequestConfigSet.t ; + next_token: String.t option } + let make ~spot_fleet_request_configs ?next_token () = + { spot_fleet_request_configs; next_token } + let parse xml = + Some + { + spot_fleet_request_configs = + (Xml.required "spotFleetRequestConfigSet" + (Util.option_bind (Xml.member "spotFleetRequestConfigSet" xml) + SpotFleetRequestConfigSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("SpotFleetRequestConfigSet", + (SpotFleetRequestConfigSet.to_query + v.spot_fleet_request_configs)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("spot_fleet_request_configs", + (SpotFleetRequestConfigSet.to_json + v.spot_fleet_request_configs))]) + let of_json j = + { + spot_fleet_request_configs = + (SpotFleetRequestConfigSet.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_configs"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module ImportVolumeResult = + struct + type t = { + conversion_task: ConversionTask.t option } + let make ?conversion_task () = { conversion_task } + let parse xml = + Some + { + conversion_task = + (Util.option_bind (Xml.member "conversionTask" xml) + ConversionTask.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.conversion_task + (fun f -> + Query.Pair ("ConversionTask", (ConversionTask.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.conversion_task + (fun f -> ("conversion_task", (ConversionTask.to_json f)))]) + let of_json j = + { + conversion_task = + (Util.option_map (Json.lookup j "conversion_task") + ConversionTask.of_json) + } + end +module DescribeVolumeAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_id: String.t ; + attribute: VolumeAttributeName.t option } + let make ?dry_run ~volume_id ?attribute () = + { dry_run; volume_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)); + attribute = + (Util.option_bind (Xml.member "Attribute" xml) + VolumeAttributeName.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> + Query.Pair ("Attribute", (VolumeAttributeName.to_query f))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> ("attribute", (VolumeAttributeName.to_json f))); + Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") + VolumeAttributeName.of_json) + } + end +module CreateNetworkAclResult = + struct + type t = { + network_acl: NetworkAcl.t option } + let make ?network_acl () = { network_acl } + let parse xml = + Some + { + network_acl = + (Util.option_bind (Xml.member "networkAcl" xml) NetworkAcl.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.network_acl + (fun f -> Query.Pair ("NetworkAcl", (NetworkAcl.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.network_acl + (fun f -> ("network_acl", (NetworkAcl.to_json f)))]) + let of_json j = + { + network_acl = + (Util.option_map (Json.lookup j "network_acl") NetworkAcl.of_json) + } + end +module CreateRouteTableResult = + struct + type t = { + route_table: RouteTable.t option } + let make ?route_table () = { route_table } + let parse xml = + Some + { + route_table = + (Util.option_bind (Xml.member "routeTable" xml) RouteTable.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.route_table + (fun f -> Query.Pair ("RouteTable", (RouteTable.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.route_table + (fun f -> ("route_table", (RouteTable.to_json f)))]) + let of_json j = + { + route_table = + (Util.option_map (Json.lookup j "route_table") RouteTable.of_json) + } + end +module DescribeSpotInstanceRequestsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_instance_request_ids: SpotInstanceRequestIdList.t ; + filters: FilterList.t } + let make ?dry_run ?(spot_instance_request_ids= []) ?(filters= []) () = + { dry_run; spot_instance_request_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_instance_request_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SpotInstanceRequestId" xml) + SpotInstanceRequestIdList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("SpotInstanceRequestId", + (SpotInstanceRequestIdList.to_query + v.spot_instance_request_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("spot_instance_request_ids", + (SpotInstanceRequestIdList.to_json v.spot_instance_request_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_instance_request_ids = + (SpotInstanceRequestIdList.of_json + (Util.of_option_exn (Json.lookup j "spot_instance_request_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DeleteNetworkInterfaceRequest = + struct + type t = { + dry_run: Boolean.t option ; + network_interface_id: String.t } + let make ?dry_run ~network_interface_id () = + { dry_run; network_interface_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NetworkInterfaceId", + (String.to_query v.network_interface_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("network_interface_id", + (String.to_json v.network_interface_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))) + } + end +module DescribePlacementGroupsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_names: PlacementGroupStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(group_names= []) ?(filters= []) () = + { dry_run; group_names; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "groupName" xml) + PlacementGroupStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("GroupName", + (PlacementGroupStringList.to_query v.group_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("group_names", + (PlacementGroupStringList.to_json v.group_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_names = + (PlacementGroupStringList.of_json + (Util.of_option_exn (Json.lookup j "group_names"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeAvailabilityZonesResult = + struct + type t = { + availability_zones: AvailabilityZoneList.t } + let make ?(availability_zones= []) () = { availability_zones } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "availabilityZoneInfo" xml) + AvailabilityZoneList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZoneInfo", + (AvailabilityZoneList.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("availability_zones", + (AvailabilityZoneList.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZoneList.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))) + } + end +module StartInstancesRequest = + struct + type t = + { + instance_ids: InstanceIdStringList.t ; + additional_info: String.t option ; + dry_run: Boolean.t option } + let make ~instance_ids ?additional_info ?dry_run () = + { instance_ids; additional_info; dry_run } + let parse xml = + Some + { + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)); + additional_info = + (Util.option_bind (Xml.member "additionalInfo" xml) String.parse); + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f))); + Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); + Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f))); + Util.option_map v.additional_info + (fun f -> ("additional_info", (String.to_json f))); + Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids))]) + let of_json j = + { + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + additional_info = + (Util.option_map (Json.lookup j "additional_info") String.of_json); + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json) + } + end +module ImportImageResult = + struct + type t = + { + import_task_id: String.t option ; + architecture: String.t option ; + license_type: String.t option ; + platform: String.t option ; + hypervisor: String.t option ; + description: String.t option ; + snapshot_details: SnapshotDetailList.t ; + image_id: String.t option ; + progress: String.t option ; + status_message: String.t option ; + status: String.t option } + let make ?import_task_id ?architecture ?license_type ?platform + ?hypervisor ?description ?(snapshot_details= []) ?image_id + ?progress ?status_message ?status () = + { + import_task_id; + architecture; + license_type; + platform; + hypervisor; + description; + snapshot_details; + image_id; + progress; + status_message; + status + } + let parse xml = + Some + { + import_task_id = + (Util.option_bind (Xml.member "importTaskId" xml) String.parse); + architecture = + (Util.option_bind (Xml.member "architecture" xml) String.parse); + license_type = + (Util.option_bind (Xml.member "licenseType" xml) String.parse); + platform = + (Util.option_bind (Xml.member "platform" xml) String.parse); + hypervisor = + (Util.option_bind (Xml.member "hypervisor" xml) String.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + snapshot_details = + (Util.of_option [] + (Util.option_bind (Xml.member "snapshotDetailSet" xml) + SnapshotDetailList.parse)); + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + progress = + (Util.option_bind (Xml.member "progress" xml) String.parse); + status_message = + (Util.option_bind (Xml.member "statusMessage" xml) String.parse); + status = (Util.option_bind (Xml.member "status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.status_message + (fun f -> Query.Pair ("StatusMessage", (String.to_query f))); + Util.option_map v.progress + (fun f -> Query.Pair ("Progress", (String.to_query f))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f))); + Some + (Query.Pair + ("SnapshotDetailSet", + (SnapshotDetailList.to_query v.snapshot_details))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.hypervisor + (fun f -> Query.Pair ("Hypervisor", (String.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (String.to_query f))); + Util.option_map v.license_type + (fun f -> Query.Pair ("LicenseType", (String.to_query f))); + Util.option_map v.architecture + (fun f -> Query.Pair ("Architecture", (String.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.status_message + (fun f -> ("status_message", (String.to_json f))); + Util.option_map v.progress + (fun f -> ("progress", (String.to_json f))); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f))); + Some + ("snapshot_details", + (SnapshotDetailList.to_json v.snapshot_details)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.hypervisor + (fun f -> ("hypervisor", (String.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (String.to_json f))); + Util.option_map v.license_type + (fun f -> ("license_type", (String.to_json f))); + Util.option_map v.architecture + (fun f -> ("architecture", (String.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f)))]) + let of_json j = + { + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + architecture = + (Util.option_map (Json.lookup j "architecture") String.of_json); + license_type = + (Util.option_map (Json.lookup j "license_type") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") String.of_json); + hypervisor = + (Util.option_map (Json.lookup j "hypervisor") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + snapshot_details = + (SnapshotDetailList.of_json + (Util.of_option_exn (Json.lookup j "snapshot_details"))); + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + progress = + (Util.option_map (Json.lookup j "progress") String.of_json); + status_message = + (Util.option_map (Json.lookup j "status_message") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module DescribeCustomerGatewaysResult = + struct + type t = { + customer_gateways: CustomerGatewayList.t } + let make ?(customer_gateways= []) () = { customer_gateways } + let parse xml = + Some + { + customer_gateways = + (Util.of_option [] + (Util.option_bind (Xml.member "customerGatewaySet" xml) + CustomerGatewayList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CustomerGatewaySet", + (CustomerGatewayList.to_query v.customer_gateways)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("customer_gateways", + (CustomerGatewayList.to_json v.customer_gateways))]) + let of_json j = + { + customer_gateways = + (CustomerGatewayList.of_json + (Util.of_option_exn (Json.lookup j "customer_gateways"))) + } + end +module DescribeVpcEndpointServicesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?dry_run ?max_results ?next_token () = + { dry_run; max_results; next_token } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeSpotFleetRequestHistoryRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_fleet_request_id: String.t ; + event_type: EventType.t option ; + start_time: DateTime.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ~spot_fleet_request_id ?event_type ~start_time + ?next_token ?max_results () = + { + dry_run; + spot_fleet_request_id; + event_type; + start_time; + next_token; + max_results + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + event_type = + (Util.option_bind (Xml.member "eventType" xml) EventType.parse); + start_time = + (Xml.required "startTime" + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("StartTime", (DateTime.to_query v.start_time))); + Util.option_map v.event_type + (fun f -> Query.Pair ("EventType", (EventType.to_query f))); + Some + (Query.Pair + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("start_time", (DateTime.to_json v.start_time)); + Util.option_map v.event_type + (fun f -> ("event_type", (EventType.to_json f))); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + event_type = + (Util.option_map (Json.lookup j "event_type") EventType.of_json); + start_time = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "start_time"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module DeleteVolumeRequest = + struct + type t = { + dry_run: Boolean.t option ; + volume_id: String.t } + let make ?dry_run ~volume_id () = { dry_run; volume_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))) + } + end +module DescribeFlowLogsResult = + struct + type t = { + flow_logs: FlowLogSet.t ; + next_token: String.t option } + let make ?(flow_logs= []) ?next_token () = { flow_logs; next_token } + let parse xml = + Some + { + flow_logs = + (Util.of_option [] + (Util.option_bind (Xml.member "flowLogSet" xml) + FlowLogSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair ("FlowLogSet", (FlowLogSet.to_query v.flow_logs)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("flow_logs", (FlowLogSet.to_json v.flow_logs))]) + let of_json j = + { + flow_logs = + (FlowLogSet.of_json + (Util.of_option_exn (Json.lookup j "flow_logs"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeBundleTasksResult = + struct + type t = { + bundle_tasks: BundleTaskList.t } + let make ?(bundle_tasks= []) () = { bundle_tasks } + let parse xml = + Some + { + bundle_tasks = + (Util.of_option [] + (Util.option_bind (Xml.member "bundleInstanceTasksSet" xml) + BundleTaskList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("BundleInstanceTasksSet", + (BundleTaskList.to_query v.bundle_tasks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("bundle_tasks", (BundleTaskList.to_json v.bundle_tasks))]) + let of_json j = + { + bundle_tasks = + (BundleTaskList.of_json + (Util.of_option_exn (Json.lookup j "bundle_tasks"))) + } + end +module DescribeVolumeStatusResult = + struct + type t = + { + volume_statuses: VolumeStatusList.t ; + next_token: String.t option } + let make ?(volume_statuses= []) ?next_token () = + { volume_statuses; next_token } + let parse xml = + Some + { + volume_statuses = + (Util.of_option [] + (Util.option_bind (Xml.member "volumeStatusSet" xml) + VolumeStatusList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("VolumeStatusSet", + (VolumeStatusList.to_query v.volume_statuses)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("volume_statuses", + (VolumeStatusList.to_json v.volume_statuses))]) + let of_json j = + { + volume_statuses = + (VolumeStatusList.of_json + (Util.of_option_exn (Json.lookup j "volume_statuses"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeSubnetsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + subnet_ids: SubnetIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(subnet_ids= []) ?(filters= []) () = + { dry_run; subnet_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + subnet_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SubnetId" xml) + SubnetIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ("DhcpOptionsId", DhcpOptionsIdStringList.to_query v.dhcp_options_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("dhcp_options_ids", DhcpOptionsIdStringList.to_json v.dhcp_options_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; dhcp_options_ids = - DhcpOptionsIdStringList.of_json - (Util.of_option_exn (Json.lookup j "dhcp_options_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeSpotPriceHistoryResult = struct - type t = - { spot_price_history : SpotPriceHistoryList.t - ; next_token : String.t option - } - - let make ?(spot_price_history = []) ?next_token () = { spot_price_history; next_token } - - let parse xml = - Some - { spot_price_history = - Util.of_option - [] + ("SubnetId", (SubnetIdStringList.to_query v.subnet_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("subnet_ids", (SubnetIdStringList.to_json v.subnet_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + subnet_ids = + (SubnetIdStringList.of_json + (Util.of_option_exn (Json.lookup j "subnet_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module ImportKeyPairResult = + struct + type t = { + key_name: String.t option ; + key_fingerprint: String.t option } + let make ?key_name ?key_fingerprint () = { key_name; key_fingerprint } + let parse xml = + Some + { + key_name = + (Util.option_bind (Xml.member "keyName" xml) String.parse); + key_fingerprint = + (Util.option_bind (Xml.member "keyFingerprint" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.key_fingerprint + (fun f -> Query.Pair ("KeyFingerprint", (String.to_query f))); + Util.option_map v.key_name + (fun f -> Query.Pair ("KeyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.key_fingerprint + (fun f -> ("key_fingerprint", (String.to_json f))); + Util.option_map v.key_name + (fun f -> ("key_name", (String.to_json f)))]) + let of_json j = + { + key_name = + (Util.option_map (Json.lookup j "key_name") String.of_json); + key_fingerprint = + (Util.option_map (Json.lookup j "key_fingerprint") String.of_json) + } + end +module CreateKeyPairRequest = + struct + type t = { + dry_run: Boolean.t option ; + key_name: String.t } + let make ?dry_run ~key_name () = { dry_run; key_name } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + key_name = + (Xml.required "KeyName" + (Util.option_bind (Xml.member "KeyName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("KeyName", (String.to_query v.key_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("key_name", (String.to_json v.key_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + key_name = + (String.of_json (Util.of_option_exn (Json.lookup j "key_name"))) + } + end +module DisassociateAddressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + public_ip: String.t option ; + association_id: String.t option } + let make ?dry_run ?public_ip ?association_id () = + { dry_run; public_ip; association_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ip = + (Util.option_bind (Xml.member "PublicIp" xml) String.parse); + association_id = + (Util.option_bind (Xml.member "AssociationId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> Query.Pair ("AssociationId", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> ("association_id", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + association_id = + (Util.option_map (Json.lookup j "association_id") String.of_json) + } + end +module DisableVpcClassicLinkResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module ReplaceRouteRequest = + struct + type t = + { + dry_run: Boolean.t option ; + route_table_id: String.t ; + destination_cidr_block: String.t ; + gateway_id: String.t option ; + instance_id: String.t option ; + network_interface_id: String.t option ; + vpc_peering_connection_id: String.t option } + let make ?dry_run ~route_table_id ~destination_cidr_block ?gateway_id + ?instance_id ?network_interface_id ?vpc_peering_connection_id () = + { + dry_run; + route_table_id; + destination_cidr_block; + gateway_id; + instance_id; + network_interface_id; + vpc_peering_connection_id + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)); + destination_cidr_block = + (Xml.required "destinationCidrBlock" + (Util.option_bind (Xml.member "destinationCidrBlock" xml) + String.parse)); + gateway_id = + (Util.option_bind (Xml.member "gatewayId" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + vpc_peering_connection_id = + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> + Query.Pair ("VpcPeeringConnectionId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.gateway_id + (fun f -> Query.Pair ("GatewayId", (String.to_query f))); + Some + (Query.Pair + ("DestinationCidrBlock", + (String.to_query v.destination_cidr_block))); + Some + (Query.Pair ("RouteTableId", (String.to_query v.route_table_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> ("vpc_peering_connection_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.gateway_id + (fun f -> ("gateway_id", (String.to_json f))); + Some + ("destination_cidr_block", + (String.to_json v.destination_cidr_block)); + Some ("route_table_id", (String.to_json v.route_table_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))); + destination_cidr_block = + (String.of_json + (Util.of_option_exn (Json.lookup j "destination_cidr_block"))); + gateway_id = + (Util.option_map (Json.lookup j "gateway_id") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + vpc_peering_connection_id = + (Util.option_map (Json.lookup j "vpc_peering_connection_id") + String.of_json) + } + end +module DeleteFlowLogsResult = + struct + type t = { + unsuccessful: UnsuccessfulItemSet.t } + let make ?(unsuccessful= []) () = { unsuccessful } + let parse xml = + Some + { + unsuccessful = + (Util.of_option [] + (Util.option_bind (Xml.member "unsuccessful" xml) + UnsuccessfulItemSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Unsuccessful", + (UnsuccessfulItemSet.to_query v.unsuccessful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("unsuccessful", (UnsuccessfulItemSet.to_json v.unsuccessful))]) + let of_json j = + { + unsuccessful = + (UnsuccessfulItemSet.of_json + (Util.of_option_exn (Json.lookup j "unsuccessful"))) + } + end +module GetConsoleOutputRequest = + struct + type t = { + dry_run: Boolean.t option ; + instance_id: String.t } + let make ?dry_run ~instance_id () = { dry_run; instance_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) + } + end +module AttachVpnGatewayResult = + struct + type t = { + vpc_attachment: VpcAttachment.t option } + let make ?vpc_attachment () = { vpc_attachment } + let parse xml = + Some + { + vpc_attachment = + (Util.option_bind (Xml.member "attachment" xml) + VpcAttachment.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_attachment + (fun f -> Query.Pair ("Attachment", (VpcAttachment.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_attachment + (fun f -> ("vpc_attachment", (VpcAttachment.to_json f)))]) + let of_json j = + { + vpc_attachment = + (Util.option_map (Json.lookup j "vpc_attachment") + VpcAttachment.of_json) + } + end +module ImageAttribute = + struct + type t = + { + image_id: String.t option ; + launch_permissions: LaunchPermissionList.t ; + product_codes: ProductCodeList.t ; + kernel_id: AttributeValue.t option ; + ramdisk_id: AttributeValue.t option ; + description: AttributeValue.t option ; + sriov_net_support: AttributeValue.t option ; + block_device_mappings: BlockDeviceMappingList.t } + let make ?image_id ?(launch_permissions= []) ?(product_codes= []) + ?kernel_id ?ramdisk_id ?description ?sriov_net_support + ?(block_device_mappings= []) () = + { + image_id; + launch_permissions; + product_codes; + kernel_id; + ramdisk_id; + description; + sriov_net_support; + block_device_mappings + } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse); + launch_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "launchPermission" xml) + LaunchPermissionList.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)); + kernel_id = + (Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse); + description = + (Util.option_bind (Xml.member "description" xml) + AttributeValue.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) + AttributeValue.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + BlockDeviceMappingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("BlockDeviceMapping", + (BlockDeviceMappingList.to_query v.block_device_mappings))); + Util.option_map v.sriov_net_support + (fun f -> + Query.Pair ("SriovNetSupport", (AttributeValue.to_query f))); + Util.option_map v.description + (fun f -> + Query.Pair ("Description", (AttributeValue.to_query f))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("Ramdisk", (AttributeValue.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("Kernel", (AttributeValue.to_query f))); + Some + (Query.Pair + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Some + (Query.Pair + ("LaunchPermission", + (LaunchPermissionList.to_query v.launch_permissions))); + Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("block_device_mappings", + (BlockDeviceMappingList.to_json v.block_device_mappings)); + Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (AttributeValue.to_json f))); + Util.option_map v.description + (fun f -> ("description", (AttributeValue.to_json f))); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (AttributeValue.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (AttributeValue.to_json f))); + Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Some + ("launch_permissions", + (LaunchPermissionList.to_json v.launch_permissions)); + Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json); + launch_permissions = + (LaunchPermissionList.of_json + (Util.of_option_exn (Json.lookup j "launch_permissions"))); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") AttributeValue.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") + AttributeValue.of_json); + description = + (Util.option_map (Json.lookup j "description") + AttributeValue.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") + AttributeValue.of_json); + block_device_mappings = + (BlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))) + } + end +module DetachClassicLinkVpcResult = + struct + type t = { + return: Boolean.t option } + let make ?return () = { return } + let parse xml = + Some + { return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f)))]) + let of_json j = + { return = (Util.option_map (Json.lookup j "return") Boolean.of_json) } + end +module CreateVpnConnectionResult = + struct + type t = { + vpn_connection: VpnConnection.t option } + let make ?vpn_connection () = { vpn_connection } + let parse xml = + Some + { + vpn_connection = + (Util.option_bind (Xml.member "vpnConnection" xml) + VpnConnection.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpn_connection + (fun f -> + Query.Pair ("VpnConnection", (VpnConnection.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpn_connection + (fun f -> ("vpn_connection", (VpnConnection.to_json f)))]) + let of_json j = + { + vpn_connection = + (Util.option_map (Json.lookup j "vpn_connection") + VpnConnection.of_json) + } + end +module DeleteSnapshotRequest = + struct + type t = { + dry_run: Boolean.t option ; + snapshot_id: String.t } + let make ?dry_run ~snapshot_id () = { dry_run; snapshot_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + snapshot_id = + (Xml.required "SnapshotId" + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("snapshot_id", (String.to_json v.snapshot_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))) + } + end +module KeyPair = + struct + type t = + { + key_name: String.t ; + key_fingerprint: String.t ; + key_material: String.t } + let make ~key_name ~key_fingerprint ~key_material () = + { key_name; key_fingerprint; key_material } + let parse xml = + Some + { + key_name = + (Xml.required "keyName" + (Util.option_bind (Xml.member "keyName" xml) String.parse)); + key_fingerprint = + (Xml.required "keyFingerprint" + (Util.option_bind (Xml.member "keyFingerprint" xml) + String.parse)); + key_material = + (Xml.required "keyMaterial" + (Util.option_bind (Xml.member "keyMaterial" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("KeyMaterial", (String.to_query v.key_material))); + Some + (Query.Pair + ("KeyFingerprint", (String.to_query v.key_fingerprint))); + Some (Query.Pair ("KeyName", (String.to_query v.key_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("key_material", (String.to_json v.key_material)); + Some ("key_fingerprint", (String.to_json v.key_fingerprint)); + Some ("key_name", (String.to_json v.key_name))]) + let of_json j = + { + key_name = + (String.of_json (Util.of_option_exn (Json.lookup j "key_name"))); + key_fingerprint = + (String.of_json + (Util.of_option_exn (Json.lookup j "key_fingerprint"))); + key_material = + (String.of_json (Util.of_option_exn (Json.lookup j "key_material"))) + } + end +module RestoreAddressToClassicRequest = + struct + type t = { + dry_run: Boolean.t option ; + public_ip: String.t } + let make ?dry_run ~public_ip () = { dry_run; public_ip } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ip = + (Xml.required "publicIp" + (Util.option_bind (Xml.member "publicIp" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("PublicIp", (String.to_query v.public_ip))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("public_ip", (String.to_json v.public_ip)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ip = + (String.of_json (Util.of_option_exn (Json.lookup j "public_ip"))) + } + end +module DeleteVpcPeeringConnectionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_peering_connection_id: String.t } + let make ?dry_run ~vpc_peering_connection_id () = + { dry_run; vpc_peering_connection_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_peering_connection_id = + (Xml.required "vpcPeeringConnectionId" + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcPeeringConnectionId", + (String.to_query v.vpc_peering_connection_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_peering_connection_id", + (String.to_json v.vpc_peering_connection_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_peering_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpc_peering_connection_id"))) + } + end +module CreateCustomerGatewayResult = + struct + type t = { + customer_gateway: CustomerGateway.t option } + let make ?customer_gateway () = { customer_gateway } + let parse xml = + Some + { + customer_gateway = + (Util.option_bind (Xml.member "customerGateway" xml) + CustomerGateway.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.customer_gateway + (fun f -> + Query.Pair ("CustomerGateway", (CustomerGateway.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.customer_gateway + (fun f -> ("customer_gateway", (CustomerGateway.to_json f)))]) + let of_json j = + { + customer_gateway = + (Util.option_map (Json.lookup j "customer_gateway") + CustomerGateway.of_json) + } + end +module ModifyReservedInstancesResult = + struct + type t = { + reserved_instances_modification_id: String.t option } + let make ?reserved_instances_modification_id () = + { reserved_instances_modification_id } + let parse xml = + Some + { + reserved_instances_modification_id = (Util.option_bind - (Xml.member "spotPriceHistorySet" xml) - SpotPriceHistoryList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + (Xml.member "reservedInstancesModificationId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reserved_instances_modification_id + (fun f -> + Query.Pair + ("ReservedInstancesModificationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reserved_instances_modification_id + (fun f -> + ("reserved_instances_modification_id", (String.to_json f)))]) + let of_json j = + { + reserved_instances_modification_id = + (Util.option_map + (Json.lookup j "reserved_instances_modification_id") + String.of_json) + } + end +module DescribeSpotInstanceRequestsResult = + struct + type t = { + spot_instance_requests: SpotInstanceRequestList.t } + let make ?(spot_instance_requests= []) () = { spot_instance_requests } + let parse xml = + Some + { + spot_instance_requests = + (Util.of_option [] + (Util.option_bind (Xml.member "spotInstanceRequestSet" xml) + SpotInstanceRequestList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotInstanceRequestSet", + (SpotInstanceRequestList.to_query v.spot_instance_requests)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_instance_requests", + (SpotInstanceRequestList.to_json v.spot_instance_requests))]) + let of_json j = + { + spot_instance_requests = + (SpotInstanceRequestList.of_json + (Util.of_option_exn (Json.lookup j "spot_instance_requests"))) + } + end +module ModifySnapshotAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + snapshot_id: String.t ; + attribute: SnapshotAttributeName.t option ; + operation_type: OperationType.t option ; + user_ids: UserIdStringList.t ; + group_names: GroupNameStringList.t ; + create_volume_permission: CreateVolumePermissionModifications.t option } + let make ?dry_run ~snapshot_id ?attribute ?operation_type ?(user_ids= + []) ?(group_names= []) ?create_volume_permission () = + { + dry_run; + snapshot_id; + attribute; + operation_type; + user_ids; + group_names; + create_volume_permission + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + snapshot_id = + (Xml.required "SnapshotId" + (Util.option_bind (Xml.member "SnapshotId" xml) String.parse)); + attribute = + (Util.option_bind (Xml.member "Attribute" xml) + SnapshotAttributeName.parse); + operation_type = + (Util.option_bind (Xml.member "OperationType" xml) + OperationType.parse); + user_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "UserId" xml) + UserIdStringList.parse)); + group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "UserGroup" xml) + GroupNameStringList.parse)); + create_volume_permission = + (Util.option_bind (Xml.member "CreateVolumePermission" xml) + CreateVolumePermissionModifications.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.create_volume_permission + (fun f -> + Query.Pair + ("CreateVolumePermission", + (CreateVolumePermissionModifications.to_query f))); + Some (Query.Pair - ("SpotPriceHistorySet", SpotPriceHistoryList.to_query v.spot_price_history)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("spot_price_history", SpotPriceHistoryList.to_json v.spot_price_history) - ]) - - let of_json j = - { spot_price_history = - SpotPriceHistoryList.of_json - (Util.of_option_exn (Json.lookup j "spot_price_history")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DeleteTagsRequest = struct - type t = - { dry_run : Boolean.t option - ; resources : ResourceIdList.t - ; tags : TagList.t - } - - let make ?dry_run ~resources ?(tags = []) () = { dry_run; resources; tags } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; resources = - Xml.required - "resourceId" - (Util.option_bind (Xml.member "resourceId" xml) ResourceIdList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "tag" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tag", TagList.to_query v.tags)) - ; Some (Query.Pair ("ResourceId", ResourceIdList.to_query v.resources)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("resources", ResourceIdList.to_json v.resources) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; resources = ResourceIdList.of_json (Util.of_option_exn (Json.lookup j "resources")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ReportInstanceStatusRequest = struct - type t = - { dry_run : Boolean.t option - ; instances : InstanceIdStringList.t - ; status : ReportStatusType.t - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; reason_codes : ReasonCodesList.t - ; description : String.t option - } - - let make ?dry_run ~instances ~status ?start_time ?end_time ~reason_codes ?description () - = - { dry_run; instances; status; start_time; end_time; reason_codes; description } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instances = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) InstanceIdStringList.parse) - ; status = - Xml.required - "status" - (Util.option_bind (Xml.member "status" xml) ReportStatusType.parse) - ; start_time = Util.option_bind (Xml.member "startTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "endTime" xml) DateTime.parse - ; reason_codes = - Xml.required - "reasonCode" - (Util.option_bind (Xml.member "reasonCode" xml) ReasonCodesList.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("ReasonCode", ReasonCodesList.to_query v.reason_codes)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Some (Query.Pair ("Status", ReportStatusType.to_query v.status)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instances)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("reason_codes", ReasonCodesList.to_json v.reason_codes) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Some ("status", ReportStatusType.to_json v.status) - ; Some ("instances", InstanceIdStringList.to_json v.instances) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instances = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instances")) - ; status = ReportStatusType.of_json (Util.of_option_exn (Json.lookup j "status")) - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; reason_codes = - ReasonCodesList.of_json (Util.of_option_exn (Json.lookup j "reason_codes")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module AssociateRouteTableResult = struct - type t = { association_id : String.t option } - - let make ?association_id () = { association_id } - - let parse xml = - Some - { association_id = Util.option_bind (Xml.member "associationId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> - Query.Pair ("AssociationId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_id (fun f -> "association_id", String.to_json f) - ]) - - let of_json j = - { association_id = Util.option_map (Json.lookup j "association_id") String.of_json } -end - -module CreateVpcPeeringConnectionRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_id : String.t option - ; peer_vpc_id : String.t option - ; peer_owner_id : String.t option - } - - let make ?dry_run ?vpc_id ?peer_vpc_id ?peer_owner_id () = - { dry_run; vpc_id; peer_vpc_id; peer_owner_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; peer_vpc_id = Util.option_bind (Xml.member "peerVpcId" xml) String.parse - ; peer_owner_id = Util.option_bind (Xml.member "peerOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.peer_owner_id (fun f -> - Query.Pair ("PeerOwnerId", String.to_query f)) - ; Util.option_map v.peer_vpc_id (fun f -> - Query.Pair ("PeerVpcId", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.peer_owner_id (fun f -> "peer_owner_id", String.to_json f) - ; Util.option_map v.peer_vpc_id (fun f -> "peer_vpc_id", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; peer_vpc_id = Util.option_map (Json.lookup j "peer_vpc_id") String.of_json - ; peer_owner_id = Util.option_map (Json.lookup j "peer_owner_id") String.of_json - } -end - -module DescribeVpcsRequest = struct - type t = - { dry_run : Boolean.t option - ; vpc_ids : VpcIdStringList.t - ; filters : FilterList.t - } - - let make ?dry_run ?(vpc_ids = []) ?(filters = []) () = { dry_run; vpc_ids; filters } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpc_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "VpcId" xml) VpcIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("VpcId", VpcIdStringList.to_query v.vpc_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("vpc_ids", VpcIdStringList.to_json v.vpc_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpc_ids = VpcIdStringList.of_json (Util.of_option_exn (Json.lookup j "vpc_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DetachNetworkInterfaceRequest = struct - type t = - { dry_run : Boolean.t option - ; attachment_id : String.t - ; force : Boolean.t option - } - - let make ?dry_run ~attachment_id ?force () = { dry_run; attachment_id; force } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; attachment_id = - Xml.required - "attachmentId" + ("UserGroup", (GroupNameStringList.to_query v.group_names))); + Some + (Query.Pair ("UserId", (UserIdStringList.to_query v.user_ids))); + Util.option_map v.operation_type + (fun f -> + Query.Pair ("OperationType", (OperationType.to_query f))); + Util.option_map v.attribute + (fun f -> + Query.Pair ("Attribute", (SnapshotAttributeName.to_query f))); + Some (Query.Pair ("SnapshotId", (String.to_query v.snapshot_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.create_volume_permission + (fun f -> + ("create_volume_permission", + (CreateVolumePermissionModifications.to_json f))); + Some ("group_names", (GroupNameStringList.to_json v.group_names)); + Some ("user_ids", (UserIdStringList.to_json v.user_ids)); + Util.option_map v.operation_type + (fun f -> ("operation_type", (OperationType.to_json f))); + Util.option_map v.attribute + (fun f -> ("attribute", (SnapshotAttributeName.to_json f))); + Some ("snapshot_id", (String.to_json v.snapshot_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + snapshot_id = + (String.of_json (Util.of_option_exn (Json.lookup j "snapshot_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") + SnapshotAttributeName.of_json); + operation_type = + (Util.option_map (Json.lookup j "operation_type") + OperationType.of_json); + user_ids = + (UserIdStringList.of_json + (Util.of_option_exn (Json.lookup j "user_ids"))); + group_names = + (GroupNameStringList.of_json + (Util.of_option_exn (Json.lookup j "group_names"))); + create_volume_permission = + (Util.option_map (Json.lookup j "create_volume_permission") + CreateVolumePermissionModifications.of_json) + } + end +module ReleaseAddressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + public_ip: String.t option ; + allocation_id: String.t option } + let make ?dry_run ?public_ip ?allocation_id () = + { dry_run; public_ip; allocation_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ip = + (Util.option_bind (Xml.member "PublicIp" xml) String.parse); + allocation_id = + (Util.option_bind (Xml.member "AllocationId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json) + } + end +module ImportSnapshotResult = + struct + type t = + { + import_task_id: String.t option ; + snapshot_task_detail: SnapshotTaskDetail.t option ; + description: String.t option } + let make ?import_task_id ?snapshot_task_detail ?description () = + { import_task_id; snapshot_task_detail; description } + let parse xml = + Some + { + import_task_id = + (Util.option_bind (Xml.member "importTaskId" xml) String.parse); + snapshot_task_detail = + (Util.option_bind (Xml.member "snapshotTaskDetail" xml) + SnapshotTaskDetail.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.snapshot_task_detail + (fun f -> + Query.Pair + ("SnapshotTaskDetail", (SnapshotTaskDetail.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.snapshot_task_detail + (fun f -> + ("snapshot_task_detail", (SnapshotTaskDetail.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f)))]) + let of_json j = + { + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + snapshot_task_detail = + (Util.option_map (Json.lookup j "snapshot_task_detail") + SnapshotTaskDetail.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module DescribeVolumesResult = + struct + type t = { + volumes: VolumeList.t ; + next_token: String.t option } + let make ?(volumes= []) ?next_token () = { volumes; next_token } + let parse xml = + Some + { + volumes = + (Util.of_option [] + (Util.option_bind (Xml.member "volumeSet" xml) + VolumeList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("VolumeSet", (VolumeList.to_query v.volumes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("volumes", (VolumeList.to_json v.volumes))]) + let of_json j = + { + volumes = + (VolumeList.of_json (Util.of_option_exn (Json.lookup j "volumes"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module AcceptVpcPeeringConnectionResult = + struct + type t = { + vpc_peering_connection: VpcPeeringConnection.t option } + let make ?vpc_peering_connection () = { vpc_peering_connection } + let parse xml = + Some + { + vpc_peering_connection = + (Util.option_bind (Xml.member "vpcPeeringConnection" xml) + VpcPeeringConnection.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection + (fun f -> + Query.Pair + ("VpcPeeringConnection", + (VpcPeeringConnection.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection + (fun f -> + ("vpc_peering_connection", (VpcPeeringConnection.to_json f)))]) + let of_json j = + { + vpc_peering_connection = + (Util.option_map (Json.lookup j "vpc_peering_connection") + VpcPeeringConnection.of_json) + } + end +module AttachNetworkInterfaceResult = + struct + type t = { + attachment_id: String.t option } + let make ?attachment_id () = { attachment_id } + let parse xml = + Some + { + attachment_id = (Util.option_bind (Xml.member "attachmentId" xml) String.parse) - ; force = Util.option_bind (Xml.member "force" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> Query.Pair ("Force", Boolean.to_query f)) - ; Some (Query.Pair ("AttachmentId", String.to_query v.attachment_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.force (fun f -> "force", Boolean.to_json f) - ; Some ("attachment_id", String.to_json v.attachment_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; attachment_id = String.of_json (Util.of_option_exn (Json.lookup j "attachment_id")) - ; force = Util.option_map (Json.lookup j "force") Boolean.of_json - } -end - -module CreateNetworkInterfaceRequest = struct - type t = - { subnet_id : String.t - ; description : String.t option - ; private_ip_address : String.t option - ; groups : SecurityGroupIdStringList.t - ; private_ip_addresses : PrivateIpAddressSpecificationList.t - ; secondary_private_ip_address_count : Integer.t option - ; dry_run : Boolean.t option - } - - let make - ~subnet_id - ?description - ?private_ip_address - ?(groups = []) - ?(private_ip_addresses = []) - ?secondary_private_ip_address_count - ?dry_run - () = - { subnet_id - ; description - ; private_ip_address - ; groups - ; private_ip_addresses - ; secondary_private_ip_address_count - ; dry_run - } - - let parse xml = - Some - { subnet_id = - Xml.required - "subnetId" - (Util.option_bind (Xml.member "subnetId" xml) String.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; private_ip_address = - Util.option_bind (Xml.member "privateIpAddress" xml) String.parse - ; groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupId" xml) - SecurityGroupIdStringList.parse) - ; private_ip_addresses = - Util.of_option - [] + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attachment_id + (fun f -> Query.Pair ("AttachmentId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attachment_id + (fun f -> ("attachment_id", (String.to_json f)))]) + let of_json j = + { + attachment_id = + (Util.option_map (Json.lookup j "attachment_id") String.of_json) + } + end +module DescribeReservedInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + reserved_instances_ids: ReservedInstancesIdStringList.t ; + filters: FilterList.t ; + offering_type: OfferingTypeValues.t option } + let make ?dry_run ?(reserved_instances_ids= []) ?(filters= []) + ?offering_type () = + { dry_run; reserved_instances_ids; filters; offering_type } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + reserved_instances_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "ReservedInstancesId" xml) + ReservedInstancesIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + offering_type = + (Util.option_bind (Xml.member "offeringType" xml) + OfferingTypeValues.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.offering_type + (fun f -> + Query.Pair ("OfferingType", (OfferingTypeValues.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("ReservedInstancesId", + (ReservedInstancesIdStringList.to_query + v.reserved_instances_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.offering_type + (fun f -> ("offering_type", (OfferingTypeValues.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("reserved_instances_ids", + (ReservedInstancesIdStringList.to_json + v.reserved_instances_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + reserved_instances_ids = + (ReservedInstancesIdStringList.of_json + (Util.of_option_exn (Json.lookup j "reserved_instances_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + offering_type = + (Util.option_map (Json.lookup j "offering_type") + OfferingTypeValues.of_json) + } + end +module DescribeVpcClassicLinkRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_ids: VpcClassicLinkIdList.t ; + filters: FilterList.t } + let make ?dry_run ?(vpc_ids= []) ?(filters= []) () = + { dry_run; vpc_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcId" xml) + VpcClassicLinkIdList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair ("VpcId", (VpcClassicLinkIdList.to_query v.vpc_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("vpc_ids", (VpcClassicLinkIdList.to_json v.vpc_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_ids = + (VpcClassicLinkIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeRegionsResult = + struct + type t = { + regions: RegionList.t } + let make ?(regions= []) () = { regions } + let parse xml = + Some + { + regions = + (Util.of_option [] + (Util.option_bind (Xml.member "regionInfo" xml) + RegionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("RegionInfo", (RegionList.to_query v.regions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("regions", (RegionList.to_json v.regions))]) + let of_json j = + { + regions = + (RegionList.of_json (Util.of_option_exn (Json.lookup j "regions"))) + } + end +module CreateVpnConnectionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + type_: String.t ; + customer_gateway_id: String.t ; + vpn_gateway_id: String.t ; + options: VpnConnectionOptionsSpecification.t option } + let make ?dry_run ~type_ ~customer_gateway_id ~vpn_gateway_id + ?options () = + { dry_run; type_; customer_gateway_id; vpn_gateway_id; options } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + type_ = + (Xml.required "Type" + (Util.option_bind (Xml.member "Type" xml) String.parse)); + customer_gateway_id = + (Xml.required "CustomerGatewayId" + (Util.option_bind (Xml.member "CustomerGatewayId" xml) + String.parse)); + vpn_gateway_id = + (Xml.required "VpnGatewayId" + (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse)); + options = + (Util.option_bind (Xml.member "options" xml) + VpnConnectionOptionsSpecification.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.options + (fun f -> + Query.Pair + ("Options", + (VpnConnectionOptionsSpecification.to_query f))); + Some + (Query.Pair ("VpnGatewayId", (String.to_query v.vpn_gateway_id))); + Some + (Query.Pair + ("CustomerGatewayId", + (String.to_query v.customer_gateway_id))); + Some (Query.Pair ("Type", (String.to_query v.type_))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.options + (fun f -> + ("options", (VpnConnectionOptionsSpecification.to_json f))); + Some ("vpn_gateway_id", (String.to_json v.vpn_gateway_id)); + Some + ("customer_gateway_id", (String.to_json v.customer_gateway_id)); + Some ("type_", (String.to_json v.type_)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + type_ = (String.of_json (Util.of_option_exn (Json.lookup j "type_"))); + customer_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "customer_gateway_id"))); + vpn_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateway_id"))); + options = + (Util.option_map (Json.lookup j "options") + VpnConnectionOptionsSpecification.of_json) + } + end +module CreateVpnGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + type_: GatewayType.t ; + availability_zone: String.t option } + let make ?dry_run ~type_ ?availability_zone () = + { dry_run; type_; availability_zone } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + type_ = + (Xml.required "Type" + (Util.option_bind (Xml.member "Type" xml) GatewayType.parse)); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Some (Query.Pair ("Type", (GatewayType.to_query v.type_))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Some ("type_", (GatewayType.to_json v.type_)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + type_ = + (GatewayType.of_json (Util.of_option_exn (Json.lookup j "type_"))); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json) + } + end +module RegisterImageResult = + struct + type t = { + image_id: String.t option } + let make ?image_id () = { image_id } + let parse xml = + Some + { + image_id = + (Util.option_bind (Xml.member "imageId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> Query.Pair ("ImageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.image_id + (fun f -> ("image_id", (String.to_json f)))]) + let of_json j = + { + image_id = + (Util.option_map (Json.lookup j "image_id") String.of_json) + } + end +module AttachVolumeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_id: String.t ; + instance_id: String.t ; + device: String.t } + let make ?dry_run ~volume_id ~instance_id ~device () = + { dry_run; volume_id; instance_id; device } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + device = + (Xml.required "Device" + (Util.option_bind (Xml.member "Device" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Device", (String.to_query v.device))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("device", (String.to_json v.device)); + Some ("instance_id", (String.to_json v.instance_id)); + Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + device = + (String.of_json (Util.of_option_exn (Json.lookup j "device"))) + } + end +module CancelReservedInstancesListingResult = + struct + type t = { + reserved_instances_listings: ReservedInstancesListingList.t } + let make ?(reserved_instances_listings= []) () = + { reserved_instances_listings } + let parse xml = + Some + { + reserved_instances_listings = + (Util.of_option [] + (Util.option_bind + (Xml.member "reservedInstancesListingsSet" xml) + ReservedInstancesListingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedInstancesListingsSet", + (ReservedInstancesListingList.to_query + v.reserved_instances_listings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_instances_listings", + (ReservedInstancesListingList.to_json + v.reserved_instances_listings))]) + let of_json j = + { + reserved_instances_listings = + (ReservedInstancesListingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_listings"))) + } + end +module CreateTagsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + resources: ResourceIdList.t ; + tags: TagList.t } + let make ?dry_run ~resources ~tags () = { dry_run; resources; tags } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + resources = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) + ResourceIdList.parse)); + tags = + (Xml.required "Tag" + (Util.option_bind (Xml.member "Tag" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tag", (TagList.to_query v.tags))); + Some + (Query.Pair + ("ResourceId", (ResourceIdList.to_query v.resources))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("resources", (ResourceIdList.to_json v.resources)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + resources = + (ResourceIdList.of_json + (Util.of_option_exn (Json.lookup j "resources"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CreateDhcpOptionsResult = + struct + type t = { + dhcp_options: DhcpOptions.t option } + let make ?dhcp_options () = { dhcp_options } + let parse xml = + Some + { + dhcp_options = + (Util.option_bind (Xml.member "dhcpOptions" xml) + DhcpOptions.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dhcp_options + (fun f -> Query.Pair ("DhcpOptions", (DhcpOptions.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dhcp_options + (fun f -> ("dhcp_options", (DhcpOptions.to_json f)))]) + let of_json j = + { + dhcp_options = + (Util.option_map (Json.lookup j "dhcp_options") DhcpOptions.of_json) + } + end +module CreatePlacementGroupRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_name: String.t ; + strategy: PlacementStrategy.t } + let make ?dry_run ~group_name ~strategy () = + { dry_run; group_name; strategy } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Xml.required "groupName" + (Util.option_bind (Xml.member "groupName" xml) String.parse)); + strategy = + (Xml.required "strategy" + (Util.option_bind (Xml.member "strategy" xml) + PlacementStrategy.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Strategy", (PlacementStrategy.to_query v.strategy))); + Some (Query.Pair ("GroupName", (String.to_query v.group_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("strategy", (PlacementStrategy.to_json v.strategy)); + Some ("group_name", (String.to_json v.group_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (String.of_json (Util.of_option_exn (Json.lookup j "group_name"))); + strategy = + (PlacementStrategy.of_json + (Util.of_option_exn (Json.lookup j "strategy"))) + } + end +module ConfirmProductInstanceResult = + struct + type t = { + owner_id: String.t option ; + return: Boolean.t option } + let make ?owner_id ?return () = { owner_id; return } + let parse xml = + Some + { + owner_id = + (Util.option_bind (Xml.member "ownerId" xml) String.parse); + return = (Util.option_bind (Xml.member "return" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> Query.Pair ("Return", (Boolean.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.return + (fun f -> ("return", (Boolean.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f)))]) + let of_json j = + { + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + return = (Util.option_map (Json.lookup j "return") Boolean.of_json) + } + end +module AssociateAddressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t option ; + public_ip: String.t option ; + allocation_id: String.t option ; + network_interface_id: String.t option ; + private_ip_address: String.t option ; + allow_reassociation: Boolean.t option } + let make ?dry_run ?instance_id ?public_ip ?allocation_id + ?network_interface_id ?private_ip_address ?allow_reassociation () = + { + dry_run; + instance_id; + public_ip; + allocation_id; + network_interface_id; + private_ip_address; + allow_reassociation + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + public_ip = + (Util.option_bind (Xml.member "PublicIp" xml) String.parse); + allocation_id = + (Util.option_bind (Xml.member "AllocationId" xml) String.parse); + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + allow_reassociation = + (Util.option_bind (Xml.member "allowReassociation" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.allow_reassociation + (fun f -> + Query.Pair ("AllowReassociation", (Boolean.to_query f))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f))); + Util.option_map v.allocation_id + (fun f -> Query.Pair ("AllocationId", (String.to_query f))); + Util.option_map v.public_ip + (fun f -> Query.Pair ("PublicIp", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.allow_reassociation + (fun f -> ("allow_reassociation", (Boolean.to_json f))); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f))); + Util.option_map v.allocation_id + (fun f -> ("allocation_id", (String.to_json f))); + Util.option_map v.public_ip + (fun f -> ("public_ip", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + public_ip = + (Util.option_map (Json.lookup j "public_ip") String.of_json); + allocation_id = + (Util.option_map (Json.lookup j "allocation_id") String.of_json); + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + allow_reassociation = + (Util.option_map (Json.lookup j "allow_reassociation") + Boolean.of_json) + } + end +module CreateRouteRequest = + struct + type t = + { + dry_run: Boolean.t option ; + route_table_id: String.t ; + destination_cidr_block: String.t ; + gateway_id: String.t option ; + instance_id: String.t option ; + network_interface_id: String.t option ; + vpc_peering_connection_id: String.t option } + let make ?dry_run ~route_table_id ~destination_cidr_block ?gateway_id + ?instance_id ?network_interface_id ?vpc_peering_connection_id () = + { + dry_run; + route_table_id; + destination_cidr_block; + gateway_id; + instance_id; + network_interface_id; + vpc_peering_connection_id + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)); + destination_cidr_block = + (Xml.required "destinationCidrBlock" + (Util.option_bind (Xml.member "destinationCidrBlock" xml) + String.parse)); + gateway_id = + (Util.option_bind (Xml.member "gatewayId" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + network_interface_id = + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse); + vpc_peering_connection_id = + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> + Query.Pair ("VpcPeeringConnectionId", (String.to_query f))); + Util.option_map v.network_interface_id + (fun f -> Query.Pair ("NetworkInterfaceId", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.gateway_id + (fun f -> Query.Pair ("GatewayId", (String.to_query f))); + Some + (Query.Pair + ("DestinationCidrBlock", + (String.to_query v.destination_cidr_block))); + Some + (Query.Pair ("RouteTableId", (String.to_query v.route_table_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_peering_connection_id + (fun f -> ("vpc_peering_connection_id", (String.to_json f))); + Util.option_map v.network_interface_id + (fun f -> ("network_interface_id", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.gateway_id + (fun f -> ("gateway_id", (String.to_json f))); + Some + ("destination_cidr_block", + (String.to_json v.destination_cidr_block)); + Some ("route_table_id", (String.to_json v.route_table_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))); + destination_cidr_block = + (String.of_json + (Util.of_option_exn (Json.lookup j "destination_cidr_block"))); + gateway_id = + (Util.option_map (Json.lookup j "gateway_id") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + network_interface_id = + (Util.option_map (Json.lookup j "network_interface_id") + String.of_json); + vpc_peering_connection_id = + (Util.option_map (Json.lookup j "vpc_peering_connection_id") + String.of_json) + } + end +module RejectVpcPeeringConnectionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_peering_connection_id: String.t } + let make ?dry_run ~vpc_peering_connection_id () = + { dry_run; vpc_peering_connection_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_peering_connection_id = + (Xml.required "vpcPeeringConnectionId" + (Util.option_bind (Xml.member "vpcPeeringConnectionId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcPeeringConnectionId", + (String.to_query v.vpc_peering_connection_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_peering_connection_id", + (String.to_json v.vpc_peering_connection_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_peering_connection_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpc_peering_connection_id"))) + } + end +module AllocateAddressRequest = + struct + type t = { + dry_run: Boolean.t option ; + domain: DomainType.t option } + let make ?dry_run ?domain () = { dry_run; domain } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + domain = + (Util.option_bind (Xml.member "Domain" xml) DomainType.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (DomainType.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.domain + (fun f -> ("domain", (DomainType.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + domain = + (Util.option_map (Json.lookup j "domain") DomainType.of_json) + } + end +module DescribeAddressesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + public_ips: PublicIpStringList.t ; + filters: FilterList.t ; + allocation_ids: AllocationIdList.t } + let make ?dry_run ?(public_ips= []) ?(filters= []) ?(allocation_ids= + []) () = { dry_run; public_ips; filters; allocation_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ips = + (Util.of_option [] + (Util.option_bind (Xml.member "PublicIp" xml) + PublicIpStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + allocation_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "AllocationId" xml) + AllocationIdList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AllocationId", + (AllocationIdList.to_query v.allocation_ids))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("PublicIp", (PublicIpStringList.to_query v.public_ips))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("allocation_ids", (AllocationIdList.to_json v.allocation_ids)); + Some ("filters", (FilterList.to_json v.filters)); + Some ("public_ips", (PublicIpStringList.to_json v.public_ips)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ips = + (PublicIpStringList.of_json + (Util.of_option_exn (Json.lookup j "public_ips"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + allocation_ids = + (AllocationIdList.of_json + (Util.of_option_exn (Json.lookup j "allocation_ids"))) + } + end +module BundleInstanceResult = + struct + type t = { + bundle_task: BundleTask.t option } + let make ?bundle_task () = { bundle_task } + let parse xml = + Some + { + bundle_task = + (Util.option_bind (Xml.member "bundleInstanceTask" xml) + BundleTask.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.bundle_task + (fun f -> + Query.Pair ("BundleInstanceTask", (BundleTask.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.bundle_task + (fun f -> ("bundle_task", (BundleTask.to_json f)))]) + let of_json j = + { + bundle_task = + (Util.option_map (Json.lookup j "bundle_task") BundleTask.of_json) + } + end +module CreateRouteTableRequest = + struct + type t = { + dry_run: Boolean.t option ; + vpc_id: String.t } + let make ?dry_run ~vpc_id () = { dry_run; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module DetachVolumeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_id: String.t ; + instance_id: String.t option ; + device: String.t option ; + force: Boolean.t option } + let make ?dry_run ~volume_id ?instance_id ?device ?force () = + { dry_run; volume_id; instance_id; device; force } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + device = (Util.option_bind (Xml.member "Device" xml) String.parse); + force = (Util.option_bind (Xml.member "Force" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.force + (fun f -> Query.Pair ("Force", (Boolean.to_query f))); + Util.option_map v.device + (fun f -> Query.Pair ("Device", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.force (fun f -> ("force", (Boolean.to_json f))); + Util.option_map v.device (fun f -> ("device", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + device = (Util.option_map (Json.lookup j "device") String.of_json); + force = (Util.option_map (Json.lookup j "force") Boolean.of_json) + } + end +module InstanceAttribute = + struct + type t = + { + instance_id: String.t option ; + instance_type: AttributeValue.t option ; + kernel_id: AttributeValue.t option ; + ramdisk_id: AttributeValue.t option ; + user_data: AttributeValue.t option ; + disable_api_termination: AttributeBooleanValue.t option ; + instance_initiated_shutdown_behavior: AttributeValue.t option ; + root_device_name: AttributeValue.t option ; + block_device_mappings: InstanceBlockDeviceMappingList.t ; + product_codes: ProductCodeList.t ; + ebs_optimized: AttributeBooleanValue.t option ; + sriov_net_support: AttributeValue.t option ; + source_dest_check: AttributeBooleanValue.t option ; + groups: GroupIdentifierList.t } + let make ?instance_id ?instance_type ?kernel_id ?ramdisk_id + ?user_data ?disable_api_termination + ?instance_initiated_shutdown_behavior ?root_device_name + ?(block_device_mappings= []) ?(product_codes= []) ?ebs_optimized + ?sriov_net_support ?source_dest_check ?(groups= []) () = + { + instance_id; + instance_type; + kernel_id; + ramdisk_id; + user_data; + disable_api_termination; + instance_initiated_shutdown_behavior; + root_device_name; + block_device_mappings; + product_codes; + ebs_optimized; + sriov_net_support; + source_dest_check; + groups + } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "instanceId" xml) String.parse); + instance_type = + (Util.option_bind (Xml.member "instanceType" xml) + AttributeValue.parse); + kernel_id = + (Util.option_bind (Xml.member "kernel" xml) AttributeValue.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdisk" xml) AttributeValue.parse); + user_data = + (Util.option_bind (Xml.member "userData" xml) + AttributeValue.parse); + disable_api_termination = + (Util.option_bind (Xml.member "disableApiTermination" xml) + AttributeBooleanValue.parse); + instance_initiated_shutdown_behavior = (Util.option_bind - (Xml.member "privateIpAddresses" xml) - PrivateIpAddressSpecificationList.parse) - ; secondary_private_ip_address_count = - Util.option_bind (Xml.member "secondaryPrivateIpAddressCount" xml) Integer.parse - ; dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - Query.Pair ("SecondaryPrivateIpAddressCount", Integer.to_query f)) - ; Some + (Xml.member "instanceInitiatedShutdownBehavior" xml) + AttributeValue.parse); + root_device_name = + (Util.option_bind (Xml.member "rootDeviceName" xml) + AttributeValue.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "blockDeviceMapping" xml) + InstanceBlockDeviceMappingList.parse)); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)); + ebs_optimized = + (Util.option_bind (Xml.member "ebsOptimized" xml) + AttributeBooleanValue.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) + AttributeValue.parse); + source_dest_check = + (Util.option_bind (Xml.member "sourceDestCheck" xml) + AttributeBooleanValue.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "groupSet" xml) + GroupIdentifierList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("GroupSet", (GroupIdentifierList.to_query v.groups))); + Util.option_map v.source_dest_check + (fun f -> + Query.Pair + ("SourceDestCheck", (AttributeBooleanValue.to_query f))); + Util.option_map v.sriov_net_support + (fun f -> + Query.Pair ("SriovNetSupport", (AttributeValue.to_query f))); + Util.option_map v.ebs_optimized + (fun f -> + Query.Pair + ("EbsOptimized", (AttributeBooleanValue.to_query f))); + Some + (Query.Pair + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Some + (Query.Pair + ("BlockDeviceMapping", + (InstanceBlockDeviceMappingList.to_query + v.block_device_mappings))); + Util.option_map v.root_device_name + (fun f -> + Query.Pair ("RootDeviceName", (AttributeValue.to_query f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + Query.Pair + ("InstanceInitiatedShutdownBehavior", + (AttributeValue.to_query f))); + Util.option_map v.disable_api_termination + (fun f -> + Query.Pair + ("DisableApiTermination", + (AttributeBooleanValue.to_query f))); + Util.option_map v.user_data + (fun f -> Query.Pair ("UserData", (AttributeValue.to_query f))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("Ramdisk", (AttributeValue.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("Kernel", (AttributeValue.to_query f))); + Util.option_map v.instance_type + (fun f -> + Query.Pair ("InstanceType", (AttributeValue.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("groups", (GroupIdentifierList.to_json v.groups)); + Util.option_map v.source_dest_check + (fun f -> + ("source_dest_check", (AttributeBooleanValue.to_json f))); + Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (AttributeValue.to_json f))); + Util.option_map v.ebs_optimized + (fun f -> ("ebs_optimized", (AttributeBooleanValue.to_json f))); + Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Some + ("block_device_mappings", + (InstanceBlockDeviceMappingList.to_json + v.block_device_mappings)); + Util.option_map v.root_device_name + (fun f -> ("root_device_name", (AttributeValue.to_json f))); + Util.option_map v.instance_initiated_shutdown_behavior + (fun f -> + ("instance_initiated_shutdown_behavior", + (AttributeValue.to_json f))); + Util.option_map v.disable_api_termination + (fun f -> + ("disable_api_termination", + (AttributeBooleanValue.to_json f))); + Util.option_map v.user_data + (fun f -> ("user_data", (AttributeValue.to_json f))); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (AttributeValue.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (AttributeValue.to_json f))); + Util.option_map v.instance_type + (fun f -> ("instance_type", (AttributeValue.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + instance_type = + (Util.option_map (Json.lookup j "instance_type") + AttributeValue.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") AttributeValue.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") + AttributeValue.of_json); + user_data = + (Util.option_map (Json.lookup j "user_data") AttributeValue.of_json); + disable_api_termination = + (Util.option_map (Json.lookup j "disable_api_termination") + AttributeBooleanValue.of_json); + instance_initiated_shutdown_behavior = + (Util.option_map + (Json.lookup j "instance_initiated_shutdown_behavior") + AttributeValue.of_json); + root_device_name = + (Util.option_map (Json.lookup j "root_device_name") + AttributeValue.of_json); + block_device_mappings = + (InstanceBlockDeviceMappingList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))); + ebs_optimized = + (Util.option_map (Json.lookup j "ebs_optimized") + AttributeBooleanValue.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") + AttributeValue.of_json); + source_dest_check = + (Util.option_map (Json.lookup j "source_dest_check") + AttributeBooleanValue.of_json); + groups = + (GroupIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "groups"))) + } + end +module DescribeAddressesResult = + struct + type t = { + addresses: AddressList.t } + let make ?(addresses= []) () = { addresses } + let parse xml = + Some + { + addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "addressesSet" xml) + AddressList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AddressesSet", (AddressList.to_query v.addresses)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("addresses", (AddressList.to_json v.addresses))]) + let of_json j = + { + addresses = + (AddressList.of_json + (Util.of_option_exn (Json.lookup j "addresses"))) + } + end +module DescribeRouteTablesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + route_table_ids: ValueStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(route_table_ids= []) ?(filters= []) () = + { dry_run; route_table_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + route_table_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "RouteTableId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("RouteTableId", + (ValueStringList.to_query v.route_table_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("route_table_ids", (ValueStringList.to_json v.route_table_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + route_table_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "route_table_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module ImportSnapshotRequest = + struct + type t = + { + dry_run: Boolean.t option ; + description: String.t option ; + disk_container: SnapshotDiskContainer.t option ; + client_data: ClientData.t option ; + client_token: String.t option ; + role_name: String.t option } + let make ?dry_run ?description ?disk_container ?client_data + ?client_token ?role_name () = + { + dry_run; + description; + disk_container; + client_data; + client_token; + role_name + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + disk_container = + (Util.option_bind (Xml.member "DiskContainer" xml) + SnapshotDiskContainer.parse); + client_data = + (Util.option_bind (Xml.member "ClientData" xml) ClientData.parse); + client_token = + (Util.option_bind (Xml.member "ClientToken" xml) String.parse); + role_name = + (Util.option_bind (Xml.member "RoleName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.role_name + (fun f -> Query.Pair ("RoleName", (String.to_query f))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.client_data + (fun f -> Query.Pair ("ClientData", (ClientData.to_query f))); + Util.option_map v.disk_container + (fun f -> + Query.Pair + ("DiskContainer", (SnapshotDiskContainer.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.role_name + (fun f -> ("role_name", (String.to_json f))); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.client_data + (fun f -> ("client_data", (ClientData.to_json f))); + Util.option_map v.disk_container + (fun f -> ("disk_container", (SnapshotDiskContainer.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + disk_container = + (Util.option_map (Json.lookup j "disk_container") + SnapshotDiskContainer.of_json); + client_data = + (Util.option_map (Json.lookup j "client_data") ClientData.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + role_name = + (Util.option_map (Json.lookup j "role_name") String.of_json) + } + end +module CreateSubnetResult = + struct + type t = { + subnet: Subnet.t option } + let make ?subnet () = { subnet } + let parse xml = + Some + { subnet = (Util.option_bind (Xml.member "subnet" xml) Subnet.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subnet + (fun f -> Query.Pair ("Subnet", (Subnet.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subnet + (fun f -> ("subnet", (Subnet.to_json f)))]) + let of_json j = + { subnet = (Util.option_map (Json.lookup j "subnet") Subnet.of_json) } + end +module StopInstancesResult = + struct + type t = { + stopping_instances: InstanceStateChangeList.t } + let make ?(stopping_instances= []) () = { stopping_instances } + let parse xml = + Some + { + stopping_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceStateChangeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", + (InstanceStateChangeList.to_query v.stopping_instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("stopping_instances", + (InstanceStateChangeList.to_json v.stopping_instances))]) + let of_json j = + { + stopping_instances = + (InstanceStateChangeList.of_json + (Util.of_option_exn (Json.lookup j "stopping_instances"))) + } + end +module RequestSpotFleetResponse = + struct + type t = { + spot_fleet_request_id: String.t } + let make ~spot_fleet_request_id () = { spot_fleet_request_id } + let parse xml = + Some + { + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id))]) + let of_json j = + { + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))) + } + end +module DescribeVpnConnectionsResult = + struct + type t = { + vpn_connections: VpnConnectionList.t } + let make ?(vpn_connections= []) () = { vpn_connections } + let parse xml = + Some + { + vpn_connections = + (Util.of_option [] + (Util.option_bind (Xml.member "vpnConnectionSet" xml) + VpnConnectionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpnConnectionSet", + (VpnConnectionList.to_query v.vpn_connections)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpn_connections", + (VpnConnectionList.to_json v.vpn_connections))]) + let of_json j = + { + vpn_connections = + (VpnConnectionList.of_json + (Util.of_option_exn (Json.lookup j "vpn_connections"))) + } + end +module DescribeReservedInstancesOfferingsResult = + struct + type t = + { + reserved_instances_offerings: ReservedInstancesOfferingList.t ; + next_token: String.t option } + let make ?(reserved_instances_offerings= []) ?next_token () = + { reserved_instances_offerings; next_token } + let parse xml = + Some + { + reserved_instances_offerings = + (Util.of_option [] + (Util.option_bind + (Xml.member "reservedInstancesOfferingsSet" xml) + ReservedInstancesOfferingList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ReservedInstancesOfferingsSet", + (ReservedInstancesOfferingList.to_query + v.reserved_instances_offerings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("reserved_instances_offerings", + (ReservedInstancesOfferingList.to_json + v.reserved_instances_offerings))]) + let of_json j = + { + reserved_instances_offerings = + (ReservedInstancesOfferingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_offerings"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module AssociateDhcpOptionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + dhcp_options_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~dhcp_options_id ~vpc_id () = + { dry_run; dhcp_options_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + dhcp_options_id = + (Xml.required "DhcpOptionsId" + (Util.option_bind (Xml.member "DhcpOptionsId" xml) + String.parse)); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some + (Query.Pair + ("DhcpOptionsId", (String.to_query v.dhcp_options_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("dhcp_options_id", (String.to_json v.dhcp_options_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + dhcp_options_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "dhcp_options_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module DeleteKeyPairRequest = + struct + type t = { + dry_run: Boolean.t option ; + key_name: String.t } + let make ?dry_run ~key_name () = { dry_run; key_name } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + key_name = + (Xml.required "KeyName" + (Util.option_bind (Xml.member "KeyName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("KeyName", (String.to_query v.key_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("key_name", (String.to_json v.key_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + key_name = + (String.of_json (Util.of_option_exn (Json.lookup j "key_name"))) + } + end +module DescribeInstancesResult = + struct + type t = { + reservations: ReservationList.t ; + next_token: String.t option } + let make ?(reservations= []) ?next_token () = + { reservations; next_token } + let parse xml = + Some + { + reservations = + (Util.of_option [] + (Util.option_bind (Xml.member "reservationSet" xml) + ReservationList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ReservationSet", (ReservationList.to_query v.reservations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("reservations", (ReservationList.to_json v.reservations))]) + let of_json j = + { + reservations = + (ReservationList.of_json + (Util.of_option_exn (Json.lookup j "reservations"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module GetPasswordDataResult = + struct + type t = + { + instance_id: String.t ; + timestamp: DateTime.t ; + password_data: String.t } + let make ~instance_id ~timestamp ~password_data () = + { instance_id; timestamp; password_data } + let parse xml = + Some + { + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + timestamp = + (Xml.required "timestamp" + (Util.option_bind (Xml.member "timestamp" xml) DateTime.parse)); + password_data = + (Xml.required "passwordData" + (Util.option_bind (Xml.member "passwordData" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("PasswordData", (String.to_query v.password_data))); + Some (Query.Pair ("Timestamp", (DateTime.to_query v.timestamp))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("password_data", (String.to_json v.password_data)); + Some ("timestamp", (DateTime.to_json v.timestamp)); + Some ("instance_id", (String.to_json v.instance_id))]) + let of_json j = + { + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + timestamp = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "timestamp"))); + password_data = + (String.of_json + (Util.of_option_exn (Json.lookup j "password_data"))) + } + end +module CreateVpcResult = + struct + type t = { + vpc: Vpc.t option } + let make ?vpc () = { vpc } + let parse xml = + Some { vpc = (Util.option_bind (Xml.member "vpc" xml) Vpc.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc + (fun f -> Query.Pair ("Vpc", (Vpc.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc (fun f -> ("vpc", (Vpc.to_json f)))]) + let of_json j = + { vpc = (Util.option_map (Json.lookup j "vpc") Vpc.of_json) } + end +module DescribeVolumesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_ids: VolumeIdStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(volume_ids= []) ?(filters= []) ?next_token + ?max_results () = + { dry_run; volume_ids; filters; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VolumeId" xml) + VolumeIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("VolumeId", (VolumeIdStringList.to_query v.volume_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some ("volume_ids", (VolumeIdStringList.to_json v.volume_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_ids = + (VolumeIdStringList.of_json + (Util.of_option_exn (Json.lookup j "volume_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module MonitorInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t } + let make ?dry_run ~instance_ids () = { dry_run; instance_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))) + } + end +module DescribeRegionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + region_names: RegionNameStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(region_names= []) ?(filters= []) () = + { dry_run; region_names; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + region_names = + (Util.of_option [] + (Util.option_bind (Xml.member "RegionName" xml) + RegionNameStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "PrivateIpAddresses" - , PrivateIpAddressSpecificationList.to_query v.private_ip_addresses )) - ; Some - (Query.Pair ("SecurityGroupId", SecurityGroupIdStringList.to_query v.groups)) - ; Util.option_map v.private_ip_address (fun f -> - Query.Pair ("PrivateIpAddress", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("SubnetId", String.to_query v.subnet_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ; Util.option_map v.secondary_private_ip_address_count (fun f -> - "secondary_private_ip_address_count", Integer.to_json f) - ; Some - ( "private_ip_addresses" - , PrivateIpAddressSpecificationList.to_json v.private_ip_addresses ) - ; Some ("groups", SecurityGroupIdStringList.to_json v.groups) - ; Util.option_map v.private_ip_address (fun f -> - "private_ip_address", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("subnet_id", String.to_json v.subnet_id) - ]) - - let of_json j = - { subnet_id = String.of_json (Util.of_option_exn (Json.lookup j "subnet_id")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; private_ip_address = - Util.option_map (Json.lookup j "private_ip_address") String.of_json - ; groups = - SecurityGroupIdStringList.of_json (Util.of_option_exn (Json.lookup j "groups")) - ; private_ip_addresses = - PrivateIpAddressSpecificationList.of_json - (Util.of_option_exn (Json.lookup j "private_ip_addresses")) - ; secondary_private_ip_address_count = - Util.option_map - (Json.lookup j "secondary_private_ip_address_count") - Integer.of_json - ; dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - } -end - -module GetPasswordDataRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - } - - let make ?dry_run ~instance_id () = { dry_run; instance_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module DeregisterImageRequest = struct - type t = - { dry_run : Boolean.t option - ; image_id : String.t - } - - let make ?dry_run ~image_id () = { dry_run; image_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - } -end - -module BundleInstanceRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_id : String.t - ; storage : Storage.t - } - - let make ?dry_run ~instance_id ~storage () = { dry_run; instance_id; storage } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; storage = - Xml.required - "Storage" - (Util.option_bind (Xml.member "Storage" xml) Storage.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Storage", Storage.to_query v.storage)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("storage", Storage.to_json v.storage) - ; Some ("instance_id", String.to_json v.instance_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; storage = Storage.of_json (Util.of_option_exn (Json.lookup j "storage")) - } -end - -module RebootInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - } - - let make ?dry_run ~instance_ids () = { dry_run; instance_ids } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - } -end - -module ReplaceRouteTableAssociationRequest = struct - type t = - { dry_run : Boolean.t option - ; association_id : String.t - ; route_table_id : String.t - } - - let make ?dry_run ~association_id ~route_table_id () = - { dry_run; association_id; route_table_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; association_id = - Xml.required - "associationId" + ("RegionName", + (RegionNameStringList.to_query v.region_names))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("region_names", (RegionNameStringList.to_json v.region_names)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + region_names = + (RegionNameStringList.of_json + (Util.of_option_exn (Json.lookup j "region_names"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module ModifySubnetAttributeRequest = + struct + type t = + { + subnet_id: String.t ; + map_public_ip_on_launch: AttributeBooleanValue.t option } + let make ~subnet_id ?map_public_ip_on_launch () = + { subnet_id; map_public_ip_on_launch } + let parse xml = + Some + { + subnet_id = + (Xml.required "subnetId" + (Util.option_bind (Xml.member "subnetId" xml) String.parse)); + map_public_ip_on_launch = + (Util.option_bind (Xml.member "MapPublicIpOnLaunch" xml) + AttributeBooleanValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.map_public_ip_on_launch + (fun f -> + Query.Pair + ("MapPublicIpOnLaunch", + (AttributeBooleanValue.to_query f))); + Some (Query.Pair ("SubnetId", (String.to_query v.subnet_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.map_public_ip_on_launch + (fun f -> + ("map_public_ip_on_launch", + (AttributeBooleanValue.to_json f))); + Some ("subnet_id", (String.to_json v.subnet_id))]) + let of_json j = + { + subnet_id = + (String.of_json (Util.of_option_exn (Json.lookup j "subnet_id"))); + map_public_ip_on_launch = + (Util.option_map (Json.lookup j "map_public_ip_on_launch") + AttributeBooleanValue.of_json) + } + end +module ImportInstanceResult = + struct + type t = { + conversion_task: ConversionTask.t option } + let make ?conversion_task () = { conversion_task } + let parse xml = + Some + { + conversion_task = + (Util.option_bind (Xml.member "conversionTask" xml) + ConversionTask.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.conversion_task + (fun f -> + Query.Pair ("ConversionTask", (ConversionTask.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.conversion_task + (fun f -> ("conversion_task", (ConversionTask.to_json f)))]) + let of_json j = + { + conversion_task = + (Util.option_map (Json.lookup j "conversion_task") + ConversionTask.of_json) + } + end +module RegisterImageRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_location: String.t option ; + name: String.t ; + description: String.t option ; + architecture: ArchitectureValues.t option ; + kernel_id: String.t option ; + ramdisk_id: String.t option ; + root_device_name: String.t option ; + block_device_mappings: BlockDeviceMappingRequestList.t ; + virtualization_type: String.t option ; + sriov_net_support: String.t option } + let make ?dry_run ?image_location ~name ?description ?architecture + ?kernel_id ?ramdisk_id ?root_device_name ?(block_device_mappings= + []) ?virtualization_type ?sriov_net_support () = + { + dry_run; + image_location; + name; + description; + architecture; + kernel_id; + ramdisk_id; + root_device_name; + block_device_mappings; + virtualization_type; + sriov_net_support + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_location = + (Util.option_bind (Xml.member "ImageLocation" xml) String.parse); + name = + (Xml.required "name" + (Util.option_bind (Xml.member "name" xml) String.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + architecture = + (Util.option_bind (Xml.member "architecture" xml) + ArchitectureValues.parse); + kernel_id = + (Util.option_bind (Xml.member "kernelId" xml) String.parse); + ramdisk_id = + (Util.option_bind (Xml.member "ramdiskId" xml) String.parse); + root_device_name = + (Util.option_bind (Xml.member "rootDeviceName" xml) String.parse); + block_device_mappings = + (Util.of_option [] + (Util.option_bind (Xml.member "BlockDeviceMapping" xml) + BlockDeviceMappingRequestList.parse)); + virtualization_type = + (Util.option_bind (Xml.member "virtualizationType" xml) + String.parse); + sriov_net_support = + (Util.option_bind (Xml.member "sriovNetSupport" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> Query.Pair ("SriovNetSupport", (String.to_query f))); + Util.option_map v.virtualization_type + (fun f -> Query.Pair ("VirtualizationType", (String.to_query f))); + Some + (Query.Pair + ("BlockDeviceMapping", + (BlockDeviceMappingRequestList.to_query + v.block_device_mappings))); + Util.option_map v.root_device_name + (fun f -> Query.Pair ("RootDeviceName", (String.to_query f))); + Util.option_map v.ramdisk_id + (fun f -> Query.Pair ("RamdiskId", (String.to_query f))); + Util.option_map v.kernel_id + (fun f -> Query.Pair ("KernelId", (String.to_query f))); + Util.option_map v.architecture + (fun f -> + Query.Pair ("Architecture", (ArchitectureValues.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Util.option_map v.image_location + (fun f -> Query.Pair ("ImageLocation", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.sriov_net_support + (fun f -> ("sriov_net_support", (String.to_json f))); + Util.option_map v.virtualization_type + (fun f -> ("virtualization_type", (String.to_json f))); + Some + ("block_device_mappings", + (BlockDeviceMappingRequestList.to_json v.block_device_mappings)); + Util.option_map v.root_device_name + (fun f -> ("root_device_name", (String.to_json f))); + Util.option_map v.ramdisk_id + (fun f -> ("ramdisk_id", (String.to_json f))); + Util.option_map v.kernel_id + (fun f -> ("kernel_id", (String.to_json f))); + Util.option_map v.architecture + (fun f -> ("architecture", (ArchitectureValues.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("name", (String.to_json v.name)); + Util.option_map v.image_location + (fun f -> ("image_location", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_location = + (Util.option_map (Json.lookup j "image_location") String.of_json); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + architecture = + (Util.option_map (Json.lookup j "architecture") + ArchitectureValues.of_json); + kernel_id = + (Util.option_map (Json.lookup j "kernel_id") String.of_json); + ramdisk_id = + (Util.option_map (Json.lookup j "ramdisk_id") String.of_json); + root_device_name = + (Util.option_map (Json.lookup j "root_device_name") String.of_json); + block_device_mappings = + (BlockDeviceMappingRequestList.of_json + (Util.of_option_exn (Json.lookup j "block_device_mappings"))); + virtualization_type = + (Util.option_map (Json.lookup j "virtualization_type") + String.of_json); + sriov_net_support = + (Util.option_map (Json.lookup j "sriov_net_support") String.of_json) + } + end +module CreateSecurityGroupRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_name: String.t ; + description: String.t ; + vpc_id: String.t option } + let make ?dry_run ~group_name ~description ?vpc_id () = + { dry_run; group_name; description; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Xml.required "GroupName" + (Util.option_bind (Xml.member "GroupName" xml) String.parse)); + description = + (Xml.required "GroupDescription" + (Util.option_bind (Xml.member "GroupDescription" xml) + String.parse)); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Some + (Query.Pair + ("GroupDescription", (String.to_query v.description))); + Some (Query.Pair ("GroupName", (String.to_query v.group_name))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> ("vpc_id", (String.to_json f))); + Some ("description", (String.to_json v.description)); + Some ("group_name", (String.to_json v.group_name)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (String.of_json (Util.of_option_exn (Json.lookup j "group_name"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json) + } + end +module DescribeVpcPeeringConnectionsResult = + struct + type t = { + vpc_peering_connections: VpcPeeringConnectionList.t } + let make ?(vpc_peering_connections= []) () = { vpc_peering_connections } + let parse xml = + Some + { + vpc_peering_connections = + (Util.of_option [] + (Util.option_bind (Xml.member "vpcPeeringConnectionSet" xml) + VpcPeeringConnectionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcPeeringConnectionSet", + (VpcPeeringConnectionList.to_query + v.vpc_peering_connections)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_peering_connections", + (VpcPeeringConnectionList.to_json v.vpc_peering_connections))]) + let of_json j = + { + vpc_peering_connections = + (VpcPeeringConnectionList.of_json + (Util.of_option_exn (Json.lookup j "vpc_peering_connections"))) + } + end +module DescribeVolumeAttributeResult = + struct + type t = + { + volume_id: String.t option ; + auto_enable_i_o: AttributeBooleanValue.t option ; + product_codes: ProductCodeList.t } + let make ?volume_id ?auto_enable_i_o ?(product_codes= []) () = + { volume_id; auto_enable_i_o; product_codes } + let parse xml = + Some + { + volume_id = + (Util.option_bind (Xml.member "volumeId" xml) String.parse); + auto_enable_i_o = + (Util.option_bind (Xml.member "autoEnableIO" xml) + AttributeBooleanValue.parse); + product_codes = + (Util.of_option [] + (Util.option_bind (Xml.member "productCodes" xml) + ProductCodeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ProductCodes", (ProductCodeList.to_query v.product_codes))); + Util.option_map v.auto_enable_i_o + (fun f -> + Query.Pair + ("AutoEnableIO", (AttributeBooleanValue.to_query f))); + Util.option_map v.volume_id + (fun f -> Query.Pair ("VolumeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("product_codes", (ProductCodeList.to_json v.product_codes)); + Util.option_map v.auto_enable_i_o + (fun f -> ("auto_enable_i_o", (AttributeBooleanValue.to_json f))); + Util.option_map v.volume_id + (fun f -> ("volume_id", (String.to_json f)))]) + let of_json j = + { + volume_id = + (Util.option_map (Json.lookup j "volume_id") String.of_json); + auto_enable_i_o = + (Util.option_map (Json.lookup j "auto_enable_i_o") + AttributeBooleanValue.of_json); + product_codes = + (ProductCodeList.of_json + (Util.of_option_exn (Json.lookup j "product_codes"))) + } + end +module DescribeVpcsResult = + struct + type t = { + vpcs: VpcList.t } + let make ?(vpcs= []) () = { vpcs } + let parse xml = + Some + { + vpcs = + (Util.of_option [] + (Util.option_bind (Xml.member "vpcSet" xml) VpcList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcSet", (VpcList.to_query v.vpcs)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("vpcs", (VpcList.to_json v.vpcs))]) + let of_json j = + { vpcs = (VpcList.of_json (Util.of_option_exn (Json.lookup j "vpcs"))) + } + end +module DescribePrefixListsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + prefix_list_ids: ValueStringList.t ; + filters: FilterList.t ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?dry_run ?(prefix_list_ids= []) ?(filters= []) ?max_results + ?next_token () = + { dry_run; prefix_list_ids; filters; max_results; next_token } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + prefix_list_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "PrefixListId" xml) + ValueStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("PrefixListId", + (ValueStringList.to_query v.prefix_list_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("prefix_list_ids", (ValueStringList.to_json v.prefix_list_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + prefix_list_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "prefix_list_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeNetworkAclsResult = + struct + type t = { + network_acls: NetworkAclList.t } + let make ?(network_acls= []) () = { network_acls } + let parse xml = + Some + { + network_acls = + (Util.of_option [] + (Util.option_bind (Xml.member "networkAclSet" xml) + NetworkAclList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NetworkAclSet", (NetworkAclList.to_query v.network_acls)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("network_acls", (NetworkAclList.to_json v.network_acls))]) + let of_json j = + { + network_acls = + (NetworkAclList.of_json + (Util.of_option_exn (Json.lookup j "network_acls"))) + } + end +module DescribeSubnetsResult = + struct + type t = { + subnets: SubnetList.t } + let make ?(subnets= []) () = { subnets } + let parse xml = + Some + { + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "subnetSet" xml) + SubnetList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("SubnetSet", (SubnetList.to_query v.subnets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnets", (SubnetList.to_json v.subnets))]) + let of_json j = + { + subnets = + (SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module CancelBundleTaskResult = + struct + type t = { + bundle_task: BundleTask.t option } + let make ?bundle_task () = { bundle_task } + let parse xml = + Some + { + bundle_task = + (Util.option_bind (Xml.member "bundleInstanceTask" xml) + BundleTask.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.bundle_task + (fun f -> + Query.Pair ("BundleInstanceTask", (BundleTask.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.bundle_task + (fun f -> ("bundle_task", (BundleTask.to_json f)))]) + let of_json j = + { + bundle_task = + (Util.option_map (Json.lookup j "bundle_task") BundleTask.of_json) + } + end +module DetachInternetGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + internet_gateway_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~internet_gateway_id ~vpc_id () = + { dry_run; internet_gateway_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + internet_gateway_id = + (Xml.required "internetGatewayId" + (Util.option_bind (Xml.member "internetGatewayId" xml) + String.parse)); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some + (Query.Pair + ("InternetGatewayId", + (String.to_query v.internet_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some + ("internet_gateway_id", (String.to_json v.internet_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + internet_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "internet_gateway_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module CancelConversionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + conversion_task_id: String.t ; + reason_message: String.t option } + let make ?dry_run ~conversion_task_id ?reason_message () = + { dry_run; conversion_task_id; reason_message } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + conversion_task_id = + (Xml.required "conversionTaskId" + (Util.option_bind (Xml.member "conversionTaskId" xml) + String.parse)); + reason_message = + (Util.option_bind (Xml.member "reasonMessage" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reason_message + (fun f -> Query.Pair ("ReasonMessage", (String.to_query f))); + Some + (Query.Pair + ("ConversionTaskId", (String.to_query v.conversion_task_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reason_message + (fun f -> ("reason_message", (String.to_json f))); + Some ("conversion_task_id", (String.to_json v.conversion_task_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + conversion_task_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "conversion_task_id"))); + reason_message = + (Util.option_map (Json.lookup j "reason_message") String.of_json) + } + end +module AttachInternetGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + internet_gateway_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~internet_gateway_id ~vpc_id () = + { dry_run; internet_gateway_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + internet_gateway_id = + (Xml.required "internetGatewayId" + (Util.option_bind (Xml.member "internetGatewayId" xml) + String.parse)); + vpc_id = + (Xml.required "vpcId" + (Util.option_bind (Xml.member "vpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some + (Query.Pair + ("InternetGatewayId", + (String.to_query v.internet_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some + ("internet_gateway_id", (String.to_json v.internet_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + internet_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "internet_gateway_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module DescribeVpcClassicLinkResult = + struct + type t = { + vpcs: VpcClassicLinkList.t } + let make ?(vpcs= []) () = { vpcs } + let parse xml = + Some + { + vpcs = + (Util.of_option [] + (Util.option_bind (Xml.member "vpcSet" xml) + VpcClassicLinkList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("VpcSet", (VpcClassicLinkList.to_query v.vpcs)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpcs", (VpcClassicLinkList.to_json v.vpcs))]) + let of_json j = + { + vpcs = + (VpcClassicLinkList.of_json + (Util.of_option_exn (Json.lookup j "vpcs"))) + } + end +module DescribeImportImageTasksResult = + struct + type t = + { + import_image_tasks: ImportImageTaskList.t ; + next_token: String.t option } + let make ?(import_image_tasks= []) ?next_token () = + { import_image_tasks; next_token } + let parse xml = + Some + { + import_image_tasks = + (Util.of_option [] + (Util.option_bind (Xml.member "importImageTaskSet" xml) + ImportImageTaskList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("ImportImageTaskSet", + (ImportImageTaskList.to_query v.import_image_tasks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("import_image_tasks", + (ImportImageTaskList.to_json v.import_image_tasks))]) + let of_json j = + { + import_image_tasks = + (ImportImageTaskList.of_json + (Util.of_option_exn (Json.lookup j "import_image_tasks"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module CreateFlowLogsRequest = + struct + type t = + { + resource_ids: ValueStringList.t ; + resource_type: FlowLogsResourceType.t ; + traffic_type: TrafficType.t ; + log_group_name: String.t ; + deliver_logs_permission_arn: String.t ; + client_token: String.t option } + let make ~resource_ids ~resource_type ~traffic_type ~log_group_name + ~deliver_logs_permission_arn ?client_token () = + { + resource_ids; + resource_type; + traffic_type; + log_group_name; + deliver_logs_permission_arn; + client_token + } + let parse xml = + Some + { + resource_ids = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) + ValueStringList.parse)); + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) + FlowLogsResourceType.parse)); + traffic_type = + (Xml.required "TrafficType" + (Util.option_bind (Xml.member "TrafficType" xml) + TrafficType.parse)); + log_group_name = + (Xml.required "LogGroupName" + (Util.option_bind (Xml.member "LogGroupName" xml) String.parse)); + deliver_logs_permission_arn = + (Xml.required "DeliverLogsPermissionArn" + (Util.option_bind (Xml.member "DeliverLogsPermissionArn" xml) + String.parse)); + client_token = + (Util.option_bind (Xml.member "ClientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Some + (Query.Pair + ("DeliverLogsPermissionArn", + (String.to_query v.deliver_logs_permission_arn))); + Some + (Query.Pair ("LogGroupName", (String.to_query v.log_group_name))); + Some + (Query.Pair + ("TrafficType", (TrafficType.to_query v.traffic_type))); + Some + (Query.Pair + ("ResourceType", + (FlowLogsResourceType.to_query v.resource_type))); + Some + (Query.Pair + ("ResourceId", (ValueStringList.to_query v.resource_ids)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Some + ("deliver_logs_permission_arn", + (String.to_json v.deliver_logs_permission_arn)); + Some ("log_group_name", (String.to_json v.log_group_name)); + Some ("traffic_type", (TrafficType.to_json v.traffic_type)); + Some + ("resource_type", + (FlowLogsResourceType.to_json v.resource_type)); + Some ("resource_ids", (ValueStringList.to_json v.resource_ids))]) + let of_json j = + { + resource_ids = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "resource_ids"))); + resource_type = + (FlowLogsResourceType.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + traffic_type = + (TrafficType.of_json + (Util.of_option_exn (Json.lookup j "traffic_type"))); + log_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "log_group_name"))); + deliver_logs_permission_arn = + (String.of_json + (Util.of_option_exn + (Json.lookup j "deliver_logs_permission_arn"))); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module CancelSpotFleetRequestsResponse = + struct + type t = + { + unsuccessful_fleet_requests: CancelSpotFleetRequestsErrorSet.t ; + successful_fleet_requests: CancelSpotFleetRequestsSuccessSet.t } + let make ?(unsuccessful_fleet_requests= []) ?(successful_fleet_requests= + []) () = { unsuccessful_fleet_requests; successful_fleet_requests } + let parse xml = + Some + { + unsuccessful_fleet_requests = + (Util.of_option [] + (Util.option_bind + (Xml.member "unsuccessfulFleetRequestSet" xml) + CancelSpotFleetRequestsErrorSet.parse)); + successful_fleet_requests = + (Util.of_option [] + (Util.option_bind (Xml.member "successfulFleetRequestSet" xml) + CancelSpotFleetRequestsSuccessSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SuccessfulFleetRequestSet", + (CancelSpotFleetRequestsSuccessSet.to_query + v.successful_fleet_requests))); + Some + (Query.Pair + ("UnsuccessfulFleetRequestSet", + (CancelSpotFleetRequestsErrorSet.to_query + v.unsuccessful_fleet_requests)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("successful_fleet_requests", + (CancelSpotFleetRequestsSuccessSet.to_json + v.successful_fleet_requests)); + Some + ("unsuccessful_fleet_requests", + (CancelSpotFleetRequestsErrorSet.to_json + v.unsuccessful_fleet_requests))]) + let of_json j = + { + unsuccessful_fleet_requests = + (CancelSpotFleetRequestsErrorSet.of_json + (Util.of_option_exn + (Json.lookup j "unsuccessful_fleet_requests"))); + successful_fleet_requests = + (CancelSpotFleetRequestsSuccessSet.of_json + (Util.of_option_exn (Json.lookup j "successful_fleet_requests"))) + } + end +module CreateSnapshotRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_id: String.t ; + description: String.t option } + let make ?dry_run ~volume_id ?description () = + { dry_run; volume_id; description } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "VolumeId" + (Util.option_bind (Xml.member "VolumeId" xml) String.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module DescribeAccountAttributesResult = + struct + type t = { + account_attributes: AccountAttributeList.t } + let make ?(account_attributes= []) () = { account_attributes } + let parse xml = + Some + { + account_attributes = + (Util.of_option [] + (Util.option_bind (Xml.member "accountAttributeSet" xml) + AccountAttributeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AccountAttributeSet", + (AccountAttributeList.to_query v.account_attributes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("account_attributes", + (AccountAttributeList.to_json v.account_attributes))]) + let of_json j = + { + account_attributes = + (AccountAttributeList.of_json + (Util.of_option_exn (Json.lookup j "account_attributes"))) + } + end +module ReplaceRouteTableAssociationResult = + struct + type t = { + new_association_id: String.t option } + let make ?new_association_id () = { new_association_id } + let parse xml = + Some + { + new_association_id = + (Util.option_bind (Xml.member "newAssociationId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.new_association_id + (fun f -> Query.Pair ("NewAssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.new_association_id + (fun f -> ("new_association_id", (String.to_json f)))]) + let of_json j = + { + new_association_id = + (Util.option_map (Json.lookup j "new_association_id") + String.of_json) + } + end +module DescribeVolumeStatusRequest = + struct + type t = + { + dry_run: Boolean.t option ; + volume_ids: VolumeIdStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(volume_ids= []) ?(filters= []) ?next_token + ?max_results () = + { dry_run; volume_ids; filters; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VolumeId" xml) + VolumeIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("VolumeId", (VolumeIdStringList.to_query v.volume_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some ("volume_ids", (VolumeIdStringList.to_json v.volume_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_ids = + (VolumeIdStringList.of_json + (Util.of_option_exn (Json.lookup j "volume_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module DescribeDhcpOptionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + dhcp_options_ids: DhcpOptionsIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(dhcp_options_ids= []) ?(filters= []) () = + { dry_run; dhcp_options_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + dhcp_options_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "DhcpOptionsId" xml) + DhcpOptionsIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("DhcpOptionsId", + (DhcpOptionsIdStringList.to_query v.dhcp_options_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some + ("dhcp_options_ids", + (DhcpOptionsIdStringList.to_json v.dhcp_options_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + dhcp_options_ids = + (DhcpOptionsIdStringList.of_json + (Util.of_option_exn (Json.lookup j "dhcp_options_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeSpotPriceHistoryResult = + struct + type t = + { + spot_price_history: SpotPriceHistoryList.t ; + next_token: String.t option } + let make ?(spot_price_history= []) ?next_token () = + { spot_price_history; next_token } + let parse xml = + Some + { + spot_price_history = + (Util.of_option [] + (Util.option_bind (Xml.member "spotPriceHistorySet" xml) + SpotPriceHistoryList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("SpotPriceHistorySet", + (SpotPriceHistoryList.to_query v.spot_price_history)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("spot_price_history", + (SpotPriceHistoryList.to_json v.spot_price_history))]) + let of_json j = + { + spot_price_history = + (SpotPriceHistoryList.of_json + (Util.of_option_exn (Json.lookup j "spot_price_history"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DeleteTagsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + resources: ResourceIdList.t ; + tags: TagList.t } + let make ?dry_run ~resources ?(tags= []) () = + { dry_run; resources; tags } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + resources = + (Xml.required "resourceId" + (Util.option_bind (Xml.member "resourceId" xml) + ResourceIdList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "tag" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tag", (TagList.to_query v.tags))); + Some + (Query.Pair + ("ResourceId", (ResourceIdList.to_query v.resources))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("resources", (ResourceIdList.to_json v.resources)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + resources = + (ResourceIdList.of_json + (Util.of_option_exn (Json.lookup j "resources"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ReportInstanceStatusRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instances: InstanceIdStringList.t ; + status: ReportStatusType.t ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + reason_codes: ReasonCodesList.t ; + description: String.t option } + let make ?dry_run ~instances ~status ?start_time ?end_time + ~reason_codes ?description () = + { + dry_run; + instances; + status; + start_time; + end_time; + reason_codes; + description + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instances = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) + InstanceIdStringList.parse)); + status = + (Xml.required "status" + (Util.option_bind (Xml.member "status" xml) + ReportStatusType.parse)); + start_time = + (Util.option_bind (Xml.member "startTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "endTime" xml) DateTime.parse); + reason_codes = + (Xml.required "reasonCode" + (Util.option_bind (Xml.member "reasonCode" xml) + ReasonCodesList.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some + (Query.Pair + ("ReasonCode", (ReasonCodesList.to_query v.reason_codes))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Some (Query.Pair ("Status", (ReportStatusType.to_query v.status))); + Some + (Query.Pair + ("InstanceId", (InstanceIdStringList.to_query v.instances))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("reason_codes", (ReasonCodesList.to_json v.reason_codes)); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Some ("status", (ReportStatusType.to_json v.status)); + Some ("instances", (InstanceIdStringList.to_json v.instances)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instances = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instances"))); + status = + (ReportStatusType.of_json + (Util.of_option_exn (Json.lookup j "status"))); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + reason_codes = + (ReasonCodesList.of_json + (Util.of_option_exn (Json.lookup j "reason_codes"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module AssociateRouteTableResult = + struct + type t = { + association_id: String.t option } + let make ?association_id () = { association_id } + let parse xml = + Some + { + association_id = (Util.option_bind (Xml.member "associationId" xml) String.parse) - ; route_table_id = - Xml.required - "routeTableId" - (Util.option_bind (Xml.member "routeTableId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ; Some (Query.Pair ("AssociationId", String.to_query v.association_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("route_table_id", String.to_json v.route_table_id) - ; Some ("association_id", String.to_json v.association_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; association_id = - String.of_json (Util.of_option_exn (Json.lookup j "association_id")) - ; route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - } -end - -module DescribeClassicLinkInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ?(instance_ids = []) ?(filters = []) ?next_token ?max_results () = - { dry_run; instance_ids; filters; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module CreateInternetGatewayResult = struct - type t = { internet_gateway : InternetGateway.t option } - - let make ?internet_gateway () = { internet_gateway } - - let parse xml = - Some - { internet_gateway = - Util.option_bind (Xml.member "internetGateway" xml) InternetGateway.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.internet_gateway (fun f -> - Query.Pair ("InternetGateway", InternetGateway.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.internet_gateway (fun f -> - "internet_gateway", InternetGateway.to_json f) - ]) - - let of_json j = - { internet_gateway = - Util.option_map (Json.lookup j "internet_gateway") InternetGateway.of_json - } -end - -module ImportInstanceRequest = struct - type t = - { dry_run : Boolean.t option - ; description : String.t option - ; launch_specification : ImportInstanceLaunchSpecification.t option - ; disk_images : DiskImageList.t - ; platform : PlatformValues.t - } - - let make ?dry_run ?description ?launch_specification ?(disk_images = []) ~platform () = - { dry_run; description; launch_specification; disk_images; platform } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; launch_specification = - Util.option_bind - (Xml.member "launchSpecification" xml) - ImportInstanceLaunchSpecification.parse - ; disk_images = - Util.of_option - [] - (Util.option_bind (Xml.member "diskImage" xml) DiskImageList.parse) - ; platform = - Xml.required - "platform" - (Util.option_bind (Xml.member "platform" xml) PlatformValues.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Platform", PlatformValues.to_query v.platform)) - ; Some (Query.Pair ("DiskImage", DiskImageList.to_query v.disk_images)) - ; Util.option_map v.launch_specification (fun f -> - Query.Pair - ("LaunchSpecification", ImportInstanceLaunchSpecification.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("platform", PlatformValues.to_json v.platform) - ; Some ("disk_images", DiskImageList.to_json v.disk_images) - ; Util.option_map v.launch_specification (fun f -> - "launch_specification", ImportInstanceLaunchSpecification.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; launch_specification = - Util.option_map - (Json.lookup j "launch_specification") - ImportInstanceLaunchSpecification.of_json - ; disk_images = - DiskImageList.of_json (Util.of_option_exn (Json.lookup j "disk_images")) - ; platform = PlatformValues.of_json (Util.of_option_exn (Json.lookup j "platform")) - } -end - -module ImportVolumeRequest = struct - type t = - { dry_run : Boolean.t option - ; availability_zone : String.t - ; image : DiskImageDetail.t - ; description : String.t option - ; volume : VolumeDetail.t - } - - let make ?dry_run ~availability_zone ~image ?description ~volume () = - { dry_run; availability_zone; image; description; volume } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; availability_zone = - Xml.required - "availabilityZone" - (Util.option_bind (Xml.member "availabilityZone" xml) String.parse) - ; image = - Xml.required - "image" - (Util.option_bind (Xml.member "image" xml) DiskImageDetail.parse) - ; description = Util.option_bind (Xml.member "description" xml) String.parse - ; volume = - Xml.required - "volume" - (Util.option_bind (Xml.member "volume" xml) VolumeDetail.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Volume", VolumeDetail.to_query v.volume)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("Image", DiskImageDetail.to_query v.image)) - ; Some (Query.Pair ("AvailabilityZone", String.to_query v.availability_zone)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("volume", VolumeDetail.to_json v.volume) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("image", DiskImageDetail.to_json v.image) - ; Some ("availability_zone", String.to_json v.availability_zone) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; availability_zone = - String.of_json (Util.of_option_exn (Json.lookup j "availability_zone")) - ; image = DiskImageDetail.of_json (Util.of_option_exn (Json.lookup j "image")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; volume = VolumeDetail.of_json (Util.of_option_exn (Json.lookup j "volume")) - } -end - -module DescribeInstanceStatusRequest = struct - type t = - { dry_run : Boolean.t option - ; instance_ids : InstanceIdStringList.t - ; filters : FilterList.t - ; next_token : String.t option - ; max_results : Integer.t option - ; include_all_instances : Boolean.t option - } - - let make - ?dry_run - ?(instance_ids = []) - ?(filters = []) - ?next_token - ?max_results - ?include_all_instances - () = - { dry_run; instance_ids; filters; next_token; max_results; include_all_instances } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; instance_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceId" xml) InstanceIdStringList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filter" xml) FilterList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; include_all_instances = - Util.option_bind (Xml.member "includeAllInstances" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.include_all_instances (fun f -> - Query.Pair ("IncludeAllInstances", Boolean.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Some (Query.Pair ("InstanceId", InstanceIdStringList.to_query v.instance_ids)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.include_all_instances (fun f -> - "include_all_instances", Boolean.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("instance_ids", InstanceIdStringList.to_json v.instance_ids) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; instance_ids = - InstanceIdStringList.of_json (Util.of_option_exn (Json.lookup j "instance_ids")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; include_all_instances = - Util.option_map (Json.lookup j "include_all_instances") Boolean.of_json - } -end - -module CancelImportTaskRequest = struct - type t = - { dry_run : Boolean.t option - ; import_task_id : String.t option - ; cancel_reason : String.t option - } - - let make ?dry_run ?import_task_id ?cancel_reason () = - { dry_run; import_task_id; cancel_reason } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; import_task_id = Util.option_bind (Xml.member "ImportTaskId" xml) String.parse - ; cancel_reason = Util.option_bind (Xml.member "CancelReason" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cancel_reason (fun f -> - Query.Pair ("CancelReason", String.to_query f)) - ; Util.option_map v.import_task_id (fun f -> - Query.Pair ("ImportTaskId", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cancel_reason (fun f -> "cancel_reason", String.to_json f) - ; Util.option_map v.import_task_id (fun f -> "import_task_id", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; import_task_id = Util.option_map (Json.lookup j "import_task_id") String.of_json - ; cancel_reason = Util.option_map (Json.lookup j "cancel_reason") String.of_json - } -end - -module DescribeVpcEndpointsResult = struct - type t = - { vpc_endpoints : VpcEndpointSet.t - ; next_token : String.t option - } - - let make ?(vpc_endpoints = []) ?next_token () = { vpc_endpoints; next_token } - - let parse xml = - Some - { vpc_endpoints = - Util.of_option - [] - (Util.option_bind (Xml.member "vpcEndpointSet" xml) VpcEndpointSet.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("VpcEndpointSet", VpcEndpointSet.to_query v.vpc_endpoints)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("vpc_endpoints", VpcEndpointSet.to_json v.vpc_endpoints) - ]) - - let of_json j = - { vpc_endpoints = - VpcEndpointSet.of_json (Util.of_option_exn (Json.lookup j "vpc_endpoints")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ImportImageRequest = struct - type t = - { dry_run : Boolean.t option - ; description : String.t option - ; disk_containers : ImageDiskContainerList.t - ; license_type : String.t option - ; hypervisor : String.t option - ; architecture : String.t option - ; platform : String.t option - ; client_data : ClientData.t option - ; client_token : String.t option - ; role_name : String.t option - } - - let make - ?dry_run - ?description - ?(disk_containers = []) - ?license_type - ?hypervisor - ?architecture - ?platform - ?client_data - ?client_token - ?role_name - () = - { dry_run - ; description - ; disk_containers - ; license_type - ; hypervisor - ; architecture - ; platform - ; client_data - ; client_token - ; role_name - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "DryRun" xml) Boolean.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; disk_containers = - Util.of_option - [] + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> Query.Pair ("AssociationId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_id + (fun f -> ("association_id", (String.to_json f)))]) + let of_json j = + { + association_id = + (Util.option_map (Json.lookup j "association_id") String.of_json) + } + end +module CreateVpcPeeringConnectionRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_id: String.t option ; + peer_vpc_id: String.t option ; + peer_owner_id: String.t option } + let make ?dry_run ?vpc_id ?peer_vpc_id ?peer_owner_id () = + { dry_run; vpc_id; peer_vpc_id; peer_owner_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + peer_vpc_id = + (Util.option_bind (Xml.member "peerVpcId" xml) String.parse); + peer_owner_id = + (Util.option_bind (Xml.member "peerOwnerId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.peer_owner_id + (fun f -> Query.Pair ("PeerOwnerId", (String.to_query f))); + Util.option_map v.peer_vpc_id + (fun f -> Query.Pair ("PeerVpcId", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.peer_owner_id + (fun f -> ("peer_owner_id", (String.to_json f))); + Util.option_map v.peer_vpc_id + (fun f -> ("peer_vpc_id", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + peer_vpc_id = + (Util.option_map (Json.lookup j "peer_vpc_id") String.of_json); + peer_owner_id = + (Util.option_map (Json.lookup j "peer_owner_id") String.of_json) + } + end +module DescribeVpcsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpc_ids: VpcIdStringList.t ; + filters: FilterList.t } + let make ?dry_run ?(vpc_ids= []) ?(filters= []) () = + { dry_run; vpc_ids; filters } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpc_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcId" xml) + VpcIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some (Query.Pair ("VpcId", (VpcIdStringList.to_query v.vpc_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("vpc_ids", (VpcIdStringList.to_json v.vpc_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpc_ids = + (VpcIdStringList.of_json + (Util.of_option_exn (Json.lookup j "vpc_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DetachNetworkInterfaceRequest = + struct + type t = + { + dry_run: Boolean.t option ; + attachment_id: String.t ; + force: Boolean.t option } + let make ?dry_run ~attachment_id ?force () = + { dry_run; attachment_id; force } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + attachment_id = + (Xml.required "attachmentId" + (Util.option_bind (Xml.member "attachmentId" xml) String.parse)); + force = (Util.option_bind (Xml.member "force" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.force + (fun f -> Query.Pair ("Force", (Boolean.to_query f))); + Some + (Query.Pair ("AttachmentId", (String.to_query v.attachment_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.force (fun f -> ("force", (Boolean.to_json f))); + Some ("attachment_id", (String.to_json v.attachment_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + attachment_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "attachment_id"))); + force = (Util.option_map (Json.lookup j "force") Boolean.of_json) + } + end +module CreateNetworkInterfaceRequest = + struct + type t = + { + subnet_id: String.t ; + description: String.t option ; + private_ip_address: String.t option ; + groups: SecurityGroupIdStringList.t ; + private_ip_addresses: PrivateIpAddressSpecificationList.t ; + secondary_private_ip_address_count: Integer.t option ; + dry_run: Boolean.t option } + let make ~subnet_id ?description ?private_ip_address ?(groups= []) + ?(private_ip_addresses= []) ?secondary_private_ip_address_count + ?dry_run () = + { + subnet_id; + description; + private_ip_address; + groups; + private_ip_addresses; + secondary_private_ip_address_count; + dry_run + } + let parse xml = + Some + { + subnet_id = + (Xml.required "subnetId" + (Util.option_bind (Xml.member "subnetId" xml) String.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + private_ip_address = + (Util.option_bind (Xml.member "privateIpAddress" xml) + String.parse); + groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupId" xml) + SecurityGroupIdStringList.parse)); + private_ip_addresses = + (Util.of_option [] + (Util.option_bind (Xml.member "privateIpAddresses" xml) + PrivateIpAddressSpecificationList.parse)); + secondary_private_ip_address_count = (Util.option_bind - (Xml.member "DiskContainer" xml) - ImageDiskContainerList.parse) - ; license_type = Util.option_bind (Xml.member "LicenseType" xml) String.parse - ; hypervisor = Util.option_bind (Xml.member "Hypervisor" xml) String.parse - ; architecture = Util.option_bind (Xml.member "Architecture" xml) String.parse - ; platform = Util.option_bind (Xml.member "Platform" xml) String.parse - ; client_data = Util.option_bind (Xml.member "ClientData" xml) ClientData.parse - ; client_token = Util.option_bind (Xml.member "ClientToken" xml) String.parse - ; role_name = Util.option_bind (Xml.member "RoleName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.role_name (fun f -> - Query.Pair ("RoleName", String.to_query f)) - ; Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.client_data (fun f -> - Query.Pair ("ClientData", ClientData.to_query f)) - ; Util.option_map v.platform (fun f -> - Query.Pair ("Platform", String.to_query f)) - ; Util.option_map v.architecture (fun f -> - Query.Pair ("Architecture", String.to_query f)) - ; Util.option_map v.hypervisor (fun f -> - Query.Pair ("Hypervisor", String.to_query f)) - ; Util.option_map v.license_type (fun f -> - Query.Pair ("LicenseType", String.to_query f)) - ; Some + (Xml.member "secondaryPrivateIpAddressCount" xml) + Integer.parse); + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + Query.Pair + ("SecondaryPrivateIpAddressCount", (Integer.to_query f))); + Some (Query.Pair - ("DiskContainer", ImageDiskContainerList.to_query v.disk_containers)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.role_name (fun f -> "role_name", String.to_json f) - ; Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.client_data (fun f -> "client_data", ClientData.to_json f) - ; Util.option_map v.platform (fun f -> "platform", String.to_json f) - ; Util.option_map v.architecture (fun f -> "architecture", String.to_json f) - ; Util.option_map v.hypervisor (fun f -> "hypervisor", String.to_json f) - ; Util.option_map v.license_type (fun f -> "license_type", String.to_json f) - ; Some ("disk_containers", ImageDiskContainerList.to_json v.disk_containers) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; disk_containers = - ImageDiskContainerList.of_json - (Util.of_option_exn (Json.lookup j "disk_containers")) - ; license_type = Util.option_map (Json.lookup j "license_type") String.of_json - ; hypervisor = Util.option_map (Json.lookup j "hypervisor") String.of_json - ; architecture = Util.option_map (Json.lookup j "architecture") String.of_json - ; platform = Util.option_map (Json.lookup j "platform") String.of_json - ; client_data = Util.option_map (Json.lookup j "client_data") ClientData.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - ; role_name = Util.option_map (Json.lookup j "role_name") String.of_json - } -end - -module DescribeClassicLinkInstancesResult = struct - type t = - { instances : ClassicLinkInstanceList.t - ; next_token : String.t option - } - - let make ?(instances = []) ?next_token () = { instances; next_token } - - let parse xml = - Some - { instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - ClassicLinkInstanceList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("InstancesSet", ClassicLinkInstanceList.to_query v.instances)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("instances", ClassicLinkInstanceList.to_json v.instances) - ]) - - let of_json j = - { instances = - ClassicLinkInstanceList.of_json (Util.of_option_exn (Json.lookup j "instances")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeSpotFleetInstancesRequest = struct - type t = - { dry_run : Boolean.t option - ; spot_fleet_request_id : String.t - ; next_token : String.t option - ; max_results : Integer.t option - } - - let make ?dry_run ~spot_fleet_request_id ?next_token ?max_results () = - { dry_run; spot_fleet_request_id; next_token; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; spot_fleet_request_id = - Xml.required - "spotFleetRequestId" - (Util.option_bind (Xml.member "spotFleetRequestId" xml) String.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("SpotFleetRequestId", String.to_query v.spot_fleet_request_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("spot_fleet_request_id", String.to_json v.spot_fleet_request_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; spot_fleet_request_id = - String.of_json (Util.of_option_exn (Json.lookup j "spot_fleet_request_id")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module DetachVpnGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; vpn_gateway_id : String.t - ; vpc_id : String.t - } - - let make ?dry_run ~vpn_gateway_id ~vpc_id () = { dry_run; vpn_gateway_id; vpc_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; vpn_gateway_id = - Xml.required - "VpnGatewayId" - (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse) - ; vpc_id = - Xml.required "VpcId" (Util.option_bind (Xml.member "VpcId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VpcId", String.to_query v.vpc_id)) - ; Some (Query.Pair ("VpnGatewayId", String.to_query v.vpn_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("vpc_id", String.to_json v.vpc_id) - ; Some ("vpn_gateway_id", String.to_json v.vpn_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; vpn_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "vpn_gateway_id")) - ; vpc_id = String.of_json (Util.of_option_exn (Json.lookup j "vpc_id")) - } -end - -module MonitorInstancesResult = struct - type t = { instance_monitorings : InstanceMonitoringList.t } - - let make ?(instance_monitorings = []) () = { instance_monitorings } - - let parse xml = - Some - { instance_monitorings = - Util.of_option - [] - (Util.option_bind - (Xml.member "instancesSet" xml) - InstanceMonitoringList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("PrivateIpAddresses", + (PrivateIpAddressSpecificationList.to_query + v.private_ip_addresses))); + Some (Query.Pair - ("InstancesSet", InstanceMonitoringList.to_query v.instance_monitorings)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "instance_monitorings" - , InstanceMonitoringList.to_json v.instance_monitorings ) - ]) - - let of_json j = - { instance_monitorings = - InstanceMonitoringList.of_json - (Util.of_option_exn (Json.lookup j "instance_monitorings")) - } -end - -module AuthorizeSecurityGroupIngressRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t option - ; group_id : String.t option - ; source_security_group_name : String.t option - ; source_security_group_owner_id : String.t option - ; ip_protocol : String.t option - ; from_port : Integer.t option - ; to_port : Integer.t option - ; cidr_ip : String.t option - ; ip_permissions : IpPermissionList.t - } - - let make - ?dry_run - ?group_name - ?group_id - ?source_security_group_name - ?source_security_group_owner_id - ?ip_protocol - ?from_port - ?to_port - ?cidr_ip - ?(ip_permissions = []) - () = - { dry_run - ; group_name - ; group_id - ; source_security_group_name - ; source_security_group_owner_id - ; ip_protocol - ; from_port - ; to_port - ; cidr_ip - ; ip_permissions - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = Util.option_bind (Xml.member "GroupName" xml) String.parse - ; group_id = Util.option_bind (Xml.member "GroupId" xml) String.parse - ; source_security_group_name = - Util.option_bind (Xml.member "SourceSecurityGroupName" xml) String.parse - ; source_security_group_owner_id = - Util.option_bind (Xml.member "SourceSecurityGroupOwnerId" xml) String.parse - ; ip_protocol = Util.option_bind (Xml.member "IpProtocol" xml) String.parse - ; from_port = Util.option_bind (Xml.member "FromPort" xml) Integer.parse - ; to_port = Util.option_bind (Xml.member "ToPort" xml) Integer.parse - ; cidr_ip = Util.option_bind (Xml.member "CidrIp" xml) String.parse - ; ip_permissions = - Util.of_option - [] - (Util.option_bind (Xml.member "IpPermissions" xml) IpPermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IpPermissions", IpPermissionList.to_query v.ip_permissions)) - ; Util.option_map v.cidr_ip (fun f -> Query.Pair ("CidrIp", String.to_query f)) - ; Util.option_map v.to_port (fun f -> Query.Pair ("ToPort", Integer.to_query f)) - ; Util.option_map v.from_port (fun f -> - Query.Pair ("FromPort", Integer.to_query f)) - ; Util.option_map v.ip_protocol (fun f -> - Query.Pair ("IpProtocol", String.to_query f)) - ; Util.option_map v.source_security_group_owner_id (fun f -> - Query.Pair ("SourceSecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.source_security_group_name (fun f -> - Query.Pair ("SourceSecurityGroupName", String.to_query f)) - ; Util.option_map v.group_id (fun f -> Query.Pair ("GroupId", String.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("ip_permissions", IpPermissionList.to_json v.ip_permissions) - ; Util.option_map v.cidr_ip (fun f -> "cidr_ip", String.to_json f) - ; Util.option_map v.to_port (fun f -> "to_port", Integer.to_json f) - ; Util.option_map v.from_port (fun f -> "from_port", Integer.to_json f) - ; Util.option_map v.ip_protocol (fun f -> "ip_protocol", String.to_json f) - ; Util.option_map v.source_security_group_owner_id (fun f -> - "source_security_group_owner_id", String.to_json f) - ; Util.option_map v.source_security_group_name (fun f -> - "source_security_group_name", String.to_json f) - ; Util.option_map v.group_id (fun f -> "group_id", String.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; group_id = Util.option_map (Json.lookup j "group_id") String.of_json - ; source_security_group_name = - Util.option_map (Json.lookup j "source_security_group_name") String.of_json - ; source_security_group_owner_id = - Util.option_map (Json.lookup j "source_security_group_owner_id") String.of_json - ; ip_protocol = Util.option_map (Json.lookup j "ip_protocol") String.of_json - ; from_port = Util.option_map (Json.lookup j "from_port") Integer.of_json - ; to_port = Util.option_map (Json.lookup j "to_port") Integer.of_json - ; cidr_ip = Util.option_map (Json.lookup j "cidr_ip") String.of_json - ; ip_permissions = - IpPermissionList.of_json (Util.of_option_exn (Json.lookup j "ip_permissions")) - } -end - -module CreateInternetGatewayRequest = struct - type t = { dry_run : Boolean.t option } - - let make ?dry_run () = { dry_run } - - let parse xml = - Some { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) ]) - - let of_json j = { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json } -end - -module DescribeImageAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; image_id : String.t - ; attribute : ImageAttributeName.t - } - - let make ?dry_run ~image_id ~attribute () = { dry_run; image_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - ; attribute = - Xml.required - "Attribute" - (Util.option_bind (Xml.member "Attribute" xml) ImageAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", ImageAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", ImageAttributeName.to_json v.attribute) - ; Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; attribute = - ImageAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module DeleteCustomerGatewayRequest = struct - type t = - { dry_run : Boolean.t option - ; customer_gateway_id : String.t - } - - let make ?dry_run ~customer_gateway_id () = { dry_run; customer_gateway_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; customer_gateway_id = - Xml.required - "CustomerGatewayId" - (Util.option_bind (Xml.member "CustomerGatewayId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CustomerGatewayId", String.to_query v.customer_gateway_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("customer_gateway_id", String.to_json v.customer_gateway_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; customer_gateway_id = - String.of_json (Util.of_option_exn (Json.lookup j "customer_gateway_id")) - } -end - -module DescribeSnapshotsResult = struct - type t = - { snapshots : SnapshotList.t - ; next_token : String.t option - } - - let make ?(snapshots = []) ?next_token () = { snapshots; next_token } - - let parse xml = - Some - { snapshots = - Util.of_option - [] - (Util.option_bind (Xml.member "snapshotSet" xml) SnapshotList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("SnapshotSet", SnapshotList.to_query v.snapshots)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("snapshots", SnapshotList.to_json v.snapshots) - ]) - - let of_json j = - { snapshots = SnapshotList.of_json (Util.of_option_exn (Json.lookup j "snapshots")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module EnableVolumeIORequest = struct - type t = - { dry_run : Boolean.t option - ; volume_id : String.t - } - - let make ?dry_run ~volume_id () = { dry_run; volume_id } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; volume_id = - Xml.required - "volumeId" - (Util.option_bind (Xml.member "volumeId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VolumeId", String.to_query v.volume_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("volume_id", String.to_json v.volume_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; volume_id = String.of_json (Util.of_option_exn (Json.lookup j "volume_id")) - } -end - -module RevokeSecurityGroupIngressRequest = struct - type t = - { dry_run : Boolean.t option - ; group_name : String.t option - ; group_id : String.t option - ; source_security_group_name : String.t option - ; source_security_group_owner_id : String.t option - ; ip_protocol : String.t option - ; from_port : Integer.t option - ; to_port : Integer.t option - ; cidr_ip : String.t option - ; ip_permissions : IpPermissionList.t - } - - let make - ?dry_run - ?group_name - ?group_id - ?source_security_group_name - ?source_security_group_owner_id - ?ip_protocol - ?from_port - ?to_port - ?cidr_ip - ?(ip_permissions = []) - () = - { dry_run - ; group_name - ; group_id - ; source_security_group_name - ; source_security_group_owner_id - ; ip_protocol - ; from_port - ; to_port - ; cidr_ip - ; ip_permissions - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; group_name = Util.option_bind (Xml.member "GroupName" xml) String.parse - ; group_id = Util.option_bind (Xml.member "GroupId" xml) String.parse - ; source_security_group_name = - Util.option_bind (Xml.member "SourceSecurityGroupName" xml) String.parse - ; source_security_group_owner_id = - Util.option_bind (Xml.member "SourceSecurityGroupOwnerId" xml) String.parse - ; ip_protocol = Util.option_bind (Xml.member "IpProtocol" xml) String.parse - ; from_port = Util.option_bind (Xml.member "FromPort" xml) Integer.parse - ; to_port = Util.option_bind (Xml.member "ToPort" xml) Integer.parse - ; cidr_ip = Util.option_bind (Xml.member "CidrIp" xml) String.parse - ; ip_permissions = - Util.of_option - [] - (Util.option_bind (Xml.member "IpPermissions" xml) IpPermissionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IpPermissions", IpPermissionList.to_query v.ip_permissions)) - ; Util.option_map v.cidr_ip (fun f -> Query.Pair ("CidrIp", String.to_query f)) - ; Util.option_map v.to_port (fun f -> Query.Pair ("ToPort", Integer.to_query f)) - ; Util.option_map v.from_port (fun f -> - Query.Pair ("FromPort", Integer.to_query f)) - ; Util.option_map v.ip_protocol (fun f -> - Query.Pair ("IpProtocol", String.to_query f)) - ; Util.option_map v.source_security_group_owner_id (fun f -> - Query.Pair ("SourceSecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.source_security_group_name (fun f -> - Query.Pair ("SourceSecurityGroupName", String.to_query f)) - ; Util.option_map v.group_id (fun f -> Query.Pair ("GroupId", String.to_query f)) - ; Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("ip_permissions", IpPermissionList.to_json v.ip_permissions) - ; Util.option_map v.cidr_ip (fun f -> "cidr_ip", String.to_json f) - ; Util.option_map v.to_port (fun f -> "to_port", Integer.to_json f) - ; Util.option_map v.from_port (fun f -> "from_port", Integer.to_json f) - ; Util.option_map v.ip_protocol (fun f -> "ip_protocol", String.to_json f) - ; Util.option_map v.source_security_group_owner_id (fun f -> - "source_security_group_owner_id", String.to_json f) - ; Util.option_map v.source_security_group_name (fun f -> - "source_security_group_name", String.to_json f) - ; Util.option_map v.group_id (fun f -> "group_id", String.to_json f) - ; Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - ; group_id = Util.option_map (Json.lookup j "group_id") String.of_json - ; source_security_group_name = - Util.option_map (Json.lookup j "source_security_group_name") String.of_json - ; source_security_group_owner_id = - Util.option_map (Json.lookup j "source_security_group_owner_id") String.of_json - ; ip_protocol = Util.option_map (Json.lookup j "ip_protocol") String.of_json - ; from_port = Util.option_map (Json.lookup j "from_port") Integer.of_json - ; to_port = Util.option_map (Json.lookup j "to_port") Integer.of_json - ; cidr_ip = Util.option_map (Json.lookup j "cidr_ip") String.of_json - ; ip_permissions = - IpPermissionList.of_json (Util.of_option_exn (Json.lookup j "ip_permissions")) - } -end - -module DisableVgwRoutePropagationRequest = struct - type t = - { route_table_id : String.t - ; gateway_id : String.t - } - - let make ~route_table_id ~gateway_id () = { route_table_id; gateway_id } - - let parse xml = - Some - { route_table_id = - Xml.required - "RouteTableId" - (Util.option_bind (Xml.member "RouteTableId" xml) String.parse) - ; gateway_id = - Xml.required - "GatewayId" - (Util.option_bind (Xml.member "GatewayId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("GatewayId", String.to_query v.gateway_id)) - ; Some (Query.Pair ("RouteTableId", String.to_query v.route_table_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("gateway_id", String.to_json v.gateway_id) - ; Some ("route_table_id", String.to_json v.route_table_id) - ]) - - let of_json j = - { route_table_id = - String.of_json (Util.of_option_exn (Json.lookup j "route_table_id")) - ; gateway_id = String.of_json (Util.of_option_exn (Json.lookup j "gateway_id")) - } -end - -module DescribeVpcAttributeResult = struct - type t = - { vpc_id : String.t option - ; enable_dns_support : AttributeBooleanValue.t option - ; enable_dns_hostnames : AttributeBooleanValue.t option - } - - let make ?vpc_id ?enable_dns_support ?enable_dns_hostnames () = - { vpc_id; enable_dns_support; enable_dns_hostnames } - - let parse xml = - Some - { vpc_id = Util.option_bind (Xml.member "vpcId" xml) String.parse - ; enable_dns_support = - Util.option_bind (Xml.member "enableDnsSupport" xml) AttributeBooleanValue.parse - ; enable_dns_hostnames = - Util.option_bind - (Xml.member "enableDnsHostnames" xml) - AttributeBooleanValue.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enable_dns_hostnames (fun f -> - Query.Pair ("EnableDnsHostnames", AttributeBooleanValue.to_query f)) - ; Util.option_map v.enable_dns_support (fun f -> - Query.Pair ("EnableDnsSupport", AttributeBooleanValue.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enable_dns_hostnames (fun f -> - "enable_dns_hostnames", AttributeBooleanValue.to_json f) - ; Util.option_map v.enable_dns_support (fun f -> - "enable_dns_support", AttributeBooleanValue.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ]) - - let of_json j = - { vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; enable_dns_support = - Util.option_map (Json.lookup j "enable_dns_support") AttributeBooleanValue.of_json - ; enable_dns_hostnames = - Util.option_map - (Json.lookup j "enable_dns_hostnames") - AttributeBooleanValue.of_json - } -end - -module DescribeNetworkInterfaceAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_id : String.t - ; attribute : NetworkInterfaceAttribute.t option - } - - let make ?dry_run ~network_interface_id ?attribute () = - { dry_run; network_interface_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; attribute = - Util.option_bind (Xml.member "attribute" xml) NetworkInterfaceAttribute.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> - Query.Pair ("Attribute", NetworkInterfaceAttribute.to_query f)) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute (fun f -> - "attribute", NetworkInterfaceAttribute.to_json f) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; attribute = - Util.option_map (Json.lookup j "attribute") NetworkInterfaceAttribute.of_json - } -end - -module PurchaseReservedInstancesOfferingRequest = struct - type t = - { dry_run : Boolean.t option - ; reserved_instances_offering_id : String.t - ; instance_count : Integer.t - ; limit_price : ReservedInstanceLimitPrice.t option - } - - let make ?dry_run ~reserved_instances_offering_id ~instance_count ?limit_price () = - { dry_run; reserved_instances_offering_id; instance_count; limit_price } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; reserved_instances_offering_id = - Xml.required - "ReservedInstancesOfferingId" - (Util.option_bind (Xml.member "ReservedInstancesOfferingId" xml) String.parse) - ; instance_count = - Xml.required - "InstanceCount" - (Util.option_bind (Xml.member "InstanceCount" xml) Integer.parse) - ; limit_price = - Util.option_bind (Xml.member "limitPrice" xml) ReservedInstanceLimitPrice.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.limit_price (fun f -> - Query.Pair ("LimitPrice", ReservedInstanceLimitPrice.to_query f)) - ; Some (Query.Pair ("InstanceCount", Integer.to_query v.instance_count)) - ; Some + ("SecurityGroupId", + (SecurityGroupIdStringList.to_query v.groups))); + Util.option_map v.private_ip_address + (fun f -> Query.Pair ("PrivateIpAddress", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("SubnetId", (String.to_query v.subnet_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f))); + Util.option_map v.secondary_private_ip_address_count + (fun f -> + ("secondary_private_ip_address_count", (Integer.to_json f))); + Some + ("private_ip_addresses", + (PrivateIpAddressSpecificationList.to_json + v.private_ip_addresses)); + Some ("groups", (SecurityGroupIdStringList.to_json v.groups)); + Util.option_map v.private_ip_address + (fun f -> ("private_ip_address", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("subnet_id", (String.to_json v.subnet_id))]) + let of_json j = + { + subnet_id = + (String.of_json (Util.of_option_exn (Json.lookup j "subnet_id"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + private_ip_address = + (Util.option_map (Json.lookup j "private_ip_address") + String.of_json); + groups = + (SecurityGroupIdStringList.of_json + (Util.of_option_exn (Json.lookup j "groups"))); + private_ip_addresses = + (PrivateIpAddressSpecificationList.of_json + (Util.of_option_exn (Json.lookup j "private_ip_addresses"))); + secondary_private_ip_address_count = + (Util.option_map + (Json.lookup j "secondary_private_ip_address_count") + Integer.of_json); + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json) + } + end +module GetPasswordDataRequest = + struct + type t = { + dry_run: Boolean.t option ; + instance_id: String.t } + let make ?dry_run ~instance_id () = { dry_run; instance_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) + } + end +module DeregisterImageRequest = + struct + type t = { + dry_run: Boolean.t option ; + image_id: String.t } + let make ?dry_run ~image_id () = { dry_run; image_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))) + } + end +module BundleInstanceRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_id: String.t ; + storage: Storage.t } + let make ?dry_run ~instance_id ~storage () = + { dry_run; instance_id; storage } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + storage = + (Xml.required "Storage" + (Util.option_bind (Xml.member "Storage" xml) Storage.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Storage", (Storage.to_query v.storage))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("storage", (Storage.to_json v.storage)); + Some ("instance_id", (String.to_json v.instance_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + storage = + (Storage.of_json (Util.of_option_exn (Json.lookup j "storage"))) + } + end +module RebootInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t } + let make ?dry_run ~instance_ids () = { dry_run; instance_ids } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))) + } + end +module ReplaceRouteTableAssociationRequest = + struct + type t = + { + dry_run: Boolean.t option ; + association_id: String.t ; + route_table_id: String.t } + let make ?dry_run ~association_id ~route_table_id () = + { dry_run; association_id; route_table_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + association_id = + (Xml.required "associationId" + (Util.option_bind (Xml.member "associationId" xml) + String.parse)); + route_table_id = + (Xml.required "routeTableId" + (Util.option_bind (Xml.member "routeTableId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RouteTableId", (String.to_query v.route_table_id))); + Some (Query.Pair - ( "ReservedInstancesOfferingId" - , String.to_query v.reserved_instances_offering_id )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.limit_price (fun f -> - "limit_price", ReservedInstanceLimitPrice.to_json f) - ; Some ("instance_count", Integer.to_json v.instance_count) - ; Some - ( "reserved_instances_offering_id" - , String.to_json v.reserved_instances_offering_id ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; reserved_instances_offering_id = - String.of_json - (Util.of_option_exn (Json.lookup j "reserved_instances_offering_id")) - ; instance_count = - Integer.of_json (Util.of_option_exn (Json.lookup j "instance_count")) - ; limit_price = - Util.option_map (Json.lookup j "limit_price") ReservedInstanceLimitPrice.of_json - } -end - -module CreateVpcEndpointResult = struct - type t = - { vpc_endpoint : VpcEndpoint.t option - ; client_token : String.t option - } - - let make ?vpc_endpoint ?client_token () = { vpc_endpoint; client_token } - - let parse xml = - Some - { vpc_endpoint = Util.option_bind (Xml.member "vpcEndpoint" xml) VpcEndpoint.parse - ; client_token = Util.option_bind (Xml.member "clientToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> - Query.Pair ("ClientToken", String.to_query f)) - ; Util.option_map v.vpc_endpoint (fun f -> - Query.Pair ("VpcEndpoint", VpcEndpoint.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.client_token (fun f -> "client_token", String.to_json f) - ; Util.option_map v.vpc_endpoint (fun f -> "vpc_endpoint", VpcEndpoint.to_json f) - ]) - - let of_json j = - { vpc_endpoint = Util.option_map (Json.lookup j "vpc_endpoint") VpcEndpoint.of_json - ; client_token = Util.option_map (Json.lookup j "client_token") String.of_json - } -end - -module DescribeMovingAddressesRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ips : ValueStringList.t - ; next_token : String.t option - ; filters : FilterList.t - ; max_results : Integer.t option - } - - let make ?dry_run ?(public_ips = []) ?next_token ?(filters = []) ?max_results () = - { dry_run; public_ips; next_token; filters; max_results } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ips = - Util.of_option - [] - (Util.option_bind (Xml.member "publicIp" xml) ValueStringList.parse) - ; next_token = Util.option_bind (Xml.member "nextToken" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "filter" xml) FilterList.parse) - ; max_results = Util.option_bind (Xml.member "maxResults" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some (Query.Pair ("Filter", FilterList.to_query v.filters)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("PublicIp", ValueStringList.to_query v.public_ips)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("public_ips", ValueStringList.to_json v.public_ips) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ips = - ValueStringList.of_json (Util.of_option_exn (Json.lookup j "public_ips")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - } -end - -module MoveAddressToVpcRequest = struct - type t = - { dry_run : Boolean.t option - ; public_ip : String.t - } - - let make ?dry_run ~public_ip () = { dry_run; public_ip } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; public_ip = - Xml.required - "publicIp" - (Util.option_bind (Xml.member "publicIp" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PublicIp", String.to_query v.public_ip)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("public_ip", String.to_json v.public_ip) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; public_ip = String.of_json (Util.of_option_exn (Json.lookup j "public_ip")) - } -end - -module ResetImageAttributeRequest = struct - type t = - { dry_run : Boolean.t option - ; image_id : String.t - ; attribute : ResetImageAttributeName.t - } - - let make ?dry_run ~image_id ~attribute () = { dry_run; image_id; attribute } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; image_id = - Xml.required - "ImageId" - (Util.option_bind (Xml.member "ImageId" xml) String.parse) - ; attribute = - Xml.required - "Attribute" - (Util.option_bind (Xml.member "Attribute" xml) ResetImageAttributeName.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", ResetImageAttributeName.to_query v.attribute)) - ; Some (Query.Pair ("ImageId", String.to_query v.image_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute", ResetImageAttributeName.to_json v.attribute) - ; Some ("image_id", String.to_json v.image_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; image_id = String.of_json (Util.of_option_exn (Json.lookup j "image_id")) - ; attribute = - ResetImageAttributeName.of_json (Util.of_option_exn (Json.lookup j "attribute")) - } -end - -module CopySnapshotRequest = struct - type t = - { dry_run : Boolean.t option - ; source_region : String.t - ; source_snapshot_id : String.t - ; description : String.t option - ; destination_region : String.t option - ; presigned_url : String.t option - ; encrypted : Boolean.t option - ; kms_key_id : String.t option - } - - let make - ?dry_run - ~source_region - ~source_snapshot_id - ?description - ?destination_region - ?presigned_url - ?encrypted - ?kms_key_id - () = - { dry_run - ; source_region - ; source_snapshot_id - ; description - ; destination_region - ; presigned_url - ; encrypted - ; kms_key_id - } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; source_region = - Xml.required - "SourceRegion" - (Util.option_bind (Xml.member "SourceRegion" xml) String.parse) - ; source_snapshot_id = - Xml.required - "SourceSnapshotId" - (Util.option_bind (Xml.member "SourceSnapshotId" xml) String.parse) - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; destination_region = - Util.option_bind (Xml.member "destinationRegion" xml) String.parse - ; presigned_url = Util.option_bind (Xml.member "presignedUrl" xml) String.parse - ; encrypted = Util.option_bind (Xml.member "encrypted" xml) Boolean.parse - ; kms_key_id = Util.option_bind (Xml.member "kmsKeyId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Util.option_map v.encrypted (fun f -> - Query.Pair ("Encrypted", Boolean.to_query f)) - ; Util.option_map v.presigned_url (fun f -> - Query.Pair ("PresignedUrl", String.to_query f)) - ; Util.option_map v.destination_region (fun f -> - Query.Pair ("DestinationRegion", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Some (Query.Pair ("SourceSnapshotId", String.to_query v.source_snapshot_id)) - ; Some (Query.Pair ("SourceRegion", String.to_query v.source_region)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Util.option_map v.encrypted (fun f -> "encrypted", Boolean.to_json f) - ; Util.option_map v.presigned_url (fun f -> "presigned_url", String.to_json f) - ; Util.option_map v.destination_region (fun f -> - "destination_region", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Some ("source_snapshot_id", String.to_json v.source_snapshot_id) - ; Some ("source_region", String.to_json v.source_region) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; source_region = String.of_json (Util.of_option_exn (Json.lookup j "source_region")) - ; source_snapshot_id = - String.of_json (Util.of_option_exn (Json.lookup j "source_snapshot_id")) - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; destination_region = - Util.option_map (Json.lookup j "destination_region") String.of_json - ; presigned_url = Util.option_map (Json.lookup j "presigned_url") String.of_json - ; encrypted = Util.option_map (Json.lookup j "encrypted") Boolean.of_json - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - } -end - -module CreateDhcpOptionsRequest = struct - type t = - { dry_run : Boolean.t option - ; dhcp_configurations : NewDhcpConfigurationList.t - } - - let make ?dry_run ~dhcp_configurations () = { dry_run; dhcp_configurations } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; dhcp_configurations = - Xml.required - "dhcpConfiguration" - (Util.option_bind - (Xml.member "dhcpConfiguration" xml) - NewDhcpConfigurationList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AssociationId", (String.to_query v.association_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("route_table_id", (String.to_json v.route_table_id)); + Some ("association_id", (String.to_json v.association_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + association_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "association_id"))); + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))) + } + end +module DescribeClassicLinkInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ?(instance_ids= []) ?(filters= []) ?next_token + ?max_results () = + { dry_run; instance_ids; filters; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module CreateInternetGatewayResult = + struct + type t = { + internet_gateway: InternetGateway.t option } + let make ?internet_gateway () = { internet_gateway } + let parse xml = + Some + { + internet_gateway = + (Util.option_bind (Xml.member "internetGateway" xml) + InternetGateway.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.internet_gateway + (fun f -> + Query.Pair ("InternetGateway", (InternetGateway.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.internet_gateway + (fun f -> ("internet_gateway", (InternetGateway.to_json f)))]) + let of_json j = + { + internet_gateway = + (Util.option_map (Json.lookup j "internet_gateway") + InternetGateway.of_json) + } + end +module ImportInstanceRequest = + struct + type t = + { + dry_run: Boolean.t option ; + description: String.t option ; + launch_specification: ImportInstanceLaunchSpecification.t option ; + disk_images: DiskImageList.t ; + platform: PlatformValues.t } + let make ?dry_run ?description ?launch_specification ?(disk_images= + []) ~platform () = + { dry_run; description; launch_specification; disk_images; platform } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + launch_specification = + (Util.option_bind (Xml.member "launchSpecification" xml) + ImportInstanceLaunchSpecification.parse); + disk_images = + (Util.of_option [] + (Util.option_bind (Xml.member "diskImage" xml) + DiskImageList.parse)); + platform = + (Xml.required "platform" + (Util.option_bind (Xml.member "platform" xml) + PlatformValues.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Platform", (PlatformValues.to_query v.platform))); + Some + (Query.Pair + ("DiskImage", (DiskImageList.to_query v.disk_images))); + Util.option_map v.launch_specification + (fun f -> + Query.Pair + ("LaunchSpecification", + (ImportInstanceLaunchSpecification.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("platform", (PlatformValues.to_json v.platform)); + Some ("disk_images", (DiskImageList.to_json v.disk_images)); + Util.option_map v.launch_specification + (fun f -> + ("launch_specification", + (ImportInstanceLaunchSpecification.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + launch_specification = + (Util.option_map (Json.lookup j "launch_specification") + ImportInstanceLaunchSpecification.of_json); + disk_images = + (DiskImageList.of_json + (Util.of_option_exn (Json.lookup j "disk_images"))); + platform = + (PlatformValues.of_json + (Util.of_option_exn (Json.lookup j "platform"))) + } + end +module ImportVolumeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + availability_zone: String.t ; + image: DiskImageDetail.t ; + description: String.t option ; + volume: VolumeDetail.t } + let make ?dry_run ~availability_zone ~image ?description ~volume () + = { dry_run; availability_zone; image; description; volume } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + availability_zone = + (Xml.required "availabilityZone" + (Util.option_bind (Xml.member "availabilityZone" xml) + String.parse)); + image = + (Xml.required "image" + (Util.option_bind (Xml.member "image" xml) + DiskImageDetail.parse)); + description = + (Util.option_bind (Xml.member "description" xml) String.parse); + volume = + (Xml.required "volume" + (Util.option_bind (Xml.member "volume" xml) VolumeDetail.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Volume", (VolumeDetail.to_query v.volume))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some (Query.Pair ("Image", (DiskImageDetail.to_query v.image))); + Some + (Query.Pair + ("AvailabilityZone", (String.to_query v.availability_zone))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("volume", (VolumeDetail.to_json v.volume)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("image", (DiskImageDetail.to_json v.image)); + Some ("availability_zone", (String.to_json v.availability_zone)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + availability_zone = + (String.of_json + (Util.of_option_exn (Json.lookup j "availability_zone"))); + image = + (DiskImageDetail.of_json + (Util.of_option_exn (Json.lookup j "image"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + volume = + (VolumeDetail.of_json (Util.of_option_exn (Json.lookup j "volume"))) + } + end +module DescribeInstanceStatusRequest = + struct + type t = + { + dry_run: Boolean.t option ; + instance_ids: InstanceIdStringList.t ; + filters: FilterList.t ; + next_token: String.t option ; + max_results: Integer.t option ; + include_all_instances: Boolean.t option } + let make ?dry_run ?(instance_ids= []) ?(filters= []) ?next_token + ?max_results ?include_all_instances () = + { + dry_run; + instance_ids; + filters; + next_token; + max_results; + include_all_instances + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + instance_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceId" xml) + InstanceIdStringList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filter" xml) FilterList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + include_all_instances = + (Util.option_bind (Xml.member "includeAllInstances" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.include_all_instances + (fun f -> + Query.Pair ("IncludeAllInstances", (Boolean.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("InstanceId", + (InstanceIdStringList.to_query v.instance_ids))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.include_all_instances + (fun f -> ("include_all_instances", (Boolean.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("instance_ids", (InstanceIdStringList.to_json v.instance_ids)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + instance_ids = + (InstanceIdStringList.of_json + (Util.of_option_exn (Json.lookup j "instance_ids"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + include_all_instances = + (Util.option_map (Json.lookup j "include_all_instances") + Boolean.of_json) + } + end +module CancelImportTaskRequest = + struct + type t = + { + dry_run: Boolean.t option ; + import_task_id: String.t option ; + cancel_reason: String.t option } + let make ?dry_run ?import_task_id ?cancel_reason () = + { dry_run; import_task_id; cancel_reason } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + import_task_id = + (Util.option_bind (Xml.member "ImportTaskId" xml) String.parse); + cancel_reason = + (Util.option_bind (Xml.member "CancelReason" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cancel_reason + (fun f -> Query.Pair ("CancelReason", (String.to_query f))); + Util.option_map v.import_task_id + (fun f -> Query.Pair ("ImportTaskId", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cancel_reason + (fun f -> ("cancel_reason", (String.to_json f))); + Util.option_map v.import_task_id + (fun f -> ("import_task_id", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + import_task_id = + (Util.option_map (Json.lookup j "import_task_id") String.of_json); + cancel_reason = + (Util.option_map (Json.lookup j "cancel_reason") String.of_json) + } + end +module DescribeVpcEndpointsResult = + struct + type t = { + vpc_endpoints: VpcEndpointSet.t ; + next_token: String.t option } + let make ?(vpc_endpoints= []) ?next_token () = + { vpc_endpoints; next_token } + let parse xml = + Some + { + vpc_endpoints = + (Util.of_option [] + (Util.option_bind (Xml.member "vpcEndpointSet" xml) + VpcEndpointSet.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("VpcEndpointSet", (VpcEndpointSet.to_query v.vpc_endpoints)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("vpc_endpoints", (VpcEndpointSet.to_json v.vpc_endpoints))]) + let of_json j = + { + vpc_endpoints = + (VpcEndpointSet.of_json + (Util.of_option_exn (Json.lookup j "vpc_endpoints"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module ImportImageRequest = + struct + type t = + { + dry_run: Boolean.t option ; + description: String.t option ; + disk_containers: ImageDiskContainerList.t ; + license_type: String.t option ; + hypervisor: String.t option ; + architecture: String.t option ; + platform: String.t option ; + client_data: ClientData.t option ; + client_token: String.t option ; + role_name: String.t option } + let make ?dry_run ?description ?(disk_containers= []) ?license_type + ?hypervisor ?architecture ?platform ?client_data ?client_token + ?role_name () = + { + dry_run; + description; + disk_containers; + license_type; + hypervisor; + architecture; + platform; + client_data; + client_token; + role_name + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "DryRun" xml) Boolean.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + disk_containers = + (Util.of_option [] + (Util.option_bind (Xml.member "DiskContainer" xml) + ImageDiskContainerList.parse)); + license_type = + (Util.option_bind (Xml.member "LicenseType" xml) String.parse); + hypervisor = + (Util.option_bind (Xml.member "Hypervisor" xml) String.parse); + architecture = + (Util.option_bind (Xml.member "Architecture" xml) String.parse); + platform = + (Util.option_bind (Xml.member "Platform" xml) String.parse); + client_data = + (Util.option_bind (Xml.member "ClientData" xml) ClientData.parse); + client_token = + (Util.option_bind (Xml.member "ClientToken" xml) String.parse); + role_name = + (Util.option_bind (Xml.member "RoleName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.role_name + (fun f -> Query.Pair ("RoleName", (String.to_query f))); + Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.client_data + (fun f -> Query.Pair ("ClientData", (ClientData.to_query f))); + Util.option_map v.platform + (fun f -> Query.Pair ("Platform", (String.to_query f))); + Util.option_map v.architecture + (fun f -> Query.Pair ("Architecture", (String.to_query f))); + Util.option_map v.hypervisor + (fun f -> Query.Pair ("Hypervisor", (String.to_query f))); + Util.option_map v.license_type + (fun f -> Query.Pair ("LicenseType", (String.to_query f))); + Some + (Query.Pair + ("DiskContainer", + (ImageDiskContainerList.to_query v.disk_containers))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.role_name + (fun f -> ("role_name", (String.to_json f))); + Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.client_data + (fun f -> ("client_data", (ClientData.to_json f))); + Util.option_map v.platform + (fun f -> ("platform", (String.to_json f))); + Util.option_map v.architecture + (fun f -> ("architecture", (String.to_json f))); + Util.option_map v.hypervisor + (fun f -> ("hypervisor", (String.to_json f))); + Util.option_map v.license_type + (fun f -> ("license_type", (String.to_json f))); + Some + ("disk_containers", + (ImageDiskContainerList.to_json v.disk_containers)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + disk_containers = + (ImageDiskContainerList.of_json + (Util.of_option_exn (Json.lookup j "disk_containers"))); + license_type = + (Util.option_map (Json.lookup j "license_type") String.of_json); + hypervisor = + (Util.option_map (Json.lookup j "hypervisor") String.of_json); + architecture = + (Util.option_map (Json.lookup j "architecture") String.of_json); + platform = + (Util.option_map (Json.lookup j "platform") String.of_json); + client_data = + (Util.option_map (Json.lookup j "client_data") ClientData.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json); + role_name = + (Util.option_map (Json.lookup j "role_name") String.of_json) + } + end +module DescribeClassicLinkInstancesResult = + struct + type t = + { + instances: ClassicLinkInstanceList.t ; + next_token: String.t option } + let make ?(instances= []) ?next_token () = { instances; next_token } + let parse xml = + Some + { + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + ClassicLinkInstanceList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("InstancesSet", + (ClassicLinkInstanceList.to_query v.instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("instances", (ClassicLinkInstanceList.to_json v.instances))]) + let of_json j = + { + instances = + (ClassicLinkInstanceList.of_json + (Util.of_option_exn (Json.lookup j "instances"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module DescribeSpotFleetInstancesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + spot_fleet_request_id: String.t ; + next_token: String.t option ; + max_results: Integer.t option } + let make ?dry_run ~spot_fleet_request_id ?next_token ?max_results () + = { dry_run; spot_fleet_request_id; next_token; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + spot_fleet_request_id = + (Xml.required "spotFleetRequestId" + (Util.option_bind (Xml.member "spotFleetRequestId" xml) + String.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("SpotFleetRequestId", + (String.to_query v.spot_fleet_request_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("spot_fleet_request_id", + (String.to_json v.spot_fleet_request_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + spot_fleet_request_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "spot_fleet_request_id"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module DetachVpnGatewayRequest = + struct + type t = + { + dry_run: Boolean.t option ; + vpn_gateway_id: String.t ; + vpc_id: String.t } + let make ?dry_run ~vpn_gateway_id ~vpc_id () = + { dry_run; vpn_gateway_id; vpc_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + vpn_gateway_id = + (Xml.required "VpnGatewayId" + (Util.option_bind (Xml.member "VpnGatewayId" xml) String.parse)); + vpc_id = + (Xml.required "VpcId" + (Util.option_bind (Xml.member "VpcId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VpcId", (String.to_query v.vpc_id))); + Some + (Query.Pair ("VpnGatewayId", (String.to_query v.vpn_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("vpc_id", (String.to_json v.vpc_id)); + Some ("vpn_gateway_id", (String.to_json v.vpn_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + vpn_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "vpn_gateway_id"))); + vpc_id = + (String.of_json (Util.of_option_exn (Json.lookup j "vpc_id"))) + } + end +module MonitorInstancesResult = + struct + type t = { + instance_monitorings: InstanceMonitoringList.t } + let make ?(instance_monitorings= []) () = { instance_monitorings } + let parse xml = + Some + { + instance_monitorings = + (Util.of_option [] + (Util.option_bind (Xml.member "instancesSet" xml) + InstanceMonitoringList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstancesSet", + (InstanceMonitoringList.to_query v.instance_monitorings)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_monitorings", + (InstanceMonitoringList.to_json v.instance_monitorings))]) + let of_json j = + { + instance_monitorings = + (InstanceMonitoringList.of_json + (Util.of_option_exn (Json.lookup j "instance_monitorings"))) + } + end +module AuthorizeSecurityGroupIngressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_name: String.t option ; + group_id: String.t option ; + source_security_group_name: String.t option ; + source_security_group_owner_id: String.t option ; + ip_protocol: String.t option ; + from_port: Integer.t option ; + to_port: Integer.t option ; + cidr_ip: String.t option ; + ip_permissions: IpPermissionList.t } + let make ?dry_run ?group_name ?group_id ?source_security_group_name + ?source_security_group_owner_id ?ip_protocol ?from_port ?to_port + ?cidr_ip ?(ip_permissions= []) () = + { + dry_run; + group_name; + group_id; + source_security_group_name; + source_security_group_owner_id; + ip_protocol; + from_port; + to_port; + cidr_ip; + ip_permissions + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Util.option_bind (Xml.member "GroupName" xml) String.parse); + group_id = + (Util.option_bind (Xml.member "GroupId" xml) String.parse); + source_security_group_name = + (Util.option_bind (Xml.member "SourceSecurityGroupName" xml) + String.parse); + source_security_group_owner_id = + (Util.option_bind (Xml.member "SourceSecurityGroupOwnerId" xml) + String.parse); + ip_protocol = + (Util.option_bind (Xml.member "IpProtocol" xml) String.parse); + from_port = + (Util.option_bind (Xml.member "FromPort" xml) Integer.parse); + to_port = + (Util.option_bind (Xml.member "ToPort" xml) Integer.parse); + cidr_ip = (Util.option_bind (Xml.member "CidrIp" xml) String.parse); + ip_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "IpPermissions" xml) + IpPermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("IpPermissions", + (IpPermissionList.to_query v.ip_permissions))); + Util.option_map v.cidr_ip + (fun f -> Query.Pair ("CidrIp", (String.to_query f))); + Util.option_map v.to_port + (fun f -> Query.Pair ("ToPort", (Integer.to_query f))); + Util.option_map v.from_port + (fun f -> Query.Pair ("FromPort", (Integer.to_query f))); + Util.option_map v.ip_protocol + (fun f -> Query.Pair ("IpProtocol", (String.to_query f))); + Util.option_map v.source_security_group_owner_id + (fun f -> + Query.Pair + ("SourceSecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.source_security_group_name + (fun f -> + Query.Pair ("SourceSecurityGroupName", (String.to_query f))); + Util.option_map v.group_id + (fun f -> Query.Pair ("GroupId", (String.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("ip_permissions", (IpPermissionList.to_json v.ip_permissions)); + Util.option_map v.cidr_ip + (fun f -> ("cidr_ip", (String.to_json f))); + Util.option_map v.to_port + (fun f -> ("to_port", (Integer.to_json f))); + Util.option_map v.from_port + (fun f -> ("from_port", (Integer.to_json f))); + Util.option_map v.ip_protocol + (fun f -> ("ip_protocol", (String.to_json f))); + Util.option_map v.source_security_group_owner_id + (fun f -> ("source_security_group_owner_id", (String.to_json f))); + Util.option_map v.source_security_group_name + (fun f -> ("source_security_group_name", (String.to_json f))); + Util.option_map v.group_id + (fun f -> ("group_id", (String.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + group_id = + (Util.option_map (Json.lookup j "group_id") String.of_json); + source_security_group_name = + (Util.option_map (Json.lookup j "source_security_group_name") + String.of_json); + source_security_group_owner_id = + (Util.option_map (Json.lookup j "source_security_group_owner_id") + String.of_json); + ip_protocol = + (Util.option_map (Json.lookup j "ip_protocol") String.of_json); + from_port = + (Util.option_map (Json.lookup j "from_port") Integer.of_json); + to_port = (Util.option_map (Json.lookup j "to_port") Integer.of_json); + cidr_ip = (Util.option_map (Json.lookup j "cidr_ip") String.of_json); + ip_permissions = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions"))) + } + end +module CreateInternetGatewayRequest = + struct + type t = { + dry_run: Boolean.t option } + let make ?dry_run () = { dry_run } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json) + } + end +module DescribeImageAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_id: String.t ; + attribute: ImageAttributeName.t } + let make ?dry_run ~image_id ~attribute () = + { dry_run; image_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)); + attribute = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + ImageAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", (ImageAttributeName.to_query v.attribute))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (ImageAttributeName.to_json v.attribute)); + Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + attribute = + (ImageAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module DeleteCustomerGatewayRequest = + struct + type t = { + dry_run: Boolean.t option ; + customer_gateway_id: String.t } + let make ?dry_run ~customer_gateway_id () = + { dry_run; customer_gateway_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + customer_gateway_id = + (Xml.required "CustomerGatewayId" + (Util.option_bind (Xml.member "CustomerGatewayId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CustomerGatewayId", + (String.to_query v.customer_gateway_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("customer_gateway_id", (String.to_json v.customer_gateway_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + customer_gateway_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "customer_gateway_id"))) + } + end +module DescribeSnapshotsResult = + struct + type t = { + snapshots: SnapshotList.t ; + next_token: String.t option } + let make ?(snapshots= []) ?next_token () = { snapshots; next_token } + let parse xml = + Some + { + snapshots = + (Util.of_option [] + (Util.option_bind (Xml.member "snapshotSet" xml) + SnapshotList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair ("SnapshotSet", (SnapshotList.to_query v.snapshots)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("snapshots", (SnapshotList.to_json v.snapshots))]) + let of_json j = + { + snapshots = + (SnapshotList.of_json + (Util.of_option_exn (Json.lookup j "snapshots"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) + } + end +module EnableVolumeIORequest = + struct + type t = { + dry_run: Boolean.t option ; + volume_id: String.t } + let make ?dry_run ~volume_id () = { dry_run; volume_id } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + volume_id = + (Xml.required "volumeId" + (Util.option_bind (Xml.member "volumeId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VolumeId", (String.to_query v.volume_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("volume_id", (String.to_json v.volume_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + volume_id = + (String.of_json (Util.of_option_exn (Json.lookup j "volume_id"))) + } + end +module RevokeSecurityGroupIngressRequest = + struct + type t = + { + dry_run: Boolean.t option ; + group_name: String.t option ; + group_id: String.t option ; + source_security_group_name: String.t option ; + source_security_group_owner_id: String.t option ; + ip_protocol: String.t option ; + from_port: Integer.t option ; + to_port: Integer.t option ; + cidr_ip: String.t option ; + ip_permissions: IpPermissionList.t } + let make ?dry_run ?group_name ?group_id ?source_security_group_name + ?source_security_group_owner_id ?ip_protocol ?from_port ?to_port + ?cidr_ip ?(ip_permissions= []) () = + { + dry_run; + group_name; + group_id; + source_security_group_name; + source_security_group_owner_id; + ip_protocol; + from_port; + to_port; + cidr_ip; + ip_permissions + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + group_name = + (Util.option_bind (Xml.member "GroupName" xml) String.parse); + group_id = + (Util.option_bind (Xml.member "GroupId" xml) String.parse); + source_security_group_name = + (Util.option_bind (Xml.member "SourceSecurityGroupName" xml) + String.parse); + source_security_group_owner_id = + (Util.option_bind (Xml.member "SourceSecurityGroupOwnerId" xml) + String.parse); + ip_protocol = + (Util.option_bind (Xml.member "IpProtocol" xml) String.parse); + from_port = + (Util.option_bind (Xml.member "FromPort" xml) Integer.parse); + to_port = + (Util.option_bind (Xml.member "ToPort" xml) Integer.parse); + cidr_ip = (Util.option_bind (Xml.member "CidrIp" xml) String.parse); + ip_permissions = + (Util.of_option [] + (Util.option_bind (Xml.member "IpPermissions" xml) + IpPermissionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("IpPermissions", + (IpPermissionList.to_query v.ip_permissions))); + Util.option_map v.cidr_ip + (fun f -> Query.Pair ("CidrIp", (String.to_query f))); + Util.option_map v.to_port + (fun f -> Query.Pair ("ToPort", (Integer.to_query f))); + Util.option_map v.from_port + (fun f -> Query.Pair ("FromPort", (Integer.to_query f))); + Util.option_map v.ip_protocol + (fun f -> Query.Pair ("IpProtocol", (String.to_query f))); + Util.option_map v.source_security_group_owner_id + (fun f -> + Query.Pair + ("SourceSecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.source_security_group_name + (fun f -> + Query.Pair ("SourceSecurityGroupName", (String.to_query f))); + Util.option_map v.group_id + (fun f -> Query.Pair ("GroupId", (String.to_query f))); + Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("ip_permissions", (IpPermissionList.to_json v.ip_permissions)); + Util.option_map v.cidr_ip + (fun f -> ("cidr_ip", (String.to_json f))); + Util.option_map v.to_port + (fun f -> ("to_port", (Integer.to_json f))); + Util.option_map v.from_port + (fun f -> ("from_port", (Integer.to_json f))); + Util.option_map v.ip_protocol + (fun f -> ("ip_protocol", (String.to_json f))); + Util.option_map v.source_security_group_owner_id + (fun f -> ("source_security_group_owner_id", (String.to_json f))); + Util.option_map v.source_security_group_name + (fun f -> ("source_security_group_name", (String.to_json f))); + Util.option_map v.group_id + (fun f -> ("group_id", (String.to_json f))); + Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json); + group_id = + (Util.option_map (Json.lookup j "group_id") String.of_json); + source_security_group_name = + (Util.option_map (Json.lookup j "source_security_group_name") + String.of_json); + source_security_group_owner_id = + (Util.option_map (Json.lookup j "source_security_group_owner_id") + String.of_json); + ip_protocol = + (Util.option_map (Json.lookup j "ip_protocol") String.of_json); + from_port = + (Util.option_map (Json.lookup j "from_port") Integer.of_json); + to_port = (Util.option_map (Json.lookup j "to_port") Integer.of_json); + cidr_ip = (Util.option_map (Json.lookup j "cidr_ip") String.of_json); + ip_permissions = + (IpPermissionList.of_json + (Util.of_option_exn (Json.lookup j "ip_permissions"))) + } + end +module DisableVgwRoutePropagationRequest = + struct + type t = { + route_table_id: String.t ; + gateway_id: String.t } + let make ~route_table_id ~gateway_id () = + { route_table_id; gateway_id } + let parse xml = + Some + { + route_table_id = + (Xml.required "RouteTableId" + (Util.option_bind (Xml.member "RouteTableId" xml) String.parse)); + gateway_id = + (Xml.required "GatewayId" + (Util.option_bind (Xml.member "GatewayId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("GatewayId", (String.to_query v.gateway_id))); + Some + (Query.Pair ("RouteTableId", (String.to_query v.route_table_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("gateway_id", (String.to_json v.gateway_id)); + Some ("route_table_id", (String.to_json v.route_table_id))]) + let of_json j = + { + route_table_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "route_table_id"))); + gateway_id = + (String.of_json (Util.of_option_exn (Json.lookup j "gateway_id"))) + } + end +module DescribeVpcAttributeResult = + struct + type t = + { + vpc_id: String.t option ; + enable_dns_support: AttributeBooleanValue.t option ; + enable_dns_hostnames: AttributeBooleanValue.t option } + let make ?vpc_id ?enable_dns_support ?enable_dns_hostnames () = + { vpc_id; enable_dns_support; enable_dns_hostnames } + let parse xml = + Some + { + vpc_id = (Util.option_bind (Xml.member "vpcId" xml) String.parse); + enable_dns_support = + (Util.option_bind (Xml.member "enableDnsSupport" xml) + AttributeBooleanValue.parse); + enable_dns_hostnames = + (Util.option_bind (Xml.member "enableDnsHostnames" xml) + AttributeBooleanValue.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enable_dns_hostnames + (fun f -> + Query.Pair + ("EnableDnsHostnames", (AttributeBooleanValue.to_query f))); + Util.option_map v.enable_dns_support + (fun f -> + Query.Pair + ("EnableDnsSupport", (AttributeBooleanValue.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enable_dns_hostnames + (fun f -> + ("enable_dns_hostnames", (AttributeBooleanValue.to_json f))); + Util.option_map v.enable_dns_support + (fun f -> + ("enable_dns_support", (AttributeBooleanValue.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f)))]) + let of_json j = + { + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + enable_dns_support = + (Util.option_map (Json.lookup j "enable_dns_support") + AttributeBooleanValue.of_json); + enable_dns_hostnames = + (Util.option_map (Json.lookup j "enable_dns_hostnames") + AttributeBooleanValue.of_json) + } + end +module DescribeNetworkInterfaceAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_interface_id: String.t ; + attribute: NetworkInterfaceAttribute.t option } + let make ?dry_run ~network_interface_id ?attribute () = + { dry_run; network_interface_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + attribute = + (Util.option_bind (Xml.member "attribute" xml) + NetworkInterfaceAttribute.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> + Query.Pair + ("Attribute", (NetworkInterfaceAttribute.to_query f))); + Some + (Query.Pair + ("NetworkInterfaceId", + (String.to_query v.network_interface_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute + (fun f -> ("attribute", (NetworkInterfaceAttribute.to_json f))); + Some + ("network_interface_id", + (String.to_json v.network_interface_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + attribute = + (Util.option_map (Json.lookup j "attribute") + NetworkInterfaceAttribute.of_json) + } + end +module PurchaseReservedInstancesOfferingRequest = + struct + type t = + { + dry_run: Boolean.t option ; + reserved_instances_offering_id: String.t ; + instance_count: Integer.t ; + limit_price: ReservedInstanceLimitPrice.t option } + let make ?dry_run ~reserved_instances_offering_id ~instance_count + ?limit_price () = + { dry_run; reserved_instances_offering_id; instance_count; limit_price + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + reserved_instances_offering_id = + (Xml.required "ReservedInstancesOfferingId" + (Util.option_bind + (Xml.member "ReservedInstancesOfferingId" xml) String.parse)); + instance_count = + (Xml.required "InstanceCount" + (Util.option_bind (Xml.member "InstanceCount" xml) + Integer.parse)); + limit_price = + (Util.option_bind (Xml.member "limitPrice" xml) + ReservedInstanceLimitPrice.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.limit_price + (fun f -> + Query.Pair + ("LimitPrice", (ReservedInstanceLimitPrice.to_query f))); + Some + (Query.Pair + ("InstanceCount", (Integer.to_query v.instance_count))); + Some + (Query.Pair + ("ReservedInstancesOfferingId", + (String.to_query v.reserved_instances_offering_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.limit_price + (fun f -> + ("limit_price", (ReservedInstanceLimitPrice.to_json f))); + Some ("instance_count", (Integer.to_json v.instance_count)); + Some + ("reserved_instances_offering_id", + (String.to_json v.reserved_instances_offering_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + reserved_instances_offering_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "reserved_instances_offering_id"))); + instance_count = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_count"))); + limit_price = + (Util.option_map (Json.lookup j "limit_price") + ReservedInstanceLimitPrice.of_json) + } + end +module CreateVpcEndpointResult = + struct + type t = + { + vpc_endpoint: VpcEndpoint.t option ; + client_token: String.t option } + let make ?vpc_endpoint ?client_token () = + { vpc_endpoint; client_token } + let parse xml = + Some + { + vpc_endpoint = + (Util.option_bind (Xml.member "vpcEndpoint" xml) + VpcEndpoint.parse); + client_token = + (Util.option_bind (Xml.member "clientToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> Query.Pair ("ClientToken", (String.to_query f))); + Util.option_map v.vpc_endpoint + (fun f -> Query.Pair ("VpcEndpoint", (VpcEndpoint.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.client_token + (fun f -> ("client_token", (String.to_json f))); + Util.option_map v.vpc_endpoint + (fun f -> ("vpc_endpoint", (VpcEndpoint.to_json f)))]) + let of_json j = + { + vpc_endpoint = + (Util.option_map (Json.lookup j "vpc_endpoint") VpcEndpoint.of_json); + client_token = + (Util.option_map (Json.lookup j "client_token") String.of_json) + } + end +module DescribeMovingAddressesRequest = + struct + type t = + { + dry_run: Boolean.t option ; + public_ips: ValueStringList.t ; + next_token: String.t option ; + filters: FilterList.t ; + max_results: Integer.t option } + let make ?dry_run ?(public_ips= []) ?next_token ?(filters= []) + ?max_results () = + { dry_run; public_ips; next_token; filters; max_results } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ips = + (Util.of_option [] + (Util.option_bind (Xml.member "publicIp" xml) + ValueStringList.parse)); + next_token = + (Util.option_bind (Xml.member "nextToken" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "filter" xml) FilterList.parse)); + max_results = + (Util.option_bind (Xml.member "maxResults" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair ("Filter", (FilterList.to_query v.filters))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("PublicIp", (ValueStringList.to_query v.public_ips))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("public_ips", (ValueStringList.to_json v.public_ips)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ips = + (ValueStringList.of_json + (Util.of_option_exn (Json.lookup j "public_ips"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json) + } + end +module MoveAddressToVpcRequest = + struct + type t = { + dry_run: Boolean.t option ; + public_ip: String.t } + let make ?dry_run ~public_ip () = { dry_run; public_ip } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + public_ip = + (Xml.required "publicIp" + (Util.option_bind (Xml.member "publicIp" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("PublicIp", (String.to_query v.public_ip))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("public_ip", (String.to_json v.public_ip)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + public_ip = + (String.of_json (Util.of_option_exn (Json.lookup j "public_ip"))) + } + end +module ResetImageAttributeRequest = + struct + type t = + { + dry_run: Boolean.t option ; + image_id: String.t ; + attribute: ResetImageAttributeName.t } + let make ?dry_run ~image_id ~attribute () = + { dry_run; image_id; attribute } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + image_id = + (Xml.required "ImageId" + (Util.option_bind (Xml.member "ImageId" xml) String.parse)); + attribute = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + ResetImageAttributeName.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attribute", + (ResetImageAttributeName.to_query v.attribute))); + Some (Query.Pair ("ImageId", (String.to_query v.image_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attribute", (ResetImageAttributeName.to_json v.attribute)); + Some ("image_id", (String.to_json v.image_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + image_id = + (String.of_json (Util.of_option_exn (Json.lookup j "image_id"))); + attribute = + (ResetImageAttributeName.of_json + (Util.of_option_exn (Json.lookup j "attribute"))) + } + end +module CopySnapshotRequest = + struct + type t = + { + dry_run: Boolean.t option ; + source_region: String.t ; + source_snapshot_id: String.t ; + description: String.t option ; + destination_region: String.t option ; + presigned_url: String.t option ; + encrypted: Boolean.t option ; + kms_key_id: String.t option } + let make ?dry_run ~source_region ~source_snapshot_id ?description + ?destination_region ?presigned_url ?encrypted ?kms_key_id () = + { + dry_run; + source_region; + source_snapshot_id; + description; + destination_region; + presigned_url; + encrypted; + kms_key_id + } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + source_region = + (Xml.required "SourceRegion" + (Util.option_bind (Xml.member "SourceRegion" xml) String.parse)); + source_snapshot_id = + (Xml.required "SourceSnapshotId" + (Util.option_bind (Xml.member "SourceSnapshotId" xml) + String.parse)); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + destination_region = + (Util.option_bind (Xml.member "destinationRegion" xml) + String.parse); + presigned_url = + (Util.option_bind (Xml.member "presignedUrl" xml) String.parse); + encrypted = + (Util.option_bind (Xml.member "encrypted" xml) Boolean.parse); + kms_key_id = + (Util.option_bind (Xml.member "kmsKeyId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Util.option_map v.encrypted + (fun f -> Query.Pair ("Encrypted", (Boolean.to_query f))); + Util.option_map v.presigned_url + (fun f -> Query.Pair ("PresignedUrl", (String.to_query f))); + Util.option_map v.destination_region + (fun f -> Query.Pair ("DestinationRegion", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Some + (Query.Pair + ("SourceSnapshotId", (String.to_query v.source_snapshot_id))); + Some + (Query.Pair ("SourceRegion", (String.to_query v.source_region))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Util.option_map v.encrypted + (fun f -> ("encrypted", (Boolean.to_json f))); + Util.option_map v.presigned_url + (fun f -> ("presigned_url", (String.to_json f))); + Util.option_map v.destination_region + (fun f -> ("destination_region", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Some ("source_snapshot_id", (String.to_json v.source_snapshot_id)); + Some ("source_region", (String.to_json v.source_region)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + source_region = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_region"))); + source_snapshot_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_snapshot_id"))); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + destination_region = + (Util.option_map (Json.lookup j "destination_region") + String.of_json); + presigned_url = + (Util.option_map (Json.lookup j "presigned_url") String.of_json); + encrypted = + (Util.option_map (Json.lookup j "encrypted") Boolean.of_json); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json) + } + end +module CreateDhcpOptionsRequest = + struct + type t = + { + dry_run: Boolean.t option ; + dhcp_configurations: NewDhcpConfigurationList.t } + let make ?dry_run ~dhcp_configurations () = + { dry_run; dhcp_configurations } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + dhcp_configurations = + (Xml.required "dhcpConfiguration" + (Util.option_bind (Xml.member "dhcpConfiguration" xml) + NewDhcpConfigurationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DhcpConfiguration", + (NewDhcpConfigurationList.to_query v.dhcp_configurations))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("dhcp_configurations", + (NewDhcpConfigurationList.to_json v.dhcp_configurations)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + dhcp_configurations = + (NewDhcpConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "dhcp_configurations"))) + } + end +module AttachNetworkInterfaceRequest = + struct + type t = + { + dry_run: Boolean.t option ; + network_interface_id: String.t ; + instance_id: String.t ; + device_index: Integer.t } + let make ?dry_run ~network_interface_id ~instance_id ~device_index () + = { dry_run; network_interface_id; instance_id; device_index } + let parse xml = + Some + { + dry_run = + (Util.option_bind (Xml.member "dryRun" xml) Boolean.parse); + network_interface_id = + (Xml.required "networkInterfaceId" + (Util.option_bind (Xml.member "networkInterfaceId" xml) + String.parse)); + instance_id = + (Xml.required "instanceId" + (Util.option_bind (Xml.member "instanceId" xml) String.parse)); + device_index = + (Xml.required "deviceIndex" + (Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("DeviceIndex", (Integer.to_query v.device_index))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair - ( "DhcpConfiguration" - , NewDhcpConfigurationList.to_query v.dhcp_configurations )) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "dhcp_configurations" - , NewDhcpConfigurationList.to_json v.dhcp_configurations ) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; dhcp_configurations = - NewDhcpConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "dhcp_configurations")) - } -end - -module AttachNetworkInterfaceRequest = struct - type t = - { dry_run : Boolean.t option - ; network_interface_id : String.t - ; instance_id : String.t - ; device_index : Integer.t - } - - let make ?dry_run ~network_interface_id ~instance_id ~device_index () = - { dry_run; network_interface_id; instance_id; device_index } - - let parse xml = - Some - { dry_run = Util.option_bind (Xml.member "dryRun" xml) Boolean.parse - ; network_interface_id = - Xml.required - "networkInterfaceId" - (Util.option_bind (Xml.member "networkInterfaceId" xml) String.parse) - ; instance_id = - Xml.required - "instanceId" - (Util.option_bind (Xml.member "instanceId" xml) String.parse) - ; device_index = - Xml.required - "deviceIndex" - (Util.option_bind (Xml.member "deviceIndex" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DeviceIndex", Integer.to_query v.device_index)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some - (Query.Pair ("NetworkInterfaceId", String.to_query v.network_interface_id)) - ; Util.option_map v.dry_run (fun f -> Query.Pair ("DryRun", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("device_index", Integer.to_json v.device_index) - ; Some ("instance_id", String.to_json v.instance_id) - ; Some ("network_interface_id", String.to_json v.network_interface_id) - ; Util.option_map v.dry_run (fun f -> "dry_run", Boolean.to_json f) - ]) - - let of_json j = - { dry_run = Util.option_map (Json.lookup j "dry_run") Boolean.of_json - ; network_interface_id = - String.of_json (Util.of_option_exn (Json.lookup j "network_interface_id")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; device_index = Integer.of_json (Util.of_option_exn (Json.lookup j "device_index")) - } -end + ("NetworkInterfaceId", + (String.to_query v.network_interface_id))); + Util.option_map v.dry_run + (fun f -> Query.Pair ("DryRun", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("device_index", (Integer.to_json v.device_index)); + Some ("instance_id", (String.to_json v.instance_id)); + Some + ("network_interface_id", + (String.to_json v.network_interface_id)); + Util.option_map v.dry_run + (fun f -> ("dry_run", (Boolean.to_json f)))]) + let of_json j = + { + dry_run = (Util.option_map (Json.lookup j "dry_run") Boolean.of_json); + network_interface_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "network_interface_id"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + device_index = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "device_index"))) + } + end \ No newline at end of file diff --git a/libraries/ec2/lib/unassignPrivateIpAddresses.ml b/libraries/ec2/lib/unassignPrivateIpAddresses.ml index e145f9a08..7128f6856 100644 --- a/libraries/ec2/lib/unassignPrivateIpAddresses.ml +++ b/libraries/ec2/lib/unassignPrivateIpAddresses.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = UnassignPrivateIpAddressesRequest.t - type output = unit - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "UnassignPrivateIpAddresses" ] ] + [("Version", ["2015-04-15"]); + ("Action", ["UnassignPrivateIpAddresses"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (UnassignPrivateIpAddressesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (UnassignPrivateIpAddressesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/unassignPrivateIpAddresses.mli b/libraries/ec2/lib/unassignPrivateIpAddresses.mli index 0580e6f62..db436e45e 100644 --- a/libraries/ec2/lib/unassignPrivateIpAddresses.mli +++ b/libraries/ec2/lib/unassignPrivateIpAddresses.mli @@ -1,10 +1,7 @@ open Types - type input = UnassignPrivateIpAddressesRequest.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 \ No newline at end of file diff --git a/libraries/ec2/lib/unmonitorInstances.ml b/libraries/ec2/lib/unmonitorInstances.ml index 466a1afce..21e909d70 100644 --- a/libraries/ec2/lib/unmonitorInstances.ml +++ b/libraries/ec2/lib/unmonitorInstances.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = UnmonitorInstancesRequest.t - type output = UnmonitorInstancesResult.t - type error = Errors_internal.t - let service = "ec2" - 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", [ "2015-04-15" ]; "Action", [ "UnmonitorInstances" ] ] + [("Version", ["2015-04-15"]); ("Action", ["UnmonitorInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UnmonitorInstancesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (UnmonitorInstancesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "UnmonitorInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp UnmonitorInstancesResult.parse) + Util.or_error (Util.option_bind resp UnmonitorInstancesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed UnmonitorInstancesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed UnmonitorInstancesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UnmonitorInstancesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UnmonitorInstancesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/ec2/lib/unmonitorInstances.mli b/libraries/ec2/lib/unmonitorInstances.mli index b0630d027..6cb6cf85b 100644 --- a/libraries/ec2/lib/unmonitorInstances.mli +++ b/libraries/ec2/lib/unmonitorInstances.mli @@ -1,10 +1,7 @@ open Types - type input = UnmonitorInstancesRequest.t - type output = UnmonitorInstancesResult.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 \ No newline at end of file diff --git a/libraries/ec2/lib_test/dune b/libraries/ec2/lib_test/dune index c025d5723..df0712cfe 100644 --- a/libraries/ec2/lib_test/dune +++ b/libraries/ec2/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_ec2_test) - (libraries aws aws_ec2 aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_ec2 aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/ec2/lib_test/test_async.ml b/libraries/ec2/lib_test/test_async.ml index 4673770ba..5a7738b83 100644 --- a/libraries/ec2/lib_test/test_async.ml +++ b/libraries/ec2/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_ec2_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/ec2/lib_test/test_lwt.ml b/libraries/ec2/lib_test/test_lwt.ml index 3680e49d8..320f6d8ef 100644 --- a/libraries/ec2/lib_test/test_lwt.ml +++ b/libraries/ec2/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_ec2_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/elasticache/lib/addTagsToResource.ml b/libraries/elasticache/lib/addTagsToResource.ml index 27bf30337..2f84cd515 100644 --- a/libraries/elasticache/lib/addTagsToResource.ml +++ b/libraries/elasticache/lib/addTagsToResource.ml @@ -1,67 +1,60 @@ open Types open Aws - type input = AddTagsToResourceMessage.t - type output = TagListMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "AddTagsToResource" ] ] + [("Version", ["2015-02-02"]); ("Action", ["AddTagsToResource"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AddTagsToResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AddTagsToResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "AddTagsToResourceResponse" (snd xml)) - (Xml.member "AddTagsToResourceResult") - in + Util.option_bind (Xml.member "AddTagsToResourceResponse" (snd xml)) + (Xml.member "AddTagsToResourceResult") in try - Util.or_error - (Util.option_bind resp TagListMessage.parse) + Util.or_error (Util.option_bind resp TagListMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed TagListMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed TagListMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TagListMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TagListMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidARN - ; Errors_internal.TagQuotaPerResourceExceeded - ; Errors_internal.SnapshotNotFoundFault - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidARN; + Errors_internal.TagQuotaPerResourceExceeded; + Errors_internal.SnapshotNotFoundFault; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/addTagsToResource.mli b/libraries/elasticache/lib/addTagsToResource.mli index e7a90f3fb..442f46f0f 100644 --- a/libraries/elasticache/lib/addTagsToResource.mli +++ b/libraries/elasticache/lib/addTagsToResource.mli @@ -1,10 +1,7 @@ open Types - type input = AddTagsToResourceMessage.t - type output = TagListMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml index 7078ad70a..a236405a5 100644 --- a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml +++ b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml @@ -1,77 +1,69 @@ open Types open Aws - type input = AuthorizeCacheSecurityGroupIngressMessage.t - type output = AuthorizeCacheSecurityGroupIngressResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ] - ; "Action", [ "AuthorizeCacheSecurityGroupIngress" ] - ] + [("Version", ["2015-02-02"]); + ("Action", ["AuthorizeCacheSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AuthorizeCacheSecurityGroupIngressMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (AuthorizeCacheSecurityGroupIngressMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "AuthorizeCacheSecurityGroupIngressResponse" (snd xml)) - (Xml.member "AuthorizeCacheSecurityGroupIngressResult") - in + (Xml.member "AuthorizeCacheSecurityGroupIngressResult") in try Util.or_error (Util.option_bind resp AuthorizeCacheSecurityGroupIngressResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed AuthorizeCacheSecurityGroupIngressResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AuthorizeCacheSecurityGroupIngressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AuthorizeCacheSecurityGroupIngressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AuthorizeCacheSecurityGroupIngressResult - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.AuthorizationAlreadyExists - ; Errors_internal.InvalidCacheSecurityGroupState - ; Errors_internal.CacheSecurityGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.AuthorizationAlreadyExists; + Errors_internal.InvalidCacheSecurityGroupState; + Errors_internal.CacheSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.mli b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.mli index aaede11a8..39ac6b8da 100644 --- a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.mli +++ b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = AuthorizeCacheSecurityGroupIngressMessage.t - type output = AuthorizeCacheSecurityGroupIngressResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/copySnapshot.ml b/libraries/elasticache/lib/copySnapshot.ml index 3fe02b878..918c6ea28 100644 --- a/libraries/elasticache/lib/copySnapshot.ml +++ b/libraries/elasticache/lib/copySnapshot.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = CopySnapshotMessage.t - type output = CopySnapshotResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CopySnapshot" ] ] + [("Version", ["2015-02-02"]); ("Action", ["CopySnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopySnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CopySnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CopySnapshotResponse" (snd xml)) - (Xml.member "CopySnapshotResult") - in + Util.option_bind (Xml.member "CopySnapshotResponse" (snd xml)) + (Xml.member "CopySnapshotResult") in try - Util.or_error - (Util.option_bind resp CopySnapshotResult.parse) + Util.or_error (Util.option_bind resp CopySnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CopySnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CopySnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopySnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopySnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidSnapshotState - ; Errors_internal.SnapshotQuotaExceededFault - ; Errors_internal.SnapshotNotFoundFault - ; Errors_internal.SnapshotAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidSnapshotState; + Errors_internal.SnapshotQuotaExceededFault; + Errors_internal.SnapshotNotFoundFault; + Errors_internal.SnapshotAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/copySnapshot.mli b/libraries/elasticache/lib/copySnapshot.mli index a848a9705..ef510b921 100644 --- a/libraries/elasticache/lib/copySnapshot.mli +++ b/libraries/elasticache/lib/copySnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CopySnapshotMessage.t - type output = CopySnapshotResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheCluster.ml b/libraries/elasticache/lib/createCacheCluster.ml index 8bc011695..4e6082eb8 100644 --- a/libraries/elasticache/lib/createCacheCluster.ml +++ b/libraries/elasticache/lib/createCacheCluster.ml @@ -1,80 +1,74 @@ open Types open Aws - type input = CreateCacheClusterMessage.t - type output = CreateCacheClusterResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateCacheCluster" ] ] + [("Version", ["2015-02-02"]); ("Action", ["CreateCacheCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateCacheClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateCacheClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateCacheClusterResponse" (snd xml)) - (Xml.member "CreateCacheClusterResult") - in + Util.option_bind (Xml.member "CreateCacheClusterResponse" (snd xml)) + (Xml.member "CreateCacheClusterResult") in try - Util.or_error - (Util.option_bind resp CreateCacheClusterResult.parse) + Util.or_error (Util.option_bind resp CreateCacheClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateCacheClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateCacheClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateCacheClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateCacheClusterResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.TagQuotaPerResourceExceeded - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.NodeQuotaForCustomerExceeded - ; Errors_internal.NodeQuotaForClusterExceeded - ; Errors_internal.ClusterQuotaForCustomerExceeded - ; Errors_internal.CacheSubnetGroupNotFoundFault - ; Errors_internal.CacheSecurityGroupNotFound - ; Errors_internal.InsufficientCacheClusterCapacity - ; Errors_internal.CacheClusterAlreadyExists - ; Errors_internal.InvalidReplicationGroupState - ; Errors_internal.ReplicationGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.TagQuotaPerResourceExceeded; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.NodeQuotaForCustomerExceeded; + Errors_internal.NodeQuotaForClusterExceeded; + Errors_internal.ClusterQuotaForCustomerExceeded; + Errors_internal.CacheSubnetGroupNotFoundFault; + Errors_internal.CacheSecurityGroupNotFound; + Errors_internal.InsufficientCacheClusterCapacity; + Errors_internal.CacheClusterAlreadyExists; + Errors_internal.InvalidReplicationGroupState; + Errors_internal.ReplicationGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheCluster.mli b/libraries/elasticache/lib/createCacheCluster.mli index 6b4dfe97c..d73e8d2b3 100644 --- a/libraries/elasticache/lib/createCacheCluster.mli +++ b/libraries/elasticache/lib/createCacheCluster.mli @@ -1,10 +1,7 @@ open Types - type input = CreateCacheClusterMessage.t - type output = CreateCacheClusterResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheParameterGroup.ml b/libraries/elasticache/lib/createCacheParameterGroup.ml index e7926aac3..53b29e04b 100644 --- a/libraries/elasticache/lib/createCacheParameterGroup.ml +++ b/libraries/elasticache/lib/createCacheParameterGroup.ml @@ -1,74 +1,69 @@ open Types open Aws - type input = CreateCacheParameterGroupMessage.t - type output = CreateCacheParameterGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateCacheParameterGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["CreateCacheParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateCacheParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateCacheParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateCacheParameterGroupResponse" (snd xml)) - (Xml.member "CreateCacheParameterGroupResult") - in + (Xml.member "CreateCacheParameterGroupResult") in try Util.or_error (Util.option_bind resp CreateCacheParameterGroupResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateCacheParameterGroupResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateCacheParameterGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateCacheParameterGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateCacheParameterGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidCacheParameterGroupState - ; Errors_internal.CacheParameterGroupAlreadyExists - ; Errors_internal.CacheParameterGroupQuotaExceeded - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidCacheParameterGroupState; + Errors_internal.CacheParameterGroupAlreadyExists; + Errors_internal.CacheParameterGroupQuotaExceeded] @ + 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheParameterGroup.mli b/libraries/elasticache/lib/createCacheParameterGroup.mli index b4e046952..c500af2b1 100644 --- a/libraries/elasticache/lib/createCacheParameterGroup.mli +++ b/libraries/elasticache/lib/createCacheParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateCacheParameterGroupMessage.t - type output = CreateCacheParameterGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheSecurityGroup.ml b/libraries/elasticache/lib/createCacheSecurityGroup.ml index a0656db3f..828e6e831 100644 --- a/libraries/elasticache/lib/createCacheSecurityGroup.ml +++ b/libraries/elasticache/lib/createCacheSecurityGroup.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = CreateCacheSecurityGroupMessage.t - type output = CreateCacheSecurityGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateCacheSecurityGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["CreateCacheSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateCacheSecurityGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateCacheSecurityGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateCacheSecurityGroupResponse" (snd xml)) - (Xml.member "CreateCacheSecurityGroupResult") - in + (Xml.member "CreateCacheSecurityGroupResult") in try Util.or_error (Util.option_bind resp CreateCacheSecurityGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateCacheSecurityGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateCacheSecurityGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateCacheSecurityGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateCacheSecurityGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.QuotaExceeded_CacheSecurityGroup - ; Errors_internal.CacheSecurityGroupAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.QuotaExceeded_CacheSecurityGroup; + Errors_internal.CacheSecurityGroupAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheSecurityGroup.mli b/libraries/elasticache/lib/createCacheSecurityGroup.mli index 4f323cfd1..b56e2b87d 100644 --- a/libraries/elasticache/lib/createCacheSecurityGroup.mli +++ b/libraries/elasticache/lib/createCacheSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateCacheSecurityGroupMessage.t - type output = CreateCacheSecurityGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheSubnetGroup.ml b/libraries/elasticache/lib/createCacheSubnetGroup.ml index 37a8fdae3..e23898621 100644 --- a/libraries/elasticache/lib/createCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/createCacheSubnetGroup.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = CreateCacheSubnetGroupMessage.t - type output = CreateCacheSubnetGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateCacheSubnetGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["CreateCacheSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateCacheSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateCacheSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateCacheSubnetGroupResponse" (snd xml)) - (Xml.member "CreateCacheSubnetGroupResult") - in + (Xml.member "CreateCacheSubnetGroupResult") in try Util.or_error (Util.option_bind resp CreateCacheSubnetGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateCacheSubnetGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateCacheSubnetGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateCacheSubnetGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateCacheSubnetGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSubnet - ; Errors_internal.CacheSubnetQuotaExceededFault - ; Errors_internal.CacheSubnetGroupQuotaExceeded - ; Errors_internal.CacheSubnetGroupAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSubnet; + Errors_internal.CacheSubnetQuotaExceededFault; + Errors_internal.CacheSubnetGroupQuotaExceeded; + Errors_internal.CacheSubnetGroupAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createCacheSubnetGroup.mli b/libraries/elasticache/lib/createCacheSubnetGroup.mli index e7f6dd233..104e1b0e8 100644 --- a/libraries/elasticache/lib/createCacheSubnetGroup.mli +++ b/libraries/elasticache/lib/createCacheSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateCacheSubnetGroupMessage.t - type output = CreateCacheSubnetGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createReplicationGroup.ml b/libraries/elasticache/lib/createReplicationGroup.ml index e40368235..163f2465d 100644 --- a/libraries/elasticache/lib/createReplicationGroup.ml +++ b/libraries/elasticache/lib/createReplicationGroup.ml @@ -1,81 +1,77 @@ open Types open Aws - type input = CreateReplicationGroupMessage.t - type output = CreateReplicationGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateReplicationGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["CreateReplicationGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateReplicationGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateReplicationGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateReplicationGroupResponse" (snd xml)) - (Xml.member "CreateReplicationGroupResult") - in + (Xml.member "CreateReplicationGroupResult") in try Util.or_error (Util.option_bind resp CreateReplicationGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateReplicationGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateReplicationGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateReplicationGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateReplicationGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.TagQuotaPerResourceExceeded - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.NodeQuotaForCustomerExceeded - ; Errors_internal.NodeQuotaForClusterExceeded - ; Errors_internal.ClusterQuotaForCustomerExceeded - ; Errors_internal.CacheSubnetGroupNotFoundFault - ; Errors_internal.CacheSecurityGroupNotFound - ; Errors_internal.InsufficientCacheClusterCapacity - ; Errors_internal.ReplicationGroupAlreadyExists - ; Errors_internal.InvalidCacheClusterState - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.TagQuotaPerResourceExceeded; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.NodeQuotaForCustomerExceeded; + Errors_internal.NodeQuotaForClusterExceeded; + Errors_internal.ClusterQuotaForCustomerExceeded; + Errors_internal.CacheSubnetGroupNotFoundFault; + Errors_internal.CacheSecurityGroupNotFound; + Errors_internal.InsufficientCacheClusterCapacity; + Errors_internal.ReplicationGroupAlreadyExists; + Errors_internal.InvalidCacheClusterState; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createReplicationGroup.mli b/libraries/elasticache/lib/createReplicationGroup.mli index 451909c9c..35a3328be 100644 --- a/libraries/elasticache/lib/createReplicationGroup.mli +++ b/libraries/elasticache/lib/createReplicationGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateReplicationGroupMessage.t - type output = CreateReplicationGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createSnapshot.ml b/libraries/elasticache/lib/createSnapshot.ml index 0c6b4a00d..b23e53091 100644 --- a/libraries/elasticache/lib/createSnapshot.ml +++ b/libraries/elasticache/lib/createSnapshot.ml @@ -1,71 +1,66 @@ open Types open Aws - type input = CreateSnapshotMessage.t - type output = CreateSnapshotResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "CreateSnapshot" ] ] + [("Version", ["2015-02-02"]); ("Action", ["CreateSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateSnapshotResponse" (snd xml)) - (Xml.member "CreateSnapshotResult") - in + Util.option_bind (Xml.member "CreateSnapshotResponse" (snd xml)) + (Xml.member "CreateSnapshotResult") in try - Util.or_error - (Util.option_bind resp CreateSnapshotResult.parse) + Util.or_error (Util.option_bind resp CreateSnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateSnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidParameterCombination - ; Errors_internal.SnapshotFeatureNotSupportedFault - ; Errors_internal.SnapshotQuotaExceededFault - ; Errors_internal.InvalidCacheClusterState - ; Errors_internal.CacheClusterNotFound - ; Errors_internal.SnapshotAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterValue; + Errors_internal.InvalidParameterCombination; + Errors_internal.SnapshotFeatureNotSupportedFault; + Errors_internal.SnapshotQuotaExceededFault; + Errors_internal.InvalidCacheClusterState; + Errors_internal.CacheClusterNotFound; + Errors_internal.SnapshotAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/createSnapshot.mli b/libraries/elasticache/lib/createSnapshot.mli index 834f4d03f..4c803ac1d 100644 --- a/libraries/elasticache/lib/createSnapshot.mli +++ b/libraries/elasticache/lib/createSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSnapshotMessage.t - type output = CreateSnapshotResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheCluster.ml b/libraries/elasticache/lib/deleteCacheCluster.ml index ab33020bc..e1b8cebe3 100644 --- a/libraries/elasticache/lib/deleteCacheCluster.ml +++ b/libraries/elasticache/lib/deleteCacheCluster.ml @@ -1,73 +1,67 @@ open Types open Aws - type input = DeleteCacheClusterMessage.t - type output = DeleteCacheClusterResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteCacheCluster" ] ] + [("Version", ["2015-02-02"]); ("Action", ["DeleteCacheCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteCacheClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteCacheClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteCacheClusterResponse" (snd xml)) - (Xml.member "DeleteCacheClusterResult") - in + Util.option_bind (Xml.member "DeleteCacheClusterResponse" (snd xml)) + (Xml.member "DeleteCacheClusterResult") in try - Util.or_error - (Util.option_bind resp DeleteCacheClusterResult.parse) + Util.or_error (Util.option_bind resp DeleteCacheClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteCacheClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteCacheClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteCacheClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteCacheClusterResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.SnapshotQuotaExceededFault - ; Errors_internal.SnapshotFeatureNotSupportedFault - ; Errors_internal.SnapshotAlreadyExistsFault - ; Errors_internal.InvalidCacheClusterState - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.SnapshotQuotaExceededFault; + Errors_internal.SnapshotFeatureNotSupportedFault; + Errors_internal.SnapshotAlreadyExistsFault; + Errors_internal.InvalidCacheClusterState; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheCluster.mli b/libraries/elasticache/lib/deleteCacheCluster.mli index f093e3a8b..3a2790647 100644 --- a/libraries/elasticache/lib/deleteCacheCluster.mli +++ b/libraries/elasticache/lib/deleteCacheCluster.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteCacheClusterMessage.t - type output = DeleteCacheClusterResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheParameterGroup.ml b/libraries/elasticache/lib/deleteCacheParameterGroup.ml index fce337db5..7e513717c 100644 --- a/libraries/elasticache/lib/deleteCacheParameterGroup.ml +++ b/libraries/elasticache/lib/deleteCacheParameterGroup.ml @@ -1,44 +1,35 @@ open Types open Aws - type input = DeleteCacheParameterGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteCacheParameterGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DeleteCacheParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteCacheParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteCacheParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.InvalidCacheParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.InvalidCacheParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheParameterGroup.mli b/libraries/elasticache/lib/deleteCacheParameterGroup.mli index 843955c40..f6142fcd4 100644 --- a/libraries/elasticache/lib/deleteCacheParameterGroup.mli +++ b/libraries/elasticache/lib/deleteCacheParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteCacheParameterGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheSecurityGroup.ml b/libraries/elasticache/lib/deleteCacheSecurityGroup.ml index aeb7a5a6f..3e2885925 100644 --- a/libraries/elasticache/lib/deleteCacheSecurityGroup.ml +++ b/libraries/elasticache/lib/deleteCacheSecurityGroup.ml @@ -1,44 +1,35 @@ open Types open Aws - type input = DeleteCacheSecurityGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteCacheSecurityGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DeleteCacheSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteCacheSecurityGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteCacheSecurityGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheSecurityGroupNotFound - ; Errors_internal.InvalidCacheSecurityGroupState - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheSecurityGroupNotFound; + Errors_internal.InvalidCacheSecurityGroupState] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheSecurityGroup.mli b/libraries/elasticache/lib/deleteCacheSecurityGroup.mli index ed2c803c2..3b6c42c93 100644 --- a/libraries/elasticache/lib/deleteCacheSecurityGroup.mli +++ b/libraries/elasticache/lib/deleteCacheSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteCacheSecurityGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheSubnetGroup.ml b/libraries/elasticache/lib/deleteCacheSubnetGroup.ml index 4d2a9b99c..60cb7c7d7 100644 --- a/libraries/elasticache/lib/deleteCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/deleteCacheSubnetGroup.ml @@ -1,42 +1,33 @@ open Types open Aws - type input = DeleteCacheSubnetGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteCacheSubnetGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DeleteCacheSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteCacheSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteCacheSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.CacheSubnetGroupNotFoundFault - ; Errors_internal.CacheSubnetGroupInUse - ] - @ Errors_internal.common - in + [Errors_internal.CacheSubnetGroupNotFoundFault; + Errors_internal.CacheSubnetGroupInUse] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteCacheSubnetGroup.mli b/libraries/elasticache/lib/deleteCacheSubnetGroup.mli index 4c1ce0faf..1b52f5da7 100644 --- a/libraries/elasticache/lib/deleteCacheSubnetGroup.mli +++ b/libraries/elasticache/lib/deleteCacheSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteCacheSubnetGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteReplicationGroup.ml b/libraries/elasticache/lib/deleteReplicationGroup.ml index aab86498b..c431e51a3 100644 --- a/libraries/elasticache/lib/deleteReplicationGroup.ml +++ b/libraries/elasticache/lib/deleteReplicationGroup.ml @@ -1,74 +1,70 @@ open Types open Aws - type input = DeleteReplicationGroupMessage.t - type output = DeleteReplicationGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteReplicationGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DeleteReplicationGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteReplicationGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteReplicationGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DeleteReplicationGroupResponse" (snd xml)) - (Xml.member "DeleteReplicationGroupResult") - in + (Xml.member "DeleteReplicationGroupResult") in try Util.or_error (Util.option_bind resp DeleteReplicationGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteReplicationGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteReplicationGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteReplicationGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteReplicationGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.SnapshotQuotaExceededFault - ; Errors_internal.SnapshotFeatureNotSupportedFault - ; Errors_internal.SnapshotAlreadyExistsFault - ; Errors_internal.InvalidReplicationGroupState - ; Errors_internal.ReplicationGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.SnapshotQuotaExceededFault; + Errors_internal.SnapshotFeatureNotSupportedFault; + Errors_internal.SnapshotAlreadyExistsFault; + Errors_internal.InvalidReplicationGroupState; + Errors_internal.ReplicationGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteReplicationGroup.mli b/libraries/elasticache/lib/deleteReplicationGroup.mli index 21e25cd7c..06b6e7369 100644 --- a/libraries/elasticache/lib/deleteReplicationGroup.mli +++ b/libraries/elasticache/lib/deleteReplicationGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteReplicationGroupMessage.t - type output = DeleteReplicationGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteSnapshot.ml b/libraries/elasticache/lib/deleteSnapshot.ml index c3ec1be8e..0cf37d1d5 100644 --- a/libraries/elasticache/lib/deleteSnapshot.ml +++ b/libraries/elasticache/lib/deleteSnapshot.ml @@ -1,68 +1,63 @@ open Types open Aws - type input = DeleteSnapshotMessage.t - type output = DeleteSnapshotResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DeleteSnapshot" ] ] + [("Version", ["2015-02-02"]); ("Action", ["DeleteSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteSnapshotResponse" (snd xml)) - (Xml.member "DeleteSnapshotResult") - in + Util.option_bind (Xml.member "DeleteSnapshotResponse" (snd xml)) + (Xml.member "DeleteSnapshotResult") in try - Util.or_error - (Util.option_bind resp DeleteSnapshotResult.parse) + Util.or_error (Util.option_bind resp DeleteSnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DeleteSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteSnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidSnapshotState - ; Errors_internal.SnapshotNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidSnapshotState; + Errors_internal.SnapshotNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/deleteSnapshot.mli b/libraries/elasticache/lib/deleteSnapshot.mli index 9561878f3..67c6b88f3 100644 --- a/libraries/elasticache/lib/deleteSnapshot.mli +++ b/libraries/elasticache/lib/deleteSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSnapshotMessage.t - type output = DeleteSnapshotResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheClusters.ml b/libraries/elasticache/lib/describeCacheClusters.ml index 4e2136911..84494bdb9 100644 --- a/libraries/elasticache/lib/describeCacheClusters.ml +++ b/libraries/elasticache/lib/describeCacheClusters.ml @@ -1,68 +1,62 @@ open Types open Aws - type input = DescribeCacheClustersMessage.t - type output = CacheClusterMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheClusters" ] ] + [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheClusters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheClustersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeCacheClustersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeCacheClustersResponse" (snd xml)) - (Xml.member "DescribeCacheClustersResult") - in + Util.option_bind (Xml.member "DescribeCacheClustersResponse" (snd xml)) + (Xml.member "DescribeCacheClustersResult") in try - Util.or_error - (Util.option_bind resp CacheClusterMessage.parse) + Util.or_error (Util.option_bind resp CacheClusterMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CacheClusterMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CacheClusterMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheClusterMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheClusterMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheClusters.mli b/libraries/elasticache/lib/describeCacheClusters.mli index 1a037c162..593bb407a 100644 --- a/libraries/elasticache/lib/describeCacheClusters.mli +++ b/libraries/elasticache/lib/describeCacheClusters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheClustersMessage.t - type output = CacheClusterMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheEngineVersions.ml b/libraries/elasticache/lib/describeCacheEngineVersions.ml index 43d6fc588..15b24e2c2 100644 --- a/libraries/elasticache/lib/describeCacheEngineVersions.ml +++ b/libraries/elasticache/lib/describeCacheEngineVersions.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeCacheEngineVersionsMessage.t - type output = CacheEngineVersionMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheEngineVersions" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeCacheEngineVersions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheEngineVersionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeCacheEngineVersionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeCacheEngineVersionsResponse" (snd xml)) - (Xml.member "DescribeCacheEngineVersionsResult") - in + (Xml.member "DescribeCacheEngineVersionsResult") in try - Util.or_error - (Util.option_bind resp CacheEngineVersionMessage.parse) + Util.or_error (Util.option_bind resp CacheEngineVersionMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheEngineVersionMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheEngineVersionMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheEngineVersionMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheEngineVersionMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheEngineVersions.mli b/libraries/elasticache/lib/describeCacheEngineVersions.mli index 0458810ec..3215fb358 100644 --- a/libraries/elasticache/lib/describeCacheEngineVersions.mli +++ b/libraries/elasticache/lib/describeCacheEngineVersions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheEngineVersionsMessage.t - type output = CacheEngineVersionMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheParameterGroups.ml b/libraries/elasticache/lib/describeCacheParameterGroups.ml index 873a8af32..4feb3025a 100644 --- a/libraries/elasticache/lib/describeCacheParameterGroups.ml +++ b/libraries/elasticache/lib/describeCacheParameterGroups.ml @@ -1,70 +1,66 @@ open Types open Aws - type input = DescribeCacheParameterGroupsMessage.t - type output = CacheParameterGroupsMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheParameterGroups" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeCacheParameterGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheParameterGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeCacheParameterGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeCacheParameterGroupsResponse" (snd xml)) - (Xml.member "DescribeCacheParameterGroupsResult") - in + (Xml.member "DescribeCacheParameterGroupsResult") in try - Util.or_error - (Util.option_bind resp CacheParameterGroupsMessage.parse) + Util.or_error (Util.option_bind resp CacheParameterGroupsMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheParameterGroupsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheParameterGroupsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheParameterGroupsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheParameterGroupsMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheParameterGroups.mli b/libraries/elasticache/lib/describeCacheParameterGroups.mli index e49530a79..6374014e9 100644 --- a/libraries/elasticache/lib/describeCacheParameterGroups.mli +++ b/libraries/elasticache/lib/describeCacheParameterGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheParameterGroupsMessage.t - type output = CacheParameterGroupsMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheParameters.ml b/libraries/elasticache/lib/describeCacheParameters.ml index b57c8c975..1865970ba 100644 --- a/libraries/elasticache/lib/describeCacheParameters.ml +++ b/libraries/elasticache/lib/describeCacheParameters.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = DescribeCacheParametersMessage.t - type output = CacheParameterGroupDetails.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheParameters" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeCacheParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeCacheParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeCacheParametersResponse" (snd xml)) - (Xml.member "DescribeCacheParametersResult") - in + (Xml.member "DescribeCacheParametersResult") in try - Util.or_error - (Util.option_bind resp CacheParameterGroupDetails.parse) + Util.or_error (Util.option_bind resp CacheParameterGroupDetails.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheParameterGroupDetails." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheParameterGroupDetails." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheParameterGroupDetails - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheParameterGroupDetails - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheParameters.mli b/libraries/elasticache/lib/describeCacheParameters.mli index 4663bc57e..1963ebbc5 100644 --- a/libraries/elasticache/lib/describeCacheParameters.mli +++ b/libraries/elasticache/lib/describeCacheParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheParametersMessage.t - type output = CacheParameterGroupDetails.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheSecurityGroups.ml b/libraries/elasticache/lib/describeCacheSecurityGroups.ml index dd6157f13..3bb1f78e2 100644 --- a/libraries/elasticache/lib/describeCacheSecurityGroups.ml +++ b/libraries/elasticache/lib/describeCacheSecurityGroups.ml @@ -1,70 +1,66 @@ open Types open Aws - type input = DescribeCacheSecurityGroupsMessage.t - type output = CacheSecurityGroupMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheSecurityGroups" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeCacheSecurityGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheSecurityGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeCacheSecurityGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeCacheSecurityGroupsResponse" (snd xml)) - (Xml.member "DescribeCacheSecurityGroupsResult") - in + (Xml.member "DescribeCacheSecurityGroupsResult") in try - Util.or_error - (Util.option_bind resp CacheSecurityGroupMessage.parse) + Util.or_error (Util.option_bind resp CacheSecurityGroupMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheSecurityGroupMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheSecurityGroupMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheSecurityGroupMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheSecurityGroupMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheSecurityGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheSecurityGroups.mli b/libraries/elasticache/lib/describeCacheSecurityGroups.mli index be9e52d09..640f1fd34 100644 --- a/libraries/elasticache/lib/describeCacheSecurityGroups.mli +++ b/libraries/elasticache/lib/describeCacheSecurityGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheSecurityGroupsMessage.t - type output = CacheSecurityGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheSubnetGroups.ml b/libraries/elasticache/lib/describeCacheSubnetGroups.ml index 02c181ddc..077abf0e1 100644 --- a/libraries/elasticache/lib/describeCacheSubnetGroups.ml +++ b/libraries/elasticache/lib/describeCacheSubnetGroups.ml @@ -1,66 +1,63 @@ open Types open Aws - type input = DescribeCacheSubnetGroupsMessage.t - type output = CacheSubnetGroupMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeCacheSubnetGroups" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeCacheSubnetGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCacheSubnetGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeCacheSubnetGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeCacheSubnetGroupsResponse" (snd xml)) - (Xml.member "DescribeCacheSubnetGroupsResult") - in + (Xml.member "DescribeCacheSubnetGroupsResult") in try - Util.or_error - (Util.option_bind resp CacheSubnetGroupMessage.parse) + Util.or_error (Util.option_bind resp CacheSubnetGroupMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheSubnetGroupMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheSubnetGroupMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheSubnetGroupMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheSubnetGroupMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.CacheSubnetGroupNotFoundFault ] @ Errors_internal.common - in + [Errors_internal.CacheSubnetGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeCacheSubnetGroups.mli b/libraries/elasticache/lib/describeCacheSubnetGroups.mli index 59576a165..d2120ade5 100644 --- a/libraries/elasticache/lib/describeCacheSubnetGroups.mli +++ b/libraries/elasticache/lib/describeCacheSubnetGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCacheSubnetGroupsMessage.t - type output = CacheSubnetGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeEngineDefaultParameters.ml b/libraries/elasticache/lib/describeEngineDefaultParameters.ml index 84ea6c280..d06432a11 100644 --- a/libraries/elasticache/lib/describeEngineDefaultParameters.ml +++ b/libraries/elasticache/lib/describeEngineDefaultParameters.ml @@ -1,69 +1,66 @@ open Types open Aws - type input = DescribeEngineDefaultParametersMessage.t - type output = DescribeEngineDefaultParametersResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeEngineDefaultParameters" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeEngineDefaultParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEngineDefaultParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeEngineDefaultParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeEngineDefaultParametersResponse" (snd xml)) - (Xml.member "DescribeEngineDefaultParametersResult") - in + (Xml.member "DescribeEngineDefaultParametersResult") in try Util.or_error (Util.option_bind resp DescribeEngineDefaultParametersResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeEngineDefaultParametersResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeEngineDefaultParametersResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeEngineDefaultParametersResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeEngineDefaultParametersResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination; Errors_internal.InvalidParameterValue ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeEngineDefaultParameters.mli b/libraries/elasticache/lib/describeEngineDefaultParameters.mli index a13373a91..050bc140f 100644 --- a/libraries/elasticache/lib/describeEngineDefaultParameters.mli +++ b/libraries/elasticache/lib/describeEngineDefaultParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEngineDefaultParametersMessage.t - type output = DescribeEngineDefaultParametersResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeEvents.ml b/libraries/elasticache/lib/describeEvents.ml index 0db8cdb4b..8c3fbaa85 100644 --- a/libraries/elasticache/lib/describeEvents.ml +++ b/libraries/elasticache/lib/describeEvents.ml @@ -1,63 +1,58 @@ open Types open Aws - type input = DescribeEventsMessage.t - type output = EventsMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeEvents" ] ] + [("Version", ["2015-02-02"]); ("Action", ["DescribeEvents"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeEventsMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeEventsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeEventsResponse" (snd xml)) - (Xml.member "DescribeEventsResult") - in + Util.option_bind (Xml.member "DescribeEventsResponse" (snd xml)) + (Xml.member "DescribeEventsResult") in try - Util.or_error - (Util.option_bind resp EventsMessage.parse) + Util.or_error (Util.option_bind resp EventsMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed EventsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed EventsMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EventsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EventsMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination; Errors_internal.InvalidParameterValue ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeEvents.mli b/libraries/elasticache/lib/describeEvents.mli index f285c481a..76d92f846 100644 --- a/libraries/elasticache/lib/describeEvents.mli +++ b/libraries/elasticache/lib/describeEvents.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEventsMessage.t - type output = EventsMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReplicationGroups.ml b/libraries/elasticache/lib/describeReplicationGroups.ml index 52f9397a8..a268c4a18 100644 --- a/libraries/elasticache/lib/describeReplicationGroups.ml +++ b/libraries/elasticache/lib/describeReplicationGroups.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = DescribeReplicationGroupsMessage.t - type output = ReplicationGroupMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeReplicationGroups" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeReplicationGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReplicationGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeReplicationGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeReplicationGroupsResponse" (snd xml)) - (Xml.member "DescribeReplicationGroupsResult") - in + (Xml.member "DescribeReplicationGroupsResult") in try - Util.or_error - (Util.option_bind resp ReplicationGroupMessage.parse) + Util.or_error (Util.option_bind resp ReplicationGroupMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ReplicationGroupMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReplicationGroupMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReplicationGroupMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReplicationGroupMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.ReplicationGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.ReplicationGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReplicationGroups.mli b/libraries/elasticache/lib/describeReplicationGroups.mli index 9440857c2..b95880a05 100644 --- a/libraries/elasticache/lib/describeReplicationGroups.mli +++ b/libraries/elasticache/lib/describeReplicationGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReplicationGroupsMessage.t - type output = ReplicationGroupMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReservedCacheNodes.ml b/libraries/elasticache/lib/describeReservedCacheNodes.ml index 05e5afc82..047ebecd2 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodes.ml +++ b/libraries/elasticache/lib/describeReservedCacheNodes.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = DescribeReservedCacheNodesMessage.t - type output = ReservedCacheNodeMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeReservedCacheNodes" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeReservedCacheNodes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedCacheNodesMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeReservedCacheNodesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeReservedCacheNodesResponse" (snd xml)) - (Xml.member "DescribeReservedCacheNodesResult") - in + (Xml.member "DescribeReservedCacheNodesResult") in try - Util.or_error - (Util.option_bind resp ReservedCacheNodeMessage.parse) + Util.or_error (Util.option_bind resp ReservedCacheNodeMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ReservedCacheNodeMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReservedCacheNodeMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReservedCacheNodeMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReservedCacheNodeMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.ReservedCacheNodeNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.ReservedCacheNodeNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReservedCacheNodes.mli b/libraries/elasticache/lib/describeReservedCacheNodes.mli index f91637d3f..587e44a71 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodes.mli +++ b/libraries/elasticache/lib/describeReservedCacheNodes.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedCacheNodesMessage.t - type output = ReservedCacheNodeMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml index 93c5b9869..65432997b 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml +++ b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml @@ -1,74 +1,68 @@ open Types open Aws - type input = DescribeReservedCacheNodesOfferingsMessage.t - type output = ReservedCacheNodesOfferingMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ] - ; "Action", [ "DescribeReservedCacheNodesOfferings" ] - ] + [("Version", ["2015-02-02"]); + ("Action", ["DescribeReservedCacheNodesOfferings"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedCacheNodesOfferingsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedCacheNodesOfferingsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeReservedCacheNodesOfferingsResponse" (snd xml)) - (Xml.member "DescribeReservedCacheNodesOfferingsResult") - in + (Xml.member "DescribeReservedCacheNodesOfferingsResult") in try Util.or_error (Util.option_bind resp ReservedCacheNodesOfferingMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ReservedCacheNodesOfferingMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReservedCacheNodesOfferingMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReservedCacheNodesOfferingMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReservedCacheNodesOfferingMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.ReservedCacheNodesOfferingNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.ReservedCacheNodesOfferingNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.mli b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.mli index 62a659c59..f4331b097 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.mli +++ b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedCacheNodesOfferingsMessage.t - type output = ReservedCacheNodesOfferingMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeSnapshots.ml b/libraries/elasticache/lib/describeSnapshots.ml index dc4e2847c..b33982720 100644 --- a/libraries/elasticache/lib/describeSnapshots.ml +++ b/libraries/elasticache/lib/describeSnapshots.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = DescribeSnapshotsMessage.t - type output = DescribeSnapshotsListMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "DescribeSnapshots" ] ] + [("Version", ["2015-02-02"]); ("Action", ["DescribeSnapshots"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeSnapshotsMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeSnapshotsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeSnapshotsResponse" (snd xml)) - (Xml.member "DescribeSnapshotsResult") - in + Util.option_bind (Xml.member "DescribeSnapshotsResponse" (snd xml)) + (Xml.member "DescribeSnapshotsResult") in try Util.or_error (Util.option_bind resp DescribeSnapshotsListMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeSnapshotsListMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSnapshotsListMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSnapshotsListMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSnapshotsListMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.SnapshotNotFoundFault - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.SnapshotNotFoundFault; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/describeSnapshots.mli b/libraries/elasticache/lib/describeSnapshots.mli index 21d297185..66706b91d 100644 --- a/libraries/elasticache/lib/describeSnapshots.mli +++ b/libraries/elasticache/lib/describeSnapshots.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSnapshotsMessage.t - type output = DescribeSnapshotsListMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/dune b/libraries/elasticache/lib/dune index 8f6348aed..b89ebeb5c 100644 --- a/libraries/elasticache/lib/dune +++ b/libraries/elasticache/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_elasticache) + (name aws_elasticache) (public_name aws-elasticache) (synopsis "aws-Amazon ElastiCache") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/elasticache/lib/errors_internal.ml b/libraries/elasticache/lib/errors_internal.ml index edb10d754..75b49953c 100644 --- a/libraries/elasticache/lib/errors_internal.ml +++ b/libraries/elasticache/lib/errors_internal.ml @@ -1,101 +1,98 @@ type t = - | AuthFailure - | AuthorizationAlreadyExists - | AuthorizationNotFound - | Blocked - | CacheClusterAlreadyExists - | CacheClusterNotFound - | CacheParameterGroupAlreadyExists - | CacheParameterGroupNotFound - | CacheParameterGroupQuotaExceeded - | CacheSecurityGroupAlreadyExists - | CacheSecurityGroupNotFound - | CacheSubnetGroupAlreadyExists - | CacheSubnetGroupInUse - | CacheSubnetGroupNotFoundFault - | CacheSubnetGroupQuotaExceeded - | CacheSubnetQuotaExceededFault - | ClusterQuotaForCustomerExceeded - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InsufficientCacheClusterCapacity - | InternalFailure - | InvalidARN - | InvalidAction - | InvalidCacheClusterState - | InvalidCacheParameterGroupState - | InvalidCacheSecurityGroupState - | InvalidClientTokenId - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidReplicationGroupState - | InvalidSnapshotState - | InvalidSubnet - | InvalidVPCNetworkStateFault - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | NodeQuotaForClusterExceeded - | NodeQuotaForCustomerExceeded - | OptInRequired - | PendingVerification - | QuotaExceeded_CacheSecurityGroup - | ReplicationGroupAlreadyExists - | ReplicationGroupNotFoundFault - | RequestExpired - | RequestLimitExceeded - | ReservedCacheNodeAlreadyExists - | ReservedCacheNodeNotFound - | ReservedCacheNodeQuotaExceeded - | ReservedCacheNodesOfferingNotFound - | ServiceUnavailable - | SnapshotAlreadyExistsFault - | SnapshotFeatureNotSupportedFault - | SnapshotNotFoundFault - | SnapshotQuotaExceededFault - | SubnetInUse - | TagNotFound - | TagQuotaPerResourceExceeded - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | AuthorizationAlreadyExists + | AuthorizationNotFound + | Blocked + | CacheClusterAlreadyExists + | CacheClusterNotFound + | CacheParameterGroupAlreadyExists + | CacheParameterGroupNotFound + | CacheParameterGroupQuotaExceeded + | CacheSecurityGroupAlreadyExists + | CacheSecurityGroupNotFound + | CacheSubnetGroupAlreadyExists + | CacheSubnetGroupInUse + | CacheSubnetGroupNotFoundFault + | CacheSubnetGroupQuotaExceeded + | CacheSubnetQuotaExceededFault + | ClusterQuotaForCustomerExceeded + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InsufficientCacheClusterCapacity + | InternalFailure + | InvalidARN + | InvalidAction + | InvalidCacheClusterState + | InvalidCacheParameterGroupState + | InvalidCacheSecurityGroupState + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidReplicationGroupState + | InvalidSnapshotState + | InvalidSubnet + | InvalidVPCNetworkStateFault + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | NodeQuotaForClusterExceeded + | NodeQuotaForCustomerExceeded + | OptInRequired + | PendingVerification + | QuotaExceeded_CacheSecurityGroup + | ReplicationGroupAlreadyExists + | ReplicationGroupNotFoundFault + | RequestExpired + | RequestLimitExceeded + | ReservedCacheNodeAlreadyExists + | ReservedCacheNodeNotFound + | ReservedCacheNodeQuotaExceeded + | ReservedCacheNodesOfferingNotFound + | ServiceUnavailable + | SnapshotAlreadyExistsFault + | SnapshotFeatureNotSupportedFault + | SnapshotNotFoundFault + | SnapshotQuotaExceededFault + | SubnetInUse + | TagNotFound + | TagQuotaPerResourceExceeded + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -165,7 +162,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -220,7 +216,8 @@ let to_string e = | ReservedCacheNodeAlreadyExists -> "ReservedCacheNodeAlreadyExists" | ReservedCacheNodeNotFound -> "ReservedCacheNodeNotFound" | ReservedCacheNodeQuotaExceeded -> "ReservedCacheNodeQuotaExceeded" - | ReservedCacheNodesOfferingNotFound -> "ReservedCacheNodesOfferingNotFound" + | ReservedCacheNodesOfferingNotFound -> + "ReservedCacheNodesOfferingNotFound" | ServiceUnavailable -> "ServiceUnavailable" | SnapshotAlreadyExistsFault -> "SnapshotAlreadyExistsFault" | SnapshotFeatureNotSupportedFault -> "SnapshotFeatureNotSupportedFault" @@ -235,7 +232,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -244,9 +240,11 @@ let of_string e = | "Blocked" -> Some Blocked | "CacheClusterAlreadyExists" -> Some CacheClusterAlreadyExists | "CacheClusterNotFound" -> Some CacheClusterNotFound - | "CacheParameterGroupAlreadyExists" -> Some CacheParameterGroupAlreadyExists + | "CacheParameterGroupAlreadyExists" -> + Some CacheParameterGroupAlreadyExists | "CacheParameterGroupNotFound" -> Some CacheParameterGroupNotFound - | "CacheParameterGroupQuotaExceeded" -> Some CacheParameterGroupQuotaExceeded + | "CacheParameterGroupQuotaExceeded" -> + Some CacheParameterGroupQuotaExceeded | "CacheSecurityGroupAlreadyExists" -> Some CacheSecurityGroupAlreadyExists | "CacheSecurityGroupNotFound" -> Some CacheSecurityGroupNotFound | "CacheSubnetGroupAlreadyExists" -> Some CacheSubnetGroupAlreadyExists @@ -258,7 +256,8 @@ let of_string e = | "DryRunOperation" -> Some DryRunOperation | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch | "IncompleteSignature" -> Some IncompleteSignature - | "InsufficientCacheClusterCapacity" -> Some InsufficientCacheClusterCapacity + | "InsufficientCacheClusterCapacity" -> + Some InsufficientCacheClusterCapacity | "InternalFailure" -> Some InternalFailure | "InvalidARN" -> Some InvalidARN | "InvalidAction" -> Some InvalidAction @@ -282,7 +281,8 @@ let of_string e = | "NodeQuotaForCustomerExceeded" -> Some NodeQuotaForCustomerExceeded | "OptInRequired" -> Some OptInRequired | "PendingVerification" -> Some PendingVerification - | "QuotaExceeded.CacheSecurityGroup" -> Some QuotaExceeded_CacheSecurityGroup + | "QuotaExceeded.CacheSecurityGroup" -> + Some QuotaExceeded_CacheSecurityGroup | "ReplicationGroupAlreadyExists" -> Some ReplicationGroupAlreadyExists | "ReplicationGroupNotFoundFault" -> Some ReplicationGroupNotFoundFault | "RequestExpired" -> Some RequestExpired @@ -290,10 +290,12 @@ let of_string e = | "ReservedCacheNodeAlreadyExists" -> Some ReservedCacheNodeAlreadyExists | "ReservedCacheNodeNotFound" -> Some ReservedCacheNodeNotFound | "ReservedCacheNodeQuotaExceeded" -> Some ReservedCacheNodeQuotaExceeded - | "ReservedCacheNodesOfferingNotFound" -> Some ReservedCacheNodesOfferingNotFound + | "ReservedCacheNodesOfferingNotFound" -> + Some ReservedCacheNodesOfferingNotFound | "ServiceUnavailable" -> Some ServiceUnavailable | "SnapshotAlreadyExistsFault" -> Some SnapshotAlreadyExistsFault - | "SnapshotFeatureNotSupportedFault" -> Some SnapshotFeatureNotSupportedFault + | "SnapshotFeatureNotSupportedFault" -> + Some SnapshotFeatureNotSupportedFault | "SnapshotNotFoundFault" -> Some SnapshotNotFoundFault | "SnapshotQuotaExceededFault" -> Some SnapshotQuotaExceededFault | "SubnetInUse" -> Some SubnetInUse @@ -305,4 +307,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/elasticache/lib/listTagsForResource.ml b/libraries/elasticache/lib/listTagsForResource.ml index 2b8ca09c8..75aeaecdf 100644 --- a/libraries/elasticache/lib/listTagsForResource.ml +++ b/libraries/elasticache/lib/listTagsForResource.ml @@ -1,67 +1,59 @@ open Types open Aws - type input = ListTagsForResourceMessage.t - type output = TagListMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ListTagsForResource" ] ] + [("Version", ["2015-02-02"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListTagsForResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ListTagsForResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListTagsForResourceResponse" (snd xml)) - (Xml.member "ListTagsForResourceResult") - in + Util.option_bind (Xml.member "ListTagsForResourceResponse" (snd xml)) + (Xml.member "ListTagsForResourceResult") in try - Util.or_error - (Util.option_bind resp TagListMessage.parse) + Util.or_error (Util.option_bind resp TagListMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed TagListMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed TagListMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TagListMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TagListMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidARN - ; Errors_internal.SnapshotNotFoundFault - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidARN; + Errors_internal.SnapshotNotFoundFault; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/listTagsForResource.mli b/libraries/elasticache/lib/listTagsForResource.mli index 4b5c9405c..bf19038f1 100644 --- a/libraries/elasticache/lib/listTagsForResource.mli +++ b/libraries/elasticache/lib/listTagsForResource.mli @@ -1,10 +1,7 @@ open Types - type input = ListTagsForResourceMessage.t - type output = TagListMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheCluster.ml b/libraries/elasticache/lib/modifyCacheCluster.ml index be1e59c75..3781e2611 100644 --- a/libraries/elasticache/lib/modifyCacheCluster.ml +++ b/libraries/elasticache/lib/modifyCacheCluster.ml @@ -1,77 +1,71 @@ open Types open Aws - type input = ModifyCacheClusterMessage.t - type output = ModifyCacheClusterResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ModifyCacheCluster" ] ] + [("Version", ["2015-02-02"]); ("Action", ["ModifyCacheCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyCacheClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyCacheClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ModifyCacheClusterResponse" (snd xml)) - (Xml.member "ModifyCacheClusterResult") - in + Util.option_bind (Xml.member "ModifyCacheClusterResponse" (snd xml)) + (Xml.member "ModifyCacheClusterResult") in try - Util.or_error - (Util.option_bind resp ModifyCacheClusterResult.parse) + Util.or_error (Util.option_bind resp ModifyCacheClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyCacheClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyCacheClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyCacheClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyCacheClusterResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.CacheSecurityGroupNotFound - ; Errors_internal.NodeQuotaForCustomerExceeded - ; Errors_internal.NodeQuotaForClusterExceeded - ; Errors_internal.CacheClusterNotFound - ; Errors_internal.InsufficientCacheClusterCapacity - ; Errors_internal.InvalidCacheSecurityGroupState - ; Errors_internal.InvalidCacheClusterState - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.CacheSecurityGroupNotFound; + Errors_internal.NodeQuotaForCustomerExceeded; + Errors_internal.NodeQuotaForClusterExceeded; + Errors_internal.CacheClusterNotFound; + Errors_internal.InsufficientCacheClusterCapacity; + Errors_internal.InvalidCacheSecurityGroupState; + Errors_internal.InvalidCacheClusterState] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheCluster.mli b/libraries/elasticache/lib/modifyCacheCluster.mli index df7296f69..f64655c3b 100644 --- a/libraries/elasticache/lib/modifyCacheCluster.mli +++ b/libraries/elasticache/lib/modifyCacheCluster.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyCacheClusterMessage.t - type output = ModifyCacheClusterResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheParameterGroup.ml b/libraries/elasticache/lib/modifyCacheParameterGroup.ml index 9f8c25a20..967b2f52b 100644 --- a/libraries/elasticache/lib/modifyCacheParameterGroup.ml +++ b/libraries/elasticache/lib/modifyCacheParameterGroup.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = ModifyCacheParameterGroupMessage.t - type output = CacheParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ModifyCacheParameterGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["ModifyCacheParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyCacheParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyCacheParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyCacheParameterGroupResponse" (snd xml)) - (Xml.member "ModifyCacheParameterGroupResult") - in + (Xml.member "ModifyCacheParameterGroupResult") in try Util.or_error (Util.option_bind resp CacheParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheParameterGroupNameMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheParameterGroupNameMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidCacheParameterGroupState - ; Errors_internal.CacheParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidCacheParameterGroupState; + Errors_internal.CacheParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheParameterGroup.mli b/libraries/elasticache/lib/modifyCacheParameterGroup.mli index 1365a811a..dda775d16 100644 --- a/libraries/elasticache/lib/modifyCacheParameterGroup.mli +++ b/libraries/elasticache/lib/modifyCacheParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyCacheParameterGroupMessage.t - type output = CacheParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheSubnetGroup.ml b/libraries/elasticache/lib/modifyCacheSubnetGroup.ml index e5bc04ad0..057631400 100644 --- a/libraries/elasticache/lib/modifyCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/modifyCacheSubnetGroup.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = ModifyCacheSubnetGroupMessage.t - type output = ModifyCacheSubnetGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ModifyCacheSubnetGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["ModifyCacheSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyCacheSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyCacheSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyCacheSubnetGroupResponse" (snd xml)) - (Xml.member "ModifyCacheSubnetGroupResult") - in + (Xml.member "ModifyCacheSubnetGroupResult") in try Util.or_error (Util.option_bind resp ModifyCacheSubnetGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyCacheSubnetGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyCacheSubnetGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyCacheSubnetGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyCacheSubnetGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSubnet - ; Errors_internal.SubnetInUse - ; Errors_internal.CacheSubnetQuotaExceededFault - ; Errors_internal.CacheSubnetGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSubnet; + Errors_internal.SubnetInUse; + Errors_internal.CacheSubnetQuotaExceededFault; + Errors_internal.CacheSubnetGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyCacheSubnetGroup.mli b/libraries/elasticache/lib/modifyCacheSubnetGroup.mli index cd74f02d2..ed640b29a 100644 --- a/libraries/elasticache/lib/modifyCacheSubnetGroup.mli +++ b/libraries/elasticache/lib/modifyCacheSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyCacheSubnetGroupMessage.t - type output = ModifyCacheSubnetGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyReplicationGroup.ml b/libraries/elasticache/lib/modifyReplicationGroup.ml index b3519fabd..390297c57 100644 --- a/libraries/elasticache/lib/modifyReplicationGroup.ml +++ b/libraries/elasticache/lib/modifyReplicationGroup.ml @@ -1,80 +1,76 @@ open Types open Aws - type input = ModifyReplicationGroupMessage.t - type output = ModifyReplicationGroupResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ModifyReplicationGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["ModifyReplicationGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyReplicationGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyReplicationGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyReplicationGroupResponse" (snd xml)) - (Xml.member "ModifyReplicationGroupResult") - in + (Xml.member "ModifyReplicationGroupResult") in try Util.or_error (Util.option_bind resp ModifyReplicationGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyReplicationGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyReplicationGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyReplicationGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyReplicationGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.CacheSecurityGroupNotFound - ; Errors_internal.NodeQuotaForCustomerExceeded - ; Errors_internal.NodeQuotaForClusterExceeded - ; Errors_internal.CacheClusterNotFound - ; Errors_internal.InsufficientCacheClusterCapacity - ; Errors_internal.InvalidCacheSecurityGroupState - ; Errors_internal.InvalidCacheClusterState - ; Errors_internal.InvalidReplicationGroupState - ; Errors_internal.ReplicationGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.CacheSecurityGroupNotFound; + Errors_internal.NodeQuotaForCustomerExceeded; + Errors_internal.NodeQuotaForClusterExceeded; + Errors_internal.CacheClusterNotFound; + Errors_internal.InsufficientCacheClusterCapacity; + Errors_internal.InvalidCacheSecurityGroupState; + Errors_internal.InvalidCacheClusterState; + Errors_internal.InvalidReplicationGroupState; + Errors_internal.ReplicationGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/modifyReplicationGroup.mli b/libraries/elasticache/lib/modifyReplicationGroup.mli index 24332d94f..c75757738 100644 --- a/libraries/elasticache/lib/modifyReplicationGroup.mli +++ b/libraries/elasticache/lib/modifyReplicationGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyReplicationGroupMessage.t - type output = ModifyReplicationGroupResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml index 95a9e9519..41169a7f4 100644 --- a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml +++ b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml @@ -1,77 +1,70 @@ open Types open Aws - type input = PurchaseReservedCacheNodesOfferingMessage.t - type output = PurchaseReservedCacheNodesOfferingResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ] - ; "Action", [ "PurchaseReservedCacheNodesOffering" ] - ] + [("Version", ["2015-02-02"]); + ("Action", ["PurchaseReservedCacheNodesOffering"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PurchaseReservedCacheNodesOfferingMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (PurchaseReservedCacheNodesOfferingMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "PurchaseReservedCacheNodesOfferingResponse" (snd xml)) - (Xml.member "PurchaseReservedCacheNodesOfferingResult") - in + (Xml.member "PurchaseReservedCacheNodesOfferingResult") in try Util.or_error (Util.option_bind resp PurchaseReservedCacheNodesOfferingResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed PurchaseReservedCacheNodesOfferingResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PurchaseReservedCacheNodesOfferingResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PurchaseReservedCacheNodesOfferingResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PurchaseReservedCacheNodesOfferingResult - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.ReservedCacheNodeQuotaExceeded - ; Errors_internal.ReservedCacheNodeAlreadyExists - ; Errors_internal.ReservedCacheNodesOfferingNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.ReservedCacheNodeQuotaExceeded; + Errors_internal.ReservedCacheNodeAlreadyExists; + Errors_internal.ReservedCacheNodesOfferingNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.mli b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.mli index cef087f60..46874a155 100644 --- a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.mli +++ b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.mli @@ -1,10 +1,7 @@ open Types - type input = PurchaseReservedCacheNodesOfferingMessage.t - type output = PurchaseReservedCacheNodesOfferingResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/rebootCacheCluster.ml b/libraries/elasticache/lib/rebootCacheCluster.ml index d2096dca1..1924332b2 100644 --- a/libraries/elasticache/lib/rebootCacheCluster.ml +++ b/libraries/elasticache/lib/rebootCacheCluster.ml @@ -1,66 +1,62 @@ open Types open Aws - type input = RebootCacheClusterMessage.t - type output = RebootCacheClusterResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "RebootCacheCluster" ] ] + [("Version", ["2015-02-02"]); ("Action", ["RebootCacheCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RebootCacheClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RebootCacheClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "RebootCacheClusterResponse" (snd xml)) - (Xml.member "RebootCacheClusterResult") - in + Util.option_bind (Xml.member "RebootCacheClusterResponse" (snd xml)) + (Xml.member "RebootCacheClusterResult") in try - Util.or_error - (Util.option_bind resp RebootCacheClusterResult.parse) + Util.or_error (Util.option_bind resp RebootCacheClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RebootCacheClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RebootCacheClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RebootCacheClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RebootCacheClusterResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.CacheClusterNotFound; Errors_internal.InvalidCacheClusterState ] - @ Errors_internal.common - in + [Errors_internal.CacheClusterNotFound; + Errors_internal.InvalidCacheClusterState] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/rebootCacheCluster.mli b/libraries/elasticache/lib/rebootCacheCluster.mli index d18357543..c13fb7330 100644 --- a/libraries/elasticache/lib/rebootCacheCluster.mli +++ b/libraries/elasticache/lib/rebootCacheCluster.mli @@ -1,10 +1,7 @@ open Types - type input = RebootCacheClusterMessage.t - type output = RebootCacheClusterResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/removeTagsFromResource.ml b/libraries/elasticache/lib/removeTagsFromResource.ml index d3e56a6a9..cf642829b 100644 --- a/libraries/elasticache/lib/removeTagsFromResource.ml +++ b/libraries/elasticache/lib/removeTagsFromResource.ml @@ -1,68 +1,62 @@ open Types open Aws - type input = RemoveTagsFromResourceMessage.t - type output = TagListMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "RemoveTagsFromResource" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["RemoveTagsFromResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RemoveTagsFromResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (RemoveTagsFromResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RemoveTagsFromResourceResponse" (snd xml)) - (Xml.member "RemoveTagsFromResourceResult") - in + (Xml.member "RemoveTagsFromResourceResult") in try - Util.or_error - (Util.option_bind resp TagListMessage.parse) + Util.or_error (Util.option_bind resp TagListMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed TagListMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed TagListMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TagListMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TagListMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.TagNotFound - ; Errors_internal.InvalidARN - ; Errors_internal.SnapshotNotFoundFault - ; Errors_internal.CacheClusterNotFound - ] - @ Errors_internal.common - in + [Errors_internal.TagNotFound; + Errors_internal.InvalidARN; + Errors_internal.SnapshotNotFoundFault; + Errors_internal.CacheClusterNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/removeTagsFromResource.mli b/libraries/elasticache/lib/removeTagsFromResource.mli index 3d81e4a0e..db22e31ab 100644 --- a/libraries/elasticache/lib/removeTagsFromResource.mli +++ b/libraries/elasticache/lib/removeTagsFromResource.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveTagsFromResourceMessage.t - type output = TagListMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/resetCacheParameterGroup.ml b/libraries/elasticache/lib/resetCacheParameterGroup.ml index 4225e6044..a2b2c26ae 100644 --- a/libraries/elasticache/lib/resetCacheParameterGroup.ml +++ b/libraries/elasticache/lib/resetCacheParameterGroup.ml @@ -1,71 +1,67 @@ open Types open Aws - type input = ResetCacheParameterGroupMessage.t - type output = CacheParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "ResetCacheParameterGroup" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["ResetCacheParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetCacheParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ResetCacheParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ResetCacheParameterGroupResponse" (snd xml)) - (Xml.member "ResetCacheParameterGroupResult") - in + (Xml.member "ResetCacheParameterGroupResult") in try Util.or_error (Util.option_bind resp CacheParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CacheParameterGroupNameMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CacheParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CacheParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CacheParameterGroupNameMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.CacheParameterGroupNotFound - ; Errors_internal.InvalidCacheParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.CacheParameterGroupNotFound; + Errors_internal.InvalidCacheParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/resetCacheParameterGroup.mli b/libraries/elasticache/lib/resetCacheParameterGroup.mli index cd5013da1..c6f8f1991 100644 --- a/libraries/elasticache/lib/resetCacheParameterGroup.mli +++ b/libraries/elasticache/lib/resetCacheParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ResetCacheParameterGroupMessage.t - type output = CacheParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml index 08c6ce45e..0a81e4813 100644 --- a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml +++ b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml @@ -1,74 +1,69 @@ open Types open Aws - type input = RevokeCacheSecurityGroupIngressMessage.t - type output = RevokeCacheSecurityGroupIngressResult.t - type error = Errors_internal.t - let service = "elasticache" - 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", [ "2015-02-02" ]; "Action", [ "RevokeCacheSecurityGroupIngress" ] ] + [("Version", ["2015-02-02"]); + ("Action", ["RevokeCacheSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RevokeCacheSecurityGroupIngressMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RevokeCacheSecurityGroupIngressMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RevokeCacheSecurityGroupIngressResponse" (snd xml)) - (Xml.member "RevokeCacheSecurityGroupIngressResult") - in + (Xml.member "RevokeCacheSecurityGroupIngressResult") in try Util.or_error (Util.option_bind resp RevokeCacheSecurityGroupIngressResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RevokeCacheSecurityGroupIngressResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RevokeCacheSecurityGroupIngressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RevokeCacheSecurityGroupIngressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RevokeCacheSecurityGroupIngressResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidParameterCombination - ; Errors_internal.InvalidParameterValue - ; Errors_internal.InvalidCacheSecurityGroupState - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.CacheSecurityGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidParameterCombination; + Errors_internal.InvalidParameterValue; + Errors_internal.InvalidCacheSecurityGroupState; + Errors_internal.AuthorizationNotFound; + Errors_internal.CacheSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.mli b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.mli index 51a26f11a..bac0beb35 100644 --- a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.mli +++ b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = RevokeCacheSecurityGroupIngressMessage.t - type output = RevokeCacheSecurityGroupIngressResult.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 \ No newline at end of file diff --git a/libraries/elasticache/lib/types.ml b/libraries/elasticache/lib/types.ml index bd855daff..736ac0829 100644 --- a/libraries/elasticache/lib/types.ml +++ b/libraries/elasticache/lib/types.ml @@ -1,7294 +1,7300 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module Endpoint = struct - type t = - { address : String.t option - ; port : Integer.t option - } - - let make ?address ?port () = { address; port } - - let parse xml = - Some - { address = Util.option_bind (Xml.member "Address" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.address (fun f -> Query.Pair ("Address", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.address (fun f -> "address", String.to_json f) - ]) - - let of_json j = - { address = Util.option_map (Json.lookup j "address") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - } -end - -module NodeGroupMember = struct - type t = - { cache_cluster_id : String.t option - ; cache_node_id : String.t option - ; read_endpoint : Endpoint.t option - ; preferred_availability_zone : String.t option - ; current_role : String.t option - } - - let make - ?cache_cluster_id - ?cache_node_id - ?read_endpoint - ?preferred_availability_zone - ?current_role - () = - { cache_cluster_id - ; cache_node_id - ; read_endpoint - ; preferred_availability_zone - ; current_role - } - - let parse xml = - Some - { cache_cluster_id = Util.option_bind (Xml.member "CacheClusterId" xml) String.parse - ; cache_node_id = Util.option_bind (Xml.member "CacheNodeId" xml) String.parse - ; read_endpoint = Util.option_bind (Xml.member "ReadEndpoint" xml) Endpoint.parse - ; preferred_availability_zone = - Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) String.parse - ; current_role = Util.option_bind (Xml.member "CurrentRole" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.current_role (fun f -> - Query.Pair ("CurrentRole", String.to_query f)) - ; Util.option_map v.preferred_availability_zone (fun f -> - Query.Pair ("PreferredAvailabilityZone", String.to_query f)) - ; Util.option_map v.read_endpoint (fun f -> - Query.Pair ("ReadEndpoint", Endpoint.to_query f)) - ; Util.option_map v.cache_node_id (fun f -> - Query.Pair ("CacheNodeId", String.to_query f)) - ; Util.option_map v.cache_cluster_id (fun f -> - Query.Pair ("CacheClusterId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.current_role (fun f -> "current_role", String.to_json f) - ; Util.option_map v.preferred_availability_zone (fun f -> - "preferred_availability_zone", String.to_json f) - ; Util.option_map v.read_endpoint (fun f -> "read_endpoint", Endpoint.to_json f) - ; Util.option_map v.cache_node_id (fun f -> "cache_node_id", String.to_json f) - ; Util.option_map v.cache_cluster_id (fun f -> - "cache_cluster_id", String.to_json f) - ]) - - let of_json j = - { cache_cluster_id = Util.option_map (Json.lookup j "cache_cluster_id") String.of_json - ; cache_node_id = Util.option_map (Json.lookup j "cache_node_id") String.of_json - ; read_endpoint = Util.option_map (Json.lookup j "read_endpoint") Endpoint.of_json - ; preferred_availability_zone = - Util.option_map (Json.lookup j "preferred_availability_zone") String.of_json - ; current_role = Util.option_map (Json.lookup j "current_role") String.of_json - } -end - -module AvailabilityZone = struct - type t = { name : String.t option } - - let make ?name () = { name } - - let parse xml = Some { name = Util.option_bind (Xml.member "Name" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> "name", String.to_json f) ]) - - let of_json j = { name = Util.option_map (Json.lookup j "name") String.of_json } -end - -module CacheNodeTypeSpecificValue = struct - type t = - { cache_node_type : String.t option - ; value : String.t option - } - - let make ?cache_node_type ?value () = { cache_node_type; value } - - let parse xml = - Some - { cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ]) - - let of_json j = - { cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module NodeGroupMemberList = struct - type t = NodeGroupMember.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NodeGroupMember.parse (Xml.members "NodeGroupMember" xml)) - - let to_query v = Query.to_query_list NodeGroupMember.to_query v - - let to_json v = `List (List.map NodeGroupMember.to_json v) - - let of_json j = Json.to_list NodeGroupMember.of_json j -end - -module RecurringCharge = struct - type t = - { recurring_charge_amount : Double.t option - ; recurring_charge_frequency : String.t option - } - - let make ?recurring_charge_amount ?recurring_charge_frequency () = - { recurring_charge_amount; recurring_charge_frequency } - - let parse xml = - Some - { recurring_charge_amount = - Util.option_bind (Xml.member "RecurringChargeAmount" xml) Double.parse - ; recurring_charge_frequency = - Util.option_bind (Xml.member "RecurringChargeFrequency" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.recurring_charge_frequency (fun f -> - Query.Pair ("RecurringChargeFrequency", String.to_query f)) - ; Util.option_map v.recurring_charge_amount (fun f -> - Query.Pair ("RecurringChargeAmount", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.recurring_charge_frequency (fun f -> - "recurring_charge_frequency", String.to_json f) - ; Util.option_map v.recurring_charge_amount (fun f -> - "recurring_charge_amount", Double.to_json f) - ]) - - let of_json j = - { recurring_charge_amount = - Util.option_map (Json.lookup j "recurring_charge_amount") Double.of_json - ; recurring_charge_frequency = - Util.option_map (Json.lookup j "recurring_charge_frequency") String.of_json - } -end - -module NodeSnapshot = struct - type t = - { cache_node_id : String.t option - ; cache_size : String.t option - ; cache_node_create_time : DateTime.t option - ; snapshot_create_time : DateTime.t option - } - - let make ?cache_node_id ?cache_size ?cache_node_create_time ?snapshot_create_time () = - { cache_node_id; cache_size; cache_node_create_time; snapshot_create_time } - - let parse xml = - Some - { cache_node_id = Util.option_bind (Xml.member "CacheNodeId" xml) String.parse - ; cache_size = Util.option_bind (Xml.member "CacheSize" xml) String.parse - ; cache_node_create_time = - Util.option_bind (Xml.member "CacheNodeCreateTime" xml) DateTime.parse - ; snapshot_create_time = - Util.option_bind (Xml.member "SnapshotCreateTime" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_create_time (fun f -> - Query.Pair ("SnapshotCreateTime", DateTime.to_query f)) - ; Util.option_map v.cache_node_create_time (fun f -> - Query.Pair ("CacheNodeCreateTime", DateTime.to_query f)) - ; Util.option_map v.cache_size (fun f -> - Query.Pair ("CacheSize", String.to_query f)) - ; Util.option_map v.cache_node_id (fun f -> - Query.Pair ("CacheNodeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_create_time (fun f -> - "snapshot_create_time", DateTime.to_json f) - ; Util.option_map v.cache_node_create_time (fun f -> - "cache_node_create_time", DateTime.to_json f) - ; Util.option_map v.cache_size (fun f -> "cache_size", String.to_json f) - ; Util.option_map v.cache_node_id (fun f -> "cache_node_id", String.to_json f) - ]) - - let of_json j = - { cache_node_id = Util.option_map (Json.lookup j "cache_node_id") String.of_json - ; cache_size = Util.option_map (Json.lookup j "cache_size") String.of_json - ; cache_node_create_time = - Util.option_map (Json.lookup j "cache_node_create_time") DateTime.of_json - ; snapshot_create_time = - Util.option_map (Json.lookup j "snapshot_create_time") DateTime.of_json - } -end - -module Subnet = struct - type t = - { subnet_identifier : String.t option - ; subnet_availability_zone : AvailabilityZone.t option - } - - let make ?subnet_identifier ?subnet_availability_zone () = - { subnet_identifier; subnet_availability_zone } - - let parse xml = - Some - { subnet_identifier = - Util.option_bind (Xml.member "SubnetIdentifier" xml) String.parse - ; subnet_availability_zone = - Util.option_bind - (Xml.member "SubnetAvailabilityZone" xml) - AvailabilityZone.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subnet_availability_zone (fun f -> - Query.Pair ("SubnetAvailabilityZone", AvailabilityZone.to_query f)) - ; Util.option_map v.subnet_identifier (fun f -> - Query.Pair ("SubnetIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subnet_availability_zone (fun f -> - "subnet_availability_zone", AvailabilityZone.to_json f) - ; Util.option_map v.subnet_identifier (fun f -> - "subnet_identifier", String.to_json f) - ]) - - let of_json j = - { subnet_identifier = - Util.option_map (Json.lookup j "subnet_identifier") String.of_json - ; subnet_availability_zone = - Util.option_map - (Json.lookup j "subnet_availability_zone") - AvailabilityZone.of_json - } -end - -module CacheNode = struct - type t = - { cache_node_id : String.t option - ; cache_node_status : String.t option - ; cache_node_create_time : DateTime.t option - ; endpoint : Endpoint.t option - ; parameter_group_status : String.t option - ; source_cache_node_id : String.t option - ; customer_availability_zone : String.t option - } - - let make - ?cache_node_id - ?cache_node_status - ?cache_node_create_time - ?endpoint - ?parameter_group_status - ?source_cache_node_id - ?customer_availability_zone - () = - { cache_node_id - ; cache_node_status - ; cache_node_create_time - ; endpoint - ; parameter_group_status - ; source_cache_node_id - ; customer_availability_zone - } - - let parse xml = - Some - { cache_node_id = Util.option_bind (Xml.member "CacheNodeId" xml) String.parse - ; cache_node_status = - Util.option_bind (Xml.member "CacheNodeStatus" xml) String.parse - ; cache_node_create_time = - Util.option_bind (Xml.member "CacheNodeCreateTime" xml) DateTime.parse - ; endpoint = Util.option_bind (Xml.member "Endpoint" xml) Endpoint.parse - ; parameter_group_status = - Util.option_bind (Xml.member "ParameterGroupStatus" xml) String.parse - ; source_cache_node_id = - Util.option_bind (Xml.member "SourceCacheNodeId" xml) String.parse - ; customer_availability_zone = - Util.option_bind (Xml.member "CustomerAvailabilityZone" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.customer_availability_zone (fun f -> - Query.Pair ("CustomerAvailabilityZone", String.to_query f)) - ; Util.option_map v.source_cache_node_id (fun f -> - Query.Pair ("SourceCacheNodeId", String.to_query f)) - ; Util.option_map v.parameter_group_status (fun f -> - Query.Pair ("ParameterGroupStatus", String.to_query f)) - ; Util.option_map v.endpoint (fun f -> - Query.Pair ("Endpoint", Endpoint.to_query f)) - ; Util.option_map v.cache_node_create_time (fun f -> - Query.Pair ("CacheNodeCreateTime", DateTime.to_query f)) - ; Util.option_map v.cache_node_status (fun f -> - Query.Pair ("CacheNodeStatus", String.to_query f)) - ; Util.option_map v.cache_node_id (fun f -> - Query.Pair ("CacheNodeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.customer_availability_zone (fun f -> - "customer_availability_zone", String.to_json f) - ; Util.option_map v.source_cache_node_id (fun f -> - "source_cache_node_id", String.to_json f) - ; Util.option_map v.parameter_group_status (fun f -> - "parameter_group_status", String.to_json f) - ; Util.option_map v.endpoint (fun f -> "endpoint", Endpoint.to_json f) - ; Util.option_map v.cache_node_create_time (fun f -> - "cache_node_create_time", DateTime.to_json f) - ; Util.option_map v.cache_node_status (fun f -> - "cache_node_status", String.to_json f) - ; Util.option_map v.cache_node_id (fun f -> "cache_node_id", String.to_json f) - ]) - - let of_json j = - { cache_node_id = Util.option_map (Json.lookup j "cache_node_id") String.of_json - ; cache_node_status = - Util.option_map (Json.lookup j "cache_node_status") String.of_json - ; cache_node_create_time = - Util.option_map (Json.lookup j "cache_node_create_time") DateTime.of_json - ; endpoint = Util.option_map (Json.lookup j "endpoint") Endpoint.of_json - ; parameter_group_status = - Util.option_map (Json.lookup j "parameter_group_status") String.of_json - ; source_cache_node_id = - Util.option_map (Json.lookup j "source_cache_node_id") String.of_json - ; customer_availability_zone = - Util.option_map (Json.lookup j "customer_availability_zone") String.of_json - } -end - -module CacheNodeIdsList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "CacheNodeId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module CacheSecurityGroupMembership = struct - type t = - { cache_security_group_name : String.t option - ; status : String.t option - } - - let make ?cache_security_group_name ?status () = { cache_security_group_name; status } - - let parse xml = - Some - { cache_security_group_name = - Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.cache_security_group_name (fun f -> - Query.Pair ("CacheSecurityGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.cache_security_group_name (fun f -> - "cache_security_group_name", String.to_json f) - ]) - - let of_json j = - { cache_security_group_name = - Util.option_map (Json.lookup j "cache_security_group_name") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module SecurityGroupMembership = struct - type t = - { security_group_id : String.t option - ; status : String.t option - } - - let make ?security_group_id ?status () = { security_group_id; status } - - let parse xml = - Some - { security_group_id = - Util.option_bind (Xml.member "SecurityGroupId" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.security_group_id (fun f -> - Query.Pair ("SecurityGroupId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.security_group_id (fun f -> - "security_group_id", String.to_json f) - ]) - - let of_json j = - { security_group_id = - Util.option_map (Json.lookup j "security_group_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module CacheNodeTypeSpecificValueList = struct - type t = CacheNodeTypeSpecificValue.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - CacheNodeTypeSpecificValue.parse - (Xml.members "CacheNodeTypeSpecificValue" xml)) - - let to_query v = Query.to_query_list CacheNodeTypeSpecificValue.to_query v - - let to_json v = `List (List.map CacheNodeTypeSpecificValue.to_json v) - - let of_json j = Json.to_list CacheNodeTypeSpecificValue.of_json j -end - -module NodeGroup = struct - type t = - { node_group_id : String.t option - ; status : String.t option - ; primary_endpoint : Endpoint.t option - ; node_group_members : NodeGroupMemberList.t - } - - let make ?node_group_id ?status ?primary_endpoint ?(node_group_members = []) () = - { node_group_id; status; primary_endpoint; node_group_members } - - let parse xml = - Some - { node_group_id = Util.option_bind (Xml.member "NodeGroupId" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; primary_endpoint = - Util.option_bind (Xml.member "PrimaryEndpoint" xml) Endpoint.parse - ; node_group_members = - Util.of_option - [] - (Util.option_bind - (Xml.member "NodeGroupMembers" xml) - NodeGroupMemberList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "NodeGroupMembers.member" - , NodeGroupMemberList.to_query v.node_group_members )) - ; Util.option_map v.primary_endpoint (fun f -> - Query.Pair ("PrimaryEndpoint", Endpoint.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.node_group_id (fun f -> - Query.Pair ("NodeGroupId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("node_group_members", NodeGroupMemberList.to_json v.node_group_members) - ; Util.option_map v.primary_endpoint (fun f -> - "primary_endpoint", Endpoint.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.node_group_id (fun f -> "node_group_id", String.to_json f) - ]) - - let of_json j = - { node_group_id = Util.option_map (Json.lookup j "node_group_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; primary_endpoint = - Util.option_map (Json.lookup j "primary_endpoint") Endpoint.of_json - ; node_group_members = - NodeGroupMemberList.of_json - (Util.of_option_exn (Json.lookup j "node_group_members")) - } -end - -module PendingAutomaticFailoverStatus = struct - type t = - | Enabled - | Disabled - - let str_to_t = [ "disabled", Disabled; "enabled", Enabled ] - - let t_to_str = [ Disabled, "disabled"; Enabled, "enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module EC2SecurityGroup = struct - type t = - { status : String.t option - ; e_c2_security_group_name : String.t option - ; e_c2_security_group_owner_id : String.t option - } - - let make ?status ?e_c2_security_group_name ?e_c2_security_group_owner_id () = - { status; e_c2_security_group_name; e_c2_security_group_owner_id } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "Status" xml) String.parse - ; e_c2_security_group_name = - Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse - ; e_c2_security_group_owner_id = - Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - Query.Pair ("EC2SecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_name (fun f -> - Query.Pair ("EC2SecurityGroupName", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - "e_c2_security_group_owner_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_name (fun f -> - "e_c2_security_group_name", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") String.of_json - ; e_c2_security_group_name = - Util.option_map (Json.lookup j "e_c2_security_group_name") String.of_json - ; e_c2_security_group_owner_id = - Util.option_map (Json.lookup j "e_c2_security_group_owner_id") String.of_json - } -end - -module RecurringChargeList = struct - type t = RecurringCharge.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map RecurringCharge.parse (Xml.members "RecurringCharge" xml)) - - let to_query v = Query.to_query_list RecurringCharge.to_query v - - let to_json v = `List (List.map RecurringCharge.to_json v) - - let of_json j = Json.to_list RecurringCharge.of_json j -end - -module NodeSnapshotList = struct - type t = NodeSnapshot.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map NodeSnapshot.parse (Xml.members "NodeSnapshot" xml)) - - let to_query v = Query.to_query_list NodeSnapshot.to_query v - - let to_json v = `List (List.map NodeSnapshot.to_json v) - - let of_json j = Json.to_list NodeSnapshot.of_json j -end - -module SubnetList = struct - type t = Subnet.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Subnet.parse (Xml.members "Subnet" xml)) - - let to_query v = Query.to_query_list Subnet.to_query v - - let to_json v = `List (List.map Subnet.to_json v) - - let of_json j = Json.to_list Subnet.of_json j -end - -module CacheNodeList = struct - type t = CacheNode.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map CacheNode.parse (Xml.members "CacheNode" xml)) - - let to_query v = Query.to_query_list CacheNode.to_query v - - let to_json v = `List (List.map CacheNode.to_json v) - - let of_json j = Json.to_list CacheNode.of_json j -end - -module CacheParameterGroupStatus = struct - type t = - { cache_parameter_group_name : String.t option - ; parameter_apply_status : String.t option - ; cache_node_ids_to_reboot : CacheNodeIdsList.t - } - - let make - ?cache_parameter_group_name - ?parameter_apply_status - ?(cache_node_ids_to_reboot = []) - () = - { cache_parameter_group_name; parameter_apply_status; cache_node_ids_to_reboot } - - let parse xml = - Some - { cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; parameter_apply_status = - Util.option_bind (Xml.member "ParameterApplyStatus" xml) String.parse - ; cache_node_ids_to_reboot = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeIdsToReboot" xml) - CacheNodeIdsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "CacheNodeIdsToReboot.member" - , CacheNodeIdsList.to_query v.cache_node_ids_to_reboot )) - ; Util.option_map v.parameter_apply_status (fun f -> - Query.Pair ("ParameterApplyStatus", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_node_ids_to_reboot" - , CacheNodeIdsList.to_json v.cache_node_ids_to_reboot ) - ; Util.option_map v.parameter_apply_status (fun f -> - "parameter_apply_status", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; parameter_apply_status = - Util.option_map (Json.lookup j "parameter_apply_status") String.of_json - ; cache_node_ids_to_reboot = - CacheNodeIdsList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_ids_to_reboot")) - } -end - -module CacheSecurityGroupMembershipList = struct - type t = CacheSecurityGroupMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CacheSecurityGroupMembership.parse (Xml.members "CacheSecurityGroup" xml)) - - let to_query v = Query.to_query_list CacheSecurityGroupMembership.to_query v - - let to_json v = `List (List.map CacheSecurityGroupMembership.to_json v) - - let of_json j = Json.to_list CacheSecurityGroupMembership.of_json j -end - -module NotificationConfiguration = struct - type t = - { topic_arn : String.t option - ; topic_status : String.t option - } - - let make ?topic_arn ?topic_status () = { topic_arn; topic_status } - - let parse xml = - Some - { topic_arn = Util.option_bind (Xml.member "TopicArn" xml) String.parse - ; topic_status = Util.option_bind (Xml.member "TopicStatus" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.topic_status (fun f -> - Query.Pair ("TopicStatus", String.to_query f)) - ; Util.option_map v.topic_arn (fun f -> - Query.Pair ("TopicArn", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.topic_status (fun f -> "topic_status", String.to_json f) - ; Util.option_map v.topic_arn (fun f -> "topic_arn", String.to_json f) - ]) - - let of_json j = - { topic_arn = Util.option_map (Json.lookup j "topic_arn") String.of_json - ; topic_status = Util.option_map (Json.lookup j "topic_status") String.of_json - } -end - -module PendingModifiedValues = struct - type t = - { num_cache_nodes : Integer.t option - ; cache_node_ids_to_remove : CacheNodeIdsList.t - ; engine_version : String.t option - } - - let make ?num_cache_nodes ?(cache_node_ids_to_remove = []) ?engine_version () = - { num_cache_nodes; cache_node_ids_to_remove; engine_version } - - let parse xml = - Some - { num_cache_nodes = Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse - ; cache_node_ids_to_remove = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeIdsToRemove" xml) - CacheNodeIdsList.parse) - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Some - (Query.Pair - ( "CacheNodeIdsToRemove.member" - , CacheNodeIdsList.to_query v.cache_node_ids_to_remove )) - ; Util.option_map v.num_cache_nodes (fun f -> - Query.Pair ("NumCacheNodes", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Some - ( "cache_node_ids_to_remove" - , CacheNodeIdsList.to_json v.cache_node_ids_to_remove ) - ; Util.option_map v.num_cache_nodes (fun f -> - "num_cache_nodes", Integer.to_json f) - ]) - - let of_json j = - { num_cache_nodes = Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json - ; cache_node_ids_to_remove = - CacheNodeIdsList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_ids_to_remove")) - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - } -end - -module SecurityGroupMembershipList = struct - type t = SecurityGroupMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map SecurityGroupMembership.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list SecurityGroupMembership.to_query v - - let to_json v = `List (List.map SecurityGroupMembership.to_json v) - - let of_json j = Json.to_list SecurityGroupMembership.of_json j -end - -module CacheNodeTypeSpecificParameter = struct - type t = - { parameter_name : String.t option - ; description : String.t option - ; source : String.t option - ; data_type : String.t option - ; allowed_values : String.t option - ; is_modifiable : Boolean.t option - ; minimum_engine_version : String.t option - ; cache_node_type_specific_values : CacheNodeTypeSpecificValueList.t - } - - let make - ?parameter_name - ?description - ?source - ?data_type - ?allowed_values - ?is_modifiable - ?minimum_engine_version - ?(cache_node_type_specific_values = []) - () = - { parameter_name - ; description - ; source - ; data_type - ; allowed_values - ; is_modifiable - ; minimum_engine_version - ; cache_node_type_specific_values - } - - let parse xml = - Some - { parameter_name = Util.option_bind (Xml.member "ParameterName" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; data_type = Util.option_bind (Xml.member "DataType" xml) String.parse - ; allowed_values = Util.option_bind (Xml.member "AllowedValues" xml) String.parse - ; is_modifiable = Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse - ; minimum_engine_version = - Util.option_bind (Xml.member "MinimumEngineVersion" xml) String.parse - ; cache_node_type_specific_values = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeTypeSpecificValues" xml) - CacheNodeTypeSpecificValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "CacheNodeTypeSpecificValues.member" - , CacheNodeTypeSpecificValueList.to_query - v.cache_node_type_specific_values )) - ; Util.option_map v.minimum_engine_version (fun f -> - Query.Pair ("MinimumEngineVersion", String.to_query f)) - ; Util.option_map v.is_modifiable (fun f -> - Query.Pair ("IsModifiable", Boolean.to_query f)) - ; Util.option_map v.allowed_values (fun f -> - Query.Pair ("AllowedValues", String.to_query f)) - ; Util.option_map v.data_type (fun f -> - Query.Pair ("DataType", String.to_query f)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.parameter_name (fun f -> - Query.Pair ("ParameterName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_node_type_specific_values" - , CacheNodeTypeSpecificValueList.to_json v.cache_node_type_specific_values ) - ; Util.option_map v.minimum_engine_version (fun f -> - "minimum_engine_version", String.to_json f) - ; Util.option_map v.is_modifiable (fun f -> "is_modifiable", Boolean.to_json f) - ; Util.option_map v.allowed_values (fun f -> "allowed_values", String.to_json f) - ; Util.option_map v.data_type (fun f -> "data_type", String.to_json f) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.parameter_name (fun f -> "parameter_name", String.to_json f) - ]) - - let of_json j = - { parameter_name = Util.option_map (Json.lookup j "parameter_name") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; data_type = Util.option_map (Json.lookup j "data_type") String.of_json - ; allowed_values = Util.option_map (Json.lookup j "allowed_values") String.of_json - ; is_modifiable = Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json - ; minimum_engine_version = - Util.option_map (Json.lookup j "minimum_engine_version") String.of_json - ; cache_node_type_specific_values = - CacheNodeTypeSpecificValueList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_type_specific_values")) - } -end - -module Parameter = struct - type t = - { parameter_name : String.t option - ; parameter_value : String.t option - ; description : String.t option - ; source : String.t option - ; data_type : String.t option - ; allowed_values : String.t option - ; is_modifiable : Boolean.t option - ; minimum_engine_version : String.t option - } - - let make - ?parameter_name - ?parameter_value - ?description - ?source - ?data_type - ?allowed_values - ?is_modifiable - ?minimum_engine_version - () = - { parameter_name - ; parameter_value - ; description - ; source - ; data_type - ; allowed_values - ; is_modifiable - ; minimum_engine_version - } - - let parse xml = - Some - { parameter_name = Util.option_bind (Xml.member "ParameterName" xml) String.parse - ; parameter_value = Util.option_bind (Xml.member "ParameterValue" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; data_type = Util.option_bind (Xml.member "DataType" xml) String.parse - ; allowed_values = Util.option_bind (Xml.member "AllowedValues" xml) String.parse - ; is_modifiable = Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse - ; minimum_engine_version = - Util.option_bind (Xml.member "MinimumEngineVersion" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.minimum_engine_version (fun f -> - Query.Pair ("MinimumEngineVersion", String.to_query f)) - ; Util.option_map v.is_modifiable (fun f -> - Query.Pair ("IsModifiable", Boolean.to_query f)) - ; Util.option_map v.allowed_values (fun f -> - Query.Pair ("AllowedValues", String.to_query f)) - ; Util.option_map v.data_type (fun f -> - Query.Pair ("DataType", String.to_query f)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.parameter_value (fun f -> - Query.Pair ("ParameterValue", String.to_query f)) - ; Util.option_map v.parameter_name (fun f -> - Query.Pair ("ParameterName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.minimum_engine_version (fun f -> - "minimum_engine_version", String.to_json f) - ; Util.option_map v.is_modifiable (fun f -> "is_modifiable", Boolean.to_json f) - ; Util.option_map v.allowed_values (fun f -> "allowed_values", String.to_json f) - ; Util.option_map v.data_type (fun f -> "data_type", String.to_json f) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.parameter_value (fun f -> - "parameter_value", String.to_json f) - ; Util.option_map v.parameter_name (fun f -> "parameter_name", String.to_json f) - ]) - - let of_json j = - { parameter_name = Util.option_map (Json.lookup j "parameter_name") String.of_json - ; parameter_value = Util.option_map (Json.lookup j "parameter_value") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; data_type = Util.option_map (Json.lookup j "data_type") String.of_json - ; allowed_values = Util.option_map (Json.lookup j "allowed_values") String.of_json - ; is_modifiable = Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json - ; minimum_engine_version = - Util.option_map (Json.lookup j "minimum_engine_version") String.of_json - } -end - -module SourceType = struct - type t = - | Cache_cluster - | Cache_parameter_group - | Cache_security_group - | Cache_subnet_group - - let str_to_t = - [ "cache-subnet-group", Cache_subnet_group - ; "cache-security-group", Cache_security_group - ; "cache-parameter-group", Cache_parameter_group - ; "cache-cluster", Cache_cluster - ] - - let t_to_str = - [ Cache_subnet_group, "cache-subnet-group" - ; Cache_security_group, "cache-security-group" - ; Cache_parameter_group, "cache-parameter-group" - ; Cache_cluster, "cache-cluster" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AutomaticFailoverStatus = struct - type t = - | Enabled - | Disabled - | Enabling - | Disabling - - let str_to_t = - [ "disabling", Disabling - ; "enabling", Enabling - ; "disabled", Disabled - ; "enabled", Enabled - ] - - let t_to_str = - [ Disabling, "disabling" - ; Enabling, "enabling" - ; Disabled, "disabled" - ; Enabled, "enabled" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ClusterIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ClusterId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module NodeGroupList = struct - type t = NodeGroup.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map NodeGroup.parse (Xml.members "NodeGroup" xml)) - - let to_query v = Query.to_query_list NodeGroup.to_query v - - let to_json v = `List (List.map NodeGroup.to_json v) - - let of_json j = Json.to_list NodeGroup.of_json j -end - -module ReplicationGroupPendingModifiedValues = struct - type t = - { primary_cluster_id : String.t option - ; automatic_failover_status : PendingAutomaticFailoverStatus.t option - } - - let make ?primary_cluster_id ?automatic_failover_status () = - { primary_cluster_id; automatic_failover_status } - - let parse xml = - Some - { primary_cluster_id = - Util.option_bind (Xml.member "PrimaryClusterId" xml) String.parse - ; automatic_failover_status = - Util.option_bind - (Xml.member "AutomaticFailoverStatus" xml) - PendingAutomaticFailoverStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.automatic_failover_status (fun f -> - Query.Pair - ("AutomaticFailoverStatus", PendingAutomaticFailoverStatus.to_query f)) - ; Util.option_map v.primary_cluster_id (fun f -> - Query.Pair ("PrimaryClusterId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.automatic_failover_status (fun f -> - "automatic_failover_status", PendingAutomaticFailoverStatus.to_json f) - ; Util.option_map v.primary_cluster_id (fun f -> - "primary_cluster_id", String.to_json f) - ]) - - let of_json j = - { primary_cluster_id = - Util.option_map (Json.lookup j "primary_cluster_id") String.of_json - ; automatic_failover_status = - Util.option_map - (Json.lookup j "automatic_failover_status") - PendingAutomaticFailoverStatus.of_json - } -end - -module EC2SecurityGroupList = struct - type t = EC2SecurityGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map EC2SecurityGroup.parse (Xml.members "EC2SecurityGroup" xml)) - - let to_query v = Query.to_query_list EC2SecurityGroup.to_query v - - let to_json v = `List (List.map EC2SecurityGroup.to_json v) - - let of_json j = Json.to_list EC2SecurityGroup.of_json j -end - -module ReservedCacheNodesOffering = struct - type t = - { reserved_cache_nodes_offering_id : String.t option - ; cache_node_type : String.t option - ; duration : Integer.t option - ; fixed_price : Double.t option - ; usage_price : Double.t option - ; product_description : String.t option - ; offering_type : String.t option - ; recurring_charges : RecurringChargeList.t - } - - let make - ?reserved_cache_nodes_offering_id - ?cache_node_type - ?duration - ?fixed_price - ?usage_price - ?product_description - ?offering_type - ?(recurring_charges = []) - () = - { reserved_cache_nodes_offering_id - ; cache_node_type - ; duration - ; fixed_price - ; usage_price - ; product_description - ; offering_type - ; recurring_charges - } - - let parse xml = - Some - { reserved_cache_nodes_offering_id = - Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; fixed_price = Util.option_bind (Xml.member "FixedPrice" xml) Double.parse - ; usage_price = Util.option_bind (Xml.member "UsagePrice" xml) Double.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "RecurringCharges" xml) - RecurringChargeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "RecurringCharges.member" - , RecurringChargeList.to_query v.recurring_charges )) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Double.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Double.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - Query.Pair ("ReservedCacheNodesOfferingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("recurring_charges", RecurringChargeList.to_json v.recurring_charges) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Double.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Double.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - "reserved_cache_nodes_offering_id", String.to_json f) - ]) - - let of_json j = - { reserved_cache_nodes_offering_id = - Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Double.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Double.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; recurring_charges = - RecurringChargeList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - } -end - -module CacheParameterGroup = struct - type t = - { cache_parameter_group_name : String.t option - ; cache_parameter_group_family : String.t option - ; description : String.t option - } - - let make ?cache_parameter_group_name ?cache_parameter_group_family ?description () = - { cache_parameter_group_name; cache_parameter_group_family; description } - - let parse xml = - Some - { cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; cache_parameter_group_family = - Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.cache_parameter_group_family (fun f -> - Query.Pair ("CacheParameterGroupFamily", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.cache_parameter_group_family (fun f -> - "cache_parameter_group_family", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; cache_parameter_group_family = - Util.option_map (Json.lookup j "cache_parameter_group_family") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module Snapshot = struct - type t = - { snapshot_name : String.t option - ; cache_cluster_id : String.t option - ; snapshot_status : String.t option - ; snapshot_source : String.t option - ; cache_node_type : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; num_cache_nodes : Integer.t option - ; preferred_availability_zone : String.t option - ; cache_cluster_create_time : DateTime.t option - ; preferred_maintenance_window : String.t option - ; topic_arn : String.t option - ; port : Integer.t option - ; cache_parameter_group_name : String.t option - ; cache_subnet_group_name : String.t option - ; vpc_id : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - ; node_snapshots : NodeSnapshotList.t - } - - let make - ?snapshot_name - ?cache_cluster_id - ?snapshot_status - ?snapshot_source - ?cache_node_type - ?engine - ?engine_version - ?num_cache_nodes - ?preferred_availability_zone - ?cache_cluster_create_time - ?preferred_maintenance_window - ?topic_arn - ?port - ?cache_parameter_group_name - ?cache_subnet_group_name - ?vpc_id - ?auto_minor_version_upgrade - ?snapshot_retention_limit - ?snapshot_window - ?(node_snapshots = []) - () = - { snapshot_name - ; cache_cluster_id - ; snapshot_status - ; snapshot_source - ; cache_node_type - ; engine - ; engine_version - ; num_cache_nodes - ; preferred_availability_zone - ; cache_cluster_create_time - ; preferred_maintenance_window - ; topic_arn - ; port - ; cache_parameter_group_name - ; cache_subnet_group_name - ; vpc_id - ; auto_minor_version_upgrade - ; snapshot_retention_limit - ; snapshot_window - ; node_snapshots - } - - let parse xml = - Some - { snapshot_name = Util.option_bind (Xml.member "SnapshotName" xml) String.parse - ; cache_cluster_id = Util.option_bind (Xml.member "CacheClusterId" xml) String.parse - ; snapshot_status = Util.option_bind (Xml.member "SnapshotStatus" xml) String.parse - ; snapshot_source = Util.option_bind (Xml.member "SnapshotSource" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; num_cache_nodes = Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse - ; preferred_availability_zone = - Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) String.parse - ; cache_cluster_create_time = - Util.option_bind (Xml.member "CacheClusterCreateTime" xml) DateTime.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; topic_arn = Util.option_bind (Xml.member "TopicArn" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - ; node_snapshots = - Util.of_option - [] - (Util.option_bind (Xml.member "NodeSnapshots" xml) NodeSnapshotList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("NodeSnapshots.member", NodeSnapshotList.to_query v.node_snapshots)) - ; Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.topic_arn (fun f -> - Query.Pair ("TopicArn", String.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.cache_cluster_create_time (fun f -> - Query.Pair ("CacheClusterCreateTime", DateTime.to_query f)) - ; Util.option_map v.preferred_availability_zone (fun f -> - Query.Pair ("PreferredAvailabilityZone", String.to_query f)) - ; Util.option_map v.num_cache_nodes (fun f -> - Query.Pair ("NumCacheNodes", Integer.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.snapshot_source (fun f -> - Query.Pair ("SnapshotSource", String.to_query f)) - ; Util.option_map v.snapshot_status (fun f -> - Query.Pair ("SnapshotStatus", String.to_query f)) - ; Util.option_map v.cache_cluster_id (fun f -> - Query.Pair ("CacheClusterId", String.to_query f)) - ; Util.option_map v.snapshot_name (fun f -> - Query.Pair ("SnapshotName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("node_snapshots", NodeSnapshotList.to_json v.node_snapshots) - ; Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.topic_arn (fun f -> "topic_arn", String.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.cache_cluster_create_time (fun f -> - "cache_cluster_create_time", DateTime.to_json f) - ; Util.option_map v.preferred_availability_zone (fun f -> - "preferred_availability_zone", String.to_json f) - ; Util.option_map v.num_cache_nodes (fun f -> - "num_cache_nodes", Integer.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.snapshot_source (fun f -> - "snapshot_source", String.to_json f) - ; Util.option_map v.snapshot_status (fun f -> - "snapshot_status", String.to_json f) - ; Util.option_map v.cache_cluster_id (fun f -> - "cache_cluster_id", String.to_json f) - ; Util.option_map v.snapshot_name (fun f -> "snapshot_name", String.to_json f) - ]) - - let of_json j = - { snapshot_name = Util.option_map (Json.lookup j "snapshot_name") String.of_json - ; cache_cluster_id = Util.option_map (Json.lookup j "cache_cluster_id") String.of_json - ; snapshot_status = Util.option_map (Json.lookup j "snapshot_status") String.of_json - ; snapshot_source = Util.option_map (Json.lookup j "snapshot_source") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; num_cache_nodes = Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json - ; preferred_availability_zone = - Util.option_map (Json.lookup j "preferred_availability_zone") String.of_json - ; cache_cluster_create_time = - Util.option_map (Json.lookup j "cache_cluster_create_time") DateTime.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; topic_arn = Util.option_map (Json.lookup j "topic_arn") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - ; node_snapshots = - NodeSnapshotList.of_json (Util.of_option_exn (Json.lookup j "node_snapshots")) - } -end - -module CacheSubnetGroup = struct - type t = - { cache_subnet_group_name : String.t option - ; cache_subnet_group_description : String.t option - ; vpc_id : String.t option - ; subnets : SubnetList.t - } - - let make - ?cache_subnet_group_name - ?cache_subnet_group_description - ?vpc_id - ?(subnets = []) - () = - { cache_subnet_group_name; cache_subnet_group_description; vpc_id; subnets } - - let parse xml = - Some - { cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; cache_subnet_group_description = - Util.option_bind (Xml.member "CacheSubnetGroupDescription" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) SubnetList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", SubnetList.to_query v.subnets)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.cache_subnet_group_description (fun f -> - Query.Pair ("CacheSubnetGroupDescription", String.to_query f)) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnets", SubnetList.to_json v.subnets) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.cache_subnet_group_description (fun f -> - "cache_subnet_group_description", String.to_json f) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ]) - - let of_json j = - { cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; cache_subnet_group_description = - Util.option_map (Json.lookup j "cache_subnet_group_description") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; subnets = SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets")) - } -end - -module Tag = struct - type t = - { key : String.t option - ; value : String.t option - } - - let make ?key ?value () = { key; value } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module ParameterNameValue = struct - type t = - { parameter_name : String.t option - ; parameter_value : String.t option - } - - let make ?parameter_name ?parameter_value () = { parameter_name; parameter_value } - - let parse xml = - Some - { parameter_name = Util.option_bind (Xml.member "ParameterName" xml) String.parse - ; parameter_value = Util.option_bind (Xml.member "ParameterValue" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.parameter_value (fun f -> - Query.Pair ("ParameterValue", String.to_query f)) - ; Util.option_map v.parameter_name (fun f -> - Query.Pair ("ParameterName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.parameter_value (fun f -> - "parameter_value", String.to_json f) - ; Util.option_map v.parameter_name (fun f -> "parameter_name", String.to_json f) - ]) - - let of_json j = - { parameter_name = Util.option_map (Json.lookup j "parameter_name") String.of_json - ; parameter_value = Util.option_map (Json.lookup j "parameter_value") String.of_json - } -end - -module CacheCluster = struct - type t = - { cache_cluster_id : String.t option - ; configuration_endpoint : Endpoint.t option - ; client_download_landing_page : String.t option - ; cache_node_type : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; cache_cluster_status : String.t option - ; num_cache_nodes : Integer.t option - ; preferred_availability_zone : String.t option - ; cache_cluster_create_time : DateTime.t option - ; preferred_maintenance_window : String.t option - ; pending_modified_values : PendingModifiedValues.t option - ; notification_configuration : NotificationConfiguration.t option - ; cache_security_groups : CacheSecurityGroupMembershipList.t - ; cache_parameter_group : CacheParameterGroupStatus.t option - ; cache_subnet_group_name : String.t option - ; cache_nodes : CacheNodeList.t - ; auto_minor_version_upgrade : Boolean.t option - ; security_groups : SecurityGroupMembershipList.t - ; replication_group_id : String.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - } - - let make - ?cache_cluster_id - ?configuration_endpoint - ?client_download_landing_page - ?cache_node_type - ?engine - ?engine_version - ?cache_cluster_status - ?num_cache_nodes - ?preferred_availability_zone - ?cache_cluster_create_time - ?preferred_maintenance_window - ?pending_modified_values - ?notification_configuration - ?(cache_security_groups = []) - ?cache_parameter_group - ?cache_subnet_group_name - ?(cache_nodes = []) - ?auto_minor_version_upgrade - ?(security_groups = []) - ?replication_group_id - ?snapshot_retention_limit - ?snapshot_window - () = - { cache_cluster_id - ; configuration_endpoint - ; client_download_landing_page - ; cache_node_type - ; engine - ; engine_version - ; cache_cluster_status - ; num_cache_nodes - ; preferred_availability_zone - ; cache_cluster_create_time - ; preferred_maintenance_window - ; pending_modified_values - ; notification_configuration - ; cache_security_groups - ; cache_parameter_group - ; cache_subnet_group_name - ; cache_nodes - ; auto_minor_version_upgrade - ; security_groups - ; replication_group_id - ; snapshot_retention_limit - ; snapshot_window - } - - let parse xml = - Some - { cache_cluster_id = Util.option_bind (Xml.member "CacheClusterId" xml) String.parse - ; configuration_endpoint = - Util.option_bind (Xml.member "ConfigurationEndpoint" xml) Endpoint.parse - ; client_download_landing_page = - Util.option_bind (Xml.member "ClientDownloadLandingPage" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; cache_cluster_status = - Util.option_bind (Xml.member "CacheClusterStatus" xml) String.parse - ; num_cache_nodes = Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse - ; preferred_availability_zone = - Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) String.parse - ; cache_cluster_create_time = - Util.option_bind (Xml.member "CacheClusterCreateTime" xml) DateTime.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; pending_modified_values = - Util.option_bind - (Xml.member "PendingModifiedValues" xml) - PendingModifiedValues.parse - ; notification_configuration = - Util.option_bind - (Xml.member "NotificationConfiguration" xml) - NotificationConfiguration.parse - ; cache_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroups" xml) - CacheSecurityGroupMembershipList.parse) - ; cache_parameter_group = - Util.option_bind - (Xml.member "CacheParameterGroup" xml) - CacheParameterGroupStatus.parse - ; cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; cache_nodes = - Util.of_option - [] - (Util.option_bind (Xml.member "CacheNodes" xml) CacheNodeList.parse) - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroups" xml) - SecurityGroupMembershipList.parse) - ; replication_group_id = - Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.replication_group_id (fun f -> - Query.Pair ("ReplicationGroupId", String.to_query f)) - ; Some - (Query.Pair - ( "SecurityGroups.member" - , SecurityGroupMembershipList.to_query v.security_groups )) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Some (Query.Pair ("CacheNodes.member", CacheNodeList.to_query v.cache_nodes)) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ; Util.option_map v.cache_parameter_group (fun f -> - Query.Pair ("CacheParameterGroup", CacheParameterGroupStatus.to_query f)) - ; Some - (Query.Pair - ( "CacheSecurityGroups.member" - , CacheSecurityGroupMembershipList.to_query v.cache_security_groups )) - ; Util.option_map v.notification_configuration (fun f -> - Query.Pair - ("NotificationConfiguration", NotificationConfiguration.to_query f)) - ; Util.option_map v.pending_modified_values (fun f -> - Query.Pair ("PendingModifiedValues", PendingModifiedValues.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.cache_cluster_create_time (fun f -> - Query.Pair ("CacheClusterCreateTime", DateTime.to_query f)) - ; Util.option_map v.preferred_availability_zone (fun f -> - Query.Pair ("PreferredAvailabilityZone", String.to_query f)) - ; Util.option_map v.num_cache_nodes (fun f -> - Query.Pair ("NumCacheNodes", Integer.to_query f)) - ; Util.option_map v.cache_cluster_status (fun f -> - Query.Pair ("CacheClusterStatus", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.client_download_landing_page (fun f -> - Query.Pair ("ClientDownloadLandingPage", String.to_query f)) - ; Util.option_map v.configuration_endpoint (fun f -> - Query.Pair ("ConfigurationEndpoint", Endpoint.to_query f)) - ; Util.option_map v.cache_cluster_id (fun f -> - Query.Pair ("CacheClusterId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.replication_group_id (fun f -> - "replication_group_id", String.to_json f) - ; Some ("security_groups", SecurityGroupMembershipList.to_json v.security_groups) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Some ("cache_nodes", CacheNodeList.to_json v.cache_nodes) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ; Util.option_map v.cache_parameter_group (fun f -> - "cache_parameter_group", CacheParameterGroupStatus.to_json f) - ; Some - ( "cache_security_groups" - , CacheSecurityGroupMembershipList.to_json v.cache_security_groups ) - ; Util.option_map v.notification_configuration (fun f -> - "notification_configuration", NotificationConfiguration.to_json f) - ; Util.option_map v.pending_modified_values (fun f -> - "pending_modified_values", PendingModifiedValues.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.cache_cluster_create_time (fun f -> - "cache_cluster_create_time", DateTime.to_json f) - ; Util.option_map v.preferred_availability_zone (fun f -> - "preferred_availability_zone", String.to_json f) - ; Util.option_map v.num_cache_nodes (fun f -> - "num_cache_nodes", Integer.to_json f) - ; Util.option_map v.cache_cluster_status (fun f -> - "cache_cluster_status", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.client_download_landing_page (fun f -> - "client_download_landing_page", String.to_json f) - ; Util.option_map v.configuration_endpoint (fun f -> - "configuration_endpoint", Endpoint.to_json f) - ; Util.option_map v.cache_cluster_id (fun f -> - "cache_cluster_id", String.to_json f) - ]) - - let of_json j = - { cache_cluster_id = Util.option_map (Json.lookup j "cache_cluster_id") String.of_json - ; configuration_endpoint = - Util.option_map (Json.lookup j "configuration_endpoint") Endpoint.of_json - ; client_download_landing_page = - Util.option_map (Json.lookup j "client_download_landing_page") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; cache_cluster_status = - Util.option_map (Json.lookup j "cache_cluster_status") String.of_json - ; num_cache_nodes = Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json - ; preferred_availability_zone = - Util.option_map (Json.lookup j "preferred_availability_zone") String.of_json - ; cache_cluster_create_time = - Util.option_map (Json.lookup j "cache_cluster_create_time") DateTime.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; pending_modified_values = - Util.option_map - (Json.lookup j "pending_modified_values") - PendingModifiedValues.of_json - ; notification_configuration = - Util.option_map - (Json.lookup j "notification_configuration") - NotificationConfiguration.of_json - ; cache_security_groups = - CacheSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "cache_security_groups")) - ; cache_parameter_group = - Util.option_map - (Json.lookup j "cache_parameter_group") - CacheParameterGroupStatus.of_json - ; cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; cache_nodes = - CacheNodeList.of_json (Util.of_option_exn (Json.lookup j "cache_nodes")) - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; security_groups = - SecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "security_groups")) - ; replication_group_id = - Util.option_map (Json.lookup j "replication_group_id") String.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - } -end - -module CacheNodeTypeSpecificParametersList = struct - type t = CacheNodeTypeSpecificParameter.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - CacheNodeTypeSpecificParameter.parse - (Xml.members "CacheNodeTypeSpecificParameter" xml)) - - let to_query v = Query.to_query_list CacheNodeTypeSpecificParameter.to_query v - - let to_json v = `List (List.map CacheNodeTypeSpecificParameter.to_json v) - - let of_json j = Json.to_list CacheNodeTypeSpecificParameter.of_json j -end - -module ParametersList = struct - type t = Parameter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Parameter.parse (Xml.members "Parameter" xml)) - - let to_query v = Query.to_query_list Parameter.to_query v - - let to_json v = `List (List.map Parameter.to_json v) - - let of_json j = Json.to_list Parameter.of_json j -end - -module Event = struct - type t = - { source_identifier : String.t option - ; source_type : SourceType.t option - ; message : String.t option - ; date : DateTime.t option - } - - let make ?source_identifier ?source_type ?message ?date () = - { source_identifier; source_type; message; date } - - let parse xml = - Some - { source_identifier = - Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) SourceType.parse - ; message = Util.option_bind (Xml.member "Message" xml) String.parse - ; date = Util.option_bind (Xml.member "Date" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.date (fun f -> Query.Pair ("Date", DateTime.to_query f)) - ; Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", SourceType.to_query f)) - ; Util.option_map v.source_identifier (fun f -> - Query.Pair ("SourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.date (fun f -> "date", DateTime.to_json f) - ; Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.source_type (fun f -> "source_type", SourceType.to_json f) - ; Util.option_map v.source_identifier (fun f -> - "source_identifier", String.to_json f) - ]) - - let of_json j = - { source_identifier = - Util.option_map (Json.lookup j "source_identifier") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") SourceType.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - ; date = Util.option_map (Json.lookup j "date") DateTime.of_json - } -end - -module ReplicationGroup = struct - type t = - { replication_group_id : String.t option - ; description : String.t option - ; status : String.t option - ; pending_modified_values : ReplicationGroupPendingModifiedValues.t option - ; member_clusters : ClusterIdList.t - ; node_groups : NodeGroupList.t - ; snapshotting_cluster_id : String.t option - ; automatic_failover : AutomaticFailoverStatus.t option - } - - let make - ?replication_group_id - ?description - ?status - ?pending_modified_values - ?(member_clusters = []) - ?(node_groups = []) - ?snapshotting_cluster_id - ?automatic_failover - () = - { replication_group_id - ; description - ; status - ; pending_modified_values - ; member_clusters - ; node_groups - ; snapshotting_cluster_id - ; automatic_failover - } - - let parse xml = - Some - { replication_group_id = - Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; pending_modified_values = - Util.option_bind - (Xml.member "PendingModifiedValues" xml) - ReplicationGroupPendingModifiedValues.parse - ; member_clusters = - Util.of_option - [] - (Util.option_bind (Xml.member "MemberClusters" xml) ClusterIdList.parse) - ; node_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "NodeGroups" xml) NodeGroupList.parse) - ; snapshotting_cluster_id = - Util.option_bind (Xml.member "SnapshottingClusterId" xml) String.parse - ; automatic_failover = - Util.option_bind - (Xml.member "AutomaticFailover" xml) - AutomaticFailoverStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.automatic_failover (fun f -> - Query.Pair ("AutomaticFailover", AutomaticFailoverStatus.to_query f)) - ; Util.option_map v.snapshotting_cluster_id (fun f -> - Query.Pair ("SnapshottingClusterId", String.to_query f)) - ; Some (Query.Pair ("NodeGroups.member", NodeGroupList.to_query v.node_groups)) - ; Some +module Endpoint = + struct + type t = { + address: String.t option ; + port: Integer.t option } + let make ?address ?port () = { address; port } + let parse xml = + Some + { + address = + (Util.option_bind (Xml.member "Address" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.address + (fun f -> Query.Pair ("Address", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.address + (fun f -> ("address", (String.to_json f)))]) + let of_json j = + { + address = (Util.option_map (Json.lookup j "address") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json) + } + end +module NodeGroupMember = + struct + type t = + { + cache_cluster_id: String.t option ; + cache_node_id: String.t option ; + read_endpoint: Endpoint.t option ; + preferred_availability_zone: String.t option ; + current_role: String.t option } + let make ?cache_cluster_id ?cache_node_id ?read_endpoint + ?preferred_availability_zone ?current_role () = + { + cache_cluster_id; + cache_node_id; + read_endpoint; + preferred_availability_zone; + current_role + } + let parse xml = + Some + { + cache_cluster_id = + (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse); + cache_node_id = + (Util.option_bind (Xml.member "CacheNodeId" xml) String.parse); + read_endpoint = + (Util.option_bind (Xml.member "ReadEndpoint" xml) Endpoint.parse); + preferred_availability_zone = + (Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) + String.parse); + current_role = + (Util.option_bind (Xml.member "CurrentRole" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.current_role + (fun f -> Query.Pair ("CurrentRole", (String.to_query f))); + Util.option_map v.preferred_availability_zone + (fun f -> + Query.Pair ("PreferredAvailabilityZone", (String.to_query f))); + Util.option_map v.read_endpoint + (fun f -> Query.Pair ("ReadEndpoint", (Endpoint.to_query f))); + Util.option_map v.cache_node_id + (fun f -> Query.Pair ("CacheNodeId", (String.to_query f))); + Util.option_map v.cache_cluster_id + (fun f -> Query.Pair ("CacheClusterId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.current_role + (fun f -> ("current_role", (String.to_json f))); + Util.option_map v.preferred_availability_zone + (fun f -> ("preferred_availability_zone", (String.to_json f))); + Util.option_map v.read_endpoint + (fun f -> ("read_endpoint", (Endpoint.to_json f))); + Util.option_map v.cache_node_id + (fun f -> ("cache_node_id", (String.to_json f))); + Util.option_map v.cache_cluster_id + (fun f -> ("cache_cluster_id", (String.to_json f)))]) + let of_json j = + { + cache_cluster_id = + (Util.option_map (Json.lookup j "cache_cluster_id") String.of_json); + cache_node_id = + (Util.option_map (Json.lookup j "cache_node_id") String.of_json); + read_endpoint = + (Util.option_map (Json.lookup j "read_endpoint") Endpoint.of_json); + preferred_availability_zone = + (Util.option_map (Json.lookup j "preferred_availability_zone") + String.of_json); + current_role = + (Util.option_map (Json.lookup j "current_role") String.of_json) + } + end +module AvailabilityZone = + struct + type t = { + name: String.t option } + let make ?name () = { name } + let parse xml = + Some { name = (Util.option_bind (Xml.member "Name" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { name = (Util.option_map (Json.lookup j "name") String.of_json) } + end +module CacheNodeTypeSpecificValue = + struct + type t = { + cache_node_type: String.t option ; + value: String.t option } + let make ?cache_node_type ?value () = { cache_node_type; value } + let parse xml = + Some + { + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f)))]) + let of_json j = + { + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module NodeGroupMemberList = + struct + type t = NodeGroupMember.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NodeGroupMember.parse (Xml.members "NodeGroupMember" xml)) + let to_query v = Query.to_query_list NodeGroupMember.to_query v + let to_json v = `List (List.map NodeGroupMember.to_json v) + let of_json j = Json.to_list NodeGroupMember.of_json j + end +module RecurringCharge = + struct + type t = + { + recurring_charge_amount: Double.t option ; + recurring_charge_frequency: String.t option } + let make ?recurring_charge_amount ?recurring_charge_frequency () = + { recurring_charge_amount; recurring_charge_frequency } + let parse xml = + Some + { + recurring_charge_amount = + (Util.option_bind (Xml.member "RecurringChargeAmount" xml) + Double.parse); + recurring_charge_frequency = + (Util.option_bind (Xml.member "RecurringChargeFrequency" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.recurring_charge_frequency + (fun f -> + Query.Pair ("RecurringChargeFrequency", (String.to_query f))); + Util.option_map v.recurring_charge_amount + (fun f -> + Query.Pair ("RecurringChargeAmount", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.recurring_charge_frequency + (fun f -> ("recurring_charge_frequency", (String.to_json f))); + Util.option_map v.recurring_charge_amount + (fun f -> ("recurring_charge_amount", (Double.to_json f)))]) + let of_json j = + { + recurring_charge_amount = + (Util.option_map (Json.lookup j "recurring_charge_amount") + Double.of_json); + recurring_charge_frequency = + (Util.option_map (Json.lookup j "recurring_charge_frequency") + String.of_json) + } + end +module NodeSnapshot = + struct + type t = + { + cache_node_id: String.t option ; + cache_size: String.t option ; + cache_node_create_time: DateTime.t option ; + snapshot_create_time: DateTime.t option } + let make ?cache_node_id ?cache_size ?cache_node_create_time + ?snapshot_create_time () = + { + cache_node_id; + cache_size; + cache_node_create_time; + snapshot_create_time + } + let parse xml = + Some + { + cache_node_id = + (Util.option_bind (Xml.member "CacheNodeId" xml) String.parse); + cache_size = + (Util.option_bind (Xml.member "CacheSize" xml) String.parse); + cache_node_create_time = + (Util.option_bind (Xml.member "CacheNodeCreateTime" xml) + DateTime.parse); + snapshot_create_time = + (Util.option_bind (Xml.member "SnapshotCreateTime" xml) + DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_create_time + (fun f -> + Query.Pair ("SnapshotCreateTime", (DateTime.to_query f))); + Util.option_map v.cache_node_create_time + (fun f -> + Query.Pair ("CacheNodeCreateTime", (DateTime.to_query f))); + Util.option_map v.cache_size + (fun f -> Query.Pair ("CacheSize", (String.to_query f))); + Util.option_map v.cache_node_id + (fun f -> Query.Pair ("CacheNodeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_create_time + (fun f -> ("snapshot_create_time", (DateTime.to_json f))); + Util.option_map v.cache_node_create_time + (fun f -> ("cache_node_create_time", (DateTime.to_json f))); + Util.option_map v.cache_size + (fun f -> ("cache_size", (String.to_json f))); + Util.option_map v.cache_node_id + (fun f -> ("cache_node_id", (String.to_json f)))]) + let of_json j = + { + cache_node_id = + (Util.option_map (Json.lookup j "cache_node_id") String.of_json); + cache_size = + (Util.option_map (Json.lookup j "cache_size") String.of_json); + cache_node_create_time = + (Util.option_map (Json.lookup j "cache_node_create_time") + DateTime.of_json); + snapshot_create_time = + (Util.option_map (Json.lookup j "snapshot_create_time") + DateTime.of_json) + } + end +module Subnet = + struct + type t = + { + subnet_identifier: String.t option ; + subnet_availability_zone: AvailabilityZone.t option } + let make ?subnet_identifier ?subnet_availability_zone () = + { subnet_identifier; subnet_availability_zone } + let parse xml = + Some + { + subnet_identifier = + (Util.option_bind (Xml.member "SubnetIdentifier" xml) + String.parse); + subnet_availability_zone = + (Util.option_bind (Xml.member "SubnetAvailabilityZone" xml) + AvailabilityZone.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subnet_availability_zone + (fun f -> + Query.Pair + ("SubnetAvailabilityZone", (AvailabilityZone.to_query f))); + Util.option_map v.subnet_identifier + (fun f -> Query.Pair ("SubnetIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subnet_availability_zone + (fun f -> + ("subnet_availability_zone", (AvailabilityZone.to_json f))); + Util.option_map v.subnet_identifier + (fun f -> ("subnet_identifier", (String.to_json f)))]) + let of_json j = + { + subnet_identifier = + (Util.option_map (Json.lookup j "subnet_identifier") String.of_json); + subnet_availability_zone = + (Util.option_map (Json.lookup j "subnet_availability_zone") + AvailabilityZone.of_json) + } + end +module CacheNode = + struct + type t = + { + cache_node_id: String.t option ; + cache_node_status: String.t option ; + cache_node_create_time: DateTime.t option ; + endpoint: Endpoint.t option ; + parameter_group_status: String.t option ; + source_cache_node_id: String.t option ; + customer_availability_zone: String.t option } + let make ?cache_node_id ?cache_node_status ?cache_node_create_time + ?endpoint ?parameter_group_status ?source_cache_node_id + ?customer_availability_zone () = + { + cache_node_id; + cache_node_status; + cache_node_create_time; + endpoint; + parameter_group_status; + source_cache_node_id; + customer_availability_zone + } + let parse xml = + Some + { + cache_node_id = + (Util.option_bind (Xml.member "CacheNodeId" xml) String.parse); + cache_node_status = + (Util.option_bind (Xml.member "CacheNodeStatus" xml) String.parse); + cache_node_create_time = + (Util.option_bind (Xml.member "CacheNodeCreateTime" xml) + DateTime.parse); + endpoint = + (Util.option_bind (Xml.member "Endpoint" xml) Endpoint.parse); + parameter_group_status = + (Util.option_bind (Xml.member "ParameterGroupStatus" xml) + String.parse); + source_cache_node_id = + (Util.option_bind (Xml.member "SourceCacheNodeId" xml) + String.parse); + customer_availability_zone = + (Util.option_bind (Xml.member "CustomerAvailabilityZone" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.customer_availability_zone + (fun f -> + Query.Pair ("CustomerAvailabilityZone", (String.to_query f))); + Util.option_map v.source_cache_node_id + (fun f -> Query.Pair ("SourceCacheNodeId", (String.to_query f))); + Util.option_map v.parameter_group_status + (fun f -> + Query.Pair ("ParameterGroupStatus", (String.to_query f))); + Util.option_map v.endpoint + (fun f -> Query.Pair ("Endpoint", (Endpoint.to_query f))); + Util.option_map v.cache_node_create_time + (fun f -> + Query.Pair ("CacheNodeCreateTime", (DateTime.to_query f))); + Util.option_map v.cache_node_status + (fun f -> Query.Pair ("CacheNodeStatus", (String.to_query f))); + Util.option_map v.cache_node_id + (fun f -> Query.Pair ("CacheNodeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.customer_availability_zone + (fun f -> ("customer_availability_zone", (String.to_json f))); + Util.option_map v.source_cache_node_id + (fun f -> ("source_cache_node_id", (String.to_json f))); + Util.option_map v.parameter_group_status + (fun f -> ("parameter_group_status", (String.to_json f))); + Util.option_map v.endpoint + (fun f -> ("endpoint", (Endpoint.to_json f))); + Util.option_map v.cache_node_create_time + (fun f -> ("cache_node_create_time", (DateTime.to_json f))); + Util.option_map v.cache_node_status + (fun f -> ("cache_node_status", (String.to_json f))); + Util.option_map v.cache_node_id + (fun f -> ("cache_node_id", (String.to_json f)))]) + let of_json j = + { + cache_node_id = + (Util.option_map (Json.lookup j "cache_node_id") String.of_json); + cache_node_status = + (Util.option_map (Json.lookup j "cache_node_status") String.of_json); + cache_node_create_time = + (Util.option_map (Json.lookup j "cache_node_create_time") + DateTime.of_json); + endpoint = + (Util.option_map (Json.lookup j "endpoint") Endpoint.of_json); + parameter_group_status = + (Util.option_map (Json.lookup j "parameter_group_status") + String.of_json); + source_cache_node_id = + (Util.option_map (Json.lookup j "source_cache_node_id") + String.of_json); + customer_availability_zone = + (Util.option_map (Json.lookup j "customer_availability_zone") + String.of_json) + } + end +module CacheNodeIdsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "CacheNodeId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module CacheSecurityGroupMembership = + struct + type t = + { + cache_security_group_name: String.t option ; + status: String.t option } + let make ?cache_security_group_name ?status () = + { cache_security_group_name; status } + let parse xml = + Some + { + cache_security_group_name = + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.cache_security_group_name + (fun f -> + Query.Pair ("CacheSecurityGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.cache_security_group_name + (fun f -> ("cache_security_group_name", (String.to_json f)))]) + let of_json j = + { + cache_security_group_name = + (Util.option_map (Json.lookup j "cache_security_group_name") + String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module SecurityGroupMembership = + struct + type t = { + security_group_id: String.t option ; + status: String.t option } + let make ?security_group_id ?status () = { security_group_id; status } + let parse xml = + Some + { + security_group_id = + (Util.option_bind (Xml.member "SecurityGroupId" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.security_group_id + (fun f -> Query.Pair ("SecurityGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.security_group_id + (fun f -> ("security_group_id", (String.to_json f)))]) + let of_json j = + { + security_group_id = + (Util.option_map (Json.lookup j "security_group_id") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module CacheNodeTypeSpecificValueList = + struct + type t = CacheNodeTypeSpecificValue.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheNodeTypeSpecificValue.parse + (Xml.members "CacheNodeTypeSpecificValue" xml)) + let to_query v = + Query.to_query_list CacheNodeTypeSpecificValue.to_query v + let to_json v = `List (List.map CacheNodeTypeSpecificValue.to_json v) + let of_json j = Json.to_list CacheNodeTypeSpecificValue.of_json j + end +module NodeGroup = + struct + type t = + { + node_group_id: String.t option ; + status: String.t option ; + primary_endpoint: Endpoint.t option ; + node_group_members: NodeGroupMemberList.t } + let make ?node_group_id ?status ?primary_endpoint + ?(node_group_members= []) () = + { node_group_id; status; primary_endpoint; node_group_members } + let parse xml = + Some + { + node_group_id = + (Util.option_bind (Xml.member "NodeGroupId" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + primary_endpoint = + (Util.option_bind (Xml.member "PrimaryEndpoint" xml) + Endpoint.parse); + node_group_members = + (Util.of_option [] + (Util.option_bind (Xml.member "NodeGroupMembers" xml) + NodeGroupMemberList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NodeGroupMembers.member", + (NodeGroupMemberList.to_query v.node_group_members))); + Util.option_map v.primary_endpoint + (fun f -> Query.Pair ("PrimaryEndpoint", (Endpoint.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.node_group_id + (fun f -> Query.Pair ("NodeGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("node_group_members", + (NodeGroupMemberList.to_json v.node_group_members)); + Util.option_map v.primary_endpoint + (fun f -> ("primary_endpoint", (Endpoint.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.node_group_id + (fun f -> ("node_group_id", (String.to_json f)))]) + let of_json j = + { + node_group_id = + (Util.option_map (Json.lookup j "node_group_id") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + primary_endpoint = + (Util.option_map (Json.lookup j "primary_endpoint") + Endpoint.of_json); + node_group_members = + (NodeGroupMemberList.of_json + (Util.of_option_exn (Json.lookup j "node_group_members"))) + } + end +module PendingAutomaticFailoverStatus = + struct + type t = + | Enabled + | Disabled + let str_to_t = [("disabled", Disabled); ("enabled", Enabled)] + let t_to_str = [(Disabled, "disabled"); (Enabled, "enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module EC2SecurityGroup = + struct + type t = + { + status: String.t option ; + e_c2_security_group_name: String.t option ; + e_c2_security_group_owner_id: String.t option } + let make ?status ?e_c2_security_group_name + ?e_c2_security_group_owner_id () = + { status; e_c2_security_group_name; e_c2_security_group_owner_id } + let parse xml = + Some + { + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + e_c2_security_group_name = + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse); + e_c2_security_group_owner_id = + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> + Query.Pair ("EC2SecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.e_c2_security_group_name + (fun f -> + Query.Pair ("EC2SecurityGroupName", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> ("e_c2_security_group_owner_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_name + (fun f -> ("e_c2_security_group_name", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f)))]) + let of_json j = + { + status = (Util.option_map (Json.lookup j "status") String.of_json); + e_c2_security_group_name = + (Util.option_map (Json.lookup j "e_c2_security_group_name") + String.of_json); + e_c2_security_group_owner_id = + (Util.option_map (Json.lookup j "e_c2_security_group_owner_id") + String.of_json) + } + end +module RecurringChargeList = + struct + type t = RecurringCharge.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map RecurringCharge.parse (Xml.members "RecurringCharge" xml)) + let to_query v = Query.to_query_list RecurringCharge.to_query v + let to_json v = `List (List.map RecurringCharge.to_json v) + let of_json j = Json.to_list RecurringCharge.of_json j + end +module NodeSnapshotList = + struct + type t = NodeSnapshot.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NodeSnapshot.parse (Xml.members "NodeSnapshot" xml)) + let to_query v = Query.to_query_list NodeSnapshot.to_query v + let to_json v = `List (List.map NodeSnapshot.to_json v) + let of_json j = Json.to_list NodeSnapshot.of_json j + end +module SubnetList = + struct + type t = Subnet.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Subnet.parse (Xml.members "Subnet" xml)) + let to_query v = Query.to_query_list Subnet.to_query v + let to_json v = `List (List.map Subnet.to_json v) + let of_json j = Json.to_list Subnet.of_json j + end +module CacheNodeList = + struct + type t = CacheNode.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheNode.parse (Xml.members "CacheNode" xml)) + let to_query v = Query.to_query_list CacheNode.to_query v + let to_json v = `List (List.map CacheNode.to_json v) + let of_json j = Json.to_list CacheNode.of_json j + end +module CacheParameterGroupStatus = + struct + type t = + { + cache_parameter_group_name: String.t option ; + parameter_apply_status: String.t option ; + cache_node_ids_to_reboot: CacheNodeIdsList.t } + let make ?cache_parameter_group_name ?parameter_apply_status + ?(cache_node_ids_to_reboot= []) () = + { + cache_parameter_group_name; + parameter_apply_status; + cache_node_ids_to_reboot + } + let parse xml = + Some + { + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + parameter_apply_status = + (Util.option_bind (Xml.member "ParameterApplyStatus" xml) + String.parse); + cache_node_ids_to_reboot = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheNodeIdsToReboot" xml) + CacheNodeIdsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheNodeIdsToReboot.member", + (CacheNodeIdsList.to_query v.cache_node_ids_to_reboot))); + Util.option_map v.parameter_apply_status + (fun f -> + Query.Pair ("ParameterApplyStatus", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_node_ids_to_reboot", + (CacheNodeIdsList.to_json v.cache_node_ids_to_reboot)); + Util.option_map v.parameter_apply_status + (fun f -> ("parameter_apply_status", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + parameter_apply_status = + (Util.option_map (Json.lookup j "parameter_apply_status") + String.of_json); + cache_node_ids_to_reboot = + (CacheNodeIdsList.of_json + (Util.of_option_exn (Json.lookup j "cache_node_ids_to_reboot"))) + } + end +module CacheSecurityGroupMembershipList = + struct + type t = CacheSecurityGroupMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheSecurityGroupMembership.parse + (Xml.members "CacheSecurityGroup" xml)) + let to_query v = + Query.to_query_list CacheSecurityGroupMembership.to_query v + let to_json v = `List (List.map CacheSecurityGroupMembership.to_json v) + let of_json j = Json.to_list CacheSecurityGroupMembership.of_json j + end +module NotificationConfiguration = + struct + type t = { + topic_arn: String.t option ; + topic_status: String.t option } + let make ?topic_arn ?topic_status () = { topic_arn; topic_status } + let parse xml = + Some + { + topic_arn = + (Util.option_bind (Xml.member "TopicArn" xml) String.parse); + topic_status = + (Util.option_bind (Xml.member "TopicStatus" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.topic_status + (fun f -> Query.Pair ("TopicStatus", (String.to_query f))); + Util.option_map v.topic_arn + (fun f -> Query.Pair ("TopicArn", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.topic_status + (fun f -> ("topic_status", (String.to_json f))); + Util.option_map v.topic_arn + (fun f -> ("topic_arn", (String.to_json f)))]) + let of_json j = + { + topic_arn = + (Util.option_map (Json.lookup j "topic_arn") String.of_json); + topic_status = + (Util.option_map (Json.lookup j "topic_status") String.of_json) + } + end +module PendingModifiedValues = + struct + type t = + { + num_cache_nodes: Integer.t option ; + cache_node_ids_to_remove: CacheNodeIdsList.t ; + engine_version: String.t option } + let make ?num_cache_nodes ?(cache_node_ids_to_remove= []) + ?engine_version () = + { num_cache_nodes; cache_node_ids_to_remove; engine_version } + let parse xml = + Some + { + num_cache_nodes = + (Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse); + cache_node_ids_to_remove = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheNodeIdsToRemove" xml) + CacheNodeIdsList.parse)); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Some (Query.Pair - ("MemberClusters.member", ClusterIdList.to_query v.member_clusters)) - ; Util.option_map v.pending_modified_values (fun f -> - Query.Pair - ( "PendingModifiedValues" - , ReplicationGroupPendingModifiedValues.to_query f )) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.replication_group_id (fun f -> - Query.Pair ("ReplicationGroupId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.automatic_failover (fun f -> - "automatic_failover", AutomaticFailoverStatus.to_json f) - ; Util.option_map v.snapshotting_cluster_id (fun f -> - "snapshotting_cluster_id", String.to_json f) - ; Some ("node_groups", NodeGroupList.to_json v.node_groups) - ; Some ("member_clusters", ClusterIdList.to_json v.member_clusters) - ; Util.option_map v.pending_modified_values (fun f -> - "pending_modified_values", ReplicationGroupPendingModifiedValues.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.replication_group_id (fun f -> - "replication_group_id", String.to_json f) - ]) - - let of_json j = - { replication_group_id = - Util.option_map (Json.lookup j "replication_group_id") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; pending_modified_values = - Util.option_map - (Json.lookup j "pending_modified_values") - ReplicationGroupPendingModifiedValues.of_json - ; member_clusters = - ClusterIdList.of_json (Util.of_option_exn (Json.lookup j "member_clusters")) - ; node_groups = - NodeGroupList.of_json (Util.of_option_exn (Json.lookup j "node_groups")) - ; snapshotting_cluster_id = - Util.option_map (Json.lookup j "snapshotting_cluster_id") String.of_json - ; automatic_failover = - Util.option_map - (Json.lookup j "automatic_failover") - AutomaticFailoverStatus.of_json - } -end - -module CacheEngineVersion = struct - type t = - { engine : String.t option - ; engine_version : String.t option - ; cache_parameter_group_family : String.t option - ; cache_engine_description : String.t option - ; cache_engine_version_description : String.t option - } - - let make - ?engine - ?engine_version - ?cache_parameter_group_family - ?cache_engine_description - ?cache_engine_version_description - () = - { engine - ; engine_version - ; cache_parameter_group_family - ; cache_engine_description - ; cache_engine_version_description - } - - let parse xml = - Some - { engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; cache_parameter_group_family = - Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse - ; cache_engine_description = - Util.option_bind (Xml.member "CacheEngineDescription" xml) String.parse - ; cache_engine_version_description = - Util.option_bind (Xml.member "CacheEngineVersionDescription" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_engine_version_description (fun f -> - Query.Pair ("CacheEngineVersionDescription", String.to_query f)) - ; Util.option_map v.cache_engine_description (fun f -> - Query.Pair ("CacheEngineDescription", String.to_query f)) - ; Util.option_map v.cache_parameter_group_family (fun f -> - Query.Pair ("CacheParameterGroupFamily", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_engine_version_description (fun f -> - "cache_engine_version_description", String.to_json f) - ; Util.option_map v.cache_engine_description (fun f -> - "cache_engine_description", String.to_json f) - ; Util.option_map v.cache_parameter_group_family (fun f -> - "cache_parameter_group_family", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ]) - - let of_json j = - { engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; cache_parameter_group_family = - Util.option_map (Json.lookup j "cache_parameter_group_family") String.of_json - ; cache_engine_description = - Util.option_map (Json.lookup j "cache_engine_description") String.of_json - ; cache_engine_version_description = - Util.option_map (Json.lookup j "cache_engine_version_description") String.of_json - } -end - -module CacheSecurityGroup = struct - type t = - { owner_id : String.t option - ; cache_security_group_name : String.t option - ; description : String.t option - ; e_c2_security_groups : EC2SecurityGroupList.t - } - - let make - ?owner_id - ?cache_security_group_name - ?description - ?(e_c2_security_groups = []) + ("CacheNodeIdsToRemove.member", + (CacheNodeIdsList.to_query v.cache_node_ids_to_remove))); + Util.option_map v.num_cache_nodes + (fun f -> Query.Pair ("NumCacheNodes", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Some + ("cache_node_ids_to_remove", + (CacheNodeIdsList.to_json v.cache_node_ids_to_remove)); + Util.option_map v.num_cache_nodes + (fun f -> ("num_cache_nodes", (Integer.to_json f)))]) + let of_json j = + { + num_cache_nodes = + (Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json); + cache_node_ids_to_remove = + (CacheNodeIdsList.of_json + (Util.of_option_exn (Json.lookup j "cache_node_ids_to_remove"))); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json) + } + end +module SecurityGroupMembershipList = + struct + type t = SecurityGroupMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SecurityGroupMembership.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list SecurityGroupMembership.to_query v + let to_json v = `List (List.map SecurityGroupMembership.to_json v) + let of_json j = Json.to_list SecurityGroupMembership.of_json j + end +module CacheNodeTypeSpecificParameter = + struct + type t = + { + parameter_name: String.t option ; + description: String.t option ; + source: String.t option ; + data_type: String.t option ; + allowed_values: String.t option ; + is_modifiable: Boolean.t option ; + minimum_engine_version: String.t option ; + cache_node_type_specific_values: CacheNodeTypeSpecificValueList.t } + let make ?parameter_name ?description ?source ?data_type + ?allowed_values ?is_modifiable ?minimum_engine_version + ?(cache_node_type_specific_values= []) () = + { + parameter_name; + description; + source; + data_type; + allowed_values; + is_modifiable; + minimum_engine_version; + cache_node_type_specific_values + } + let parse xml = + Some + { + parameter_name = + (Util.option_bind (Xml.member "ParameterName" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + data_type = + (Util.option_bind (Xml.member "DataType" xml) String.parse); + allowed_values = + (Util.option_bind (Xml.member "AllowedValues" xml) String.parse); + is_modifiable = + (Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse); + minimum_engine_version = + (Util.option_bind (Xml.member "MinimumEngineVersion" xml) + String.parse); + cache_node_type_specific_values = + (Util.of_option [] + (Util.option_bind + (Xml.member "CacheNodeTypeSpecificValues" xml) + CacheNodeTypeSpecificValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheNodeTypeSpecificValues.member", + (CacheNodeTypeSpecificValueList.to_query + v.cache_node_type_specific_values))); + Util.option_map v.minimum_engine_version + (fun f -> + Query.Pair ("MinimumEngineVersion", (String.to_query f))); + Util.option_map v.is_modifiable + (fun f -> Query.Pair ("IsModifiable", (Boolean.to_query f))); + Util.option_map v.allowed_values + (fun f -> Query.Pair ("AllowedValues", (String.to_query f))); + Util.option_map v.data_type + (fun f -> Query.Pair ("DataType", (String.to_query f))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.parameter_name + (fun f -> Query.Pair ("ParameterName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_node_type_specific_values", + (CacheNodeTypeSpecificValueList.to_json + v.cache_node_type_specific_values)); + Util.option_map v.minimum_engine_version + (fun f -> ("minimum_engine_version", (String.to_json f))); + Util.option_map v.is_modifiable + (fun f -> ("is_modifiable", (Boolean.to_json f))); + Util.option_map v.allowed_values + (fun f -> ("allowed_values", (String.to_json f))); + Util.option_map v.data_type + (fun f -> ("data_type", (String.to_json f))); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.parameter_name + (fun f -> ("parameter_name", (String.to_json f)))]) + let of_json j = + { + parameter_name = + (Util.option_map (Json.lookup j "parameter_name") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + source = (Util.option_map (Json.lookup j "source") String.of_json); + data_type = + (Util.option_map (Json.lookup j "data_type") String.of_json); + allowed_values = + (Util.option_map (Json.lookup j "allowed_values") String.of_json); + is_modifiable = + (Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json); + minimum_engine_version = + (Util.option_map (Json.lookup j "minimum_engine_version") + String.of_json); + cache_node_type_specific_values = + (CacheNodeTypeSpecificValueList.of_json + (Util.of_option_exn + (Json.lookup j "cache_node_type_specific_values"))) + } + end +module Parameter = + struct + type t = + { + parameter_name: String.t option ; + parameter_value: String.t option ; + description: String.t option ; + source: String.t option ; + data_type: String.t option ; + allowed_values: String.t option ; + is_modifiable: Boolean.t option ; + minimum_engine_version: String.t option } + let make ?parameter_name ?parameter_value ?description ?source + ?data_type ?allowed_values ?is_modifiable ?minimum_engine_version () = - { owner_id; cache_security_group_name; description; e_c2_security_groups } - - let parse xml = - Some - { owner_id = Util.option_bind (Xml.member "OwnerId" xml) String.parse - ; cache_security_group_name = - Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; e_c2_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "EC2SecurityGroups" xml) - EC2SecurityGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + { + parameter_name; + parameter_value; + description; + source; + data_type; + allowed_values; + is_modifiable; + minimum_engine_version + } + let parse xml = + Some + { + parameter_name = + (Util.option_bind (Xml.member "ParameterName" xml) String.parse); + parameter_value = + (Util.option_bind (Xml.member "ParameterValue" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + data_type = + (Util.option_bind (Xml.member "DataType" xml) String.parse); + allowed_values = + (Util.option_bind (Xml.member "AllowedValues" xml) String.parse); + is_modifiable = + (Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse); + minimum_engine_version = + (Util.option_bind (Xml.member "MinimumEngineVersion" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.minimum_engine_version + (fun f -> + Query.Pair ("MinimumEngineVersion", (String.to_query f))); + Util.option_map v.is_modifiable + (fun f -> Query.Pair ("IsModifiable", (Boolean.to_query f))); + Util.option_map v.allowed_values + (fun f -> Query.Pair ("AllowedValues", (String.to_query f))); + Util.option_map v.data_type + (fun f -> Query.Pair ("DataType", (String.to_query f))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.parameter_value + (fun f -> Query.Pair ("ParameterValue", (String.to_query f))); + Util.option_map v.parameter_name + (fun f -> Query.Pair ("ParameterName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.minimum_engine_version + (fun f -> ("minimum_engine_version", (String.to_json f))); + Util.option_map v.is_modifiable + (fun f -> ("is_modifiable", (Boolean.to_json f))); + Util.option_map v.allowed_values + (fun f -> ("allowed_values", (String.to_json f))); + Util.option_map v.data_type + (fun f -> ("data_type", (String.to_json f))); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.parameter_value + (fun f -> ("parameter_value", (String.to_json f))); + Util.option_map v.parameter_name + (fun f -> ("parameter_name", (String.to_json f)))]) + let of_json j = + { + parameter_name = + (Util.option_map (Json.lookup j "parameter_name") String.of_json); + parameter_value = + (Util.option_map (Json.lookup j "parameter_value") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + source = (Util.option_map (Json.lookup j "source") String.of_json); + data_type = + (Util.option_map (Json.lookup j "data_type") String.of_json); + allowed_values = + (Util.option_map (Json.lookup j "allowed_values") String.of_json); + is_modifiable = + (Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json); + minimum_engine_version = + (Util.option_map (Json.lookup j "minimum_engine_version") + String.of_json) + } + end +module SourceType = + struct + type t = + | Cache_cluster + | Cache_parameter_group + | Cache_security_group + | Cache_subnet_group + let str_to_t = + [("cache-subnet-group", Cache_subnet_group); + ("cache-security-group", Cache_security_group); + ("cache-parameter-group", Cache_parameter_group); + ("cache-cluster", Cache_cluster)] + let t_to_str = + [(Cache_subnet_group, "cache-subnet-group"); + (Cache_security_group, "cache-security-group"); + (Cache_parameter_group, "cache-parameter-group"); + (Cache_cluster, "cache-cluster")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AutomaticFailoverStatus = + struct + type t = + | Enabled + | Disabled + | Enabling + | Disabling + let str_to_t = + [("disabling", Disabling); + ("enabling", Enabling); + ("disabled", Disabled); + ("enabled", Enabled)] + let t_to_str = + [(Disabling, "disabling"); + (Enabling, "enabling"); + (Disabled, "disabled"); + (Enabled, "enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ClusterIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ClusterId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module NodeGroupList = + struct + type t = NodeGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map NodeGroup.parse (Xml.members "NodeGroup" xml)) + let to_query v = Query.to_query_list NodeGroup.to_query v + let to_json v = `List (List.map NodeGroup.to_json v) + let of_json j = Json.to_list NodeGroup.of_json j + end +module ReplicationGroupPendingModifiedValues = + struct + type t = + { + primary_cluster_id: String.t option ; + automatic_failover_status: PendingAutomaticFailoverStatus.t option } + let make ?primary_cluster_id ?automatic_failover_status () = + { primary_cluster_id; automatic_failover_status } + let parse xml = + Some + { + primary_cluster_id = + (Util.option_bind (Xml.member "PrimaryClusterId" xml) + String.parse); + automatic_failover_status = + (Util.option_bind (Xml.member "AutomaticFailoverStatus" xml) + PendingAutomaticFailoverStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.automatic_failover_status + (fun f -> + Query.Pair + ("AutomaticFailoverStatus", + (PendingAutomaticFailoverStatus.to_query f))); + Util.option_map v.primary_cluster_id + (fun f -> Query.Pair ("PrimaryClusterId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.automatic_failover_status + (fun f -> + ("automatic_failover_status", + (PendingAutomaticFailoverStatus.to_json f))); + Util.option_map v.primary_cluster_id + (fun f -> ("primary_cluster_id", (String.to_json f)))]) + let of_json j = + { + primary_cluster_id = + (Util.option_map (Json.lookup j "primary_cluster_id") + String.of_json); + automatic_failover_status = + (Util.option_map (Json.lookup j "automatic_failover_status") + PendingAutomaticFailoverStatus.of_json) + } + end +module EC2SecurityGroupList = + struct + type t = EC2SecurityGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map EC2SecurityGroup.parse (Xml.members "EC2SecurityGroup" xml)) + let to_query v = Query.to_query_list EC2SecurityGroup.to_query v + let to_json v = `List (List.map EC2SecurityGroup.to_json v) + let of_json j = Json.to_list EC2SecurityGroup.of_json j + end +module ReservedCacheNodesOffering = + struct + type t = + { + reserved_cache_nodes_offering_id: String.t option ; + cache_node_type: String.t option ; + duration: Integer.t option ; + fixed_price: Double.t option ; + usage_price: Double.t option ; + product_description: String.t option ; + offering_type: String.t option ; + recurring_charges: RecurringChargeList.t } + let make ?reserved_cache_nodes_offering_id ?cache_node_type ?duration + ?fixed_price ?usage_price ?product_description ?offering_type + ?(recurring_charges= []) () = + { + reserved_cache_nodes_offering_id; + cache_node_type; + duration; + fixed_price; + usage_price; + product_description; + offering_type; + recurring_charges + } + let parse xml = + Some + { + reserved_cache_nodes_offering_id = + (Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) + String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + fixed_price = + (Util.option_bind (Xml.member "FixedPrice" xml) Double.parse); + usage_price = + (Util.option_bind (Xml.member "UsagePrice" xml) Double.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "RecurringCharges" xml) + RecurringChargeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RecurringCharges.member", + (RecurringChargeList.to_query v.recurring_charges))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Double.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Double.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + Query.Pair + ("ReservedCacheNodesOfferingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("recurring_charges", + (RecurringChargeList.to_json v.recurring_charges)); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Double.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Double.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + ("reserved_cache_nodes_offering_id", (String.to_json f)))]) + let of_json j = + { + reserved_cache_nodes_offering_id = + (Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") + String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Double.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Double.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + recurring_charges = + (RecurringChargeList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))) + } + end +module CacheParameterGroup = + struct + type t = + { + cache_parameter_group_name: String.t option ; + cache_parameter_group_family: String.t option ; + description: String.t option } + let make ?cache_parameter_group_name ?cache_parameter_group_family + ?description () = + { cache_parameter_group_name; cache_parameter_group_family; description + } + let parse xml = + Some + { + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + cache_parameter_group_family = + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.cache_parameter_group_family + (fun f -> + Query.Pair ("CacheParameterGroupFamily", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.cache_parameter_group_family + (fun f -> ("cache_parameter_group_family", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + cache_parameter_group_family = + (Util.option_map (Json.lookup j "cache_parameter_group_family") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module Snapshot = + struct + type t = + { + snapshot_name: String.t option ; + cache_cluster_id: String.t option ; + snapshot_status: String.t option ; + snapshot_source: String.t option ; + cache_node_type: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + num_cache_nodes: Integer.t option ; + preferred_availability_zone: String.t option ; + cache_cluster_create_time: DateTime.t option ; + preferred_maintenance_window: String.t option ; + topic_arn: String.t option ; + port: Integer.t option ; + cache_parameter_group_name: String.t option ; + cache_subnet_group_name: String.t option ; + vpc_id: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option ; + node_snapshots: NodeSnapshotList.t } + let make ?snapshot_name ?cache_cluster_id ?snapshot_status + ?snapshot_source ?cache_node_type ?engine ?engine_version + ?num_cache_nodes ?preferred_availability_zone + ?cache_cluster_create_time ?preferred_maintenance_window ?topic_arn + ?port ?cache_parameter_group_name ?cache_subnet_group_name ?vpc_id + ?auto_minor_version_upgrade ?snapshot_retention_limit + ?snapshot_window ?(node_snapshots= []) () = + { + snapshot_name; + cache_cluster_id; + snapshot_status; + snapshot_source; + cache_node_type; + engine; + engine_version; + num_cache_nodes; + preferred_availability_zone; + cache_cluster_create_time; + preferred_maintenance_window; + topic_arn; + port; + cache_parameter_group_name; + cache_subnet_group_name; + vpc_id; + auto_minor_version_upgrade; + snapshot_retention_limit; + snapshot_window; + node_snapshots + } + let parse xml = + Some + { + snapshot_name = + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse); + cache_cluster_id = + (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse); + snapshot_status = + (Util.option_bind (Xml.member "SnapshotStatus" xml) String.parse); + snapshot_source = + (Util.option_bind (Xml.member "SnapshotSource" xml) String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + num_cache_nodes = + (Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse); + preferred_availability_zone = + (Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) + String.parse); + cache_cluster_create_time = + (Util.option_bind (Xml.member "CacheClusterCreateTime" xml) + DateTime.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + topic_arn = + (Util.option_bind (Xml.member "TopicArn" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse); + node_snapshots = + (Util.of_option [] + (Util.option_bind (Xml.member "NodeSnapshots" xml) + NodeSnapshotList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NodeSnapshots.member", + (NodeSnapshotList.to_query v.node_snapshots))); + Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.topic_arn + (fun f -> Query.Pair ("TopicArn", (String.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.cache_cluster_create_time + (fun f -> + Query.Pair ("CacheClusterCreateTime", (DateTime.to_query f))); + Util.option_map v.preferred_availability_zone + (fun f -> + Query.Pair ("PreferredAvailabilityZone", (String.to_query f))); + Util.option_map v.num_cache_nodes + (fun f -> Query.Pair ("NumCacheNodes", (Integer.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.snapshot_source + (fun f -> Query.Pair ("SnapshotSource", (String.to_query f))); + Util.option_map v.snapshot_status + (fun f -> Query.Pair ("SnapshotStatus", (String.to_query f))); + Util.option_map v.cache_cluster_id + (fun f -> Query.Pair ("CacheClusterId", (String.to_query f))); + Util.option_map v.snapshot_name + (fun f -> Query.Pair ("SnapshotName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("node_snapshots", (NodeSnapshotList.to_json v.node_snapshots)); + Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.topic_arn + (fun f -> ("topic_arn", (String.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.cache_cluster_create_time + (fun f -> ("cache_cluster_create_time", (DateTime.to_json f))); + Util.option_map v.preferred_availability_zone + (fun f -> ("preferred_availability_zone", (String.to_json f))); + Util.option_map v.num_cache_nodes + (fun f -> ("num_cache_nodes", (Integer.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.snapshot_source + (fun f -> ("snapshot_source", (String.to_json f))); + Util.option_map v.snapshot_status + (fun f -> ("snapshot_status", (String.to_json f))); + Util.option_map v.cache_cluster_id + (fun f -> ("cache_cluster_id", (String.to_json f))); + Util.option_map v.snapshot_name + (fun f -> ("snapshot_name", (String.to_json f)))]) + let of_json j = + { + snapshot_name = + (Util.option_map (Json.lookup j "snapshot_name") String.of_json); + cache_cluster_id = + (Util.option_map (Json.lookup j "cache_cluster_id") String.of_json); + snapshot_status = + (Util.option_map (Json.lookup j "snapshot_status") String.of_json); + snapshot_source = + (Util.option_map (Json.lookup j "snapshot_source") String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + num_cache_nodes = + (Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json); + preferred_availability_zone = + (Util.option_map (Json.lookup j "preferred_availability_zone") + String.of_json); + cache_cluster_create_time = + (Util.option_map (Json.lookup j "cache_cluster_create_time") + DateTime.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + topic_arn = + (Util.option_map (Json.lookup j "topic_arn") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json); + node_snapshots = + (NodeSnapshotList.of_json + (Util.of_option_exn (Json.lookup j "node_snapshots"))) + } + end +module CacheSubnetGroup = + struct + type t = + { + cache_subnet_group_name: String.t option ; + cache_subnet_group_description: String.t option ; + vpc_id: String.t option ; + subnets: SubnetList.t } + let make ?cache_subnet_group_name ?cache_subnet_group_description + ?vpc_id ?(subnets= []) () = + { + cache_subnet_group_name; + cache_subnet_group_description; + vpc_id; + subnets + } + let parse xml = + Some + { + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + cache_subnet_group_description = + (Util.option_bind (Xml.member "CacheSubnetGroupDescription" xml) + String.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) SubnetList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (SubnetList.to_query v.subnets))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.cache_subnet_group_description + (fun f -> + Query.Pair + ("CacheSubnetGroupDescription", (String.to_query f))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnets", (SubnetList.to_json v.subnets)); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.cache_subnet_group_description + (fun f -> ("cache_subnet_group_description", (String.to_json f))); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f)))]) + let of_json j = + { + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + cache_subnet_group_description = + (Util.option_map (Json.lookup j "cache_subnet_group_description") + String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + subnets = + (SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module Tag = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module ParameterNameValue = + struct + type t = + { + parameter_name: String.t option ; + parameter_value: String.t option } + let make ?parameter_name ?parameter_value () = + { parameter_name; parameter_value } + let parse xml = + Some + { + parameter_name = + (Util.option_bind (Xml.member "ParameterName" xml) String.parse); + parameter_value = + (Util.option_bind (Xml.member "ParameterValue" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.parameter_value + (fun f -> Query.Pair ("ParameterValue", (String.to_query f))); + Util.option_map v.parameter_name + (fun f -> Query.Pair ("ParameterName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.parameter_value + (fun f -> ("parameter_value", (String.to_json f))); + Util.option_map v.parameter_name + (fun f -> ("parameter_name", (String.to_json f)))]) + let of_json j = + { + parameter_name = + (Util.option_map (Json.lookup j "parameter_name") String.of_json); + parameter_value = + (Util.option_map (Json.lookup j "parameter_value") String.of_json) + } + end +module CacheCluster = + struct + type t = + { + cache_cluster_id: String.t option ; + configuration_endpoint: Endpoint.t option ; + client_download_landing_page: String.t option ; + cache_node_type: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + cache_cluster_status: String.t option ; + num_cache_nodes: Integer.t option ; + preferred_availability_zone: String.t option ; + cache_cluster_create_time: DateTime.t option ; + preferred_maintenance_window: String.t option ; + pending_modified_values: PendingModifiedValues.t option ; + notification_configuration: NotificationConfiguration.t option ; + cache_security_groups: CacheSecurityGroupMembershipList.t ; + cache_parameter_group: CacheParameterGroupStatus.t option ; + cache_subnet_group_name: String.t option ; + cache_nodes: CacheNodeList.t ; + auto_minor_version_upgrade: Boolean.t option ; + security_groups: SecurityGroupMembershipList.t ; + replication_group_id: String.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option } + let make ?cache_cluster_id ?configuration_endpoint + ?client_download_landing_page ?cache_node_type ?engine + ?engine_version ?cache_cluster_status ?num_cache_nodes + ?preferred_availability_zone ?cache_cluster_create_time + ?preferred_maintenance_window ?pending_modified_values + ?notification_configuration ?(cache_security_groups= []) + ?cache_parameter_group ?cache_subnet_group_name ?(cache_nodes= []) + ?auto_minor_version_upgrade ?(security_groups= []) + ?replication_group_id ?snapshot_retention_limit ?snapshot_window () + = + { + cache_cluster_id; + configuration_endpoint; + client_download_landing_page; + cache_node_type; + engine; + engine_version; + cache_cluster_status; + num_cache_nodes; + preferred_availability_zone; + cache_cluster_create_time; + preferred_maintenance_window; + pending_modified_values; + notification_configuration; + cache_security_groups; + cache_parameter_group; + cache_subnet_group_name; + cache_nodes; + auto_minor_version_upgrade; + security_groups; + replication_group_id; + snapshot_retention_limit; + snapshot_window + } + let parse xml = + Some + { + cache_cluster_id = + (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse); + configuration_endpoint = + (Util.option_bind (Xml.member "ConfigurationEndpoint" xml) + Endpoint.parse); + client_download_landing_page = + (Util.option_bind (Xml.member "ClientDownloadLandingPage" xml) + String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + cache_cluster_status = + (Util.option_bind (Xml.member "CacheClusterStatus" xml) + String.parse); + num_cache_nodes = + (Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse); + preferred_availability_zone = + (Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) + String.parse); + cache_cluster_create_time = + (Util.option_bind (Xml.member "CacheClusterCreateTime" xml) + DateTime.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + pending_modified_values = + (Util.option_bind (Xml.member "PendingModifiedValues" xml) + PendingModifiedValues.parse); + notification_configuration = + (Util.option_bind (Xml.member "NotificationConfiguration" xml) + NotificationConfiguration.parse); + cache_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroups" xml) + CacheSecurityGroupMembershipList.parse)); + cache_parameter_group = + (Util.option_bind (Xml.member "CacheParameterGroup" xml) + CacheParameterGroupStatus.parse); + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + cache_nodes = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheNodes" xml) + CacheNodeList.parse)); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroupMembershipList.parse)); + replication_group_id = + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.replication_group_id + (fun f -> Query.Pair ("ReplicationGroupId", (String.to_query f))); + Some (Query.Pair - ( "EC2SecurityGroups.member" - , EC2SecurityGroupList.to_query v.e_c2_security_groups )) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.cache_security_group_name (fun f -> - Query.Pair ("CacheSecurityGroupName", String.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("e_c2_security_groups", EC2SecurityGroupList.to_json v.e_c2_security_groups) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.cache_security_group_name (fun f -> - "cache_security_group_name", String.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ]) - - let of_json j = - { owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; cache_security_group_name = - Util.option_map (Json.lookup j "cache_security_group_name") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; e_c2_security_groups = - EC2SecurityGroupList.of_json - (Util.of_option_exn (Json.lookup j "e_c2_security_groups")) - } -end - -module ReservedCacheNode = struct - type t = - { reserved_cache_node_id : String.t option - ; reserved_cache_nodes_offering_id : String.t option - ; cache_node_type : String.t option - ; start_time : DateTime.t option - ; duration : Integer.t option - ; fixed_price : Double.t option - ; usage_price : Double.t option - ; cache_node_count : Integer.t option - ; product_description : String.t option - ; offering_type : String.t option - ; state : String.t option - ; recurring_charges : RecurringChargeList.t - } - - let make - ?reserved_cache_node_id - ?reserved_cache_nodes_offering_id - ?cache_node_type - ?start_time - ?duration - ?fixed_price - ?usage_price - ?cache_node_count - ?product_description - ?offering_type - ?state - ?(recurring_charges = []) - () = - { reserved_cache_node_id - ; reserved_cache_nodes_offering_id - ; cache_node_type - ; start_time - ; duration - ; fixed_price - ; usage_price - ; cache_node_count - ; product_description - ; offering_type - ; state - ; recurring_charges - } - - let parse xml = - Some - { reserved_cache_node_id = - Util.option_bind (Xml.member "ReservedCacheNodeId" xml) String.parse - ; reserved_cache_nodes_offering_id = - Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; fixed_price = Util.option_bind (Xml.member "FixedPrice" xml) Double.parse - ; usage_price = Util.option_bind (Xml.member "UsagePrice" xml) Double.parse - ; cache_node_count = - Util.option_bind (Xml.member "CacheNodeCount" xml) Integer.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; state = Util.option_bind (Xml.member "State" xml) String.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "RecurringCharges" xml) - RecurringChargeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SecurityGroups.member", + (SecurityGroupMembershipList.to_query v.security_groups))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Some (Query.Pair - ( "RecurringCharges.member" - , RecurringChargeList.to_query v.recurring_charges )) - ; Util.option_map v.state (fun f -> Query.Pair ("State", String.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.cache_node_count (fun f -> - Query.Pair ("CacheNodeCount", Integer.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Double.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Double.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - Query.Pair ("ReservedCacheNodesOfferingId", String.to_query f)) - ; Util.option_map v.reserved_cache_node_id (fun f -> - Query.Pair ("ReservedCacheNodeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("recurring_charges", RecurringChargeList.to_json v.recurring_charges) - ; Util.option_map v.state (fun f -> "state", String.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.cache_node_count (fun f -> - "cache_node_count", Integer.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Double.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Double.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - "reserved_cache_nodes_offering_id", String.to_json f) - ; Util.option_map v.reserved_cache_node_id (fun f -> - "reserved_cache_node_id", String.to_json f) - ]) - - let of_json j = - { reserved_cache_node_id = - Util.option_map (Json.lookup j "reserved_cache_node_id") String.of_json - ; reserved_cache_nodes_offering_id = - Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Double.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Double.of_json - ; cache_node_count = - Util.option_map (Json.lookup j "cache_node_count") Integer.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; state = Util.option_map (Json.lookup j "state") String.of_json - ; recurring_charges = - RecurringChargeList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - } -end - -module ReservedCacheNodesOfferingList = struct - type t = ReservedCacheNodesOffering.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - ReservedCacheNodesOffering.parse - (Xml.members "ReservedCacheNodesOffering" xml)) - - let to_query v = Query.to_query_list ReservedCacheNodesOffering.to_query v - - let to_json v = `List (List.map ReservedCacheNodesOffering.to_json v) - - let of_json j = Json.to_list ReservedCacheNodesOffering.of_json j -end - -module CacheParameterGroupList = struct - type t = CacheParameterGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CacheParameterGroup.parse (Xml.members "CacheParameterGroup" xml)) - - let to_query v = Query.to_query_list CacheParameterGroup.to_query v - - let to_json v = `List (List.map CacheParameterGroup.to_json v) - - let of_json j = Json.to_list CacheParameterGroup.of_json j -end - -module SnapshotList = struct - type t = Snapshot.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Snapshot.parse (Xml.members "Snapshot" xml)) - - let to_query v = Query.to_query_list Snapshot.to_query v - - let to_json v = `List (List.map Snapshot.to_json v) - - let of_json j = Json.to_list Snapshot.of_json j -end - -module CacheSubnetGroups = struct - type t = CacheSubnetGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CacheSubnetGroup.parse (Xml.members "CacheSubnetGroup" xml)) - - let to_query v = Query.to_query_list CacheSubnetGroup.to_query v - - let to_json v = `List (List.map CacheSubnetGroup.to_json v) - - let of_json j = Json.to_list CacheSubnetGroup.of_json j -end - -module TagList = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module ParameterNameValueList = struct - type t = ParameterNameValue.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ParameterNameValue.parse (Xml.members "ParameterNameValue" xml)) - - let to_query v = Query.to_query_list ParameterNameValue.to_query v - - let to_json v = `List (List.map ParameterNameValue.to_json v) - - let of_json j = Json.to_list ParameterNameValue.of_json j -end - -module SubnetIdentifierList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SubnetIdentifier" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AvailabilityZonesList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "AvailabilityZone" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module CacheSecurityGroupNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "CacheSecurityGroupName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SecurityGroupIdsList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SecurityGroupId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SnapshotArnsList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "SnapshotArn" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module CacheClusterList = struct - type t = CacheCluster.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CacheCluster.parse (Xml.members "CacheCluster" xml)) - - let to_query v = Query.to_query_list CacheCluster.to_query v - - let to_json v = `List (List.map CacheCluster.to_json v) - - let of_json j = Json.to_list CacheCluster.of_json j -end - -module EngineDefaults = struct - type t = - { cache_parameter_group_family : String.t option - ; marker : String.t option - ; parameters : ParametersList.t - ; cache_node_type_specific_parameters : CacheNodeTypeSpecificParametersList.t - } - - let make - ?cache_parameter_group_family - ?marker - ?(parameters = []) - ?(cache_node_type_specific_parameters = []) - () = - { cache_parameter_group_family - ; marker - ; parameters - ; cache_node_type_specific_parameters - } - - let parse xml = - Some - { cache_parameter_group_family = - Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - ; cache_node_type_specific_parameters = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeTypeSpecificParameters" xml) - CacheNodeTypeSpecificParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheNodes.member", (CacheNodeList.to_query v.cache_nodes))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f))); + Util.option_map v.cache_parameter_group + (fun f -> + Query.Pair + ("CacheParameterGroup", + (CacheParameterGroupStatus.to_query f))); + Some (Query.Pair - ( "CacheNodeTypeSpecificParameters.member" - , CacheNodeTypeSpecificParametersList.to_query - v.cache_node_type_specific_parameters )) - ; Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.cache_parameter_group_family (fun f -> - Query.Pair ("CacheParameterGroupFamily", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_node_type_specific_parameters" - , CacheNodeTypeSpecificParametersList.to_json - v.cache_node_type_specific_parameters ) - ; Some ("parameters", ParametersList.to_json v.parameters) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.cache_parameter_group_family (fun f -> - "cache_parameter_group_family", String.to_json f) - ]) - - let of_json j = - { cache_parameter_group_family = - Util.option_map (Json.lookup j "cache_parameter_group_family") String.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; cache_node_type_specific_parameters = - CacheNodeTypeSpecificParametersList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_type_specific_parameters")) - } -end - -module EventList = struct - type t = Event.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Event.parse (Xml.members "Event" xml)) - - let to_query v = Query.to_query_list Event.to_query v - - let to_json v = `List (List.map Event.to_json v) - - let of_json j = Json.to_list Event.of_json j -end - -module AZMode = struct - type t = - | Single_az - | Cross_az - - let str_to_t = [ "cross-az", Cross_az; "single-az", Single_az ] - - let t_to_str = [ Cross_az, "cross-az"; Single_az, "single-az" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module PreferredAvailabilityZoneList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "PreferredAvailabilityZone" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module KeyList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReplicationGroupList = struct - type t = ReplicationGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReplicationGroup.parse (Xml.members "ReplicationGroup" xml)) - - let to_query v = Query.to_query_list ReplicationGroup.to_query v - - let to_json v = `List (List.map ReplicationGroup.to_json v) - - let of_json j = Json.to_list ReplicationGroup.of_json j -end - -module CacheEngineVersionList = struct - type t = CacheEngineVersion.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CacheEngineVersion.parse (Xml.members "CacheEngineVersion" xml)) - - let to_query v = Query.to_query_list CacheEngineVersion.to_query v - - let to_json v = `List (List.map CacheEngineVersion.to_json v) - - let of_json j = Json.to_list CacheEngineVersion.of_json j -end - -module CacheSecurityGroups = struct - type t = CacheSecurityGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CacheSecurityGroup.parse (Xml.members "CacheSecurityGroup" xml)) - - let to_query v = Query.to_query_list CacheSecurityGroup.to_query v - - let to_json v = `List (List.map CacheSecurityGroup.to_json v) - - let of_json j = Json.to_list CacheSecurityGroup.of_json j -end - -module ReservedCacheNodeList = struct - type t = ReservedCacheNode.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ReservedCacheNode.parse (Xml.members "ReservedCacheNode" xml)) - - let to_query v = Query.to_query_list ReservedCacheNode.to_query v - - let to_json v = `List (List.map ReservedCacheNode.to_json v) - - let of_json j = Json.to_list ReservedCacheNode.of_json j -end - -module CreateCacheSecurityGroupResult = struct - type t = { cache_security_group : CacheSecurityGroup.t option } - - let make ?cache_security_group () = { cache_security_group } - - let parse xml = - Some - { cache_security_group = - Util.option_bind (Xml.member "CacheSecurityGroup" xml) CacheSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - Query.Pair ("CacheSecurityGroup", CacheSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - "cache_security_group", CacheSecurityGroup.to_json f) - ]) - - let of_json j = - { cache_security_group = - Util.option_map (Json.lookup j "cache_security_group") CacheSecurityGroup.of_json - } -end - -module ReservedCacheNodesOfferingMessage = struct - type t = - { marker : String.t option - ; reserved_cache_nodes_offerings : ReservedCacheNodesOfferingList.t - } - - let make ?marker ?(reserved_cache_nodes_offerings = []) () = - { marker; reserved_cache_nodes_offerings } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; reserved_cache_nodes_offerings = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedCacheNodesOfferings" xml) - ReservedCacheNodesOfferingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheSecurityGroups.member", + (CacheSecurityGroupMembershipList.to_query + v.cache_security_groups))); + Util.option_map v.notification_configuration + (fun f -> + Query.Pair + ("NotificationConfiguration", + (NotificationConfiguration.to_query f))); + Util.option_map v.pending_modified_values + (fun f -> + Query.Pair + ("PendingModifiedValues", + (PendingModifiedValues.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.cache_cluster_create_time + (fun f -> + Query.Pair ("CacheClusterCreateTime", (DateTime.to_query f))); + Util.option_map v.preferred_availability_zone + (fun f -> + Query.Pair ("PreferredAvailabilityZone", (String.to_query f))); + Util.option_map v.num_cache_nodes + (fun f -> Query.Pair ("NumCacheNodes", (Integer.to_query f))); + Util.option_map v.cache_cluster_status + (fun f -> Query.Pair ("CacheClusterStatus", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.client_download_landing_page + (fun f -> + Query.Pair ("ClientDownloadLandingPage", (String.to_query f))); + Util.option_map v.configuration_endpoint + (fun f -> + Query.Pair ("ConfigurationEndpoint", (Endpoint.to_query f))); + Util.option_map v.cache_cluster_id + (fun f -> Query.Pair ("CacheClusterId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.replication_group_id + (fun f -> ("replication_group_id", (String.to_json f))); + Some + ("security_groups", + (SecurityGroupMembershipList.to_json v.security_groups)); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Some ("cache_nodes", (CacheNodeList.to_json v.cache_nodes)); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f))); + Util.option_map v.cache_parameter_group + (fun f -> + ("cache_parameter_group", + (CacheParameterGroupStatus.to_json f))); + Some + ("cache_security_groups", + (CacheSecurityGroupMembershipList.to_json + v.cache_security_groups)); + Util.option_map v.notification_configuration + (fun f -> + ("notification_configuration", + (NotificationConfiguration.to_json f))); + Util.option_map v.pending_modified_values + (fun f -> + ("pending_modified_values", + (PendingModifiedValues.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.cache_cluster_create_time + (fun f -> ("cache_cluster_create_time", (DateTime.to_json f))); + Util.option_map v.preferred_availability_zone + (fun f -> ("preferred_availability_zone", (String.to_json f))); + Util.option_map v.num_cache_nodes + (fun f -> ("num_cache_nodes", (Integer.to_json f))); + Util.option_map v.cache_cluster_status + (fun f -> ("cache_cluster_status", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.client_download_landing_page + (fun f -> ("client_download_landing_page", (String.to_json f))); + Util.option_map v.configuration_endpoint + (fun f -> ("configuration_endpoint", (Endpoint.to_json f))); + Util.option_map v.cache_cluster_id + (fun f -> ("cache_cluster_id", (String.to_json f)))]) + let of_json j = + { + cache_cluster_id = + (Util.option_map (Json.lookup j "cache_cluster_id") String.of_json); + configuration_endpoint = + (Util.option_map (Json.lookup j "configuration_endpoint") + Endpoint.of_json); + client_download_landing_page = + (Util.option_map (Json.lookup j "client_download_landing_page") + String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + cache_cluster_status = + (Util.option_map (Json.lookup j "cache_cluster_status") + String.of_json); + num_cache_nodes = + (Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json); + preferred_availability_zone = + (Util.option_map (Json.lookup j "preferred_availability_zone") + String.of_json); + cache_cluster_create_time = + (Util.option_map (Json.lookup j "cache_cluster_create_time") + DateTime.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + pending_modified_values = + (Util.option_map (Json.lookup j "pending_modified_values") + PendingModifiedValues.of_json); + notification_configuration = + (Util.option_map (Json.lookup j "notification_configuration") + NotificationConfiguration.of_json); + cache_security_groups = + (CacheSecurityGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "cache_security_groups"))); + cache_parameter_group = + (Util.option_map (Json.lookup j "cache_parameter_group") + CacheParameterGroupStatus.of_json); + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + cache_nodes = + (CacheNodeList.of_json + (Util.of_option_exn (Json.lookup j "cache_nodes"))); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + security_groups = + (SecurityGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + replication_group_id = + (Util.option_map (Json.lookup j "replication_group_id") + String.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json) + } + end +module CacheNodeTypeSpecificParametersList = + struct + type t = CacheNodeTypeSpecificParameter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheNodeTypeSpecificParameter.parse + (Xml.members "CacheNodeTypeSpecificParameter" xml)) + let to_query v = + Query.to_query_list CacheNodeTypeSpecificParameter.to_query v + let to_json v = `List (List.map CacheNodeTypeSpecificParameter.to_json v) + let of_json j = Json.to_list CacheNodeTypeSpecificParameter.of_json j + end +module ParametersList = + struct + type t = Parameter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Parameter.parse (Xml.members "Parameter" xml)) + let to_query v = Query.to_query_list Parameter.to_query v + let to_json v = `List (List.map Parameter.to_json v) + let of_json j = Json.to_list Parameter.of_json j + end +module Event = + struct + type t = + { + source_identifier: String.t option ; + source_type: SourceType.t option ; + message: String.t option ; + date: DateTime.t option } + let make ?source_identifier ?source_type ?message ?date () = + { source_identifier; source_type; message; date } + let parse xml = + Some + { + source_identifier = + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) SourceType.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse); + date = (Util.option_bind (Xml.member "Date" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.date + (fun f -> Query.Pair ("Date", (DateTime.to_query f))); + Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (SourceType.to_query f))); + Util.option_map v.source_identifier + (fun f -> Query.Pair ("SourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.date (fun f -> ("date", (DateTime.to_json f))); + Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.source_type + (fun f -> ("source_type", (SourceType.to_json f))); + Util.option_map v.source_identifier + (fun f -> ("source_identifier", (String.to_json f)))]) + let of_json j = + { + source_identifier = + (Util.option_map (Json.lookup j "source_identifier") String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") SourceType.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json); + date = (Util.option_map (Json.lookup j "date") DateTime.of_json) + } + end +module ReplicationGroup = + struct + type t = + { + replication_group_id: String.t option ; + description: String.t option ; + status: String.t option ; + pending_modified_values: ReplicationGroupPendingModifiedValues.t option ; + member_clusters: ClusterIdList.t ; + node_groups: NodeGroupList.t ; + snapshotting_cluster_id: String.t option ; + automatic_failover: AutomaticFailoverStatus.t option } + let make ?replication_group_id ?description ?status + ?pending_modified_values ?(member_clusters= []) ?(node_groups= []) + ?snapshotting_cluster_id ?automatic_failover () = + { + replication_group_id; + description; + status; + pending_modified_values; + member_clusters; + node_groups; + snapshotting_cluster_id; + automatic_failover + } + let parse xml = + Some + { + replication_group_id = + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + pending_modified_values = + (Util.option_bind (Xml.member "PendingModifiedValues" xml) + ReplicationGroupPendingModifiedValues.parse); + member_clusters = + (Util.of_option [] + (Util.option_bind (Xml.member "MemberClusters" xml) + ClusterIdList.parse)); + node_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "NodeGroups" xml) + NodeGroupList.parse)); + snapshotting_cluster_id = + (Util.option_bind (Xml.member "SnapshottingClusterId" xml) + String.parse); + automatic_failover = + (Util.option_bind (Xml.member "AutomaticFailover" xml) + AutomaticFailoverStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.automatic_failover + (fun f -> + Query.Pair + ("AutomaticFailover", + (AutomaticFailoverStatus.to_query f))); + Util.option_map v.snapshotting_cluster_id + (fun f -> + Query.Pair ("SnapshottingClusterId", (String.to_query f))); + Some (Query.Pair - ( "ReservedCacheNodesOfferings.member" - , ReservedCacheNodesOfferingList.to_query v.reserved_cache_nodes_offerings - )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_cache_nodes_offerings" - , ReservedCacheNodesOfferingList.to_json v.reserved_cache_nodes_offerings ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; reserved_cache_nodes_offerings = - ReservedCacheNodesOfferingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_cache_nodes_offerings")) - } -end - -module CacheParameterGroupsMessage = struct - type t = - { marker : String.t option - ; cache_parameter_groups : CacheParameterGroupList.t - } - - let make ?marker ?(cache_parameter_groups = []) () = { marker; cache_parameter_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; cache_parameter_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheParameterGroups" xml) - CacheParameterGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("NodeGroups.member", (NodeGroupList.to_query v.node_groups))); + Some (Query.Pair - ( "CacheParameterGroups.member" - , CacheParameterGroupList.to_query v.cache_parameter_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_parameter_groups" - , CacheParameterGroupList.to_json v.cache_parameter_groups ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; cache_parameter_groups = - CacheParameterGroupList.of_json - (Util.of_option_exn (Json.lookup j "cache_parameter_groups")) - } -end - -module DescribeCacheClustersMessage = struct - type t = - { cache_cluster_id : String.t option - ; max_records : Integer.t option - ; marker : String.t option - ; show_cache_node_info : Boolean.t option - } - - let make ?cache_cluster_id ?max_records ?marker ?show_cache_node_info () = - { cache_cluster_id; max_records; marker; show_cache_node_info } - - let parse xml = - Some - { cache_cluster_id = Util.option_bind (Xml.member "CacheClusterId" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; show_cache_node_info = - Util.option_bind (Xml.member "ShowCacheNodeInfo" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.show_cache_node_info (fun f -> - Query.Pair ("ShowCacheNodeInfo", Boolean.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.cache_cluster_id (fun f -> - Query.Pair ("CacheClusterId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.show_cache_node_info (fun f -> - "show_cache_node_info", Boolean.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.cache_cluster_id (fun f -> - "cache_cluster_id", String.to_json f) - ]) - - let of_json j = - { cache_cluster_id = Util.option_map (Json.lookup j "cache_cluster_id") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; show_cache_node_info = - Util.option_map (Json.lookup j "show_cache_node_info") Boolean.of_json - } -end - -module DeleteCacheClusterMessage = struct - type t = - { cache_cluster_id : String.t - ; final_snapshot_identifier : String.t option - } - - let make ~cache_cluster_id ?final_snapshot_identifier () = - { cache_cluster_id; final_snapshot_identifier } - - let parse xml = - Some - { cache_cluster_id = - Xml.required - "CacheClusterId" - (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse) - ; final_snapshot_identifier = - Util.option_bind (Xml.member "FinalSnapshotIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.final_snapshot_identifier (fun f -> - Query.Pair ("FinalSnapshotIdentifier", String.to_query f)) - ; Some (Query.Pair ("CacheClusterId", String.to_query v.cache_cluster_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.final_snapshot_identifier (fun f -> - "final_snapshot_identifier", String.to_json f) - ; Some ("cache_cluster_id", String.to_json v.cache_cluster_id) - ]) - - let of_json j = - { cache_cluster_id = - String.of_json (Util.of_option_exn (Json.lookup j "cache_cluster_id")) - ; final_snapshot_identifier = - Util.option_map (Json.lookup j "final_snapshot_identifier") String.of_json - } -end - -module DeleteReplicationGroupResult = struct - type t = { replication_group : ReplicationGroup.t option } - - let make ?replication_group () = { replication_group } - - let parse xml = - Some - { replication_group = - Util.option_bind (Xml.member "ReplicationGroup" xml) ReplicationGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - Query.Pair ("ReplicationGroup", ReplicationGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - "replication_group", ReplicationGroup.to_json f) - ]) - - let of_json j = - { replication_group = - Util.option_map (Json.lookup j "replication_group") ReplicationGroup.of_json - } -end - -module DescribeSnapshotsListMessage = struct - type t = - { marker : String.t option - ; snapshots : SnapshotList.t - } - - let make ?marker ?(snapshots = []) () = { marker; snapshots } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; snapshots = - Util.of_option - [] - (Util.option_bind (Xml.member "Snapshots" xml) SnapshotList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Snapshots.member", SnapshotList.to_query v.snapshots)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("snapshots", SnapshotList.to_json v.snapshots) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; snapshots = SnapshotList.of_json (Util.of_option_exn (Json.lookup j "snapshots")) - } -end - -module CreateReplicationGroupResult = struct - type t = { replication_group : ReplicationGroup.t option } - - let make ?replication_group () = { replication_group } - - let parse xml = - Some - { replication_group = - Util.option_bind (Xml.member "ReplicationGroup" xml) ReplicationGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - Query.Pair ("ReplicationGroup", ReplicationGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - "replication_group", ReplicationGroup.to_json f) - ]) - - let of_json j = - { replication_group = - Util.option_map (Json.lookup j "replication_group") ReplicationGroup.of_json - } -end - -module ModifyCacheSubnetGroupResult = struct - type t = { cache_subnet_group : CacheSubnetGroup.t option } - - let make ?cache_subnet_group () = { cache_subnet_group } - - let parse xml = - Some - { cache_subnet_group = - Util.option_bind (Xml.member "CacheSubnetGroup" xml) CacheSubnetGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_subnet_group (fun f -> - Query.Pair ("CacheSubnetGroup", CacheSubnetGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_subnet_group (fun f -> - "cache_subnet_group", CacheSubnetGroup.to_json f) - ]) - - let of_json j = - { cache_subnet_group = - Util.option_map (Json.lookup j "cache_subnet_group") CacheSubnetGroup.of_json - } -end - -module CacheParameterGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SnapshotNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeReplicationGroupsMessage = struct - type t = - { replication_group_id : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?replication_group_id ?max_records ?marker () = - { replication_group_id; max_records; marker } - - let parse xml = - Some - { replication_group_id = - Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.replication_group_id (fun f -> - Query.Pair ("ReplicationGroupId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.replication_group_id (fun f -> - "replication_group_id", String.to_json f) - ]) - - let of_json j = - { replication_group_id = - Util.option_map (Json.lookup j "replication_group_id") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ReservedCacheNodesOfferingNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteCacheClusterResult = struct - type t = { cache_cluster : CacheCluster.t option } - - let make ?cache_cluster () = { cache_cluster } - - let parse xml = - Some - { cache_cluster = - Util.option_bind (Xml.member "CacheCluster" xml) CacheCluster.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - Query.Pair ("CacheCluster", CacheCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - "cache_cluster", CacheCluster.to_json f) - ]) - - let of_json j = - { cache_cluster = Util.option_map (Json.lookup j "cache_cluster") CacheCluster.of_json - } -end - -module AuthorizationNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ReservedCacheNodeAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheSubnetGroupMessage = struct - type t = - { marker : String.t option - ; cache_subnet_groups : CacheSubnetGroups.t - } - - let make ?marker ?(cache_subnet_groups = []) () = { marker; cache_subnet_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; cache_subnet_groups = - Util.of_option - [] + ("MemberClusters.member", + (ClusterIdList.to_query v.member_clusters))); + Util.option_map v.pending_modified_values + (fun f -> + Query.Pair + ("PendingModifiedValues", + (ReplicationGroupPendingModifiedValues.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.replication_group_id + (fun f -> Query.Pair ("ReplicationGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.automatic_failover + (fun f -> + ("automatic_failover", (AutomaticFailoverStatus.to_json f))); + Util.option_map v.snapshotting_cluster_id + (fun f -> ("snapshotting_cluster_id", (String.to_json f))); + Some ("node_groups", (NodeGroupList.to_json v.node_groups)); + Some + ("member_clusters", (ClusterIdList.to_json v.member_clusters)); + Util.option_map v.pending_modified_values + (fun f -> + ("pending_modified_values", + (ReplicationGroupPendingModifiedValues.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.replication_group_id + (fun f -> ("replication_group_id", (String.to_json f)))]) + let of_json j = + { + replication_group_id = + (Util.option_map (Json.lookup j "replication_group_id") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + pending_modified_values = + (Util.option_map (Json.lookup j "pending_modified_values") + ReplicationGroupPendingModifiedValues.of_json); + member_clusters = + (ClusterIdList.of_json + (Util.of_option_exn (Json.lookup j "member_clusters"))); + node_groups = + (NodeGroupList.of_json + (Util.of_option_exn (Json.lookup j "node_groups"))); + snapshotting_cluster_id = + (Util.option_map (Json.lookup j "snapshotting_cluster_id") + String.of_json); + automatic_failover = + (Util.option_map (Json.lookup j "automatic_failover") + AutomaticFailoverStatus.of_json) + } + end +module CacheEngineVersion = + struct + type t = + { + engine: String.t option ; + engine_version: String.t option ; + cache_parameter_group_family: String.t option ; + cache_engine_description: String.t option ; + cache_engine_version_description: String.t option } + let make ?engine ?engine_version ?cache_parameter_group_family + ?cache_engine_description ?cache_engine_version_description () = + { + engine; + engine_version; + cache_parameter_group_family; + cache_engine_description; + cache_engine_version_description + } + let parse xml = + Some + { + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + cache_parameter_group_family = + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse); + cache_engine_description = + (Util.option_bind (Xml.member "CacheEngineDescription" xml) + String.parse); + cache_engine_version_description = (Util.option_bind - (Xml.member "CacheSubnetGroups" xml) - CacheSubnetGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "CacheEngineVersionDescription" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_engine_version_description + (fun f -> + Query.Pair + ("CacheEngineVersionDescription", (String.to_query f))); + Util.option_map v.cache_engine_description + (fun f -> + Query.Pair ("CacheEngineDescription", (String.to_query f))); + Util.option_map v.cache_parameter_group_family + (fun f -> + Query.Pair ("CacheParameterGroupFamily", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_engine_version_description + (fun f -> + ("cache_engine_version_description", (String.to_json f))); + Util.option_map v.cache_engine_description + (fun f -> ("cache_engine_description", (String.to_json f))); + Util.option_map v.cache_parameter_group_family + (fun f -> ("cache_parameter_group_family", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f)))]) + let of_json j = + { + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + cache_parameter_group_family = + (Util.option_map (Json.lookup j "cache_parameter_group_family") + String.of_json); + cache_engine_description = + (Util.option_map (Json.lookup j "cache_engine_description") + String.of_json); + cache_engine_version_description = + (Util.option_map (Json.lookup j "cache_engine_version_description") + String.of_json) + } + end +module CacheSecurityGroup = + struct + type t = + { + owner_id: String.t option ; + cache_security_group_name: String.t option ; + description: String.t option ; + e_c2_security_groups: EC2SecurityGroupList.t } + let make ?owner_id ?cache_security_group_name ?description + ?(e_c2_security_groups= []) () = + { + owner_id; + cache_security_group_name; + description; + e_c2_security_groups + } + let parse xml = + Some + { + owner_id = + (Util.option_bind (Xml.member "OwnerId" xml) String.parse); + cache_security_group_name = + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + e_c2_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "EC2SecurityGroups" xml) + EC2SecurityGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EC2SecurityGroups.member", + (EC2SecurityGroupList.to_query v.e_c2_security_groups))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.cache_security_group_name + (fun f -> + Query.Pair ("CacheSecurityGroupName", (String.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("e_c2_security_groups", + (EC2SecurityGroupList.to_json v.e_c2_security_groups)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.cache_security_group_name + (fun f -> ("cache_security_group_name", (String.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f)))]) + let of_json j = + { + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + cache_security_group_name = + (Util.option_map (Json.lookup j "cache_security_group_name") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + e_c2_security_groups = + (EC2SecurityGroupList.of_json + (Util.of_option_exn (Json.lookup j "e_c2_security_groups"))) + } + end +module ReservedCacheNode = + struct + type t = + { + reserved_cache_node_id: String.t option ; + reserved_cache_nodes_offering_id: String.t option ; + cache_node_type: String.t option ; + start_time: DateTime.t option ; + duration: Integer.t option ; + fixed_price: Double.t option ; + usage_price: Double.t option ; + cache_node_count: Integer.t option ; + product_description: String.t option ; + offering_type: String.t option ; + state: String.t option ; + recurring_charges: RecurringChargeList.t } + let make ?reserved_cache_node_id ?reserved_cache_nodes_offering_id + ?cache_node_type ?start_time ?duration ?fixed_price ?usage_price + ?cache_node_count ?product_description ?offering_type ?state + ?(recurring_charges= []) () = + { + reserved_cache_node_id; + reserved_cache_nodes_offering_id; + cache_node_type; + start_time; + duration; + fixed_price; + usage_price; + cache_node_count; + product_description; + offering_type; + state; + recurring_charges + } + let parse xml = + Some + { + reserved_cache_node_id = + (Util.option_bind (Xml.member "ReservedCacheNodeId" xml) + String.parse); + reserved_cache_nodes_offering_id = + (Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) + String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + fixed_price = + (Util.option_bind (Xml.member "FixedPrice" xml) Double.parse); + usage_price = + (Util.option_bind (Xml.member "UsagePrice" xml) Double.parse); + cache_node_count = + (Util.option_bind (Xml.member "CacheNodeCount" xml) Integer.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + state = (Util.option_bind (Xml.member "State" xml) String.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "RecurringCharges" xml) + RecurringChargeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RecurringCharges.member", + (RecurringChargeList.to_query v.recurring_charges))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (String.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.cache_node_count + (fun f -> Query.Pair ("CacheNodeCount", (Integer.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Double.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Double.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + Query.Pair + ("ReservedCacheNodesOfferingId", (String.to_query f))); + Util.option_map v.reserved_cache_node_id + (fun f -> + Query.Pair ("ReservedCacheNodeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("recurring_charges", + (RecurringChargeList.to_json v.recurring_charges)); + Util.option_map v.state (fun f -> ("state", (String.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.cache_node_count + (fun f -> ("cache_node_count", (Integer.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Double.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Double.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + ("reserved_cache_nodes_offering_id", (String.to_json f))); + Util.option_map v.reserved_cache_node_id + (fun f -> ("reserved_cache_node_id", (String.to_json f)))]) + let of_json j = + { + reserved_cache_node_id = + (Util.option_map (Json.lookup j "reserved_cache_node_id") + String.of_json); + reserved_cache_nodes_offering_id = + (Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") + String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Double.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Double.of_json); + cache_node_count = + (Util.option_map (Json.lookup j "cache_node_count") Integer.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + state = (Util.option_map (Json.lookup j "state") String.of_json); + recurring_charges = + (RecurringChargeList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))) + } + end +module ReservedCacheNodesOfferingList = + struct + type t = ReservedCacheNodesOffering.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedCacheNodesOffering.parse + (Xml.members "ReservedCacheNodesOffering" xml)) + let to_query v = + Query.to_query_list ReservedCacheNodesOffering.to_query v + let to_json v = `List (List.map ReservedCacheNodesOffering.to_json v) + let of_json j = Json.to_list ReservedCacheNodesOffering.of_json j + end +module CacheParameterGroupList = + struct + type t = CacheParameterGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheParameterGroup.parse + (Xml.members "CacheParameterGroup" xml)) + let to_query v = Query.to_query_list CacheParameterGroup.to_query v + let to_json v = `List (List.map CacheParameterGroup.to_json v) + let of_json j = Json.to_list CacheParameterGroup.of_json j + end +module SnapshotList = + struct + type t = Snapshot.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Snapshot.parse (Xml.members "Snapshot" xml)) + let to_query v = Query.to_query_list Snapshot.to_query v + let to_json v = `List (List.map Snapshot.to_json v) + let of_json j = Json.to_list Snapshot.of_json j + end +module CacheSubnetGroups = + struct + type t = CacheSubnetGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheSubnetGroup.parse (Xml.members "CacheSubnetGroup" xml)) + let to_query v = Query.to_query_list CacheSubnetGroup.to_query v + let to_json v = `List (List.map CacheSubnetGroup.to_json v) + let of_json j = Json.to_list CacheSubnetGroup.of_json j + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module ParameterNameValueList = + struct + type t = ParameterNameValue.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ParameterNameValue.parse + (Xml.members "ParameterNameValue" xml)) + let to_query v = Query.to_query_list ParameterNameValue.to_query v + let to_json v = `List (List.map ParameterNameValue.to_json v) + let of_json j = Json.to_list ParameterNameValue.of_json j + end +module SubnetIdentifierList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SubnetIdentifier" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AvailabilityZonesList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AvailabilityZone" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module CacheSecurityGroupNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "CacheSecurityGroupName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SecurityGroupIdsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SecurityGroupId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SnapshotArnsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "SnapshotArn" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module CacheClusterList = + struct + type t = CacheCluster.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheCluster.parse (Xml.members "CacheCluster" xml)) + let to_query v = Query.to_query_list CacheCluster.to_query v + let to_json v = `List (List.map CacheCluster.to_json v) + let of_json j = Json.to_list CacheCluster.of_json j + end +module EngineDefaults = + struct + type t = + { + cache_parameter_group_family: String.t option ; + marker: String.t option ; + parameters: ParametersList.t ; + cache_node_type_specific_parameters: + CacheNodeTypeSpecificParametersList.t } + let make ?cache_parameter_group_family ?marker ?(parameters= []) + ?(cache_node_type_specific_parameters= []) () = + { + cache_parameter_group_family; + marker; + parameters; + cache_node_type_specific_parameters + } + let parse xml = + Some + { + cache_parameter_group_family = + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)); + cache_node_type_specific_parameters = + (Util.of_option [] + (Util.option_bind + (Xml.member "CacheNodeTypeSpecificParameters" xml) + CacheNodeTypeSpecificParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheNodeTypeSpecificParameters.member", + (CacheNodeTypeSpecificParametersList.to_query + v.cache_node_type_specific_parameters))); + Some (Query.Pair - ( "CacheSubnetGroups.member" - , CacheSubnetGroups.to_query v.cache_subnet_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cache_subnet_groups", CacheSubnetGroups.to_json v.cache_subnet_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; cache_subnet_groups = - CacheSubnetGroups.of_json - (Util.of_option_exn (Json.lookup j "cache_subnet_groups")) - } -end - -module CacheSecurityGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteCacheParameterGroupMessage = struct - type t = { cache_parameter_group_name : String.t } - - let make ~cache_parameter_group_name () = { cache_parameter_group_name } - - let parse xml = - Some - { cache_parameter_group_name = - Xml.required - "CacheParameterGroupName" - (Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("Parameters.member", (ParametersList.to_query v.parameters))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.cache_parameter_group_family + (fun f -> + Query.Pair ("CacheParameterGroupFamily", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_node_type_specific_parameters", + (CacheNodeTypeSpecificParametersList.to_json + v.cache_node_type_specific_parameters)); + Some ("parameters", (ParametersList.to_json v.parameters)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.cache_parameter_group_family + (fun f -> ("cache_parameter_group_family", (String.to_json f)))]) + let of_json j = + { + cache_parameter_group_family = + (Util.option_map (Json.lookup j "cache_parameter_group_family") + String.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + cache_node_type_specific_parameters = + (CacheNodeTypeSpecificParametersList.of_json + (Util.of_option_exn + (Json.lookup j "cache_node_type_specific_parameters"))) + } + end +module EventList = + struct + type t = Event.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Event.parse (Xml.members "Event" xml)) + let to_query v = Query.to_query_list Event.to_query v + let to_json v = `List (List.map Event.to_json v) + let of_json j = Json.to_list Event.of_json j + end +module AZMode = + struct + type t = + | Single_az + | Cross_az + let str_to_t = [("cross-az", Cross_az); ("single-az", Single_az)] + let t_to_str = [(Cross_az, "cross-az"); (Single_az, "single-az")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module PreferredAvailabilityZoneList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "PreferredAvailabilityZone" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module KeyList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReplicationGroupList = + struct + type t = ReplicationGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReplicationGroup.parse (Xml.members "ReplicationGroup" xml)) + let to_query v = Query.to_query_list ReplicationGroup.to_query v + let to_json v = `List (List.map ReplicationGroup.to_json v) + let of_json j = Json.to_list ReplicationGroup.of_json j + end +module CacheEngineVersionList = + struct + type t = CacheEngineVersion.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheEngineVersion.parse + (Xml.members "CacheEngineVersion" xml)) + let to_query v = Query.to_query_list CacheEngineVersion.to_query v + let to_json v = `List (List.map CacheEngineVersion.to_json v) + let of_json j = Json.to_list CacheEngineVersion.of_json j + end +module CacheSecurityGroups = + struct + type t = CacheSecurityGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CacheSecurityGroup.parse + (Xml.members "CacheSecurityGroup" xml)) + let to_query v = Query.to_query_list CacheSecurityGroup.to_query v + let to_json v = `List (List.map CacheSecurityGroup.to_json v) + let of_json j = Json.to_list CacheSecurityGroup.of_json j + end +module ReservedCacheNodeList = + struct + type t = ReservedCacheNode.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedCacheNode.parse + (Xml.members "ReservedCacheNode" xml)) + let to_query v = Query.to_query_list ReservedCacheNode.to_query v + let to_json v = `List (List.map ReservedCacheNode.to_json v) + let of_json j = Json.to_list ReservedCacheNode.of_json j + end +module CreateCacheSecurityGroupResult = + struct + type t = { + cache_security_group: CacheSecurityGroup.t option } + let make ?cache_security_group () = { cache_security_group } + let parse xml = + Some + { + cache_security_group = + (Util.option_bind (Xml.member "CacheSecurityGroup" xml) + CacheSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + Query.Pair + ("CacheSecurityGroup", (CacheSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + ("cache_security_group", (CacheSecurityGroup.to_json f)))]) + let of_json j = + { + cache_security_group = + (Util.option_map (Json.lookup j "cache_security_group") + CacheSecurityGroup.of_json) + } + end +module ReservedCacheNodesOfferingMessage = + struct + type t = + { + marker: String.t option ; + reserved_cache_nodes_offerings: ReservedCacheNodesOfferingList.t } + let make ?marker ?(reserved_cache_nodes_offerings= []) () = + { marker; reserved_cache_nodes_offerings } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + reserved_cache_nodes_offerings = + (Util.of_option [] + (Util.option_bind + (Xml.member "ReservedCacheNodesOfferings" xml) + ReservedCacheNodesOfferingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedCacheNodesOfferings.member", + (ReservedCacheNodesOfferingList.to_query + v.reserved_cache_nodes_offerings))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_cache_nodes_offerings", + (ReservedCacheNodesOfferingList.to_json + v.reserved_cache_nodes_offerings)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + reserved_cache_nodes_offerings = + (ReservedCacheNodesOfferingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_cache_nodes_offerings"))) + } + end +module CacheParameterGroupsMessage = + struct + type t = + { + marker: String.t option ; + cache_parameter_groups: CacheParameterGroupList.t } + let make ?marker ?(cache_parameter_groups= []) () = + { marker; cache_parameter_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + cache_parameter_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheParameterGroups" xml) + CacheParameterGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheParameterGroups.member", + (CacheParameterGroupList.to_query v.cache_parameter_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_parameter_groups", + (CacheParameterGroupList.to_json v.cache_parameter_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + cache_parameter_groups = + (CacheParameterGroupList.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_groups"))) + } + end +module DescribeCacheClustersMessage = + struct + type t = + { + cache_cluster_id: String.t option ; + max_records: Integer.t option ; + marker: String.t option ; + show_cache_node_info: Boolean.t option } + let make ?cache_cluster_id ?max_records ?marker ?show_cache_node_info + () = { cache_cluster_id; max_records; marker; show_cache_node_info } + let parse xml = + Some + { + cache_cluster_id = + (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + show_cache_node_info = + (Util.option_bind (Xml.member "ShowCacheNodeInfo" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.show_cache_node_info + (fun f -> + Query.Pair ("ShowCacheNodeInfo", (Boolean.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.cache_cluster_id + (fun f -> Query.Pair ("CacheClusterId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.show_cache_node_info + (fun f -> ("show_cache_node_info", (Boolean.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.cache_cluster_id + (fun f -> ("cache_cluster_id", (String.to_json f)))]) + let of_json j = + { + cache_cluster_id = + (Util.option_map (Json.lookup j "cache_cluster_id") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + show_cache_node_info = + (Util.option_map (Json.lookup j "show_cache_node_info") + Boolean.of_json) + } + end +module DeleteCacheClusterMessage = + struct + type t = + { + cache_cluster_id: String.t ; + final_snapshot_identifier: String.t option } + let make ~cache_cluster_id ?final_snapshot_identifier () = + { cache_cluster_id; final_snapshot_identifier } + let parse xml = + Some + { + cache_cluster_id = + (Xml.required "CacheClusterId" + (Util.option_bind (Xml.member "CacheClusterId" xml) + String.parse)); + final_snapshot_identifier = + (Util.option_bind (Xml.member "FinalSnapshotIdentifier" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.final_snapshot_identifier + (fun f -> + Query.Pair ("FinalSnapshotIdentifier", (String.to_query f))); + Some (Query.Pair - ("CacheParameterGroupName", String.to_query v.cache_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cache_parameter_group_name", String.to_json v.cache_parameter_group_name) - ]) - - let of_json j = - { cache_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_name")) - } -end - -module AuthorizeCacheSecurityGroupIngressMessage = struct - type t = - { cache_security_group_name : String.t - ; e_c2_security_group_name : String.t - ; e_c2_security_group_owner_id : String.t - } - - let make - ~cache_security_group_name - ~e_c2_security_group_name - ~e_c2_security_group_owner_id - () = - { cache_security_group_name; e_c2_security_group_name; e_c2_security_group_owner_id } - - let parse xml = - Some - { cache_security_group_name = - Xml.required - "CacheSecurityGroupName" - (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse) - ; e_c2_security_group_name = - Xml.required - "EC2SecurityGroupName" - (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse) - ; e_c2_security_group_owner_id = - Xml.required - "EC2SecurityGroupOwnerId" - (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheClusterId", (String.to_query v.cache_cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.final_snapshot_identifier + (fun f -> ("final_snapshot_identifier", (String.to_json f))); + Some ("cache_cluster_id", (String.to_json v.cache_cluster_id))]) + let of_json j = + { + cache_cluster_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_cluster_id"))); + final_snapshot_identifier = + (Util.option_map (Json.lookup j "final_snapshot_identifier") + String.of_json) + } + end +module DeleteReplicationGroupResult = + struct + type t = { + replication_group: ReplicationGroup.t option } + let make ?replication_group () = { replication_group } + let parse xml = + Some + { + replication_group = + (Util.option_bind (Xml.member "ReplicationGroup" xml) + ReplicationGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> + Query.Pair + ("ReplicationGroup", (ReplicationGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> ("replication_group", (ReplicationGroup.to_json f)))]) + let of_json j = + { + replication_group = + (Util.option_map (Json.lookup j "replication_group") + ReplicationGroup.of_json) + } + end +module DescribeSnapshotsListMessage = + struct + type t = { + marker: String.t option ; + snapshots: SnapshotList.t } + let make ?marker ?(snapshots= []) () = { marker; snapshots } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + snapshots = + (Util.of_option [] + (Util.option_bind (Xml.member "Snapshots" xml) + SnapshotList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Snapshots.member", (SnapshotList.to_query v.snapshots))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("snapshots", (SnapshotList.to_json v.snapshots)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + snapshots = + (SnapshotList.of_json + (Util.of_option_exn (Json.lookup j "snapshots"))) + } + end +module CreateReplicationGroupResult = + struct + type t = { + replication_group: ReplicationGroup.t option } + let make ?replication_group () = { replication_group } + let parse xml = + Some + { + replication_group = + (Util.option_bind (Xml.member "ReplicationGroup" xml) + ReplicationGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> + Query.Pair + ("ReplicationGroup", (ReplicationGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> ("replication_group", (ReplicationGroup.to_json f)))]) + let of_json j = + { + replication_group = + (Util.option_map (Json.lookup j "replication_group") + ReplicationGroup.of_json) + } + end +module ModifyCacheSubnetGroupResult = + struct + type t = { + cache_subnet_group: CacheSubnetGroup.t option } + let make ?cache_subnet_group () = { cache_subnet_group } + let parse xml = + Some + { + cache_subnet_group = + (Util.option_bind (Xml.member "CacheSubnetGroup" xml) + CacheSubnetGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_subnet_group + (fun f -> + Query.Pair + ("CacheSubnetGroup", (CacheSubnetGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_subnet_group + (fun f -> ("cache_subnet_group", (CacheSubnetGroup.to_json f)))]) + let of_json j = + { + cache_subnet_group = + (Util.option_map (Json.lookup j "cache_subnet_group") + CacheSubnetGroup.of_json) + } + end +module CacheParameterGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SnapshotNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeReplicationGroupsMessage = + struct + type t = + { + replication_group_id: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?replication_group_id ?max_records ?marker () = + { replication_group_id; max_records; marker } + let parse xml = + Some + { + replication_group_id = + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.replication_group_id + (fun f -> Query.Pair ("ReplicationGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.replication_group_id + (fun f -> ("replication_group_id", (String.to_json f)))]) + let of_json j = + { + replication_group_id = + (Util.option_map (Json.lookup j "replication_group_id") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ReservedCacheNodesOfferingNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteCacheClusterResult = + struct + type t = { + cache_cluster: CacheCluster.t option } + let make ?cache_cluster () = { cache_cluster } + let parse xml = + Some + { + cache_cluster = + (Util.option_bind (Xml.member "CacheCluster" xml) + CacheCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> + Query.Pair ("CacheCluster", (CacheCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> ("cache_cluster", (CacheCluster.to_json f)))]) + let of_json j = + { + cache_cluster = + (Util.option_map (Json.lookup j "cache_cluster") + CacheCluster.of_json) + } + end +module AuthorizationNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReservedCacheNodeAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheSubnetGroupMessage = + struct + type t = + { + marker: String.t option ; + cache_subnet_groups: CacheSubnetGroups.t } + let make ?marker ?(cache_subnet_groups= []) () = + { marker; cache_subnet_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + cache_subnet_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSubnetGroups" xml) + CacheSubnetGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheSubnetGroups.member", + (CacheSubnetGroups.to_query v.cache_subnet_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_subnet_groups", + (CacheSubnetGroups.to_json v.cache_subnet_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + cache_subnet_groups = + (CacheSubnetGroups.of_json + (Util.of_option_exn (Json.lookup j "cache_subnet_groups"))) + } + end +module CacheSecurityGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteCacheParameterGroupMessage = + struct + type t = { + cache_parameter_group_name: String.t } + let make ~cache_parameter_group_name () = { cache_parameter_group_name } + let parse xml = + Some + { + cache_parameter_group_name = + (Xml.required "CacheParameterGroupName" + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheParameterGroupName", + (String.to_query v.cache_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_parameter_group_name", + (String.to_json v.cache_parameter_group_name))]) + let of_json j = + { + cache_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_group_name"))) + } + end +module AuthorizeCacheSecurityGroupIngressMessage = + struct + type t = + { + cache_security_group_name: String.t ; + e_c2_security_group_name: String.t ; + e_c2_security_group_owner_id: String.t } + let make ~cache_security_group_name ~e_c2_security_group_name + ~e_c2_security_group_owner_id () = + { + cache_security_group_name; + e_c2_security_group_name; + e_c2_security_group_owner_id + } + let parse xml = + Some + { + cache_security_group_name = + (Xml.required "CacheSecurityGroupName" + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse)); + e_c2_security_group_name = + (Xml.required "EC2SecurityGroupName" + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse)); + e_c2_security_group_owner_id = + (Xml.required "EC2SecurityGroupOwnerId" + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EC2SecurityGroupOwnerId", + (String.to_query v.e_c2_security_group_owner_id))); + Some (Query.Pair - ("EC2SecurityGroupOwnerId", String.to_query v.e_c2_security_group_owner_id)) - ; Some + ("EC2SecurityGroupName", + (String.to_query v.e_c2_security_group_name))); + Some (Query.Pair - ("EC2SecurityGroupName", String.to_query v.e_c2_security_group_name)) - ; Some + ("CacheSecurityGroupName", + (String.to_query v.cache_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("e_c2_security_group_owner_id", + (String.to_json v.e_c2_security_group_owner_id)); + Some + ("e_c2_security_group_name", + (String.to_json v.e_c2_security_group_name)); + Some + ("cache_security_group_name", + (String.to_json v.cache_security_group_name))]) + let of_json j = + { + cache_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_name"))); + e_c2_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "e_c2_security_group_name"))); + e_c2_security_group_owner_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "e_c2_security_group_owner_id"))) + } + end +module NodeQuotaForCustomerExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeReservedCacheNodesOfferingsMessage = + struct + type t = + { + reserved_cache_nodes_offering_id: String.t option ; + cache_node_type: String.t option ; + duration: String.t option ; + product_description: String.t option ; + offering_type: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?reserved_cache_nodes_offering_id ?cache_node_type ?duration + ?product_description ?offering_type ?max_records ?marker () = + { + reserved_cache_nodes_offering_id; + cache_node_type; + duration; + product_description; + offering_type; + max_records; + marker + } + let parse xml = + Some + { + reserved_cache_nodes_offering_id = + (Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) + String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + Query.Pair + ("ReservedCacheNodesOfferingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + ("reserved_cache_nodes_offering_id", (String.to_json f)))]) + let of_json j = + { + reserved_cache_nodes_offering_id = + (Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") + String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module TagListMessage = + struct + type t = { + tag_list: TagList.t } + let make ?(tag_list= []) () = { tag_list } + let parse xml = + Some + { + tag_list = + (Util.of_option [] + (Util.option_bind (Xml.member "TagList" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("TagList.member", (TagList.to_query v.tag_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tag_list", (TagList.to_json v.tag_list))]) + let of_json j = + { + tag_list = + (TagList.of_json (Util.of_option_exn (Json.lookup j "tag_list"))) + } + end +module CacheSecurityGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module PurchaseReservedCacheNodesOfferingMessage = + struct + type t = + { + reserved_cache_nodes_offering_id: String.t ; + reserved_cache_node_id: String.t option ; + cache_node_count: Integer.t option } + let make ~reserved_cache_nodes_offering_id ?reserved_cache_node_id + ?cache_node_count () = + { + reserved_cache_nodes_offering_id; + reserved_cache_node_id; + cache_node_count + } + let parse xml = + Some + { + reserved_cache_nodes_offering_id = + (Xml.required "ReservedCacheNodesOfferingId" + (Util.option_bind + (Xml.member "ReservedCacheNodesOfferingId" xml) + String.parse)); + reserved_cache_node_id = + (Util.option_bind (Xml.member "ReservedCacheNodeId" xml) + String.parse); + cache_node_count = + (Util.option_bind (Xml.member "CacheNodeCount" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_node_count + (fun f -> Query.Pair ("CacheNodeCount", (Integer.to_query f))); + Util.option_map v.reserved_cache_node_id + (fun f -> + Query.Pair ("ReservedCacheNodeId", (String.to_query f))); + Some (Query.Pair - ("CacheSecurityGroupName", String.to_query v.cache_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "e_c2_security_group_owner_id" - , String.to_json v.e_c2_security_group_owner_id ) - ; Some ("e_c2_security_group_name", String.to_json v.e_c2_security_group_name) - ; Some ("cache_security_group_name", String.to_json v.cache_security_group_name) - ]) - - let of_json j = - { cache_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_security_group_name")) - ; e_c2_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "e_c2_security_group_name")) - ; e_c2_security_group_owner_id = - String.of_json (Util.of_option_exn (Json.lookup j "e_c2_security_group_owner_id")) - } -end - -module NodeQuotaForCustomerExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeReservedCacheNodesOfferingsMessage = struct - type t = - { reserved_cache_nodes_offering_id : String.t option - ; cache_node_type : String.t option - ; duration : String.t option - ; product_description : String.t option - ; offering_type : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?reserved_cache_nodes_offering_id - ?cache_node_type - ?duration - ?product_description - ?offering_type - ?max_records - ?marker - () = - { reserved_cache_nodes_offering_id - ; cache_node_type - ; duration - ; product_description - ; offering_type - ; max_records - ; marker - } - - let parse xml = - Some - { reserved_cache_nodes_offering_id = - Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) String.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - Query.Pair ("ReservedCacheNodesOfferingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.duration (fun f -> "duration", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - "reserved_cache_nodes_offering_id", String.to_json f) - ]) - - let of_json j = - { reserved_cache_nodes_offering_id = - Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module TagListMessage = struct - type t = { tag_list : TagList.t } - - let make ?(tag_list = []) () = { tag_list } - - let parse xml = - Some - { tag_list = - Util.of_option [] (Util.option_bind (Xml.member "TagList" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagList.member", TagList.to_query v.tag_list)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("tag_list", TagList.to_json v.tag_list) ]) - - let of_json j = - { tag_list = TagList.of_json (Util.of_option_exn (Json.lookup j "tag_list")) } -end - -module CacheSecurityGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module PurchaseReservedCacheNodesOfferingMessage = struct - type t = - { reserved_cache_nodes_offering_id : String.t - ; reserved_cache_node_id : String.t option - ; cache_node_count : Integer.t option - } - - let make ~reserved_cache_nodes_offering_id ?reserved_cache_node_id ?cache_node_count () - = - { reserved_cache_nodes_offering_id; reserved_cache_node_id; cache_node_count } - - let parse xml = - Some - { reserved_cache_nodes_offering_id = - Xml.required - "ReservedCacheNodesOfferingId" - (Util.option_bind - (Xml.member "ReservedCacheNodesOfferingId" xml) + ("ReservedCacheNodesOfferingId", + (String.to_query v.reserved_cache_nodes_offering_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_node_count + (fun f -> ("cache_node_count", (Integer.to_json f))); + Util.option_map v.reserved_cache_node_id + (fun f -> ("reserved_cache_node_id", (String.to_json f))); + Some + ("reserved_cache_nodes_offering_id", + (String.to_json v.reserved_cache_nodes_offering_id))]) + let of_json j = + { + reserved_cache_nodes_offering_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "reserved_cache_nodes_offering_id"))); + reserved_cache_node_id = + (Util.option_map (Json.lookup j "reserved_cache_node_id") + String.of_json); + cache_node_count = + (Util.option_map (Json.lookup j "cache_node_count") Integer.of_json) + } + end +module AuthorizationAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteReplicationGroupMessage = + struct + type t = + { + replication_group_id: String.t ; + retain_primary_cluster: Boolean.t option ; + final_snapshot_identifier: String.t option } + let make ~replication_group_id ?retain_primary_cluster + ?final_snapshot_identifier () = + { + replication_group_id; + retain_primary_cluster; + final_snapshot_identifier + } + let parse xml = + Some + { + replication_group_id = + (Xml.required "ReplicationGroupId" + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse)); + retain_primary_cluster = + (Util.option_bind (Xml.member "RetainPrimaryCluster" xml) + Boolean.parse); + final_snapshot_identifier = + (Util.option_bind (Xml.member "FinalSnapshotIdentifier" xml) String.parse) - ; reserved_cache_node_id = - Util.option_bind (Xml.member "ReservedCacheNodeId" xml) String.parse - ; cache_node_count = - Util.option_bind (Xml.member "CacheNodeCount" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_node_count (fun f -> - Query.Pair ("CacheNodeCount", Integer.to_query f)) - ; Util.option_map v.reserved_cache_node_id (fun f -> - Query.Pair ("ReservedCacheNodeId", String.to_query f)) - ; Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.final_snapshot_identifier + (fun f -> + Query.Pair ("FinalSnapshotIdentifier", (String.to_query f))); + Util.option_map v.retain_primary_cluster + (fun f -> + Query.Pair ("RetainPrimaryCluster", (Boolean.to_query f))); + Some (Query.Pair - ( "ReservedCacheNodesOfferingId" - , String.to_query v.reserved_cache_nodes_offering_id )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_node_count (fun f -> - "cache_node_count", Integer.to_json f) - ; Util.option_map v.reserved_cache_node_id (fun f -> - "reserved_cache_node_id", String.to_json f) - ; Some - ( "reserved_cache_nodes_offering_id" - , String.to_json v.reserved_cache_nodes_offering_id ) - ]) - - let of_json j = - { reserved_cache_nodes_offering_id = - String.of_json - (Util.of_option_exn (Json.lookup j "reserved_cache_nodes_offering_id")) - ; reserved_cache_node_id = - Util.option_map (Json.lookup j "reserved_cache_node_id") String.of_json - ; cache_node_count = - Util.option_map (Json.lookup j "cache_node_count") Integer.of_json - } -end - -module AuthorizationAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteReplicationGroupMessage = struct - type t = - { replication_group_id : String.t - ; retain_primary_cluster : Boolean.t option - ; final_snapshot_identifier : String.t option - } - - let make ~replication_group_id ?retain_primary_cluster ?final_snapshot_identifier () = - { replication_group_id; retain_primary_cluster; final_snapshot_identifier } - - let parse xml = - Some - { replication_group_id = - Xml.required - "ReplicationGroupId" - (Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse) - ; retain_primary_cluster = - Util.option_bind (Xml.member "RetainPrimaryCluster" xml) Boolean.parse - ; final_snapshot_identifier = - Util.option_bind (Xml.member "FinalSnapshotIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.final_snapshot_identifier (fun f -> - Query.Pair ("FinalSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.retain_primary_cluster (fun f -> - Query.Pair ("RetainPrimaryCluster", Boolean.to_query f)) - ; Some - (Query.Pair ("ReplicationGroupId", String.to_query v.replication_group_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.final_snapshot_identifier (fun f -> - "final_snapshot_identifier", String.to_json f) - ; Util.option_map v.retain_primary_cluster (fun f -> - "retain_primary_cluster", Boolean.to_json f) - ; Some ("replication_group_id", String.to_json v.replication_group_id) - ]) - - let of_json j = - { replication_group_id = - String.of_json (Util.of_option_exn (Json.lookup j "replication_group_id")) - ; retain_primary_cluster = - Util.option_map (Json.lookup j "retain_primary_cluster") Boolean.of_json - ; final_snapshot_identifier = - Util.option_map (Json.lookup j "final_snapshot_identifier") String.of_json - } -end - -module ClusterQuotaForCustomerExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module TagNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CopySnapshotResult = struct - type t = { snapshot : Snapshot.t option } - - let make ?snapshot () = { snapshot } - - let parse xml = - Some { snapshot = Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> - Query.Pair ("Snapshot", Snapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> "snapshot", Snapshot.to_json f) ]) - - let of_json j = - { snapshot = Util.option_map (Json.lookup j "snapshot") Snapshot.of_json } -end - -module DescribeCacheSecurityGroupsMessage = struct - type t = - { cache_security_group_name : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?cache_security_group_name ?max_records ?marker () = - { cache_security_group_name; max_records; marker } - - let parse xml = - Some - { cache_security_group_name = - Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.cache_security_group_name (fun f -> - Query.Pair ("CacheSecurityGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.cache_security_group_name (fun f -> - "cache_security_group_name", String.to_json f) - ]) - - let of_json j = - { cache_security_group_name = - Util.option_map (Json.lookup j "cache_security_group_name") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module CacheSubnetGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ResetCacheParameterGroupMessage = struct - type t = - { cache_parameter_group_name : String.t - ; reset_all_parameters : Boolean.t option - ; parameter_name_values : ParameterNameValueList.t - } - - let make ~cache_parameter_group_name ?reset_all_parameters ~parameter_name_values () = - { cache_parameter_group_name; reset_all_parameters; parameter_name_values } - - let parse xml = - Some - { cache_parameter_group_name = - Xml.required - "CacheParameterGroupName" - (Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse) - ; reset_all_parameters = - Util.option_bind (Xml.member "ResetAllParameters" xml) Boolean.parse - ; parameter_name_values = - Xml.required - "ParameterNameValues" - (Util.option_bind - (Xml.member "ParameterNameValues" xml) - ParameterNameValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "ParameterNameValues.member" - , ParameterNameValueList.to_query v.parameter_name_values )) - ; Util.option_map v.reset_all_parameters (fun f -> - Query.Pair ("ResetAllParameters", Boolean.to_query f)) - ; Some - (Query.Pair - ("CacheParameterGroupName", String.to_query v.cache_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "parameter_name_values" - , ParameterNameValueList.to_json v.parameter_name_values ) - ; Util.option_map v.reset_all_parameters (fun f -> - "reset_all_parameters", Boolean.to_json f) - ; Some ("cache_parameter_group_name", String.to_json v.cache_parameter_group_name) - ]) - - let of_json j = - { cache_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_name")) - ; reset_all_parameters = - Util.option_map (Json.lookup j "reset_all_parameters") Boolean.of_json - ; parameter_name_values = - ParameterNameValueList.of_json - (Util.of_option_exn (Json.lookup j "parameter_name_values")) - } -end - -module CacheSecurityGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RevokeCacheSecurityGroupIngressResult = struct - type t = { cache_security_group : CacheSecurityGroup.t option } - - let make ?cache_security_group () = { cache_security_group } - - let parse xml = - Some - { cache_security_group = - Util.option_bind (Xml.member "CacheSecurityGroup" xml) CacheSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - Query.Pair ("CacheSecurityGroup", CacheSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - "cache_security_group", CacheSecurityGroup.to_json f) - ]) - - let of_json j = - { cache_security_group = - Util.option_map (Json.lookup j "cache_security_group") CacheSecurityGroup.of_json - } -end - -module DescribeEventsMessage = struct - type t = - { source_identifier : String.t option - ; source_type : SourceType.t option - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; duration : Integer.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?source_identifier - ?source_type - ?start_time - ?end_time - ?duration - ?max_records - ?marker - () = - { source_identifier - ; source_type - ; start_time - ; end_time - ; duration - ; max_records - ; marker - } - - let parse xml = - Some - { source_identifier = - Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) SourceType.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", SourceType.to_query f)) - ; Util.option_map v.source_identifier (fun f -> - Query.Pair ("SourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.source_type (fun f -> "source_type", SourceType.to_json f) - ; Util.option_map v.source_identifier (fun f -> - "source_identifier", String.to_json f) - ]) - - let of_json j = - { source_identifier = - Util.option_map (Json.lookup j "source_identifier") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") SourceType.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ModifyCacheSubnetGroupMessage = struct - type t = - { cache_subnet_group_name : String.t - ; cache_subnet_group_description : String.t option - ; subnet_ids : SubnetIdentifierList.t - } - - let make ~cache_subnet_group_name ?cache_subnet_group_description ?(subnet_ids = []) () - = - { cache_subnet_group_name; cache_subnet_group_description; subnet_ids } - - let parse xml = - Some - { cache_subnet_group_name = - Xml.required - "CacheSubnetGroupName" - (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse) - ; cache_subnet_group_description = - Util.option_bind (Xml.member "CacheSubnetGroupDescription" xml) String.parse - ; subnet_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "SubnetIds" xml) SubnetIdentifierList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("SubnetIds.member", SubnetIdentifierList.to_query v.subnet_ids)) - ; Util.option_map v.cache_subnet_group_description (fun f -> - Query.Pair ("CacheSubnetGroupDescription", String.to_query f)) - ; Some + ("ReplicationGroupId", + (String.to_query v.replication_group_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.final_snapshot_identifier + (fun f -> ("final_snapshot_identifier", (String.to_json f))); + Util.option_map v.retain_primary_cluster + (fun f -> ("retain_primary_cluster", (Boolean.to_json f))); + Some + ("replication_group_id", + (String.to_json v.replication_group_id))]) + let of_json j = + { + replication_group_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "replication_group_id"))); + retain_primary_cluster = + (Util.option_map (Json.lookup j "retain_primary_cluster") + Boolean.of_json); + final_snapshot_identifier = + (Util.option_map (Json.lookup j "final_snapshot_identifier") + String.of_json) + } + end +module ClusterQuotaForCustomerExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module TagNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CopySnapshotResult = + struct + type t = { + snapshot: Snapshot.t option } + let make ?snapshot () = { snapshot } + let parse xml = + Some + { + snapshot = + (Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> Query.Pair ("Snapshot", (Snapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> ("snapshot", (Snapshot.to_json f)))]) + let of_json j = + { + snapshot = + (Util.option_map (Json.lookup j "snapshot") Snapshot.of_json) + } + end +module DescribeCacheSecurityGroupsMessage = + struct + type t = + { + cache_security_group_name: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?cache_security_group_name ?max_records ?marker () = + { cache_security_group_name; max_records; marker } + let parse xml = + Some + { + cache_security_group_name = + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.cache_security_group_name + (fun f -> + Query.Pair ("CacheSecurityGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.cache_security_group_name + (fun f -> ("cache_security_group_name", (String.to_json f)))]) + let of_json j = + { + cache_security_group_name = + (Util.option_map (Json.lookup j "cache_security_group_name") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module CacheSubnetGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ResetCacheParameterGroupMessage = + struct + type t = + { + cache_parameter_group_name: String.t ; + reset_all_parameters: Boolean.t option ; + parameter_name_values: ParameterNameValueList.t } + let make ~cache_parameter_group_name ?reset_all_parameters + ~parameter_name_values () = + { + cache_parameter_group_name; + reset_all_parameters; + parameter_name_values + } + let parse xml = + Some + { + cache_parameter_group_name = + (Xml.required "CacheParameterGroupName" + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse)); + reset_all_parameters = + (Util.option_bind (Xml.member "ResetAllParameters" xml) + Boolean.parse); + parameter_name_values = + (Xml.required "ParameterNameValues" + (Util.option_bind (Xml.member "ParameterNameValues" xml) + ParameterNameValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ParameterNameValues.member", + (ParameterNameValueList.to_query v.parameter_name_values))); + Util.option_map v.reset_all_parameters + (fun f -> + Query.Pair ("ResetAllParameters", (Boolean.to_query f))); + Some (Query.Pair - ("CacheSubnetGroupName", String.to_query v.cache_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnet_ids", SubnetIdentifierList.to_json v.subnet_ids) - ; Util.option_map v.cache_subnet_group_description (fun f -> - "cache_subnet_group_description", String.to_json f) - ; Some ("cache_subnet_group_name", String.to_json v.cache_subnet_group_name) - ]) - - let of_json j = - { cache_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_subnet_group_name")) - ; cache_subnet_group_description = - Util.option_map (Json.lookup j "cache_subnet_group_description") String.of_json - ; subnet_ids = - SubnetIdentifierList.of_json (Util.of_option_exn (Json.lookup j "subnet_ids")) - } -end - -module ReservedCacheNodeNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RevokeCacheSecurityGroupIngressMessage = struct - type t = - { cache_security_group_name : String.t - ; e_c2_security_group_name : String.t - ; e_c2_security_group_owner_id : String.t - } - - let make - ~cache_security_group_name - ~e_c2_security_group_name - ~e_c2_security_group_owner_id - () = - { cache_security_group_name; e_c2_security_group_name; e_c2_security_group_owner_id } - - let parse xml = - Some - { cache_security_group_name = - Xml.required - "CacheSecurityGroupName" - (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse) - ; e_c2_security_group_name = - Xml.required - "EC2SecurityGroupName" - (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse) - ; e_c2_security_group_owner_id = - Xml.required - "EC2SecurityGroupOwnerId" - (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheParameterGroupName", + (String.to_query v.cache_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("parameter_name_values", + (ParameterNameValueList.to_json v.parameter_name_values)); + Util.option_map v.reset_all_parameters + (fun f -> ("reset_all_parameters", (Boolean.to_json f))); + Some + ("cache_parameter_group_name", + (String.to_json v.cache_parameter_group_name))]) + let of_json j = + { + cache_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_group_name"))); + reset_all_parameters = + (Util.option_map (Json.lookup j "reset_all_parameters") + Boolean.of_json); + parameter_name_values = + (ParameterNameValueList.of_json + (Util.of_option_exn (Json.lookup j "parameter_name_values"))) + } + end +module CacheSecurityGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RevokeCacheSecurityGroupIngressResult = + struct + type t = { + cache_security_group: CacheSecurityGroup.t option } + let make ?cache_security_group () = { cache_security_group } + let parse xml = + Some + { + cache_security_group = + (Util.option_bind (Xml.member "CacheSecurityGroup" xml) + CacheSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + Query.Pair + ("CacheSecurityGroup", (CacheSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + ("cache_security_group", (CacheSecurityGroup.to_json f)))]) + let of_json j = + { + cache_security_group = + (Util.option_map (Json.lookup j "cache_security_group") + CacheSecurityGroup.of_json) + } + end +module DescribeEventsMessage = + struct + type t = + { + source_identifier: String.t option ; + source_type: SourceType.t option ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + duration: Integer.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?source_identifier ?source_type ?start_time ?end_time + ?duration ?max_records ?marker () = + { + source_identifier; + source_type; + start_time; + end_time; + duration; + max_records; + marker + } + let parse xml = + Some + { + source_identifier = + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) SourceType.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (SourceType.to_query f))); + Util.option_map v.source_identifier + (fun f -> Query.Pair ("SourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.source_type + (fun f -> ("source_type", (SourceType.to_json f))); + Util.option_map v.source_identifier + (fun f -> ("source_identifier", (String.to_json f)))]) + let of_json j = + { + source_identifier = + (Util.option_map (Json.lookup j "source_identifier") String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") SourceType.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ModifyCacheSubnetGroupMessage = + struct + type t = + { + cache_subnet_group_name: String.t ; + cache_subnet_group_description: String.t option ; + subnet_ids: SubnetIdentifierList.t } + let make ~cache_subnet_group_name ?cache_subnet_group_description + ?(subnet_ids= []) () = + { cache_subnet_group_name; cache_subnet_group_description; subnet_ids } + let parse xml = + Some + { + cache_subnet_group_name = + (Xml.required "CacheSubnetGroupName" + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse)); + cache_subnet_group_description = + (Util.option_bind (Xml.member "CacheSubnetGroupDescription" xml) + String.parse); + subnet_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SubnetIds" xml) + SubnetIdentifierList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SubnetIds.member", + (SubnetIdentifierList.to_query v.subnet_ids))); + Util.option_map v.cache_subnet_group_description + (fun f -> + Query.Pair + ("CacheSubnetGroupDescription", (String.to_query f))); + Some (Query.Pair - ("EC2SecurityGroupOwnerId", String.to_query v.e_c2_security_group_owner_id)) - ; Some + ("CacheSubnetGroupName", + (String.to_query v.cache_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnet_ids", (SubnetIdentifierList.to_json v.subnet_ids)); + Util.option_map v.cache_subnet_group_description + (fun f -> ("cache_subnet_group_description", (String.to_json f))); + Some + ("cache_subnet_group_name", + (String.to_json v.cache_subnet_group_name))]) + let of_json j = + { + cache_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_subnet_group_name"))); + cache_subnet_group_description = + (Util.option_map (Json.lookup j "cache_subnet_group_description") + String.of_json); + subnet_ids = + (SubnetIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "subnet_ids"))) + } + end +module ReservedCacheNodeNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RevokeCacheSecurityGroupIngressMessage = + struct + type t = + { + cache_security_group_name: String.t ; + e_c2_security_group_name: String.t ; + e_c2_security_group_owner_id: String.t } + let make ~cache_security_group_name ~e_c2_security_group_name + ~e_c2_security_group_owner_id () = + { + cache_security_group_name; + e_c2_security_group_name; + e_c2_security_group_owner_id + } + let parse xml = + Some + { + cache_security_group_name = + (Xml.required "CacheSecurityGroupName" + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse)); + e_c2_security_group_name = + (Xml.required "EC2SecurityGroupName" + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse)); + e_c2_security_group_owner_id = + (Xml.required "EC2SecurityGroupOwnerId" + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EC2SecurityGroupOwnerId", + (String.to_query v.e_c2_security_group_owner_id))); + Some (Query.Pair - ("EC2SecurityGroupName", String.to_query v.e_c2_security_group_name)) - ; Some + ("EC2SecurityGroupName", + (String.to_query v.e_c2_security_group_name))); + Some (Query.Pair - ("CacheSecurityGroupName", String.to_query v.cache_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "e_c2_security_group_owner_id" - , String.to_json v.e_c2_security_group_owner_id ) - ; Some ("e_c2_security_group_name", String.to_json v.e_c2_security_group_name) - ; Some ("cache_security_group_name", String.to_json v.cache_security_group_name) - ]) - - let of_json j = - { cache_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_security_group_name")) - ; e_c2_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "e_c2_security_group_name")) - ; e_c2_security_group_owner_id = - String.of_json (Util.of_option_exn (Json.lookup j "e_c2_security_group_owner_id")) - } -end - -module InvalidReplicationGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SnapshotAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateReplicationGroupMessage = struct - type t = - { replication_group_id : String.t - ; replication_group_description : String.t - ; primary_cluster_id : String.t option - ; automatic_failover_enabled : Boolean.t option - ; num_cache_clusters : Integer.t option - ; preferred_cache_cluster_a_zs : AvailabilityZonesList.t - ; cache_node_type : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; cache_parameter_group_name : String.t option - ; cache_subnet_group_name : String.t option - ; cache_security_group_names : CacheSecurityGroupNameList.t - ; security_group_ids : SecurityGroupIdsList.t - ; tags : TagList.t - ; snapshot_arns : SnapshotArnsList.t - ; snapshot_name : String.t option - ; preferred_maintenance_window : String.t option - ; port : Integer.t option - ; notification_topic_arn : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - } - - let make - ~replication_group_id - ~replication_group_description - ?primary_cluster_id - ?automatic_failover_enabled - ?num_cache_clusters - ?(preferred_cache_cluster_a_zs = []) - ?cache_node_type - ?engine - ?engine_version - ?cache_parameter_group_name - ?cache_subnet_group_name - ?(cache_security_group_names = []) - ?(security_group_ids = []) - ?(tags = []) - ?(snapshot_arns = []) - ?snapshot_name - ?preferred_maintenance_window - ?port - ?notification_topic_arn - ?auto_minor_version_upgrade - ?snapshot_retention_limit - ?snapshot_window - () = - { replication_group_id - ; replication_group_description - ; primary_cluster_id - ; automatic_failover_enabled - ; num_cache_clusters - ; preferred_cache_cluster_a_zs - ; cache_node_type - ; engine - ; engine_version - ; cache_parameter_group_name - ; cache_subnet_group_name - ; cache_security_group_names - ; security_group_ids - ; tags - ; snapshot_arns - ; snapshot_name - ; preferred_maintenance_window - ; port - ; notification_topic_arn - ; auto_minor_version_upgrade - ; snapshot_retention_limit - ; snapshot_window - } - - let parse xml = - Some - { replication_group_id = - Xml.required - "ReplicationGroupId" - (Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse) - ; replication_group_description = - Xml.required - "ReplicationGroupDescription" - (Util.option_bind (Xml.member "ReplicationGroupDescription" xml) String.parse) - ; primary_cluster_id = - Util.option_bind (Xml.member "PrimaryClusterId" xml) String.parse - ; automatic_failover_enabled = - Util.option_bind (Xml.member "AutomaticFailoverEnabled" xml) Boolean.parse - ; num_cache_clusters = - Util.option_bind (Xml.member "NumCacheClusters" xml) Integer.parse - ; preferred_cache_cluster_a_zs = - Util.of_option - [] - (Util.option_bind - (Xml.member "PreferredCacheClusterAZs" xml) - AvailabilityZonesList.parse) - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; cache_security_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroupNames" xml) - CacheSecurityGroupNameList.parse) - ; security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupIds" xml) - SecurityGroupIdsList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; snapshot_arns = - Util.of_option - [] - (Util.option_bind (Xml.member "SnapshotArns" xml) SnapshotArnsList.parse) - ; snapshot_name = Util.option_bind (Xml.member "SnapshotName" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; notification_topic_arn = - Util.option_bind (Xml.member "NotificationTopicArn" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.notification_topic_arn (fun f -> - Query.Pair ("NotificationTopicArn", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.snapshot_name (fun f -> - Query.Pair ("SnapshotName", String.to_query f)) - ; Some - (Query.Pair ("SnapshotArns.member", SnapshotArnsList.to_query v.snapshot_arns)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("CacheSecurityGroupName", + (String.to_query v.cache_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("e_c2_security_group_owner_id", + (String.to_json v.e_c2_security_group_owner_id)); + Some + ("e_c2_security_group_name", + (String.to_json v.e_c2_security_group_name)); + Some + ("cache_security_group_name", + (String.to_json v.cache_security_group_name))]) + let of_json j = + { + cache_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_name"))); + e_c2_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "e_c2_security_group_name"))); + e_c2_security_group_owner_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "e_c2_security_group_owner_id"))) + } + end +module InvalidReplicationGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SnapshotAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateReplicationGroupMessage = + struct + type t = + { + replication_group_id: String.t ; + replication_group_description: String.t ; + primary_cluster_id: String.t option ; + automatic_failover_enabled: Boolean.t option ; + num_cache_clusters: Integer.t option ; + preferred_cache_cluster_a_zs: AvailabilityZonesList.t ; + cache_node_type: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + cache_parameter_group_name: String.t option ; + cache_subnet_group_name: String.t option ; + cache_security_group_names: CacheSecurityGroupNameList.t ; + security_group_ids: SecurityGroupIdsList.t ; + tags: TagList.t ; + snapshot_arns: SnapshotArnsList.t ; + snapshot_name: String.t option ; + preferred_maintenance_window: String.t option ; + port: Integer.t option ; + notification_topic_arn: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option } + let make ~replication_group_id ~replication_group_description + ?primary_cluster_id ?automatic_failover_enabled ?num_cache_clusters + ?(preferred_cache_cluster_a_zs= []) ?cache_node_type ?engine + ?engine_version ?cache_parameter_group_name ?cache_subnet_group_name + ?(cache_security_group_names= []) ?(security_group_ids= []) ?(tags= + []) ?(snapshot_arns= []) ?snapshot_name + ?preferred_maintenance_window ?port ?notification_topic_arn + ?auto_minor_version_upgrade ?snapshot_retention_limit + ?snapshot_window () = + { + replication_group_id; + replication_group_description; + primary_cluster_id; + automatic_failover_enabled; + num_cache_clusters; + preferred_cache_cluster_a_zs; + cache_node_type; + engine; + engine_version; + cache_parameter_group_name; + cache_subnet_group_name; + cache_security_group_names; + security_group_ids; + tags; + snapshot_arns; + snapshot_name; + preferred_maintenance_window; + port; + notification_topic_arn; + auto_minor_version_upgrade; + snapshot_retention_limit; + snapshot_window + } + let parse xml = + Some + { + replication_group_id = + (Xml.required "ReplicationGroupId" + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse)); + replication_group_description = + (Xml.required "ReplicationGroupDescription" + (Util.option_bind + (Xml.member "ReplicationGroupDescription" xml) String.parse)); + primary_cluster_id = + (Util.option_bind (Xml.member "PrimaryClusterId" xml) + String.parse); + automatic_failover_enabled = + (Util.option_bind (Xml.member "AutomaticFailoverEnabled" xml) + Boolean.parse); + num_cache_clusters = + (Util.option_bind (Xml.member "NumCacheClusters" xml) + Integer.parse); + preferred_cache_cluster_a_zs = + (Util.of_option [] + (Util.option_bind (Xml.member "PreferredCacheClusterAZs" xml) + AvailabilityZonesList.parse)); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + cache_security_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroupNames" xml) + CacheSecurityGroupNameList.parse)); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupIds" xml) + SecurityGroupIdsList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + snapshot_arns = + (Util.of_option [] + (Util.option_bind (Xml.member "SnapshotArns" xml) + SnapshotArnsList.parse)); + snapshot_name = + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + notification_topic_arn = + (Util.option_bind (Xml.member "NotificationTopicArn" xml) + String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.notification_topic_arn + (fun f -> + Query.Pair ("NotificationTopicArn", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.snapshot_name + (fun f -> Query.Pair ("SnapshotName", (String.to_query f))); + Some (Query.Pair - ( "SecurityGroupIds.member" - , SecurityGroupIdsList.to_query v.security_group_ids )) - ; Some + ("SnapshotArns.member", + (SnapshotArnsList.to_query v.snapshot_arns))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "CacheSecurityGroupNames.member" - , CacheSecurityGroupNameList.to_query v.cache_security_group_names )) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Some + ("SecurityGroupIds.member", + (SecurityGroupIdsList.to_query v.security_group_ids))); + Some (Query.Pair - ( "PreferredCacheClusterAZs.member" - , AvailabilityZonesList.to_query v.preferred_cache_cluster_a_zs )) - ; Util.option_map v.num_cache_clusters (fun f -> - Query.Pair ("NumCacheClusters", Integer.to_query f)) - ; Util.option_map v.automatic_failover_enabled (fun f -> - Query.Pair ("AutomaticFailoverEnabled", Boolean.to_query f)) - ; Util.option_map v.primary_cluster_id (fun f -> - Query.Pair ("PrimaryClusterId", String.to_query f)) - ; Some + ("CacheSecurityGroupNames.member", + (CacheSecurityGroupNameList.to_query + v.cache_security_group_names))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Some (Query.Pair - ( "ReplicationGroupDescription" - , String.to_query v.replication_group_description )) - ; Some - (Query.Pair ("ReplicationGroupId", String.to_query v.replication_group_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.notification_topic_arn (fun f -> - "notification_topic_arn", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.snapshot_name (fun f -> "snapshot_name", String.to_json f) - ; Some ("snapshot_arns", SnapshotArnsList.to_json v.snapshot_arns) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("security_group_ids", SecurityGroupIdsList.to_json v.security_group_ids) - ; Some - ( "cache_security_group_names" - , CacheSecurityGroupNameList.to_json v.cache_security_group_names ) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Some - ( "preferred_cache_cluster_a_zs" - , AvailabilityZonesList.to_json v.preferred_cache_cluster_a_zs ) - ; Util.option_map v.num_cache_clusters (fun f -> - "num_cache_clusters", Integer.to_json f) - ; Util.option_map v.automatic_failover_enabled (fun f -> - "automatic_failover_enabled", Boolean.to_json f) - ; Util.option_map v.primary_cluster_id (fun f -> - "primary_cluster_id", String.to_json f) - ; Some - ( "replication_group_description" - , String.to_json v.replication_group_description ) - ; Some ("replication_group_id", String.to_json v.replication_group_id) - ]) - - let of_json j = - { replication_group_id = - String.of_json (Util.of_option_exn (Json.lookup j "replication_group_id")) - ; replication_group_description = - String.of_json - (Util.of_option_exn (Json.lookup j "replication_group_description")) - ; primary_cluster_id = - Util.option_map (Json.lookup j "primary_cluster_id") String.of_json - ; automatic_failover_enabled = - Util.option_map (Json.lookup j "automatic_failover_enabled") Boolean.of_json - ; num_cache_clusters = - Util.option_map (Json.lookup j "num_cache_clusters") Integer.of_json - ; preferred_cache_cluster_a_zs = - AvailabilityZonesList.of_json - (Util.of_option_exn (Json.lookup j "preferred_cache_cluster_a_zs")) - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; cache_security_group_names = - CacheSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "cache_security_group_names")) - ; security_group_ids = - SecurityGroupIdsList.of_json - (Util.of_option_exn (Json.lookup j "security_group_ids")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; snapshot_arns = - SnapshotArnsList.of_json (Util.of_option_exn (Json.lookup j "snapshot_arns")) - ; snapshot_name = Util.option_map (Json.lookup j "snapshot_name") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; notification_topic_arn = - Util.option_map (Json.lookup j "notification_topic_arn") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - } -end - -module InvalidCacheClusterStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ReplicationGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheClusterMessage = struct - type t = - { marker : String.t option - ; cache_clusters : CacheClusterList.t - } - - let make ?marker ?(cache_clusters = []) () = { marker; cache_clusters } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; cache_clusters = - Util.of_option - [] - (Util.option_bind (Xml.member "CacheClusters" xml) CacheClusterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("PreferredCacheClusterAZs.member", + (AvailabilityZonesList.to_query + v.preferred_cache_cluster_a_zs))); + Util.option_map v.num_cache_clusters + (fun f -> Query.Pair ("NumCacheClusters", (Integer.to_query f))); + Util.option_map v.automatic_failover_enabled + (fun f -> + Query.Pair ("AutomaticFailoverEnabled", (Boolean.to_query f))); + Util.option_map v.primary_cluster_id + (fun f -> Query.Pair ("PrimaryClusterId", (String.to_query f))); + Some (Query.Pair - ("CacheClusters.member", CacheClusterList.to_query v.cache_clusters)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cache_clusters", CacheClusterList.to_json v.cache_clusters) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; cache_clusters = - CacheClusterList.of_json (Util.of_option_exn (Json.lookup j "cache_clusters")) - } -end - -module CacheParameterGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheSubnetGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateCacheSubnetGroupMessage = struct - type t = - { cache_subnet_group_name : String.t - ; cache_subnet_group_description : String.t - ; subnet_ids : SubnetIdentifierList.t - } - - let make ~cache_subnet_group_name ~cache_subnet_group_description ~subnet_ids () = - { cache_subnet_group_name; cache_subnet_group_description; subnet_ids } - - let parse xml = - Some - { cache_subnet_group_name = - Xml.required - "CacheSubnetGroupName" - (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse) - ; cache_subnet_group_description = - Xml.required - "CacheSubnetGroupDescription" - (Util.option_bind (Xml.member "CacheSubnetGroupDescription" xml) String.parse) - ; subnet_ids = - Xml.required - "SubnetIds" - (Util.option_bind (Xml.member "SubnetIds" xml) SubnetIdentifierList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("SubnetIds.member", SubnetIdentifierList.to_query v.subnet_ids)) - ; Some + ("ReplicationGroupDescription", + (String.to_query v.replication_group_description))); + Some (Query.Pair - ( "CacheSubnetGroupDescription" - , String.to_query v.cache_subnet_group_description )) - ; Some + ("ReplicationGroupId", + (String.to_query v.replication_group_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.notification_topic_arn + (fun f -> ("notification_topic_arn", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.snapshot_name + (fun f -> ("snapshot_name", (String.to_json f))); + Some ("snapshot_arns", (SnapshotArnsList.to_json v.snapshot_arns)); + Some ("tags", (TagList.to_json v.tags)); + Some + ("security_group_ids", + (SecurityGroupIdsList.to_json v.security_group_ids)); + Some + ("cache_security_group_names", + (CacheSecurityGroupNameList.to_json + v.cache_security_group_names)); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Some + ("preferred_cache_cluster_a_zs", + (AvailabilityZonesList.to_json v.preferred_cache_cluster_a_zs)); + Util.option_map v.num_cache_clusters + (fun f -> ("num_cache_clusters", (Integer.to_json f))); + Util.option_map v.automatic_failover_enabled + (fun f -> ("automatic_failover_enabled", (Boolean.to_json f))); + Util.option_map v.primary_cluster_id + (fun f -> ("primary_cluster_id", (String.to_json f))); + Some + ("replication_group_description", + (String.to_json v.replication_group_description)); + Some + ("replication_group_id", + (String.to_json v.replication_group_id))]) + let of_json j = + { + replication_group_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "replication_group_id"))); + replication_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "replication_group_description"))); + primary_cluster_id = + (Util.option_map (Json.lookup j "primary_cluster_id") + String.of_json); + automatic_failover_enabled = + (Util.option_map (Json.lookup j "automatic_failover_enabled") + Boolean.of_json); + num_cache_clusters = + (Util.option_map (Json.lookup j "num_cache_clusters") + Integer.of_json); + preferred_cache_cluster_a_zs = + (AvailabilityZonesList.of_json + (Util.of_option_exn + (Json.lookup j "preferred_cache_cluster_a_zs"))); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + cache_security_group_names = + (CacheSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_names"))); + security_group_ids = + (SecurityGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + snapshot_arns = + (SnapshotArnsList.of_json + (Util.of_option_exn (Json.lookup j "snapshot_arns"))); + snapshot_name = + (Util.option_map (Json.lookup j "snapshot_name") String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + notification_topic_arn = + (Util.option_map (Json.lookup j "notification_topic_arn") + String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json) + } + end +module InvalidCacheClusterStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReplicationGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheClusterMessage = + struct + type t = { + marker: String.t option ; + cache_clusters: CacheClusterList.t } + let make ?marker ?(cache_clusters= []) () = { marker; cache_clusters } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + cache_clusters = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheClusters" xml) + CacheClusterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheClusters.member", + (CacheClusterList.to_query v.cache_clusters))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_clusters", (CacheClusterList.to_json v.cache_clusters)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + cache_clusters = + (CacheClusterList.of_json + (Util.of_option_exn (Json.lookup j "cache_clusters"))) + } + end +module CacheParameterGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheSubnetGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateCacheSubnetGroupMessage = + struct + type t = + { + cache_subnet_group_name: String.t ; + cache_subnet_group_description: String.t ; + subnet_ids: SubnetIdentifierList.t } + let make ~cache_subnet_group_name ~cache_subnet_group_description + ~subnet_ids () = + { cache_subnet_group_name; cache_subnet_group_description; subnet_ids } + let parse xml = + Some + { + cache_subnet_group_name = + (Xml.required "CacheSubnetGroupName" + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse)); + cache_subnet_group_description = + (Xml.required "CacheSubnetGroupDescription" + (Util.option_bind + (Xml.member "CacheSubnetGroupDescription" xml) String.parse)); + subnet_ids = + (Xml.required "SubnetIds" + (Util.option_bind (Xml.member "SubnetIds" xml) + SubnetIdentifierList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SubnetIds.member", + (SubnetIdentifierList.to_query v.subnet_ids))); + Some (Query.Pair - ("CacheSubnetGroupName", String.to_query v.cache_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnet_ids", SubnetIdentifierList.to_json v.subnet_ids) - ; Some - ( "cache_subnet_group_description" - , String.to_json v.cache_subnet_group_description ) - ; Some ("cache_subnet_group_name", String.to_json v.cache_subnet_group_name) - ]) - - let of_json j = - { cache_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_subnet_group_name")) - ; cache_subnet_group_description = - String.of_json - (Util.of_option_exn (Json.lookup j "cache_subnet_group_description")) - ; subnet_ids = - SubnetIdentifierList.of_json (Util.of_option_exn (Json.lookup j "subnet_ids")) - } -end - -module RebootCacheClusterMessage = struct - type t = - { cache_cluster_id : String.t - ; cache_node_ids_to_reboot : CacheNodeIdsList.t - } - - let make ~cache_cluster_id ~cache_node_ids_to_reboot () = - { cache_cluster_id; cache_node_ids_to_reboot } - - let parse xml = - Some - { cache_cluster_id = - Xml.required - "CacheClusterId" - (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse) - ; cache_node_ids_to_reboot = - Xml.required - "CacheNodeIdsToReboot" - (Util.option_bind - (Xml.member "CacheNodeIdsToReboot" xml) - CacheNodeIdsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheSubnetGroupDescription", + (String.to_query v.cache_subnet_group_description))); + Some (Query.Pair - ( "CacheNodeIdsToReboot.member" - , CacheNodeIdsList.to_query v.cache_node_ids_to_reboot )) - ; Some (Query.Pair ("CacheClusterId", String.to_query v.cache_cluster_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_node_ids_to_reboot" - , CacheNodeIdsList.to_json v.cache_node_ids_to_reboot ) - ; Some ("cache_cluster_id", String.to_json v.cache_cluster_id) - ]) - - let of_json j = - { cache_cluster_id = - String.of_json (Util.of_option_exn (Json.lookup j "cache_cluster_id")) - ; cache_node_ids_to_reboot = - CacheNodeIdsList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_ids_to_reboot")) - } -end - -module DescribeEngineDefaultParametersResult = struct - type t = { engine_defaults : EngineDefaults.t } - - let make ~engine_defaults () = { engine_defaults } - - let parse xml = - Some - { engine_defaults = - Xml.required - "EngineDefaults" - (Util.option_bind (Xml.member "EngineDefaults" xml) EngineDefaults.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("EngineDefaults", EngineDefaults.to_query v.engine_defaults)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("engine_defaults", EngineDefaults.to_json v.engine_defaults) ]) - - let of_json j = - { engine_defaults = - EngineDefaults.of_json (Util.of_option_exn (Json.lookup j "engine_defaults")) - } -end - -module InvalidParameterValueException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module TagQuotaPerResourceExceeded = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteSnapshotResult = struct - type t = { snapshot : Snapshot.t option } - - let make ?snapshot () = { snapshot } - - let parse xml = - Some { snapshot = Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> - Query.Pair ("Snapshot", Snapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> "snapshot", Snapshot.to_json f) ]) - - let of_json j = - { snapshot = Util.option_map (Json.lookup j "snapshot") Snapshot.of_json } -end - -module ReservedCacheNodeQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InsufficientCacheClusterCapacityFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SnapshotQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidSubnet = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateCacheParameterGroupResult = struct - type t = { cache_parameter_group : CacheParameterGroup.t option } - - let make ?cache_parameter_group () = { cache_parameter_group } - - let parse xml = - Some - { cache_parameter_group = - Util.option_bind - (Xml.member "CacheParameterGroup" xml) - CacheParameterGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_parameter_group (fun f -> - Query.Pair ("CacheParameterGroup", CacheParameterGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_parameter_group (fun f -> - "cache_parameter_group", CacheParameterGroup.to_json f) - ]) - - let of_json j = - { cache_parameter_group = - Util.option_map - (Json.lookup j "cache_parameter_group") - CacheParameterGroup.of_json - } -end - -module CreateCacheSecurityGroupMessage = struct - type t = - { cache_security_group_name : String.t - ; description : String.t - } - - let make ~cache_security_group_name ~description () = - { cache_security_group_name; description } - - let parse xml = - Some - { cache_security_group_name = - Xml.required - "CacheSecurityGroupName" - (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse) - ; description = - Xml.required - "Description" - (Util.option_bind (Xml.member "Description" xml) String.parse) + ("CacheSubnetGroupName", + (String.to_query v.cache_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnet_ids", (SubnetIdentifierList.to_json v.subnet_ids)); + Some + ("cache_subnet_group_description", + (String.to_json v.cache_subnet_group_description)); + Some + ("cache_subnet_group_name", + (String.to_json v.cache_subnet_group_name))]) + let of_json j = + { + cache_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_subnet_group_name"))); + cache_subnet_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "cache_subnet_group_description"))); + subnet_ids = + (SubnetIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "subnet_ids"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Description", String.to_query v.description)) - ; Some + end +module RebootCacheClusterMessage = + struct + type t = + { + cache_cluster_id: String.t ; + cache_node_ids_to_reboot: CacheNodeIdsList.t } + let make ~cache_cluster_id ~cache_node_ids_to_reboot () = + { cache_cluster_id; cache_node_ids_to_reboot } + let parse xml = + Some + { + cache_cluster_id = + (Xml.required "CacheClusterId" + (Util.option_bind (Xml.member "CacheClusterId" xml) + String.parse)); + cache_node_ids_to_reboot = + (Xml.required "CacheNodeIdsToReboot" + (Util.option_bind (Xml.member "CacheNodeIdsToReboot" xml) + CacheNodeIdsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheNodeIdsToReboot.member", + (CacheNodeIdsList.to_query v.cache_node_ids_to_reboot))); + Some (Query.Pair - ("CacheSecurityGroupName", String.to_query v.cache_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("description", String.to_json v.description) - ; Some ("cache_security_group_name", String.to_json v.cache_security_group_name) - ]) - - let of_json j = - { cache_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_security_group_name")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - } -end - -module AddTagsToResourceMessage = struct - type t = - { resource_name : String.t - ; tags : TagList.t - } - - let make ~resource_name ~tags () = { resource_name; tags } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - ; tags = - Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("resource_name", String.to_json v.resource_name) - ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CacheSubnetQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeReservedCacheNodesMessage = struct - type t = - { reserved_cache_node_id : String.t option - ; reserved_cache_nodes_offering_id : String.t option - ; cache_node_type : String.t option - ; duration : String.t option - ; product_description : String.t option - ; offering_type : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?reserved_cache_node_id - ?reserved_cache_nodes_offering_id - ?cache_node_type - ?duration - ?product_description - ?offering_type - ?max_records - ?marker - () = - { reserved_cache_node_id - ; reserved_cache_nodes_offering_id - ; cache_node_type - ; duration - ; product_description - ; offering_type - ; max_records - ; marker - } - - let parse xml = - Some - { reserved_cache_node_id = - Util.option_bind (Xml.member "ReservedCacheNodeId" xml) String.parse - ; reserved_cache_nodes_offering_id = - Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) String.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) String.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - Query.Pair ("ReservedCacheNodesOfferingId", String.to_query f)) - ; Util.option_map v.reserved_cache_node_id (fun f -> - Query.Pair ("ReservedCacheNodeId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.duration (fun f -> "duration", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.reserved_cache_nodes_offering_id (fun f -> - "reserved_cache_nodes_offering_id", String.to_json f) - ; Util.option_map v.reserved_cache_node_id (fun f -> - "reserved_cache_node_id", String.to_json f) - ]) - - let of_json j = - { reserved_cache_node_id = - Util.option_map (Json.lookup j "reserved_cache_node_id") String.of_json - ; reserved_cache_nodes_offering_id = - Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") String.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module SubnetInUse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidVPCNetworkStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateCacheClusterResult = struct - type t = { cache_cluster : CacheCluster.t option } - - let make ?cache_cluster () = { cache_cluster } - - let parse xml = - Some - { cache_cluster = - Util.option_bind (Xml.member "CacheCluster" xml) CacheCluster.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - Query.Pair ("CacheCluster", CacheCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - "cache_cluster", CacheCluster.to_json f) - ]) - - let of_json j = - { cache_cluster = Util.option_map (Json.lookup j "cache_cluster") CacheCluster.of_json - } -end - -module AuthorizeCacheSecurityGroupIngressResult = struct - type t = { cache_security_group : CacheSecurityGroup.t option } - - let make ?cache_security_group () = { cache_security_group } - - let parse xml = - Some - { cache_security_group = - Util.option_bind (Xml.member "CacheSecurityGroup" xml) CacheSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - Query.Pair ("CacheSecurityGroup", CacheSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_security_group (fun f -> - "cache_security_group", CacheSecurityGroup.to_json f) - ]) - - let of_json j = - { cache_security_group = - Util.option_map (Json.lookup j "cache_security_group") CacheSecurityGroup.of_json - } -end - -module InvalidParameterCombinationException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module CacheClusterNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SnapshotFeatureNotSupportedFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheParameterGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateSnapshotMessage = struct - type t = - { cache_cluster_id : String.t - ; snapshot_name : String.t - } - - let make ~cache_cluster_id ~snapshot_name () = { cache_cluster_id; snapshot_name } - - let parse xml = - Some - { cache_cluster_id = - Xml.required - "CacheClusterId" - (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse) - ; snapshot_name = - Xml.required - "SnapshotName" - (Util.option_bind (Xml.member "SnapshotName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SnapshotName", String.to_query v.snapshot_name)) - ; Some (Query.Pair ("CacheClusterId", String.to_query v.cache_cluster_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("snapshot_name", String.to_json v.snapshot_name) - ; Some ("cache_cluster_id", String.to_json v.cache_cluster_id) - ]) - - let of_json j = - { cache_cluster_id = - String.of_json (Util.of_option_exn (Json.lookup j "cache_cluster_id")) - ; snapshot_name = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_name")) - } -end - -module InvalidARNFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidCacheParameterGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeSnapshotsMessage = struct - type t = - { cache_cluster_id : String.t option - ; snapshot_name : String.t option - ; snapshot_source : String.t option - ; marker : String.t option - ; max_records : Integer.t option - } - - let make ?cache_cluster_id ?snapshot_name ?snapshot_source ?marker ?max_records () = - { cache_cluster_id; snapshot_name; snapshot_source; marker; max_records } - - let parse xml = - Some - { cache_cluster_id = Util.option_bind (Xml.member "CacheClusterId" xml) String.parse - ; snapshot_name = Util.option_bind (Xml.member "SnapshotName" xml) String.parse - ; snapshot_source = Util.option_bind (Xml.member "SnapshotSource" xml) String.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.snapshot_source (fun f -> - Query.Pair ("SnapshotSource", String.to_query f)) - ; Util.option_map v.snapshot_name (fun f -> - Query.Pair ("SnapshotName", String.to_query f)) - ; Util.option_map v.cache_cluster_id (fun f -> - Query.Pair ("CacheClusterId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.snapshot_source (fun f -> - "snapshot_source", String.to_json f) - ; Util.option_map v.snapshot_name (fun f -> "snapshot_name", String.to_json f) - ; Util.option_map v.cache_cluster_id (fun f -> - "cache_cluster_id", String.to_json f) - ]) - - let of_json j = - { cache_cluster_id = Util.option_map (Json.lookup j "cache_cluster_id") String.of_json - ; snapshot_name = Util.option_map (Json.lookup j "snapshot_name") String.of_json - ; snapshot_source = Util.option_map (Json.lookup j "snapshot_source") String.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module DescribeCacheSubnetGroupsMessage = struct - type t = - { cache_subnet_group_name : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?cache_subnet_group_name ?max_records ?marker () = - { cache_subnet_group_name; max_records; marker } - - let parse xml = - Some - { cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ]) - - let of_json j = - { cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DeleteCacheSecurityGroupMessage = struct - type t = { cache_security_group_name : String.t } - - let make ~cache_security_group_name () = { cache_security_group_name } - - let parse xml = - Some - { cache_security_group_name = - Xml.required - "CacheSecurityGroupName" - (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheClusterId", (String.to_query v.cache_cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_node_ids_to_reboot", + (CacheNodeIdsList.to_json v.cache_node_ids_to_reboot)); + Some ("cache_cluster_id", (String.to_json v.cache_cluster_id))]) + let of_json j = + { + cache_cluster_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_cluster_id"))); + cache_node_ids_to_reboot = + (CacheNodeIdsList.of_json + (Util.of_option_exn (Json.lookup j "cache_node_ids_to_reboot"))) + } + end +module DescribeEngineDefaultParametersResult = + struct + type t = { + engine_defaults: EngineDefaults.t } + let make ~engine_defaults () = { engine_defaults } + let parse xml = + Some + { + engine_defaults = + (Xml.required "EngineDefaults" + (Util.option_bind (Xml.member "EngineDefaults" xml) + EngineDefaults.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EngineDefaults", + (EngineDefaults.to_query v.engine_defaults)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("engine_defaults", (EngineDefaults.to_json v.engine_defaults))]) + let of_json j = + { + engine_defaults = + (EngineDefaults.of_json + (Util.of_option_exn (Json.lookup j "engine_defaults"))) + } + end +module InvalidParameterValueException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module TagQuotaPerResourceExceeded = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteSnapshotResult = + struct + type t = { + snapshot: Snapshot.t option } + let make ?snapshot () = { snapshot } + let parse xml = + Some + { + snapshot = + (Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> Query.Pair ("Snapshot", (Snapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> ("snapshot", (Snapshot.to_json f)))]) + let of_json j = + { + snapshot = + (Util.option_map (Json.lookup j "snapshot") Snapshot.of_json) + } + end +module ReservedCacheNodeQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InsufficientCacheClusterCapacityFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SnapshotQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidSubnet = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateCacheParameterGroupResult = + struct + type t = { + cache_parameter_group: CacheParameterGroup.t option } + let make ?cache_parameter_group () = { cache_parameter_group } + let parse xml = + Some + { + cache_parameter_group = + (Util.option_bind (Xml.member "CacheParameterGroup" xml) + CacheParameterGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_parameter_group + (fun f -> + Query.Pair + ("CacheParameterGroup", (CacheParameterGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_parameter_group + (fun f -> + ("cache_parameter_group", (CacheParameterGroup.to_json f)))]) + let of_json j = + { + cache_parameter_group = + (Util.option_map (Json.lookup j "cache_parameter_group") + CacheParameterGroup.of_json) + } + end +module CreateCacheSecurityGroupMessage = + struct + type t = { + cache_security_group_name: String.t ; + description: String.t } + let make ~cache_security_group_name ~description () = + { cache_security_group_name; description } + let parse xml = + Some + { + cache_security_group_name = + (Xml.required "CacheSecurityGroupName" + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse)); + description = + (Xml.required "Description" + (Util.option_bind (Xml.member "Description" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Description", (String.to_query v.description))); + Some (Query.Pair - ("CacheSecurityGroupName", String.to_query v.cache_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cache_security_group_name", String.to_json v.cache_security_group_name) - ]) - - let of_json j = - { cache_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_security_group_name")) - } -end - -module EventsMessage = struct - type t = - { marker : String.t option - ; events : EventList.t - } - - let make ?marker ?(events = []) () = { marker; events } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; events = - Util.of_option [] (Util.option_bind (Xml.member "Events" xml) EventList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Events.member", EventList.to_query v.events)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("events", EventList.to_json v.events) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - } -end - -module CopySnapshotMessage = struct - type t = - { source_snapshot_name : String.t - ; target_snapshot_name : String.t - } - - let make ~source_snapshot_name ~target_snapshot_name () = - { source_snapshot_name; target_snapshot_name } - - let parse xml = - Some - { source_snapshot_name = - Xml.required - "SourceSnapshotName" - (Util.option_bind (Xml.member "SourceSnapshotName" xml) String.parse) - ; target_snapshot_name = - Xml.required - "TargetSnapshotName" - (Util.option_bind (Xml.member "TargetSnapshotName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("TargetSnapshotName", String.to_query v.target_snapshot_name)) - ; Some - (Query.Pair ("SourceSnapshotName", String.to_query v.source_snapshot_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("target_snapshot_name", String.to_json v.target_snapshot_name) - ; Some ("source_snapshot_name", String.to_json v.source_snapshot_name) - ]) - - let of_json j = - { source_snapshot_name = - String.of_json (Util.of_option_exn (Json.lookup j "source_snapshot_name")) - ; target_snapshot_name = - String.of_json (Util.of_option_exn (Json.lookup j "target_snapshot_name")) - } -end - -module CreateSnapshotResult = struct - type t = { snapshot : Snapshot.t option } - - let make ?snapshot () = { snapshot } - - let parse xml = - Some { snapshot = Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> - Query.Pair ("Snapshot", Snapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot (fun f -> "snapshot", Snapshot.to_json f) ]) - - let of_json j = - { snapshot = Util.option_map (Json.lookup j "snapshot") Snapshot.of_json } -end - -module ReplicationGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateCacheClusterMessage = struct - type t = - { cache_cluster_id : String.t - ; replication_group_id : String.t option - ; a_z_mode : AZMode.t option - ; preferred_availability_zone : String.t option - ; preferred_availability_zones : PreferredAvailabilityZoneList.t - ; num_cache_nodes : Integer.t option - ; cache_node_type : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; cache_parameter_group_name : String.t option - ; cache_subnet_group_name : String.t option - ; cache_security_group_names : CacheSecurityGroupNameList.t - ; security_group_ids : SecurityGroupIdsList.t - ; tags : TagList.t - ; snapshot_arns : SnapshotArnsList.t - ; snapshot_name : String.t option - ; preferred_maintenance_window : String.t option - ; port : Integer.t option - ; notification_topic_arn : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - } - - let make - ~cache_cluster_id - ?replication_group_id - ?a_z_mode - ?preferred_availability_zone - ?(preferred_availability_zones = []) - ?num_cache_nodes - ?cache_node_type - ?engine - ?engine_version - ?cache_parameter_group_name - ?cache_subnet_group_name - ?(cache_security_group_names = []) - ?(security_group_ids = []) - ?(tags = []) - ?(snapshot_arns = []) - ?snapshot_name - ?preferred_maintenance_window - ?port - ?notification_topic_arn - ?auto_minor_version_upgrade - ?snapshot_retention_limit - ?snapshot_window - () = - { cache_cluster_id - ; replication_group_id - ; a_z_mode - ; preferred_availability_zone - ; preferred_availability_zones - ; num_cache_nodes - ; cache_node_type - ; engine - ; engine_version - ; cache_parameter_group_name - ; cache_subnet_group_name - ; cache_security_group_names - ; security_group_ids - ; tags - ; snapshot_arns - ; snapshot_name - ; preferred_maintenance_window - ; port - ; notification_topic_arn - ; auto_minor_version_upgrade - ; snapshot_retention_limit - ; snapshot_window - } - - let parse xml = - Some - { cache_cluster_id = - Xml.required - "CacheClusterId" - (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse) - ; replication_group_id = - Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse - ; a_z_mode = Util.option_bind (Xml.member "AZMode" xml) AZMode.parse - ; preferred_availability_zone = - Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) String.parse - ; preferred_availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "PreferredAvailabilityZones" xml) - PreferredAvailabilityZoneList.parse) - ; num_cache_nodes = Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse - ; cache_node_type = Util.option_bind (Xml.member "CacheNodeType" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; cache_subnet_group_name = - Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse - ; cache_security_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroupNames" xml) - CacheSecurityGroupNameList.parse) - ; security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupIds" xml) - SecurityGroupIdsList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; snapshot_arns = - Util.of_option - [] - (Util.option_bind (Xml.member "SnapshotArns" xml) SnapshotArnsList.parse) - ; snapshot_name = Util.option_bind (Xml.member "SnapshotName" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; notification_topic_arn = - Util.option_bind (Xml.member "NotificationTopicArn" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.notification_topic_arn (fun f -> - Query.Pair ("NotificationTopicArn", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.snapshot_name (fun f -> - Query.Pair ("SnapshotName", String.to_query f)) - ; Some - (Query.Pair ("SnapshotArns.member", SnapshotArnsList.to_query v.snapshot_arns)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("CacheSecurityGroupName", + (String.to_query v.cache_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("description", (String.to_json v.description)); + Some + ("cache_security_group_name", + (String.to_json v.cache_security_group_name))]) + let of_json j = + { + cache_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_name"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))) + } + end +module AddTagsToResourceMessage = + struct + type t = { + resource_name: String.t ; + tags: TagList.t } + let make ~resource_name ~tags () = { resource_name; tags } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)); + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CacheSubnetQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeReservedCacheNodesMessage = + struct + type t = + { + reserved_cache_node_id: String.t option ; + reserved_cache_nodes_offering_id: String.t option ; + cache_node_type: String.t option ; + duration: String.t option ; + product_description: String.t option ; + offering_type: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?reserved_cache_node_id ?reserved_cache_nodes_offering_id + ?cache_node_type ?duration ?product_description ?offering_type + ?max_records ?marker () = + { + reserved_cache_node_id; + reserved_cache_nodes_offering_id; + cache_node_type; + duration; + product_description; + offering_type; + max_records; + marker + } + let parse xml = + Some + { + reserved_cache_node_id = + (Util.option_bind (Xml.member "ReservedCacheNodeId" xml) + String.parse); + reserved_cache_nodes_offering_id = + (Util.option_bind (Xml.member "ReservedCacheNodesOfferingId" xml) + String.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + Query.Pair + ("ReservedCacheNodesOfferingId", (String.to_query f))); + Util.option_map v.reserved_cache_node_id + (fun f -> + Query.Pair ("ReservedCacheNodeId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.reserved_cache_nodes_offering_id + (fun f -> + ("reserved_cache_nodes_offering_id", (String.to_json f))); + Util.option_map v.reserved_cache_node_id + (fun f -> ("reserved_cache_node_id", (String.to_json f)))]) + let of_json j = + { + reserved_cache_node_id = + (Util.option_map (Json.lookup j "reserved_cache_node_id") + String.of_json); + reserved_cache_nodes_offering_id = + (Util.option_map (Json.lookup j "reserved_cache_nodes_offering_id") + String.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module SubnetInUse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidVPCNetworkStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateCacheClusterResult = + struct + type t = { + cache_cluster: CacheCluster.t option } + let make ?cache_cluster () = { cache_cluster } + let parse xml = + Some + { + cache_cluster = + (Util.option_bind (Xml.member "CacheCluster" xml) + CacheCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> + Query.Pair ("CacheCluster", (CacheCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> ("cache_cluster", (CacheCluster.to_json f)))]) + let of_json j = + { + cache_cluster = + (Util.option_map (Json.lookup j "cache_cluster") + CacheCluster.of_json) + } + end +module AuthorizeCacheSecurityGroupIngressResult = + struct + type t = { + cache_security_group: CacheSecurityGroup.t option } + let make ?cache_security_group () = { cache_security_group } + let parse xml = + Some + { + cache_security_group = + (Util.option_bind (Xml.member "CacheSecurityGroup" xml) + CacheSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + Query.Pair + ("CacheSecurityGroup", (CacheSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_security_group + (fun f -> + ("cache_security_group", (CacheSecurityGroup.to_json f)))]) + let of_json j = + { + cache_security_group = + (Util.option_map (Json.lookup j "cache_security_group") + CacheSecurityGroup.of_json) + } + end +module InvalidParameterCombinationException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module CacheClusterNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SnapshotFeatureNotSupportedFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheParameterGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateSnapshotMessage = + struct + type t = { + cache_cluster_id: String.t ; + snapshot_name: String.t } + let make ~cache_cluster_id ~snapshot_name () = + { cache_cluster_id; snapshot_name } + let parse xml = + Some + { + cache_cluster_id = + (Xml.required "CacheClusterId" + (Util.option_bind (Xml.member "CacheClusterId" xml) + String.parse)); + snapshot_name = + (Xml.required "SnapshotName" + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("SnapshotName", (String.to_query v.snapshot_name))); + Some (Query.Pair - ( "SecurityGroupIds.member" - , SecurityGroupIdsList.to_query v.security_group_ids )) - ; Some + ("CacheClusterId", (String.to_query v.cache_cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("snapshot_name", (String.to_json v.snapshot_name)); + Some ("cache_cluster_id", (String.to_json v.cache_cluster_id))]) + let of_json j = + { + cache_cluster_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_cluster_id"))); + snapshot_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "snapshot_name"))) + } + end +module InvalidARNFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidCacheParameterGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeSnapshotsMessage = + struct + type t = + { + cache_cluster_id: String.t option ; + snapshot_name: String.t option ; + snapshot_source: String.t option ; + marker: String.t option ; + max_records: Integer.t option } + let make ?cache_cluster_id ?snapshot_name ?snapshot_source ?marker + ?max_records () = + { cache_cluster_id; snapshot_name; snapshot_source; marker; max_records + } + let parse xml = + Some + { + cache_cluster_id = + (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse); + snapshot_name = + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse); + snapshot_source = + (Util.option_bind (Xml.member "SnapshotSource" xml) String.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.snapshot_source + (fun f -> Query.Pair ("SnapshotSource", (String.to_query f))); + Util.option_map v.snapshot_name + (fun f -> Query.Pair ("SnapshotName", (String.to_query f))); + Util.option_map v.cache_cluster_id + (fun f -> Query.Pair ("CacheClusterId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.snapshot_source + (fun f -> ("snapshot_source", (String.to_json f))); + Util.option_map v.snapshot_name + (fun f -> ("snapshot_name", (String.to_json f))); + Util.option_map v.cache_cluster_id + (fun f -> ("cache_cluster_id", (String.to_json f)))]) + let of_json j = + { + cache_cluster_id = + (Util.option_map (Json.lookup j "cache_cluster_id") String.of_json); + snapshot_name = + (Util.option_map (Json.lookup j "snapshot_name") String.of_json); + snapshot_source = + (Util.option_map (Json.lookup j "snapshot_source") String.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) + } + end +module DescribeCacheSubnetGroupsMessage = + struct + type t = + { + cache_subnet_group_name: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?cache_subnet_group_name ?max_records ?marker () = + { cache_subnet_group_name; max_records; marker } + let parse xml = + Some + { + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f)))]) + let of_json j = + { + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DeleteCacheSecurityGroupMessage = + struct + type t = { + cache_security_group_name: String.t } + let make ~cache_security_group_name () = { cache_security_group_name } + let parse xml = + Some + { + cache_security_group_name = + (Xml.required "CacheSecurityGroupName" + (Util.option_bind (Xml.member "CacheSecurityGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheSecurityGroupName", + (String.to_query v.cache_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_security_group_name", + (String.to_json v.cache_security_group_name))]) + let of_json j = + { + cache_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_name"))) + } + end +module EventsMessage = + struct + type t = { + marker: String.t option ; + events: EventList.t } + let make ?marker ?(events= []) () = { marker; events } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + events = + (Util.of_option [] + (Util.option_bind (Xml.member "Events" xml) EventList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Events.member", (EventList.to_query v.events))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("events", (EventList.to_json v.events)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))) + } + end +module CopySnapshotMessage = + struct + type t = + { + source_snapshot_name: String.t ; + target_snapshot_name: String.t } + let make ~source_snapshot_name ~target_snapshot_name () = + { source_snapshot_name; target_snapshot_name } + let parse xml = + Some + { + source_snapshot_name = + (Xml.required "SourceSnapshotName" + (Util.option_bind (Xml.member "SourceSnapshotName" xml) + String.parse)); + target_snapshot_name = + (Xml.required "TargetSnapshotName" + (Util.option_bind (Xml.member "TargetSnapshotName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TargetSnapshotName", + (String.to_query v.target_snapshot_name))); + Some (Query.Pair - ( "CacheSecurityGroupNames.member" - , CacheSecurityGroupNameList.to_query v.cache_security_group_names )) - ; Util.option_map v.cache_subnet_group_name (fun f -> - Query.Pair ("CacheSubnetGroupName", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.cache_node_type (fun f -> - Query.Pair ("CacheNodeType", String.to_query f)) - ; Util.option_map v.num_cache_nodes (fun f -> - Query.Pair ("NumCacheNodes", Integer.to_query f)) - ; Some + ("SourceSnapshotName", + (String.to_query v.source_snapshot_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("target_snapshot_name", + (String.to_json v.target_snapshot_name)); + Some + ("source_snapshot_name", + (String.to_json v.source_snapshot_name))]) + let of_json j = + { + source_snapshot_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_snapshot_name"))); + target_snapshot_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "target_snapshot_name"))) + } + end +module CreateSnapshotResult = + struct + type t = { + snapshot: Snapshot.t option } + let make ?snapshot () = { snapshot } + let parse xml = + Some + { + snapshot = + (Util.option_bind (Xml.member "Snapshot" xml) Snapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> Query.Pair ("Snapshot", (Snapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot + (fun f -> ("snapshot", (Snapshot.to_json f)))]) + let of_json j = + { + snapshot = + (Util.option_map (Json.lookup j "snapshot") Snapshot.of_json) + } + end +module ReplicationGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateCacheClusterMessage = + struct + type t = + { + cache_cluster_id: String.t ; + replication_group_id: String.t option ; + a_z_mode: AZMode.t option ; + preferred_availability_zone: String.t option ; + preferred_availability_zones: PreferredAvailabilityZoneList.t ; + num_cache_nodes: Integer.t option ; + cache_node_type: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + cache_parameter_group_name: String.t option ; + cache_subnet_group_name: String.t option ; + cache_security_group_names: CacheSecurityGroupNameList.t ; + security_group_ids: SecurityGroupIdsList.t ; + tags: TagList.t ; + snapshot_arns: SnapshotArnsList.t ; + snapshot_name: String.t option ; + preferred_maintenance_window: String.t option ; + port: Integer.t option ; + notification_topic_arn: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option } + let make ~cache_cluster_id ?replication_group_id ?a_z_mode + ?preferred_availability_zone ?(preferred_availability_zones= []) + ?num_cache_nodes ?cache_node_type ?engine ?engine_version + ?cache_parameter_group_name ?cache_subnet_group_name + ?(cache_security_group_names= []) ?(security_group_ids= []) ?(tags= + []) ?(snapshot_arns= []) ?snapshot_name + ?preferred_maintenance_window ?port ?notification_topic_arn + ?auto_minor_version_upgrade ?snapshot_retention_limit + ?snapshot_window () = + { + cache_cluster_id; + replication_group_id; + a_z_mode; + preferred_availability_zone; + preferred_availability_zones; + num_cache_nodes; + cache_node_type; + engine; + engine_version; + cache_parameter_group_name; + cache_subnet_group_name; + cache_security_group_names; + security_group_ids; + tags; + snapshot_arns; + snapshot_name; + preferred_maintenance_window; + port; + notification_topic_arn; + auto_minor_version_upgrade; + snapshot_retention_limit; + snapshot_window + } + let parse xml = + Some + { + cache_cluster_id = + (Xml.required "CacheClusterId" + (Util.option_bind (Xml.member "CacheClusterId" xml) + String.parse)); + replication_group_id = + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse); + a_z_mode = + (Util.option_bind (Xml.member "AZMode" xml) AZMode.parse); + preferred_availability_zone = + (Util.option_bind (Xml.member "PreferredAvailabilityZone" xml) + String.parse); + preferred_availability_zones = + (Util.of_option [] + (Util.option_bind + (Xml.member "PreferredAvailabilityZones" xml) + PreferredAvailabilityZoneList.parse)); + num_cache_nodes = + (Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse); + cache_node_type = + (Util.option_bind (Xml.member "CacheNodeType" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + cache_subnet_group_name = + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse); + cache_security_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroupNames" xml) + CacheSecurityGroupNameList.parse)); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupIds" xml) + SecurityGroupIdsList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + snapshot_arns = + (Util.of_option [] + (Util.option_bind (Xml.member "SnapshotArns" xml) + SnapshotArnsList.parse)); + snapshot_name = + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + notification_topic_arn = + (Util.option_bind (Xml.member "NotificationTopicArn" xml) + String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.notification_topic_arn + (fun f -> + Query.Pair ("NotificationTopicArn", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.snapshot_name + (fun f -> Query.Pair ("SnapshotName", (String.to_query f))); + Some (Query.Pair - ( "PreferredAvailabilityZones.member" - , PreferredAvailabilityZoneList.to_query v.preferred_availability_zones )) - ; Util.option_map v.preferred_availability_zone (fun f -> - Query.Pair ("PreferredAvailabilityZone", String.to_query f)) - ; Util.option_map v.a_z_mode (fun f -> Query.Pair ("AZMode", AZMode.to_query f)) - ; Util.option_map v.replication_group_id (fun f -> - Query.Pair ("ReplicationGroupId", String.to_query f)) - ; Some (Query.Pair ("CacheClusterId", String.to_query v.cache_cluster_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.notification_topic_arn (fun f -> - "notification_topic_arn", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.snapshot_name (fun f -> "snapshot_name", String.to_json f) - ; Some ("snapshot_arns", SnapshotArnsList.to_json v.snapshot_arns) - ; Some ("tags", TagList.to_json v.tags) - ; Some ("security_group_ids", SecurityGroupIdsList.to_json v.security_group_ids) - ; Some - ( "cache_security_group_names" - , CacheSecurityGroupNameList.to_json v.cache_security_group_names ) - ; Util.option_map v.cache_subnet_group_name (fun f -> - "cache_subnet_group_name", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.cache_node_type (fun f -> - "cache_node_type", String.to_json f) - ; Util.option_map v.num_cache_nodes (fun f -> - "num_cache_nodes", Integer.to_json f) - ; Some - ( "preferred_availability_zones" - , PreferredAvailabilityZoneList.to_json v.preferred_availability_zones ) - ; Util.option_map v.preferred_availability_zone (fun f -> - "preferred_availability_zone", String.to_json f) - ; Util.option_map v.a_z_mode (fun f -> "a_z_mode", AZMode.to_json f) - ; Util.option_map v.replication_group_id (fun f -> - "replication_group_id", String.to_json f) - ; Some ("cache_cluster_id", String.to_json v.cache_cluster_id) - ]) - - let of_json j = - { cache_cluster_id = - String.of_json (Util.of_option_exn (Json.lookup j "cache_cluster_id")) - ; replication_group_id = - Util.option_map (Json.lookup j "replication_group_id") String.of_json - ; a_z_mode = Util.option_map (Json.lookup j "a_z_mode") AZMode.of_json - ; preferred_availability_zone = - Util.option_map (Json.lookup j "preferred_availability_zone") String.of_json - ; preferred_availability_zones = - PreferredAvailabilityZoneList.of_json - (Util.of_option_exn (Json.lookup j "preferred_availability_zones")) - ; num_cache_nodes = Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json - ; cache_node_type = Util.option_map (Json.lookup j "cache_node_type") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; cache_subnet_group_name = - Util.option_map (Json.lookup j "cache_subnet_group_name") String.of_json - ; cache_security_group_names = - CacheSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "cache_security_group_names")) - ; security_group_ids = - SecurityGroupIdsList.of_json - (Util.of_option_exn (Json.lookup j "security_group_ids")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; snapshot_arns = - SnapshotArnsList.of_json (Util.of_option_exn (Json.lookup j "snapshot_arns")) - ; snapshot_name = Util.option_map (Json.lookup j "snapshot_name") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; notification_topic_arn = - Util.option_map (Json.lookup j "notification_topic_arn") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - } -end - -module NodeQuotaForClusterExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeCacheEngineVersionsMessage = struct - type t = - { engine : String.t option - ; engine_version : String.t option - ; cache_parameter_group_family : String.t option - ; max_records : Integer.t option - ; marker : String.t option - ; default_only : Boolean.t option - } - - let make - ?engine - ?engine_version - ?cache_parameter_group_family - ?max_records - ?marker - ?default_only - () = - { engine - ; engine_version - ; cache_parameter_group_family - ; max_records - ; marker - ; default_only - } - - let parse xml = - Some - { engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; cache_parameter_group_family = - Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; default_only = Util.option_bind (Xml.member "DefaultOnly" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.default_only (fun f -> - Query.Pair ("DefaultOnly", Boolean.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.cache_parameter_group_family (fun f -> - Query.Pair ("CacheParameterGroupFamily", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.default_only (fun f -> "default_only", Boolean.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.cache_parameter_group_family (fun f -> - "cache_parameter_group_family", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ]) - - let of_json j = - { engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; cache_parameter_group_family = - Util.option_map (Json.lookup j "cache_parameter_group_family") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; default_only = Util.option_map (Json.lookup j "default_only") Boolean.of_json - } -end - -module ModifyCacheClusterResult = struct - type t = { cache_cluster : CacheCluster.t option } - - let make ?cache_cluster () = { cache_cluster } - - let parse xml = - Some - { cache_cluster = - Util.option_bind (Xml.member "CacheCluster" xml) CacheCluster.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - Query.Pair ("CacheCluster", CacheCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - "cache_cluster", CacheCluster.to_json f) - ]) - - let of_json j = - { cache_cluster = Util.option_map (Json.lookup j "cache_cluster") CacheCluster.of_json - } -end - -module CacheSubnetGroupInUse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RemoveTagsFromResourceMessage = struct - type t = - { resource_name : String.t - ; tag_keys : KeyList.t - } - - let make ~resource_name ~tag_keys () = { resource_name; tag_keys } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - ; tag_keys = - Xml.required - "TagKeys" - (Util.option_bind (Xml.member "TagKeys" xml) KeyList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagKeys.member", KeyList.to_query v.tag_keys)) - ; Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tag_keys", KeyList.to_json v.tag_keys) - ; Some ("resource_name", String.to_json v.resource_name) - ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - ; tag_keys = KeyList.of_json (Util.of_option_exn (Json.lookup j "tag_keys")) - } -end - -module ReplicationGroupMessage = struct - type t = - { marker : String.t option - ; replication_groups : ReplicationGroupList.t - } - - let make ?marker ?(replication_groups = []) () = { marker; replication_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; replication_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReplicationGroups" xml) - ReplicationGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SnapshotArns.member", + (SnapshotArnsList.to_query v.snapshot_arns))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "ReplicationGroups.member" - , ReplicationGroupList.to_query v.replication_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("replication_groups", ReplicationGroupList.to_json v.replication_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; replication_groups = - ReplicationGroupList.of_json - (Util.of_option_exn (Json.lookup j "replication_groups")) - } -end - -module DescribeCacheParametersMessage = struct - type t = - { cache_parameter_group_name : String.t - ; source : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~cache_parameter_group_name ?source ?max_records ?marker () = - { cache_parameter_group_name; source; max_records; marker } - - let parse xml = - Some - { cache_parameter_group_name = - Xml.required - "CacheParameterGroupName" - (Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse) - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Some + ("SecurityGroupIds.member", + (SecurityGroupIdsList.to_query v.security_group_ids))); + Some (Query.Pair - ("CacheParameterGroupName", String.to_query v.cache_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Some ("cache_parameter_group_name", String.to_json v.cache_parameter_group_name) - ]) - - let of_json j = - { cache_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_name")) - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module CacheParameterGroupDetails = struct - type t = - { marker : String.t option - ; parameters : ParametersList.t - ; cache_node_type_specific_parameters : CacheNodeTypeSpecificParametersList.t - } - - let make ?marker ?(parameters = []) ?(cache_node_type_specific_parameters = []) () = - { marker; parameters; cache_node_type_specific_parameters } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - ; cache_node_type_specific_parameters = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeTypeSpecificParameters" xml) - CacheNodeTypeSpecificParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheSecurityGroupNames.member", + (CacheSecurityGroupNameList.to_query + v.cache_security_group_names))); + Util.option_map v.cache_subnet_group_name + (fun f -> + Query.Pair ("CacheSubnetGroupName", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.cache_node_type + (fun f -> Query.Pair ("CacheNodeType", (String.to_query f))); + Util.option_map v.num_cache_nodes + (fun f -> Query.Pair ("NumCacheNodes", (Integer.to_query f))); + Some (Query.Pair - ( "CacheNodeTypeSpecificParameters.member" - , CacheNodeTypeSpecificParametersList.to_query - v.cache_node_type_specific_parameters )) - ; Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_node_type_specific_parameters" - , CacheNodeTypeSpecificParametersList.to_json - v.cache_node_type_specific_parameters ) - ; Some ("parameters", ParametersList.to_json v.parameters) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; cache_node_type_specific_parameters = - CacheNodeTypeSpecificParametersList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_type_specific_parameters")) - } -end - -module CacheSubnetGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheClusterAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyReplicationGroupMessage = struct - type t = - { replication_group_id : String.t - ; replication_group_description : String.t option - ; primary_cluster_id : String.t option - ; snapshotting_cluster_id : String.t option - ; automatic_failover_enabled : Boolean.t option - ; cache_security_group_names : CacheSecurityGroupNameList.t - ; security_group_ids : SecurityGroupIdsList.t - ; preferred_maintenance_window : String.t option - ; notification_topic_arn : String.t option - ; cache_parameter_group_name : String.t option - ; notification_topic_status : String.t option - ; apply_immediately : Boolean.t option - ; engine_version : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - } - - let make - ~replication_group_id - ?replication_group_description - ?primary_cluster_id - ?snapshotting_cluster_id - ?automatic_failover_enabled - ?(cache_security_group_names = []) - ?(security_group_ids = []) - ?preferred_maintenance_window - ?notification_topic_arn - ?cache_parameter_group_name - ?notification_topic_status - ?apply_immediately - ?engine_version - ?auto_minor_version_upgrade - ?snapshot_retention_limit - ?snapshot_window - () = - { replication_group_id - ; replication_group_description - ; primary_cluster_id - ; snapshotting_cluster_id - ; automatic_failover_enabled - ; cache_security_group_names - ; security_group_ids - ; preferred_maintenance_window - ; notification_topic_arn - ; cache_parameter_group_name - ; notification_topic_status - ; apply_immediately - ; engine_version - ; auto_minor_version_upgrade - ; snapshot_retention_limit - ; snapshot_window - } - - let parse xml = - Some - { replication_group_id = - Xml.required - "ReplicationGroupId" - (Util.option_bind (Xml.member "ReplicationGroupId" xml) String.parse) - ; replication_group_description = - Util.option_bind (Xml.member "ReplicationGroupDescription" xml) String.parse - ; primary_cluster_id = - Util.option_bind (Xml.member "PrimaryClusterId" xml) String.parse - ; snapshotting_cluster_id = - Util.option_bind (Xml.member "SnapshottingClusterId" xml) String.parse - ; automatic_failover_enabled = - Util.option_bind (Xml.member "AutomaticFailoverEnabled" xml) Boolean.parse - ; cache_security_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroupNames" xml) - CacheSecurityGroupNameList.parse) - ; security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupIds" xml) - SecurityGroupIdsList.parse) - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; notification_topic_arn = - Util.option_bind (Xml.member "NotificationTopicArn" xml) String.parse - ; cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; notification_topic_status = - Util.option_bind (Xml.member "NotificationTopicStatus" xml) String.parse - ; apply_immediately = - Util.option_bind (Xml.member "ApplyImmediately" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.apply_immediately (fun f -> - Query.Pair ("ApplyImmediately", Boolean.to_query f)) - ; Util.option_map v.notification_topic_status (fun f -> - Query.Pair ("NotificationTopicStatus", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ; Util.option_map v.notification_topic_arn (fun f -> - Query.Pair ("NotificationTopicArn", String.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Some + ("PreferredAvailabilityZones.member", + (PreferredAvailabilityZoneList.to_query + v.preferred_availability_zones))); + Util.option_map v.preferred_availability_zone + (fun f -> + Query.Pair ("PreferredAvailabilityZone", (String.to_query f))); + Util.option_map v.a_z_mode + (fun f -> Query.Pair ("AZMode", (AZMode.to_query f))); + Util.option_map v.replication_group_id + (fun f -> Query.Pair ("ReplicationGroupId", (String.to_query f))); + Some (Query.Pair - ( "SecurityGroupIds.member" - , SecurityGroupIdsList.to_query v.security_group_ids )) - ; Some + ("CacheClusterId", (String.to_query v.cache_cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.notification_topic_arn + (fun f -> ("notification_topic_arn", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.snapshot_name + (fun f -> ("snapshot_name", (String.to_json f))); + Some ("snapshot_arns", (SnapshotArnsList.to_json v.snapshot_arns)); + Some ("tags", (TagList.to_json v.tags)); + Some + ("security_group_ids", + (SecurityGroupIdsList.to_json v.security_group_ids)); + Some + ("cache_security_group_names", + (CacheSecurityGroupNameList.to_json + v.cache_security_group_names)); + Util.option_map v.cache_subnet_group_name + (fun f -> ("cache_subnet_group_name", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.cache_node_type + (fun f -> ("cache_node_type", (String.to_json f))); + Util.option_map v.num_cache_nodes + (fun f -> ("num_cache_nodes", (Integer.to_json f))); + Some + ("preferred_availability_zones", + (PreferredAvailabilityZoneList.to_json + v.preferred_availability_zones)); + Util.option_map v.preferred_availability_zone + (fun f -> ("preferred_availability_zone", (String.to_json f))); + Util.option_map v.a_z_mode + (fun f -> ("a_z_mode", (AZMode.to_json f))); + Util.option_map v.replication_group_id + (fun f -> ("replication_group_id", (String.to_json f))); + Some ("cache_cluster_id", (String.to_json v.cache_cluster_id))]) + let of_json j = + { + cache_cluster_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_cluster_id"))); + replication_group_id = + (Util.option_map (Json.lookup j "replication_group_id") + String.of_json); + a_z_mode = + (Util.option_map (Json.lookup j "a_z_mode") AZMode.of_json); + preferred_availability_zone = + (Util.option_map (Json.lookup j "preferred_availability_zone") + String.of_json); + preferred_availability_zones = + (PreferredAvailabilityZoneList.of_json + (Util.of_option_exn + (Json.lookup j "preferred_availability_zones"))); + num_cache_nodes = + (Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json); + cache_node_type = + (Util.option_map (Json.lookup j "cache_node_type") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + cache_subnet_group_name = + (Util.option_map (Json.lookup j "cache_subnet_group_name") + String.of_json); + cache_security_group_names = + (CacheSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_names"))); + security_group_ids = + (SecurityGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + snapshot_arns = + (SnapshotArnsList.of_json + (Util.of_option_exn (Json.lookup j "snapshot_arns"))); + snapshot_name = + (Util.option_map (Json.lookup j "snapshot_name") String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + notification_topic_arn = + (Util.option_map (Json.lookup j "notification_topic_arn") + String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json) + } + end +module NodeQuotaForClusterExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeCacheEngineVersionsMessage = + struct + type t = + { + engine: String.t option ; + engine_version: String.t option ; + cache_parameter_group_family: String.t option ; + max_records: Integer.t option ; + marker: String.t option ; + default_only: Boolean.t option } + let make ?engine ?engine_version ?cache_parameter_group_family + ?max_records ?marker ?default_only () = + { + engine; + engine_version; + cache_parameter_group_family; + max_records; + marker; + default_only + } + let parse xml = + Some + { + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + cache_parameter_group_family = + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + default_only = + (Util.option_bind (Xml.member "DefaultOnly" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.default_only + (fun f -> Query.Pair ("DefaultOnly", (Boolean.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.cache_parameter_group_family + (fun f -> + Query.Pair ("CacheParameterGroupFamily", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.default_only + (fun f -> ("default_only", (Boolean.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.cache_parameter_group_family + (fun f -> ("cache_parameter_group_family", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f)))]) + let of_json j = + { + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + cache_parameter_group_family = + (Util.option_map (Json.lookup j "cache_parameter_group_family") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + default_only = + (Util.option_map (Json.lookup j "default_only") Boolean.of_json) + } + end +module ModifyCacheClusterResult = + struct + type t = { + cache_cluster: CacheCluster.t option } + let make ?cache_cluster () = { cache_cluster } + let parse xml = + Some + { + cache_cluster = + (Util.option_bind (Xml.member "CacheCluster" xml) + CacheCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> + Query.Pair ("CacheCluster", (CacheCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> ("cache_cluster", (CacheCluster.to_json f)))]) + let of_json j = + { + cache_cluster = + (Util.option_map (Json.lookup j "cache_cluster") + CacheCluster.of_json) + } + end +module CacheSubnetGroupInUse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveTagsFromResourceMessage = + struct + type t = { + resource_name: String.t ; + tag_keys: KeyList.t } + let make ~resource_name ~tag_keys () = { resource_name; tag_keys } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)); + tag_keys = + (Xml.required "TagKeys" + (Util.option_bind (Xml.member "TagKeys" xml) KeyList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("TagKeys.member", (KeyList.to_query v.tag_keys))); + Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tag_keys", (KeyList.to_json v.tag_keys)); + Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))); + tag_keys = + (KeyList.of_json (Util.of_option_exn (Json.lookup j "tag_keys"))) + } + end +module ReplicationGroupMessage = + struct + type t = + { + marker: String.t option ; + replication_groups: ReplicationGroupList.t } + let make ?marker ?(replication_groups= []) () = + { marker; replication_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + replication_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "ReplicationGroups" xml) + ReplicationGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReplicationGroups.member", + (ReplicationGroupList.to_query v.replication_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("replication_groups", + (ReplicationGroupList.to_json v.replication_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + replication_groups = + (ReplicationGroupList.of_json + (Util.of_option_exn (Json.lookup j "replication_groups"))) + } + end +module DescribeCacheParametersMessage = + struct + type t = + { + cache_parameter_group_name: String.t ; + source: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ~cache_parameter_group_name ?source ?max_records ?marker () + = { cache_parameter_group_name; source; max_records; marker } + let parse xml = + Some + { + cache_parameter_group_name = + (Xml.required "CacheParameterGroupName" + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse)); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Some (Query.Pair - ( "CacheSecurityGroupNames.member" - , CacheSecurityGroupNameList.to_query v.cache_security_group_names )) - ; Util.option_map v.automatic_failover_enabled (fun f -> - Query.Pair ("AutomaticFailoverEnabled", Boolean.to_query f)) - ; Util.option_map v.snapshotting_cluster_id (fun f -> - Query.Pair ("SnapshottingClusterId", String.to_query f)) - ; Util.option_map v.primary_cluster_id (fun f -> - Query.Pair ("PrimaryClusterId", String.to_query f)) - ; Util.option_map v.replication_group_description (fun f -> - Query.Pair ("ReplicationGroupDescription", String.to_query f)) - ; Some - (Query.Pair ("ReplicationGroupId", String.to_query v.replication_group_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.apply_immediately (fun f -> - "apply_immediately", Boolean.to_json f) - ; Util.option_map v.notification_topic_status (fun f -> - "notification_topic_status", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ; Util.option_map v.notification_topic_arn (fun f -> - "notification_topic_arn", String.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Some ("security_group_ids", SecurityGroupIdsList.to_json v.security_group_ids) - ; Some - ( "cache_security_group_names" - , CacheSecurityGroupNameList.to_json v.cache_security_group_names ) - ; Util.option_map v.automatic_failover_enabled (fun f -> - "automatic_failover_enabled", Boolean.to_json f) - ; Util.option_map v.snapshotting_cluster_id (fun f -> - "snapshotting_cluster_id", String.to_json f) - ; Util.option_map v.primary_cluster_id (fun f -> - "primary_cluster_id", String.to_json f) - ; Util.option_map v.replication_group_description (fun f -> - "replication_group_description", String.to_json f) - ; Some ("replication_group_id", String.to_json v.replication_group_id) - ]) - - let of_json j = - { replication_group_id = - String.of_json (Util.of_option_exn (Json.lookup j "replication_group_id")) - ; replication_group_description = - Util.option_map (Json.lookup j "replication_group_description") String.of_json - ; primary_cluster_id = - Util.option_map (Json.lookup j "primary_cluster_id") String.of_json - ; snapshotting_cluster_id = - Util.option_map (Json.lookup j "snapshotting_cluster_id") String.of_json - ; automatic_failover_enabled = - Util.option_map (Json.lookup j "automatic_failover_enabled") Boolean.of_json - ; cache_security_group_names = - CacheSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "cache_security_group_names")) - ; security_group_ids = - SecurityGroupIdsList.of_json - (Util.of_option_exn (Json.lookup j "security_group_ids")) - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; notification_topic_arn = - Util.option_map (Json.lookup j "notification_topic_arn") String.of_json - ; cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; notification_topic_status = - Util.option_map (Json.lookup j "notification_topic_status") String.of_json - ; apply_immediately = - Util.option_map (Json.lookup j "apply_immediately") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - } -end - -module CreateCacheParameterGroupMessage = struct - type t = - { cache_parameter_group_name : String.t - ; cache_parameter_group_family : String.t - ; description : String.t - } - - let make ~cache_parameter_group_name ~cache_parameter_group_family ~description () = - { cache_parameter_group_name; cache_parameter_group_family; description } - - let parse xml = - Some - { cache_parameter_group_name = - Xml.required - "CacheParameterGroupName" - (Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse) - ; cache_parameter_group_family = - Xml.required - "CacheParameterGroupFamily" - (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse) - ; description = - Xml.required - "Description" - (Util.option_bind (Xml.member "Description" xml) String.parse) + ("CacheParameterGroupName", + (String.to_query v.cache_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Some + ("cache_parameter_group_name", + (String.to_json v.cache_parameter_group_name))]) + let of_json j = + { + cache_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_group_name"))); + source = (Util.option_map (Json.lookup j "source") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Description", String.to_query v.description)) - ; Some + end +module CacheParameterGroupDetails = + struct + type t = + { + marker: String.t option ; + parameters: ParametersList.t ; + cache_node_type_specific_parameters: + CacheNodeTypeSpecificParametersList.t } + let make ?marker ?(parameters= []) + ?(cache_node_type_specific_parameters= []) () = + { marker; parameters; cache_node_type_specific_parameters } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)); + cache_node_type_specific_parameters = + (Util.of_option [] + (Util.option_bind + (Xml.member "CacheNodeTypeSpecificParameters" xml) + CacheNodeTypeSpecificParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheNodeTypeSpecificParameters.member", + (CacheNodeTypeSpecificParametersList.to_query + v.cache_node_type_specific_parameters))); + Some (Query.Pair - ( "CacheParameterGroupFamily" - , String.to_query v.cache_parameter_group_family )) - ; Some + ("Parameters.member", (ParametersList.to_query v.parameters))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_node_type_specific_parameters", + (CacheNodeTypeSpecificParametersList.to_json + v.cache_node_type_specific_parameters)); + Some ("parameters", (ParametersList.to_json v.parameters)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + cache_node_type_specific_parameters = + (CacheNodeTypeSpecificParametersList.of_json + (Util.of_option_exn + (Json.lookup j "cache_node_type_specific_parameters"))) + } + end +module CacheSubnetGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheClusterAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyReplicationGroupMessage = + struct + type t = + { + replication_group_id: String.t ; + replication_group_description: String.t option ; + primary_cluster_id: String.t option ; + snapshotting_cluster_id: String.t option ; + automatic_failover_enabled: Boolean.t option ; + cache_security_group_names: CacheSecurityGroupNameList.t ; + security_group_ids: SecurityGroupIdsList.t ; + preferred_maintenance_window: String.t option ; + notification_topic_arn: String.t option ; + cache_parameter_group_name: String.t option ; + notification_topic_status: String.t option ; + apply_immediately: Boolean.t option ; + engine_version: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option } + let make ~replication_group_id ?replication_group_description + ?primary_cluster_id ?snapshotting_cluster_id + ?automatic_failover_enabled ?(cache_security_group_names= []) + ?(security_group_ids= []) ?preferred_maintenance_window + ?notification_topic_arn ?cache_parameter_group_name + ?notification_topic_status ?apply_immediately ?engine_version + ?auto_minor_version_upgrade ?snapshot_retention_limit + ?snapshot_window () = + { + replication_group_id; + replication_group_description; + primary_cluster_id; + snapshotting_cluster_id; + automatic_failover_enabled; + cache_security_group_names; + security_group_ids; + preferred_maintenance_window; + notification_topic_arn; + cache_parameter_group_name; + notification_topic_status; + apply_immediately; + engine_version; + auto_minor_version_upgrade; + snapshot_retention_limit; + snapshot_window + } + let parse xml = + Some + { + replication_group_id = + (Xml.required "ReplicationGroupId" + (Util.option_bind (Xml.member "ReplicationGroupId" xml) + String.parse)); + replication_group_description = + (Util.option_bind (Xml.member "ReplicationGroupDescription" xml) + String.parse); + primary_cluster_id = + (Util.option_bind (Xml.member "PrimaryClusterId" xml) + String.parse); + snapshotting_cluster_id = + (Util.option_bind (Xml.member "SnapshottingClusterId" xml) + String.parse); + automatic_failover_enabled = + (Util.option_bind (Xml.member "AutomaticFailoverEnabled" xml) + Boolean.parse); + cache_security_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroupNames" xml) + CacheSecurityGroupNameList.parse)); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupIds" xml) + SecurityGroupIdsList.parse)); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + notification_topic_arn = + (Util.option_bind (Xml.member "NotificationTopicArn" xml) + String.parse); + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + notification_topic_status = + (Util.option_bind (Xml.member "NotificationTopicStatus" xml) + String.parse); + apply_immediately = + (Util.option_bind (Xml.member "ApplyImmediately" xml) + Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.apply_immediately + (fun f -> Query.Pair ("ApplyImmediately", (Boolean.to_query f))); + Util.option_map v.notification_topic_status + (fun f -> + Query.Pair ("NotificationTopicStatus", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f))); + Util.option_map v.notification_topic_arn + (fun f -> + Query.Pair ("NotificationTopicArn", (String.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Some (Query.Pair - ("CacheParameterGroupName", String.to_query v.cache_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("description", String.to_json v.description) - ; Some - ( "cache_parameter_group_family" - , String.to_json v.cache_parameter_group_family ) - ; Some ("cache_parameter_group_name", String.to_json v.cache_parameter_group_name) - ]) - - let of_json j = - { cache_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_name")) - ; cache_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_family")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - } -end - -module InvalidCacheSecurityGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CacheEngineVersionMessage = struct - type t = - { marker : String.t option - ; cache_engine_versions : CacheEngineVersionList.t - } - - let make ?marker ?(cache_engine_versions = []) () = { marker; cache_engine_versions } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; cache_engine_versions = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheEngineVersions" xml) - CacheEngineVersionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SecurityGroupIds.member", + (SecurityGroupIdsList.to_query v.security_group_ids))); + Some (Query.Pair - ( "CacheEngineVersions.member" - , CacheEngineVersionList.to_query v.cache_engine_versions )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "cache_engine_versions" - , CacheEngineVersionList.to_json v.cache_engine_versions ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; cache_engine_versions = - CacheEngineVersionList.of_json - (Util.of_option_exn (Json.lookup j "cache_engine_versions")) - } -end - -module PurchaseReservedCacheNodesOfferingResult = struct - type t = { reserved_cache_node : ReservedCacheNode.t option } - - let make ?reserved_cache_node () = { reserved_cache_node } - - let parse xml = - Some - { reserved_cache_node = - Util.option_bind (Xml.member "ReservedCacheNode" xml) ReservedCacheNode.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reserved_cache_node (fun f -> - Query.Pair ("ReservedCacheNode", ReservedCacheNode.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reserved_cache_node (fun f -> - "reserved_cache_node", ReservedCacheNode.to_json f) - ]) - - let of_json j = - { reserved_cache_node = - Util.option_map (Json.lookup j "reserved_cache_node") ReservedCacheNode.of_json - } -end - -module ModifyReplicationGroupResult = struct - type t = { replication_group : ReplicationGroup.t option } - - let make ?replication_group () = { replication_group } - - let parse xml = - Some - { replication_group = - Util.option_bind (Xml.member "ReplicationGroup" xml) ReplicationGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - Query.Pair ("ReplicationGroup", ReplicationGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_group (fun f -> - "replication_group", ReplicationGroup.to_json f) - ]) - - let of_json j = - { replication_group = - Util.option_map (Json.lookup j "replication_group") ReplicationGroup.of_json - } -end - -module CacheSecurityGroupMessage = struct - type t = - { marker : String.t option - ; cache_security_groups : CacheSecurityGroups.t - } - - let make ?marker ?(cache_security_groups = []) () = { marker; cache_security_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; cache_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroups" xml) - CacheSecurityGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheSecurityGroupNames.member", + (CacheSecurityGroupNameList.to_query + v.cache_security_group_names))); + Util.option_map v.automatic_failover_enabled + (fun f -> + Query.Pair ("AutomaticFailoverEnabled", (Boolean.to_query f))); + Util.option_map v.snapshotting_cluster_id + (fun f -> + Query.Pair ("SnapshottingClusterId", (String.to_query f))); + Util.option_map v.primary_cluster_id + (fun f -> Query.Pair ("PrimaryClusterId", (String.to_query f))); + Util.option_map v.replication_group_description + (fun f -> + Query.Pair + ("ReplicationGroupDescription", (String.to_query f))); + Some (Query.Pair - ( "CacheSecurityGroups.member" - , CacheSecurityGroups.to_query v.cache_security_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("cache_security_groups", CacheSecurityGroups.to_json v.cache_security_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; cache_security_groups = - CacheSecurityGroups.of_json - (Util.of_option_exn (Json.lookup j "cache_security_groups")) - } -end - -module InvalidSnapshotStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListTagsForResourceMessage = struct - type t = { resource_name : String.t } - - let make ~resource_name () = { resource_name } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("resource_name", String.to_json v.resource_name) ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - } -end - -module DeleteCacheSubnetGroupMessage = struct - type t = { cache_subnet_group_name : String.t } - - let make ~cache_subnet_group_name () = { cache_subnet_group_name } - - let parse xml = - Some - { cache_subnet_group_name = - Xml.required - "CacheSubnetGroupName" - (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("ReplicationGroupId", + (String.to_query v.replication_group_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.apply_immediately + (fun f -> ("apply_immediately", (Boolean.to_json f))); + Util.option_map v.notification_topic_status + (fun f -> ("notification_topic_status", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f))); + Util.option_map v.notification_topic_arn + (fun f -> ("notification_topic_arn", (String.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Some + ("security_group_ids", + (SecurityGroupIdsList.to_json v.security_group_ids)); + Some + ("cache_security_group_names", + (CacheSecurityGroupNameList.to_json + v.cache_security_group_names)); + Util.option_map v.automatic_failover_enabled + (fun f -> ("automatic_failover_enabled", (Boolean.to_json f))); + Util.option_map v.snapshotting_cluster_id + (fun f -> ("snapshotting_cluster_id", (String.to_json f))); + Util.option_map v.primary_cluster_id + (fun f -> ("primary_cluster_id", (String.to_json f))); + Util.option_map v.replication_group_description + (fun f -> ("replication_group_description", (String.to_json f))); + Some + ("replication_group_id", + (String.to_json v.replication_group_id))]) + let of_json j = + { + replication_group_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "replication_group_id"))); + replication_group_description = + (Util.option_map (Json.lookup j "replication_group_description") + String.of_json); + primary_cluster_id = + (Util.option_map (Json.lookup j "primary_cluster_id") + String.of_json); + snapshotting_cluster_id = + (Util.option_map (Json.lookup j "snapshotting_cluster_id") + String.of_json); + automatic_failover_enabled = + (Util.option_map (Json.lookup j "automatic_failover_enabled") + Boolean.of_json); + cache_security_group_names = + (CacheSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_names"))); + security_group_ids = + (SecurityGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + notification_topic_arn = + (Util.option_map (Json.lookup j "notification_topic_arn") + String.of_json); + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + notification_topic_status = + (Util.option_map (Json.lookup j "notification_topic_status") + String.of_json); + apply_immediately = + (Util.option_map (Json.lookup j "apply_immediately") + Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json) + } + end +module CreateCacheParameterGroupMessage = + struct + type t = + { + cache_parameter_group_name: String.t ; + cache_parameter_group_family: String.t ; + description: String.t } + let make ~cache_parameter_group_name ~cache_parameter_group_family + ~description () = + { cache_parameter_group_name; cache_parameter_group_family; description + } + let parse xml = + Some + { + cache_parameter_group_name = + (Xml.required "CacheParameterGroupName" + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse)); + cache_parameter_group_family = + (Xml.required "CacheParameterGroupFamily" + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse)); + description = + (Xml.required "Description" + (Util.option_bind (Xml.member "Description" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Description", (String.to_query v.description))); + Some (Query.Pair - ("CacheSubnetGroupName", String.to_query v.cache_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cache_subnet_group_name", String.to_json v.cache_subnet_group_name) ]) - - let of_json j = - { cache_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_subnet_group_name")) - } -end - -module DescribeEngineDefaultParametersMessage = struct - type t = - { cache_parameter_group_family : String.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~cache_parameter_group_family ?max_records ?marker () = - { cache_parameter_group_family; max_records; marker } - - let parse xml = - Some - { cache_parameter_group_family = - Xml.required - "CacheParameterGroupFamily" - (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) String.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some + ("CacheParameterGroupFamily", + (String.to_query v.cache_parameter_group_family))); + Some (Query.Pair - ( "CacheParameterGroupFamily" - , String.to_query v.cache_parameter_group_family )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some - ( "cache_parameter_group_family" - , String.to_json v.cache_parameter_group_family ) - ]) - - let of_json j = - { cache_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_family")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module RebootCacheClusterResult = struct - type t = { cache_cluster : CacheCluster.t option } - - let make ?cache_cluster () = { cache_cluster } - - let parse xml = - Some - { cache_cluster = - Util.option_bind (Xml.member "CacheCluster" xml) CacheCluster.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - Query.Pair ("CacheCluster", CacheCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_cluster (fun f -> - "cache_cluster", CacheCluster.to_json f) - ]) - - let of_json j = - { cache_cluster = Util.option_map (Json.lookup j "cache_cluster") CacheCluster.of_json - } -end - -module DeleteSnapshotMessage = struct - type t = { snapshot_name : String.t } - - let make ~snapshot_name () = { snapshot_name } - - let parse xml = - Some - { snapshot_name = - Xml.required - "SnapshotName" - (Util.option_bind (Xml.member "SnapshotName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SnapshotName", String.to_query v.snapshot_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("snapshot_name", String.to_json v.snapshot_name) ]) - - let of_json j = - { snapshot_name = String.of_json (Util.of_option_exn (Json.lookup j "snapshot_name")) - } -end - -module ModifyCacheParameterGroupMessage = struct - type t = - { cache_parameter_group_name : String.t - ; parameter_name_values : ParameterNameValueList.t - } - - let make ~cache_parameter_group_name ~parameter_name_values () = - { cache_parameter_group_name; parameter_name_values } - - let parse xml = - Some - { cache_parameter_group_name = - Xml.required - "CacheParameterGroupName" - (Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse) - ; parameter_name_values = - Xml.required - "ParameterNameValues" - (Util.option_bind - (Xml.member "ParameterNameValues" xml) - ParameterNameValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheParameterGroupName", + (String.to_query v.cache_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("description", (String.to_json v.description)); + Some + ("cache_parameter_group_family", + (String.to_json v.cache_parameter_group_family)); + Some + ("cache_parameter_group_name", + (String.to_json v.cache_parameter_group_name))]) + let of_json j = + { + cache_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_group_name"))); + cache_parameter_group_family = + (String.of_json + (Util.of_option_exn + (Json.lookup j "cache_parameter_group_family"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))) + } + end +module InvalidCacheSecurityGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CacheEngineVersionMessage = + struct + type t = + { + marker: String.t option ; + cache_engine_versions: CacheEngineVersionList.t } + let make ?marker ?(cache_engine_versions= []) () = + { marker; cache_engine_versions } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + cache_engine_versions = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheEngineVersions" xml) + CacheEngineVersionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheEngineVersions.member", + (CacheEngineVersionList.to_query v.cache_engine_versions))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_engine_versions", + (CacheEngineVersionList.to_json v.cache_engine_versions)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + cache_engine_versions = + (CacheEngineVersionList.of_json + (Util.of_option_exn (Json.lookup j "cache_engine_versions"))) + } + end +module PurchaseReservedCacheNodesOfferingResult = + struct + type t = { + reserved_cache_node: ReservedCacheNode.t option } + let make ?reserved_cache_node () = { reserved_cache_node } + let parse xml = + Some + { + reserved_cache_node = + (Util.option_bind (Xml.member "ReservedCacheNode" xml) + ReservedCacheNode.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reserved_cache_node + (fun f -> + Query.Pair + ("ReservedCacheNode", (ReservedCacheNode.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reserved_cache_node + (fun f -> + ("reserved_cache_node", (ReservedCacheNode.to_json f)))]) + let of_json j = + { + reserved_cache_node = + (Util.option_map (Json.lookup j "reserved_cache_node") + ReservedCacheNode.of_json) + } + end +module ModifyReplicationGroupResult = + struct + type t = { + replication_group: ReplicationGroup.t option } + let make ?replication_group () = { replication_group } + let parse xml = + Some + { + replication_group = + (Util.option_bind (Xml.member "ReplicationGroup" xml) + ReplicationGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> + Query.Pair + ("ReplicationGroup", (ReplicationGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_group + (fun f -> ("replication_group", (ReplicationGroup.to_json f)))]) + let of_json j = + { + replication_group = + (Util.option_map (Json.lookup j "replication_group") + ReplicationGroup.of_json) + } + end +module CacheSecurityGroupMessage = + struct + type t = + { + marker: String.t option ; + cache_security_groups: CacheSecurityGroups.t } + let make ?marker ?(cache_security_groups= []) () = + { marker; cache_security_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + cache_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroups" xml) + CacheSecurityGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheSecurityGroups.member", + (CacheSecurityGroups.to_query v.cache_security_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_security_groups", + (CacheSecurityGroups.to_json v.cache_security_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + cache_security_groups = + (CacheSecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "cache_security_groups"))) + } + end +module InvalidSnapshotStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListTagsForResourceMessage = + struct + type t = { + resource_name: String.t } + let make ~resource_name () = { resource_name } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))) + } + end +module DeleteCacheSubnetGroupMessage = + struct + type t = { + cache_subnet_group_name: String.t } + let make ~cache_subnet_group_name () = { cache_subnet_group_name } + let parse xml = + Some + { + cache_subnet_group_name = + (Xml.required "CacheSubnetGroupName" + (Util.option_bind (Xml.member "CacheSubnetGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CacheSubnetGroupName", + (String.to_query v.cache_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("cache_subnet_group_name", + (String.to_json v.cache_subnet_group_name))]) + let of_json j = + { + cache_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_subnet_group_name"))) + } + end +module DescribeEngineDefaultParametersMessage = + struct + type t = + { + cache_parameter_group_family: String.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~cache_parameter_group_family ?max_records ?marker () = + { cache_parameter_group_family; max_records; marker } + let parse xml = + Some + { + cache_parameter_group_family = + (Xml.required "CacheParameterGroupFamily" + (Util.option_bind (Xml.member "CacheParameterGroupFamily" xml) + String.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some (Query.Pair - ( "ParameterNameValues.member" - , ParameterNameValueList.to_query v.parameter_name_values )) - ; Some + ("CacheParameterGroupFamily", + (String.to_query v.cache_parameter_group_family)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some + ("cache_parameter_group_family", + (String.to_json v.cache_parameter_group_family))]) + let of_json j = + { + cache_parameter_group_family = + (String.of_json + (Util.of_option_exn + (Json.lookup j "cache_parameter_group_family"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module RebootCacheClusterResult = + struct + type t = { + cache_cluster: CacheCluster.t option } + let make ?cache_cluster () = { cache_cluster } + let parse xml = + Some + { + cache_cluster = + (Util.option_bind (Xml.member "CacheCluster" xml) + CacheCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> + Query.Pair ("CacheCluster", (CacheCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_cluster + (fun f -> ("cache_cluster", (CacheCluster.to_json f)))]) + let of_json j = + { + cache_cluster = + (Util.option_map (Json.lookup j "cache_cluster") + CacheCluster.of_json) + } + end +module DeleteSnapshotMessage = + struct + type t = { + snapshot_name: String.t } + let make ~snapshot_name () = { snapshot_name } + let parse xml = + Some + { + snapshot_name = + (Xml.required "SnapshotName" + (Util.option_bind (Xml.member "SnapshotName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("SnapshotName", (String.to_query v.snapshot_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("snapshot_name", (String.to_json v.snapshot_name))]) + let of_json j = + { + snapshot_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "snapshot_name"))) + } + end +module ModifyCacheParameterGroupMessage = + struct + type t = + { + cache_parameter_group_name: String.t ; + parameter_name_values: ParameterNameValueList.t } + let make ~cache_parameter_group_name ~parameter_name_values () = + { cache_parameter_group_name; parameter_name_values } + let parse xml = + Some + { + cache_parameter_group_name = + (Xml.required "CacheParameterGroupName" + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse)); + parameter_name_values = + (Xml.required "ParameterNameValues" + (Util.option_bind (Xml.member "ParameterNameValues" xml) + ParameterNameValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ParameterNameValues.member", + (ParameterNameValueList.to_query v.parameter_name_values))); + Some (Query.Pair - ("CacheParameterGroupName", String.to_query v.cache_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "parameter_name_values" - , ParameterNameValueList.to_json v.parameter_name_values ) - ; Some ("cache_parameter_group_name", String.to_json v.cache_parameter_group_name) - ]) - - let of_json j = - { cache_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "cache_parameter_group_name")) - ; parameter_name_values = - ParameterNameValueList.of_json - (Util.of_option_exn (Json.lookup j "parameter_name_values")) - } -end - -module CreateCacheSubnetGroupResult = struct - type t = { cache_subnet_group : CacheSubnetGroup.t option } - - let make ?cache_subnet_group () = { cache_subnet_group } - - let parse xml = - Some - { cache_subnet_group = - Util.option_bind (Xml.member "CacheSubnetGroup" xml) CacheSubnetGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_subnet_group (fun f -> - Query.Pair ("CacheSubnetGroup", CacheSubnetGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_subnet_group (fun f -> - "cache_subnet_group", CacheSubnetGroup.to_json f) - ]) - - let of_json j = - { cache_subnet_group = - Util.option_map (Json.lookup j "cache_subnet_group") CacheSubnetGroup.of_json - } -end - -module ModifyCacheClusterMessage = struct - type t = - { cache_cluster_id : String.t - ; num_cache_nodes : Integer.t option - ; cache_node_ids_to_remove : CacheNodeIdsList.t - ; a_z_mode : AZMode.t option - ; new_availability_zones : PreferredAvailabilityZoneList.t - ; cache_security_group_names : CacheSecurityGroupNameList.t - ; security_group_ids : SecurityGroupIdsList.t - ; preferred_maintenance_window : String.t option - ; notification_topic_arn : String.t option - ; cache_parameter_group_name : String.t option - ; notification_topic_status : String.t option - ; apply_immediately : Boolean.t option - ; engine_version : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; snapshot_retention_limit : Integer.t option - ; snapshot_window : String.t option - } - - let make - ~cache_cluster_id - ?num_cache_nodes - ?(cache_node_ids_to_remove = []) - ?a_z_mode - ?(new_availability_zones = []) - ?(cache_security_group_names = []) - ?(security_group_ids = []) - ?preferred_maintenance_window - ?notification_topic_arn - ?cache_parameter_group_name - ?notification_topic_status - ?apply_immediately - ?engine_version - ?auto_minor_version_upgrade - ?snapshot_retention_limit - ?snapshot_window - () = - { cache_cluster_id - ; num_cache_nodes - ; cache_node_ids_to_remove - ; a_z_mode - ; new_availability_zones - ; cache_security_group_names - ; security_group_ids - ; preferred_maintenance_window - ; notification_topic_arn - ; cache_parameter_group_name - ; notification_topic_status - ; apply_immediately - ; engine_version - ; auto_minor_version_upgrade - ; snapshot_retention_limit - ; snapshot_window - } - - let parse xml = - Some - { cache_cluster_id = - Xml.required - "CacheClusterId" - (Util.option_bind (Xml.member "CacheClusterId" xml) String.parse) - ; num_cache_nodes = Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse - ; cache_node_ids_to_remove = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheNodeIdsToRemove" xml) - CacheNodeIdsList.parse) - ; a_z_mode = Util.option_bind (Xml.member "AZMode" xml) AZMode.parse - ; new_availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "NewAvailabilityZones" xml) - PreferredAvailabilityZoneList.parse) - ; cache_security_group_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "CacheSecurityGroupNames" xml) - CacheSecurityGroupNameList.parse) - ; security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "SecurityGroupIds" xml) - SecurityGroupIdsList.parse) - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; notification_topic_arn = - Util.option_bind (Xml.member "NotificationTopicArn" xml) String.parse - ; cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; notification_topic_status = - Util.option_bind (Xml.member "NotificationTopicStatus" xml) String.parse - ; apply_immediately = - Util.option_bind (Xml.member "ApplyImmediately" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; snapshot_retention_limit = - Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) Integer.parse - ; snapshot_window = Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - Query.Pair ("SnapshotWindow", String.to_query f)) - ; Util.option_map v.snapshot_retention_limit (fun f -> - Query.Pair ("SnapshotRetentionLimit", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.apply_immediately (fun f -> - Query.Pair ("ApplyImmediately", Boolean.to_query f)) - ; Util.option_map v.notification_topic_status (fun f -> - Query.Pair ("NotificationTopicStatus", String.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ; Util.option_map v.notification_topic_arn (fun f -> - Query.Pair ("NotificationTopicArn", String.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Some + ("CacheParameterGroupName", + (String.to_query v.cache_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("parameter_name_values", + (ParameterNameValueList.to_json v.parameter_name_values)); + Some + ("cache_parameter_group_name", + (String.to_json v.cache_parameter_group_name))]) + let of_json j = + { + cache_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_parameter_group_name"))); + parameter_name_values = + (ParameterNameValueList.of_json + (Util.of_option_exn (Json.lookup j "parameter_name_values"))) + } + end +module CreateCacheSubnetGroupResult = + struct + type t = { + cache_subnet_group: CacheSubnetGroup.t option } + let make ?cache_subnet_group () = { cache_subnet_group } + let parse xml = + Some + { + cache_subnet_group = + (Util.option_bind (Xml.member "CacheSubnetGroup" xml) + CacheSubnetGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_subnet_group + (fun f -> + Query.Pair + ("CacheSubnetGroup", (CacheSubnetGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_subnet_group + (fun f -> ("cache_subnet_group", (CacheSubnetGroup.to_json f)))]) + let of_json j = + { + cache_subnet_group = + (Util.option_map (Json.lookup j "cache_subnet_group") + CacheSubnetGroup.of_json) + } + end +module ModifyCacheClusterMessage = + struct + type t = + { + cache_cluster_id: String.t ; + num_cache_nodes: Integer.t option ; + cache_node_ids_to_remove: CacheNodeIdsList.t ; + a_z_mode: AZMode.t option ; + new_availability_zones: PreferredAvailabilityZoneList.t ; + cache_security_group_names: CacheSecurityGroupNameList.t ; + security_group_ids: SecurityGroupIdsList.t ; + preferred_maintenance_window: String.t option ; + notification_topic_arn: String.t option ; + cache_parameter_group_name: String.t option ; + notification_topic_status: String.t option ; + apply_immediately: Boolean.t option ; + engine_version: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + snapshot_retention_limit: Integer.t option ; + snapshot_window: String.t option } + let make ~cache_cluster_id ?num_cache_nodes ?(cache_node_ids_to_remove= + []) ?a_z_mode ?(new_availability_zones= []) + ?(cache_security_group_names= []) ?(security_group_ids= []) + ?preferred_maintenance_window ?notification_topic_arn + ?cache_parameter_group_name ?notification_topic_status + ?apply_immediately ?engine_version ?auto_minor_version_upgrade + ?snapshot_retention_limit ?snapshot_window () = + { + cache_cluster_id; + num_cache_nodes; + cache_node_ids_to_remove; + a_z_mode; + new_availability_zones; + cache_security_group_names; + security_group_ids; + preferred_maintenance_window; + notification_topic_arn; + cache_parameter_group_name; + notification_topic_status; + apply_immediately; + engine_version; + auto_minor_version_upgrade; + snapshot_retention_limit; + snapshot_window + } + let parse xml = + Some + { + cache_cluster_id = + (Xml.required "CacheClusterId" + (Util.option_bind (Xml.member "CacheClusterId" xml) + String.parse)); + num_cache_nodes = + (Util.option_bind (Xml.member "NumCacheNodes" xml) Integer.parse); + cache_node_ids_to_remove = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheNodeIdsToRemove" xml) + CacheNodeIdsList.parse)); + a_z_mode = + (Util.option_bind (Xml.member "AZMode" xml) AZMode.parse); + new_availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "NewAvailabilityZones" xml) + PreferredAvailabilityZoneList.parse)); + cache_security_group_names = + (Util.of_option [] + (Util.option_bind (Xml.member "CacheSecurityGroupNames" xml) + CacheSecurityGroupNameList.parse)); + security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroupIds" xml) + SecurityGroupIdsList.parse)); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + notification_topic_arn = + (Util.option_bind (Xml.member "NotificationTopicArn" xml) + String.parse); + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + notification_topic_status = + (Util.option_bind (Xml.member "NotificationTopicStatus" xml) + String.parse); + apply_immediately = + (Util.option_bind (Xml.member "ApplyImmediately" xml) + Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + snapshot_retention_limit = + (Util.option_bind (Xml.member "SnapshotRetentionLimit" xml) + Integer.parse); + snapshot_window = + (Util.option_bind (Xml.member "SnapshotWindow" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> Query.Pair ("SnapshotWindow", (String.to_query f))); + Util.option_map v.snapshot_retention_limit + (fun f -> + Query.Pair ("SnapshotRetentionLimit", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.apply_immediately + (fun f -> Query.Pair ("ApplyImmediately", (Boolean.to_query f))); + Util.option_map v.notification_topic_status + (fun f -> + Query.Pair ("NotificationTopicStatus", (String.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f))); + Util.option_map v.notification_topic_arn + (fun f -> + Query.Pair ("NotificationTopicArn", (String.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Some (Query.Pair - ( "SecurityGroupIds.member" - , SecurityGroupIdsList.to_query v.security_group_ids )) - ; Some + ("SecurityGroupIds.member", + (SecurityGroupIdsList.to_query v.security_group_ids))); + Some (Query.Pair - ( "CacheSecurityGroupNames.member" - , CacheSecurityGroupNameList.to_query v.cache_security_group_names )) - ; Some + ("CacheSecurityGroupNames.member", + (CacheSecurityGroupNameList.to_query + v.cache_security_group_names))); + Some (Query.Pair - ( "NewAvailabilityZones.member" - , PreferredAvailabilityZoneList.to_query v.new_availability_zones )) - ; Util.option_map v.a_z_mode (fun f -> Query.Pair ("AZMode", AZMode.to_query f)) - ; Some + ("NewAvailabilityZones.member", + (PreferredAvailabilityZoneList.to_query + v.new_availability_zones))); + Util.option_map v.a_z_mode + (fun f -> Query.Pair ("AZMode", (AZMode.to_query f))); + Some (Query.Pair - ( "CacheNodeIdsToRemove.member" - , CacheNodeIdsList.to_query v.cache_node_ids_to_remove )) - ; Util.option_map v.num_cache_nodes (fun f -> - Query.Pair ("NumCacheNodes", Integer.to_query f)) - ; Some (Query.Pair ("CacheClusterId", String.to_query v.cache_cluster_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.snapshot_window (fun f -> - "snapshot_window", String.to_json f) - ; Util.option_map v.snapshot_retention_limit (fun f -> - "snapshot_retention_limit", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.apply_immediately (fun f -> - "apply_immediately", Boolean.to_json f) - ; Util.option_map v.notification_topic_status (fun f -> - "notification_topic_status", String.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ; Util.option_map v.notification_topic_arn (fun f -> - "notification_topic_arn", String.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Some ("security_group_ids", SecurityGroupIdsList.to_json v.security_group_ids) - ; Some - ( "cache_security_group_names" - , CacheSecurityGroupNameList.to_json v.cache_security_group_names ) - ; Some - ( "new_availability_zones" - , PreferredAvailabilityZoneList.to_json v.new_availability_zones ) - ; Util.option_map v.a_z_mode (fun f -> "a_z_mode", AZMode.to_json f) - ; Some - ( "cache_node_ids_to_remove" - , CacheNodeIdsList.to_json v.cache_node_ids_to_remove ) - ; Util.option_map v.num_cache_nodes (fun f -> - "num_cache_nodes", Integer.to_json f) - ; Some ("cache_cluster_id", String.to_json v.cache_cluster_id) - ]) - - let of_json j = - { cache_cluster_id = - String.of_json (Util.of_option_exn (Json.lookup j "cache_cluster_id")) - ; num_cache_nodes = Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json - ; cache_node_ids_to_remove = - CacheNodeIdsList.of_json - (Util.of_option_exn (Json.lookup j "cache_node_ids_to_remove")) - ; a_z_mode = Util.option_map (Json.lookup j "a_z_mode") AZMode.of_json - ; new_availability_zones = - PreferredAvailabilityZoneList.of_json - (Util.of_option_exn (Json.lookup j "new_availability_zones")) - ; cache_security_group_names = - CacheSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "cache_security_group_names")) - ; security_group_ids = - SecurityGroupIdsList.of_json - (Util.of_option_exn (Json.lookup j "security_group_ids")) - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; notification_topic_arn = - Util.option_map (Json.lookup j "notification_topic_arn") String.of_json - ; cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; notification_topic_status = - Util.option_map (Json.lookup j "notification_topic_status") String.of_json - ; apply_immediately = - Util.option_map (Json.lookup j "apply_immediately") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; snapshot_retention_limit = - Util.option_map (Json.lookup j "snapshot_retention_limit") Integer.of_json - ; snapshot_window = Util.option_map (Json.lookup j "snapshot_window") String.of_json - } -end - -module CacheParameterGroupNameMessage = struct - type t = { cache_parameter_group_name : String.t option } - - let make ?cache_parameter_group_name () = { cache_parameter_group_name } - - let parse xml = - Some - { cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - } -end - -module DescribeCacheParameterGroupsMessage = struct - type t = - { cache_parameter_group_name : String.t option - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?cache_parameter_group_name ?max_records ?marker () = - { cache_parameter_group_name; max_records; marker } - - let parse xml = - Some - { cache_parameter_group_name = - Util.option_bind (Xml.member "CacheParameterGroupName" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.cache_parameter_group_name (fun f -> - Query.Pair ("CacheParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.cache_parameter_group_name (fun f -> - "cache_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { cache_parameter_group_name = - Util.option_map (Json.lookup j "cache_parameter_group_name") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ReservedCacheNodeMessage = struct - type t = - { marker : String.t option - ; reserved_cache_nodes : ReservedCacheNodeList.t - } - - let make ?marker ?(reserved_cache_nodes = []) () = { marker; reserved_cache_nodes } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; reserved_cache_nodes = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedCacheNodes" xml) - ReservedCacheNodeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("CacheNodeIdsToRemove.member", + (CacheNodeIdsList.to_query v.cache_node_ids_to_remove))); + Util.option_map v.num_cache_nodes + (fun f -> Query.Pair ("NumCacheNodes", (Integer.to_query f))); + Some (Query.Pair - ( "ReservedCacheNodes.member" - , ReservedCacheNodeList.to_query v.reserved_cache_nodes )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("reserved_cache_nodes", ReservedCacheNodeList.to_json v.reserved_cache_nodes) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; reserved_cache_nodes = - ReservedCacheNodeList.of_json - (Util.of_option_exn (Json.lookup j "reserved_cache_nodes")) - } -end + ("CacheClusterId", (String.to_query v.cache_cluster_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.snapshot_window + (fun f -> ("snapshot_window", (String.to_json f))); + Util.option_map v.snapshot_retention_limit + (fun f -> ("snapshot_retention_limit", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.apply_immediately + (fun f -> ("apply_immediately", (Boolean.to_json f))); + Util.option_map v.notification_topic_status + (fun f -> ("notification_topic_status", (String.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f))); + Util.option_map v.notification_topic_arn + (fun f -> ("notification_topic_arn", (String.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Some + ("security_group_ids", + (SecurityGroupIdsList.to_json v.security_group_ids)); + Some + ("cache_security_group_names", + (CacheSecurityGroupNameList.to_json + v.cache_security_group_names)); + Some + ("new_availability_zones", + (PreferredAvailabilityZoneList.to_json + v.new_availability_zones)); + Util.option_map v.a_z_mode + (fun f -> ("a_z_mode", (AZMode.to_json f))); + Some + ("cache_node_ids_to_remove", + (CacheNodeIdsList.to_json v.cache_node_ids_to_remove)); + Util.option_map v.num_cache_nodes + (fun f -> ("num_cache_nodes", (Integer.to_json f))); + Some ("cache_cluster_id", (String.to_json v.cache_cluster_id))]) + let of_json j = + { + cache_cluster_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "cache_cluster_id"))); + num_cache_nodes = + (Util.option_map (Json.lookup j "num_cache_nodes") Integer.of_json); + cache_node_ids_to_remove = + (CacheNodeIdsList.of_json + (Util.of_option_exn (Json.lookup j "cache_node_ids_to_remove"))); + a_z_mode = + (Util.option_map (Json.lookup j "a_z_mode") AZMode.of_json); + new_availability_zones = + (PreferredAvailabilityZoneList.of_json + (Util.of_option_exn (Json.lookup j "new_availability_zones"))); + cache_security_group_names = + (CacheSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "cache_security_group_names"))); + security_group_ids = + (SecurityGroupIdsList.of_json + (Util.of_option_exn (Json.lookup j "security_group_ids"))); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + notification_topic_arn = + (Util.option_map (Json.lookup j "notification_topic_arn") + String.of_json); + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + notification_topic_status = + (Util.option_map (Json.lookup j "notification_topic_status") + String.of_json); + apply_immediately = + (Util.option_map (Json.lookup j "apply_immediately") + Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + snapshot_retention_limit = + (Util.option_map (Json.lookup j "snapshot_retention_limit") + Integer.of_json); + snapshot_window = + (Util.option_map (Json.lookup j "snapshot_window") String.of_json) + } + end +module CacheParameterGroupNameMessage = + struct + type t = { + cache_parameter_group_name: String.t option } + let make ?cache_parameter_group_name () = { cache_parameter_group_name } + let parse xml = + Some + { + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json) + } + end +module DescribeCacheParameterGroupsMessage = + struct + type t = + { + cache_parameter_group_name: String.t option ; + max_records: Integer.t option ; + marker: String.t option } + let make ?cache_parameter_group_name ?max_records ?marker () = + { cache_parameter_group_name; max_records; marker } + let parse xml = + Some + { + cache_parameter_group_name = + (Util.option_bind (Xml.member "CacheParameterGroupName" xml) + String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.cache_parameter_group_name + (fun f -> + Query.Pair ("CacheParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.cache_parameter_group_name + (fun f -> ("cache_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + cache_parameter_group_name = + (Util.option_map (Json.lookup j "cache_parameter_group_name") + String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ReservedCacheNodeMessage = + struct + type t = + { + marker: String.t option ; + reserved_cache_nodes: ReservedCacheNodeList.t } + let make ?marker ?(reserved_cache_nodes= []) () = + { marker; reserved_cache_nodes } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + reserved_cache_nodes = + (Util.of_option [] + (Util.option_bind (Xml.member "ReservedCacheNodes" xml) + ReservedCacheNodeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedCacheNodes.member", + (ReservedCacheNodeList.to_query v.reserved_cache_nodes))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_cache_nodes", + (ReservedCacheNodeList.to_json v.reserved_cache_nodes)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + reserved_cache_nodes = + (ReservedCacheNodeList.of_json + (Util.of_option_exn (Json.lookup j "reserved_cache_nodes"))) + } + end \ No newline at end of file diff --git a/libraries/elasticache/lib_test/dune b/libraries/elasticache/lib_test/dune index a25a1b76f..b393b498b 100644 --- a/libraries/elasticache/lib_test/dune +++ b/libraries/elasticache/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_elasticache_test) - (libraries aws aws_elasticache aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_elasticache aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/elasticache/lib_test/test_async.ml b/libraries/elasticache/lib_test/test_async.ml index b88363929..7356b9770 100644 --- a/libraries/elasticache/lib_test/test_async.ml +++ b/libraries/elasticache/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_elasticache_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/elasticache/lib_test/test_lwt.ml b/libraries/elasticache/lib_test/test_lwt.ml index d85f83549..f7959f88c 100644 --- a/libraries/elasticache/lib_test/test_lwt.ml +++ b/libraries/elasticache/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_elasticache_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/elasticloadbalancing/lib/addTags.ml b/libraries/elasticloadbalancing/lib/addTags.ml index 3f8473e5b..367f77007 100644 --- a/libraries/elasticloadbalancing/lib/addTags.ml +++ b/libraries/elasticloadbalancing/lib/addTags.ml @@ -1,42 +1,31 @@ open Types open Aws - type input = AddTagsInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "AddTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-06-01"]); ("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.DuplicateTagKeys - ; Errors_internal.TooManyTags - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.DuplicateTagKeys; + Errors_internal.TooManyTags; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/addTags.mli b/libraries/elasticloadbalancing/lib/addTags.mli index c407166aa..98213128e 100644 --- a/libraries/elasticloadbalancing/lib/addTags.mli +++ b/libraries/elasticloadbalancing/lib/addTags.mli @@ -1,10 +1,7 @@ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml index c75264350..6ba793c38 100644 --- a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml @@ -1,75 +1,67 @@ open Types open Aws - type input = ApplySecurityGroupsToLoadBalancerInput.t - type output = ApplySecurityGroupsToLoadBalancerOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "ApplySecurityGroupsToLoadBalancer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["ApplySecurityGroupsToLoadBalancer"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ApplySecurityGroupsToLoadBalancerInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ApplySecurityGroupsToLoadBalancerInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ApplySecurityGroupsToLoadBalancerResponse" (snd xml)) - (Xml.member "ApplySecurityGroupsToLoadBalancerResult") - in + (Xml.member "ApplySecurityGroupsToLoadBalancerResult") in try Util.or_error (Util.option_bind resp ApplySecurityGroupsToLoadBalancerOutput.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed ApplySecurityGroupsToLoadBalancerOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ApplySecurityGroupsToLoadBalancerOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ApplySecurityGroupsToLoadBalancerOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ApplySecurityGroupsToLoadBalancerOutput - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSecurityGroup - ; Errors_internal.InvalidConfigurationRequest - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSecurityGroup; + Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.mli b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.mli index 839f242ea..874bbacbc 100644 --- a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = ApplySecurityGroupsToLoadBalancerInput.t - type output = ApplySecurityGroupsToLoadBalancerOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml index 113ded3c0..cf8080f8f 100644 --- a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml +++ b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml @@ -1,73 +1,67 @@ open Types open Aws - type input = AttachLoadBalancerToSubnetsInput.t - type output = AttachLoadBalancerToSubnetsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "AttachLoadBalancerToSubnets" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["AttachLoadBalancerToSubnets"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AttachLoadBalancerToSubnetsInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (AttachLoadBalancerToSubnetsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "AttachLoadBalancerToSubnetsResponse" (snd xml)) - (Xml.member "AttachLoadBalancerToSubnetsResult") - in + (Xml.member "AttachLoadBalancerToSubnetsResult") in try Util.or_error (Util.option_bind resp AttachLoadBalancerToSubnetsOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed AttachLoadBalancerToSubnetsOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AttachLoadBalancerToSubnetsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AttachLoadBalancerToSubnetsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AttachLoadBalancerToSubnetsOutput - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSubnet - ; Errors_internal.SubnetNotFound - ; Errors_internal.InvalidConfigurationRequest - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSubnet; + Errors_internal.SubnetNotFound; + Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.mli b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.mli index a53609fbd..c58d51a70 100644 --- a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.mli +++ b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.mli @@ -1,10 +1,7 @@ open Types - type input = AttachLoadBalancerToSubnetsInput.t - type output = AttachLoadBalancerToSubnetsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/configureHealthCheck.ml b/libraries/elasticloadbalancing/lib/configureHealthCheck.ml index 9e8c5a627..c40bb556a 100644 --- a/libraries/elasticloadbalancing/lib/configureHealthCheck.ml +++ b/libraries/elasticloadbalancing/lib/configureHealthCheck.ml @@ -1,63 +1,61 @@ open Types open Aws - type input = ConfigureHealthCheckInput.t - type output = ConfigureHealthCheckOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "ConfigureHealthCheck" ] ] + [("Version", ["2012-06-01"]); ("Action", ["ConfigureHealthCheck"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ConfigureHealthCheckInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ConfigureHealthCheckInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ConfigureHealthCheckResponse" (snd xml)) - (Xml.member "ConfigureHealthCheckResult") - in + Util.option_bind (Xml.member "ConfigureHealthCheckResponse" (snd xml)) + (Xml.member "ConfigureHealthCheckResult") in try - Util.or_error - (Util.option_bind resp ConfigureHealthCheckOutput.parse) + Util.or_error (Util.option_bind resp ConfigureHealthCheckOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ConfigureHealthCheckOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ConfigureHealthCheckOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ConfigureHealthCheckOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ConfigureHealthCheckOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/configureHealthCheck.mli b/libraries/elasticloadbalancing/lib/configureHealthCheck.mli index 0ef2a9742..9dee99740 100644 --- a/libraries/elasticloadbalancing/lib/configureHealthCheck.mli +++ b/libraries/elasticloadbalancing/lib/configureHealthCheck.mli @@ -1,10 +1,7 @@ open Types - type input = ConfigureHealthCheckInput.t - type output = ConfigureHealthCheckOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml index 5fef1b50f..dd7d1033b 100644 --- a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml @@ -1,44 +1,36 @@ open Types open Aws - type input = CreateAppCookieStickinessPolicyInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "CreateAppCookieStickinessPolicy" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["CreateAppCookieStickinessPolicy"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateAppCookieStickinessPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateAppCookieStickinessPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.TooManyPolicies - ; Errors_internal.DuplicatePolicyName - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.TooManyPolicies; + Errors_internal.DuplicatePolicyName; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.mli b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.mli index 0ae7ed441..9f3d379ff 100644 --- a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.mli +++ b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = CreateAppCookieStickinessPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml index 44eafeddb..f54ad26b0 100644 --- a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml @@ -1,44 +1,36 @@ open Types open Aws - type input = CreateLBCookieStickinessPolicyInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "CreateLBCookieStickinessPolicy" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["CreateLBCookieStickinessPolicy"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateLBCookieStickinessPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateLBCookieStickinessPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.TooManyPolicies - ; Errors_internal.DuplicatePolicyName - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.TooManyPolicies; + Errors_internal.DuplicatePolicyName; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.mli b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.mli index 48f036cd9..45d94be15 100644 --- a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.mli +++ b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = CreateLBCookieStickinessPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancer.ml b/libraries/elasticloadbalancing/lib/createLoadBalancer.ml index e2379277f..b22d8c148 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancer.ml @@ -1,76 +1,70 @@ open Types open Aws - type input = CreateAccessPointInput.t - type output = CreateAccessPointOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "CreateLoadBalancer" ] ] + [("Version", ["2012-06-01"]); ("Action", ["CreateLoadBalancer"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateAccessPointInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateAccessPointInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateLoadBalancerResponse" (snd xml)) - (Xml.member "CreateLoadBalancerResult") - in + Util.option_bind (Xml.member "CreateLoadBalancerResponse" (snd xml)) + (Xml.member "CreateLoadBalancerResult") in try - Util.or_error - (Util.option_bind resp CreateAccessPointOutput.parse) + Util.or_error (Util.option_bind resp CreateAccessPointOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateAccessPointOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateAccessPointOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateAccessPointOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateAccessPointOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DuplicateTagKeys - ; Errors_internal.TooManyTags - ; Errors_internal.InvalidScheme - ; Errors_internal.InvalidSecurityGroup - ; Errors_internal.InvalidSubnet - ; Errors_internal.SubnetNotFound - ; Errors_internal.InvalidConfigurationRequest - ; Errors_internal.CertificateNotFound - ; Errors_internal.TooManyLoadBalancers - ; Errors_internal.DuplicateLoadBalancerName - ] - @ Errors_internal.common - in + [Errors_internal.DuplicateTagKeys; + Errors_internal.TooManyTags; + Errors_internal.InvalidScheme; + Errors_internal.InvalidSecurityGroup; + Errors_internal.InvalidSubnet; + Errors_internal.SubnetNotFound; + Errors_internal.InvalidConfigurationRequest; + Errors_internal.CertificateNotFound; + Errors_internal.TooManyLoadBalancers; + Errors_internal.DuplicateLoadBalancerName] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancer.mli b/libraries/elasticloadbalancing/lib/createLoadBalancer.mli index 29ee1d5ce..7fed7f9c4 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/createLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = CreateAccessPointInput.t - type output = CreateAccessPointOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml index 676c426dd..ad211446c 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml @@ -1,44 +1,35 @@ open Types open Aws - type input = CreateLoadBalancerListenerInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "CreateLoadBalancerListeners" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["CreateLoadBalancerListeners"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateLoadBalancerListenerInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateLoadBalancerListenerInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.CertificateNotFound - ; Errors_internal.DuplicateListener - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.CertificateNotFound; + Errors_internal.DuplicateListener; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.mli b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.mli index 62527f4ae..fa1258b9a 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.mli +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.mli @@ -1,10 +1,7 @@ open Types - type input = CreateLoadBalancerListenerInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml index 3bbcda157..1cf2c5dd3 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml @@ -1,45 +1,36 @@ open Types open Aws - type input = CreateLoadBalancerPolicyInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "CreateLoadBalancerPolicy" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["CreateLoadBalancerPolicy"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateLoadBalancerPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateLoadBalancerPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.TooManyPolicies - ; Errors_internal.DuplicatePolicyName - ; Errors_internal.PolicyTypeNotFound - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.TooManyPolicies; + Errors_internal.DuplicatePolicyName; + Errors_internal.PolicyTypeNotFound; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.mli b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.mli index dd665b3da..b6e82d1a6 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.mli +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = CreateLoadBalancerPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml index 216f3c573..b434d32a5 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteAccessPointInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DeleteLoadBalancer" ] ] + [("Version", ["2012-06-01"]); ("Action", ["DeleteLoadBalancer"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteAccessPointInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteAccessPointInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.mli b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.mli index 293542eb1..72b1f3e4d 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteAccessPointInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml index d015f416a..e977361f8 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = DeleteLoadBalancerListenerInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DeleteLoadBalancerListeners" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DeleteLoadBalancerListeners"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteLoadBalancerListenerInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteLoadBalancerListenerInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.mli b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.mli index 1506dddd4..fd681f21c 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.mli +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteLoadBalancerListenerInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml index 40dab740e..83e7f4953 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml @@ -1,40 +1,33 @@ open Types open Aws - type input = DeleteLoadBalancerPolicyInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DeleteLoadBalancerPolicy" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DeleteLoadBalancerPolicy"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteLoadBalancerPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteLoadBalancerPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.mli b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.mli index 174362eed..bb2ab4c9f 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.mli +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteLoadBalancerPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml index 5612e9199..88faee993 100644 --- a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml @@ -1,68 +1,64 @@ open Types open Aws - type input = DeregisterEndPointsInput.t - type output = DeregisterEndPointsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "DeregisterInstancesFromLoadBalancer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["DeregisterInstancesFromLoadBalancer"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeregisterEndPointsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeregisterEndPointsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DeregisterInstancesFromLoadBalancerResponse" (snd xml)) - (Xml.member "DeregisterInstancesFromLoadBalancerResult") - in + (Xml.member "DeregisterInstancesFromLoadBalancerResult") in try - Util.or_error - (Util.option_bind resp DeregisterEndPointsOutput.parse) + Util.or_error (Util.option_bind resp DeregisterEndPointsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeregisterEndPointsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeregisterEndPointsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeregisterEndPointsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeregisterEndPointsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.mli b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.mli index d61eae9aa..a12bd8443 100644 --- a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = DeregisterEndPointsInput.t - type output = DeregisterEndPointsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml b/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml index 39897216d..e21f86ed0 100644 --- a/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml +++ b/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml @@ -1,67 +1,64 @@ open Types open Aws - type input = DescribeEndPointStateInput.t - type output = DescribeEndPointStateOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeInstanceHealth" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DescribeInstanceHealth"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEndPointStateInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeEndPointStateInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeInstanceHealthResponse" (snd xml)) - (Xml.member "DescribeInstanceHealthResult") - in + (Xml.member "DescribeInstanceHealthResult") in try - Util.or_error - (Util.option_bind resp DescribeEndPointStateOutput.parse) + Util.or_error (Util.option_bind resp DescribeEndPointStateOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeEndPointStateOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeEndPointStateOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeEndPointStateOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeEndPointStateOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeInstanceHealth.mli b/libraries/elasticloadbalancing/lib/describeInstanceHealth.mli index f8b03633e..ec8c7bbdc 100644 --- a/libraries/elasticloadbalancing/lib/describeInstanceHealth.mli +++ b/libraries/elasticloadbalancing/lib/describeInstanceHealth.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEndPointStateInput.t - type output = DescribeEndPointStateOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml index d24bcd966..114ae24e2 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml @@ -1,71 +1,66 @@ open Types open Aws - type input = DescribeLoadBalancerAttributesInput.t - type output = DescribeLoadBalancerAttributesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeLoadBalancerAttributes" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DescribeLoadBalancerAttributes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeLoadBalancerAttributesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeLoadBalancerAttributesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLoadBalancerAttributesResponse" (snd xml)) - (Xml.member "DescribeLoadBalancerAttributesResult") - in + (Xml.member "DescribeLoadBalancerAttributesResult") in try Util.or_error (Util.option_bind resp DescribeLoadBalancerAttributesOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeLoadBalancerAttributesOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLoadBalancerAttributesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLoadBalancerAttributesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLoadBalancerAttributesOutput - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.LoadBalancerAttributeNotFound - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.LoadBalancerAttributeNotFound; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.mli b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.mli index 0651e5c21..42aff63d8 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.mli +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeLoadBalancerAttributesInput.t - type output = DescribeLoadBalancerAttributesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml index 7c103536e..d08c13721 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml @@ -1,69 +1,65 @@ open Types open Aws - type input = DescribeLoadBalancerPoliciesInput.t - type output = DescribeLoadBalancerPoliciesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeLoadBalancerPolicies" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DescribeLoadBalancerPolicies"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeLoadBalancerPoliciesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeLoadBalancerPoliciesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLoadBalancerPoliciesResponse" (snd xml)) - (Xml.member "DescribeLoadBalancerPoliciesResult") - in + (Xml.member "DescribeLoadBalancerPoliciesResult") in try Util.or_error (Util.option_bind resp DescribeLoadBalancerPoliciesOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeLoadBalancerPoliciesOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLoadBalancerPoliciesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLoadBalancerPoliciesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLoadBalancerPoliciesOutput - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.PolicyNotFound; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.PolicyNotFound; Errors_internal.LoadBalancerNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.mli b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.mli index 975c78311..25ba36efe 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.mli +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeLoadBalancerPoliciesInput.t - type output = DescribeLoadBalancerPoliciesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml index d600588e0..347cb6f8c 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml @@ -1,66 +1,64 @@ open Types open Aws - type input = DescribeLoadBalancerPolicyTypesInput.t - type output = DescribeLoadBalancerPolicyTypesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeLoadBalancerPolicyTypes" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DescribeLoadBalancerPolicyTypes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeLoadBalancerPolicyTypesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeLoadBalancerPolicyTypesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeLoadBalancerPolicyTypesResponse" (snd xml)) - (Xml.member "DescribeLoadBalancerPolicyTypesResult") - in + (Xml.member "DescribeLoadBalancerPolicyTypesResult") in try Util.or_error (Util.option_bind resp DescribeLoadBalancerPolicyTypesOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeLoadBalancerPolicyTypesOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeLoadBalancerPolicyTypesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeLoadBalancerPolicyTypesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeLoadBalancerPolicyTypesOutput - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.PolicyTypeNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.PolicyTypeNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.mli b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.mli index a667427ec..1ae30910e 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.mli +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeLoadBalancerPolicyTypesInput.t - type output = DescribeLoadBalancerPolicyTypesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml index a1abde7b3..028f4908f 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml @@ -1,63 +1,61 @@ open Types open Aws - type input = DescribeAccessPointsInput.t - type output = DescribeAccessPointsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeLoadBalancers" ] ] + [("Version", ["2012-06-01"]); ("Action", ["DescribeLoadBalancers"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeAccessPointsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeAccessPointsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeLoadBalancersResponse" (snd xml)) - (Xml.member "DescribeLoadBalancersResult") - in + Util.option_bind (Xml.member "DescribeLoadBalancersResponse" (snd xml)) + (Xml.member "DescribeLoadBalancersResult") in try - Util.or_error - (Util.option_bind resp DescribeAccessPointsOutput.parse) + Util.or_error (Util.option_bind resp DescribeAccessPointsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAccessPointsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAccessPointsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAccessPointsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAccessPointsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancers.mli b/libraries/elasticloadbalancing/lib/describeLoadBalancers.mli index ca1547188..0e82a2db5 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancers.mli +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancers.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAccessPointsInput.t - type output = DescribeAccessPointsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeTags.ml b/libraries/elasticloadbalancing/lib/describeTags.ml index 2a419fad5..aa167a733 100644 --- a/libraries/elasticloadbalancing/lib/describeTags.ml +++ b/libraries/elasticloadbalancing/lib/describeTags.ml @@ -1,61 +1,60 @@ open Types open Aws - type input = DescribeTagsInput.t - type output = DescribeTagsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DescribeTags" ] ] + [("Version", ["2012-06-01"]); ("Action", ["DescribeTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeTagsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeTagsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeTagsResponse" (snd xml)) - (Xml.member "DescribeTagsResult") - in + Util.option_bind (Xml.member "DescribeTagsResponse" (snd xml)) + (Xml.member "DescribeTagsResult") in try - Util.or_error - (Util.option_bind resp DescribeTagsOutput.parse) + Util.or_error (Util.option_bind resp DescribeTagsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeTagsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeTagsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeTagsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeTagsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/describeTags.mli b/libraries/elasticloadbalancing/lib/describeTags.mli index 61ca30f73..af65dc459 100644 --- a/libraries/elasticloadbalancing/lib/describeTags.mli +++ b/libraries/elasticloadbalancing/lib/describeTags.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeTagsInput.t - type output = DescribeTagsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml index 65d6d4f32..c4679ab6f 100644 --- a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml +++ b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml @@ -1,69 +1,66 @@ open Types open Aws - type input = DetachLoadBalancerFromSubnetsInput.t - type output = DetachLoadBalancerFromSubnetsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "DetachLoadBalancerFromSubnets" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["DetachLoadBalancerFromSubnets"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DetachLoadBalancerFromSubnetsInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DetachLoadBalancerFromSubnetsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DetachLoadBalancerFromSubnetsResponse" (snd xml)) - (Xml.member "DetachLoadBalancerFromSubnetsResult") - in + (Xml.member "DetachLoadBalancerFromSubnetsResult") in try Util.or_error (Util.option_bind resp DetachLoadBalancerFromSubnetsOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DetachLoadBalancerFromSubnetsOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DetachLoadBalancerFromSubnetsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DetachLoadBalancerFromSubnetsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DetachLoadBalancerFromSubnetsOutput - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.mli b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.mli index 13214f739..32aba662e 100644 --- a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.mli +++ b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.mli @@ -1,10 +1,7 @@ open Types - type input = DetachLoadBalancerFromSubnetsInput.t - type output = DetachLoadBalancerFromSubnetsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml index ba44f6d55..c7c871286 100644 --- a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml @@ -1,69 +1,66 @@ open Types open Aws - type input = RemoveAvailabilityZonesInput.t - type output = RemoveAvailabilityZonesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "DisableAvailabilityZonesForLoadBalancer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["DisableAvailabilityZonesForLoadBalancer"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RemoveAvailabilityZonesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (RemoveAvailabilityZonesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind - (Xml.member "DisableAvailabilityZonesForLoadBalancerResponse" (snd xml)) - (Xml.member "DisableAvailabilityZonesForLoadBalancerResult") - in + (Xml.member "DisableAvailabilityZonesForLoadBalancerResponse" + (snd xml)) + (Xml.member "DisableAvailabilityZonesForLoadBalancerResult") in try Util.or_error (Util.option_bind resp RemoveAvailabilityZonesOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RemoveAvailabilityZonesOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RemoveAvailabilityZonesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RemoveAvailabilityZonesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RemoveAvailabilityZonesOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.mli b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.mli index 289d0c274..a9decc968 100644 --- a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveAvailabilityZonesInput.t - type output = RemoveAvailabilityZonesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/dune b/libraries/elasticloadbalancing/lib/dune index a53b7c270..a513b031c 100644 --- a/libraries/elasticloadbalancing/lib/dune +++ b/libraries/elasticloadbalancing/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_elasticloadbalancing) + (name aws_elasticloadbalancing) (public_name aws-elasticloadbalancing) (synopsis "aws-Elastic Load Balancing") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml index 1ac208b7e..05d80fbf5 100644 --- a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml @@ -1,65 +1,64 @@ open Types open Aws - type input = AddAvailabilityZonesInput.t - type output = AddAvailabilityZonesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "EnableAvailabilityZonesForLoadBalancer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["EnableAvailabilityZonesForLoadBalancer"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AddAvailabilityZonesInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AddAvailabilityZonesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind - (Xml.member "EnableAvailabilityZonesForLoadBalancerResponse" (snd xml)) - (Xml.member "EnableAvailabilityZonesForLoadBalancerResult") - in + (Xml.member "EnableAvailabilityZonesForLoadBalancerResponse" + (snd xml)) + (Xml.member "EnableAvailabilityZonesForLoadBalancerResult") in try - Util.or_error - (Util.option_bind resp AddAvailabilityZonesOutput.parse) + Util.or_error (Util.option_bind resp AddAvailabilityZonesOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AddAvailabilityZonesOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AddAvailabilityZonesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AddAvailabilityZonesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AddAvailabilityZonesOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.mli b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.mli index dc102628b..5fc74867c 100644 --- a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = AddAvailabilityZonesInput.t - type output = AddAvailabilityZonesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/errors_internal.ml b/libraries/elasticloadbalancing/lib/errors_internal.ml index aeef76c8a..4d45a6d0f 100644 --- a/libraries/elasticloadbalancing/lib/errors_internal.ml +++ b/libraries/elasticloadbalancing/lib/errors_internal.ml @@ -1,80 +1,77 @@ type t = - | AuthFailure - | Blocked - | CertificateNotFound - | DryRunOperation - | DuplicateListener - | DuplicateLoadBalancerName - | DuplicatePolicyName - | DuplicateTagKeys - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidConfigurationRequest - | InvalidInstance - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidScheme - | InvalidSecurityGroup - | InvalidSubnet - | ListenerNotFound - | LoadBalancerAttributeNotFound - | LoadBalancerNotFound - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | PolicyNotFound - | PolicyTypeNotFound - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | SubnetNotFound - | Throttling - | TooManyLoadBalancers - | TooManyPolicies - | TooManyTags - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | CertificateNotFound + | DryRunOperation + | DuplicateListener + | DuplicateLoadBalancerName + | DuplicatePolicyName + | DuplicateTagKeys + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidConfigurationRequest + | InvalidInstance + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidScheme + | InvalidSecurityGroup + | InvalidSubnet + | ListenerNotFound + | LoadBalancerAttributeNotFound + | LoadBalancerNotFound + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | PolicyNotFound + | PolicyTypeNotFound + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | SubnetNotFound + | Throttling + | TooManyLoadBalancers + | TooManyPolicies + | TooManyTags + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -123,7 +120,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -172,7 +168,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -221,4 +216,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml index 3faf5c0ab..4de8c9e65 100644 --- a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml +++ b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml @@ -1,72 +1,66 @@ open Types open Aws - type input = ModifyLoadBalancerAttributesInput.t - type output = ModifyLoadBalancerAttributesOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "ModifyLoadBalancerAttributes" ] ] + [("Version", ["2012-06-01"]); + ("Action", ["ModifyLoadBalancerAttributes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyLoadBalancerAttributesInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyLoadBalancerAttributesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyLoadBalancerAttributesResponse" (snd xml)) - (Xml.member "ModifyLoadBalancerAttributesResult") - in + (Xml.member "ModifyLoadBalancerAttributesResult") in try Util.or_error (Util.option_bind resp ModifyLoadBalancerAttributesOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ModifyLoadBalancerAttributesOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyLoadBalancerAttributesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyLoadBalancerAttributesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyLoadBalancerAttributesOutput - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.LoadBalancerAttributeNotFound - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.LoadBalancerAttributeNotFound; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.mli b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.mli index fc7f96657..ef909da93 100644 --- a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.mli +++ b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyLoadBalancerAttributesInput.t - type output = ModifyLoadBalancerAttributesOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml index 0059db23b..629a80083 100644 --- a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml @@ -1,68 +1,64 @@ open Types open Aws - type input = RegisterEndPointsInput.t - type output = RegisterEndPointsOutput.t - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "RegisterInstancesWithLoadBalancer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["RegisterInstancesWithLoadBalancer"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RegisterEndPointsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RegisterEndPointsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RegisterInstancesWithLoadBalancerResponse" (snd xml)) - (Xml.member "RegisterInstancesWithLoadBalancerResult") - in + (Xml.member "RegisterInstancesWithLoadBalancerResult") in try - Util.or_error - (Util.option_bind resp RegisterEndPointsOutput.parse) + Util.or_error (Util.option_bind resp RegisterEndPointsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RegisterEndPointsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RegisterEndPointsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RegisterEndPointsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RegisterEndPointsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound ] - @ Errors_internal.common - in + [Errors_internal.InvalidInstance; Errors_internal.LoadBalancerNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.mli b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.mli index 263426357..b1c90af92 100644 --- a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.mli +++ b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.mli @@ -1,10 +1,7 @@ open Types - type input = RegisterEndPointsInput.t - type output = RegisterEndPointsOutput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/removeTags.ml b/libraries/elasticloadbalancing/lib/removeTags.ml index fed67039a..c77934752 100644 --- a/libraries/elasticloadbalancing/lib/removeTags.ml +++ b/libraries/elasticloadbalancing/lib/removeTags.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = RemoveTagsInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ]; "Action", [ "RemoveTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-06-01"]); ("Action", ["RemoveTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RemoveTagsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RemoveTagsInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.LoadBalancerNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/removeTags.mli b/libraries/elasticloadbalancing/lib/removeTags.mli index db40a6a91..ae480b1f0 100644 --- a/libraries/elasticloadbalancing/lib/removeTags.mli +++ b/libraries/elasticloadbalancing/lib/removeTags.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveTagsInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml index 81ebfc197..a9e044019 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml @@ -1,46 +1,36 @@ open Types open Aws - type input = SetLoadBalancerListenerSSLCertificateInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "SetLoadBalancerListenerSSLCertificate" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["SetLoadBalancerListenerSSLCertificate"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (SetLoadBalancerListenerSSLCertificateInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (SetLoadBalancerListenerSSLCertificateInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.ListenerNotFound - ; Errors_internal.LoadBalancerNotFound - ; Errors_internal.CertificateNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.ListenerNotFound; + Errors_internal.LoadBalancerNotFound; + Errors_internal.CertificateNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.mli b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.mli index 5723dfbea..7facdfc29 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.mli +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.mli @@ -1,10 +1,7 @@ open Types - type input = SetLoadBalancerListenerSSLCertificateInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml index f78b1b54e..7f6eafabc 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml @@ -1,45 +1,35 @@ open Types open Aws - type input = SetLoadBalancerPoliciesForBackendServerInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "SetLoadBalancerPoliciesForBackendServer" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["SetLoadBalancerPoliciesForBackendServer"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (SetLoadBalancerPoliciesForBackendServerInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (SetLoadBalancerPoliciesForBackendServerInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.PolicyNotFound - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.PolicyNotFound; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.mli b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.mli index 48a498429..7a958850c 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.mli +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.mli @@ -1,10 +1,7 @@ open Types - type input = SetLoadBalancerPoliciesForBackendServerInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml index 4bf2857f2..c71b7d711 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml @@ -1,46 +1,36 @@ open Types open Aws - type input = SetLoadBalancerPoliciesOfListenerInput.t - type output = unit - type error = Errors_internal.t - let service = "elasticloadbalancing" - 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", [ "2012-06-01" ] - ; "Action", [ "SetLoadBalancerPoliciesOfListener" ] - ] + [("Version", ["2012-06-01"]); + ("Action", ["SetLoadBalancerPoliciesOfListener"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (SetLoadBalancerPoliciesOfListenerInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (SetLoadBalancerPoliciesOfListenerInput.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidConfigurationRequest - ; Errors_internal.ListenerNotFound - ; Errors_internal.PolicyNotFound - ; Errors_internal.LoadBalancerNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidConfigurationRequest; + Errors_internal.ListenerNotFound; + Errors_internal.PolicyNotFound; + Errors_internal.LoadBalancerNotFound] @ 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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.mli b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.mli index c27039e34..0f102cccd 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.mli +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.mli @@ -1,10 +1,7 @@ open Types - type input = SetLoadBalancerPoliciesOfListenerInput.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 \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib/types.ml b/libraries/elasticloadbalancing/lib/types.ml index 89cc83bdf..c5fa03858 100644 --- a/libraries/elasticloadbalancing/lib/types.ml +++ b/libraries/elasticloadbalancing/lib/types.ml @@ -1,3901 +1,3717 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module PolicyNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Listener = struct - type t = - { protocol : String.t - ; load_balancer_port : Integer.t - ; instance_protocol : String.t option - ; instance_port : Integer.t - ; s_s_l_certificate_id : String.t option - } - - let make - ~protocol - ~load_balancer_port - ?instance_protocol - ~instance_port - ?s_s_l_certificate_id - () = - { protocol - ; load_balancer_port - ; instance_protocol - ; instance_port - ; s_s_l_certificate_id - } - - let parse xml = - Some - { protocol = - Xml.required - "Protocol" - (Util.option_bind (Xml.member "Protocol" xml) String.parse) - ; load_balancer_port = - Xml.required - "LoadBalancerPort" - (Util.option_bind (Xml.member "LoadBalancerPort" xml) Integer.parse) - ; instance_protocol = - Util.option_bind (Xml.member "InstanceProtocol" xml) String.parse - ; instance_port = - Xml.required - "InstancePort" - (Util.option_bind (Xml.member "InstancePort" xml) Integer.parse) - ; s_s_l_certificate_id = - Util.option_bind (Xml.member "SSLCertificateId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s_s_l_certificate_id (fun f -> - Query.Pair ("SSLCertificateId", String.to_query f)) - ; Some (Query.Pair ("InstancePort", Integer.to_query v.instance_port)) - ; Util.option_map v.instance_protocol (fun f -> - Query.Pair ("InstanceProtocol", String.to_query f)) - ; Some (Query.Pair ("LoadBalancerPort", Integer.to_query v.load_balancer_port)) - ; Some (Query.Pair ("Protocol", String.to_query v.protocol)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s_s_l_certificate_id (fun f -> - "s_s_l_certificate_id", String.to_json f) - ; Some ("instance_port", Integer.to_json v.instance_port) - ; Util.option_map v.instance_protocol (fun f -> - "instance_protocol", String.to_json f) - ; Some ("load_balancer_port", Integer.to_json v.load_balancer_port) - ; Some ("protocol", String.to_json v.protocol) - ]) - - let of_json j = - { protocol = String.of_json (Util.of_option_exn (Json.lookup j "protocol")) - ; load_balancer_port = - Integer.of_json (Util.of_option_exn (Json.lookup j "load_balancer_port")) - ; instance_protocol = - Util.option_map (Json.lookup j "instance_protocol") String.of_json - ; instance_port = Integer.of_json (Util.of_option_exn (Json.lookup j "instance_port")) - ; s_s_l_certificate_id = - Util.option_map (Json.lookup j "s_s_l_certificate_id") String.of_json - } -end - -module AppCookieStickinessPolicy = struct - type t = - { policy_name : String.t option - ; cookie_name : String.t option - } - - let make ?policy_name ?cookie_name () = { policy_name; cookie_name } - - let parse xml = - Some - { policy_name = Util.option_bind (Xml.member "PolicyName" xml) String.parse - ; cookie_name = Util.option_bind (Xml.member "CookieName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cookie_name (fun f -> - Query.Pair ("CookieName", String.to_query f)) - ; Util.option_map v.policy_name (fun f -> - Query.Pair ("PolicyName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cookie_name (fun f -> "cookie_name", String.to_json f) - ; Util.option_map v.policy_name (fun f -> "policy_name", String.to_json f) - ]) - - let of_json j = - { policy_name = Util.option_map (Json.lookup j "policy_name") String.of_json - ; cookie_name = Util.option_map (Json.lookup j "cookie_name") String.of_json - } -end - -module LBCookieStickinessPolicy = struct - type t = - { policy_name : String.t option - ; cookie_expiration_period : Long.t option - } - - let make ?policy_name ?cookie_expiration_period () = - { policy_name; cookie_expiration_period } - - let parse xml = - Some - { policy_name = Util.option_bind (Xml.member "PolicyName" xml) String.parse - ; cookie_expiration_period = - Util.option_bind (Xml.member "CookieExpirationPeriod" xml) Long.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cookie_expiration_period (fun f -> - Query.Pair ("CookieExpirationPeriod", Long.to_query f)) - ; Util.option_map v.policy_name (fun f -> - Query.Pair ("PolicyName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cookie_expiration_period (fun f -> - "cookie_expiration_period", Long.to_json f) - ; Util.option_map v.policy_name (fun f -> "policy_name", String.to_json f) - ]) - - let of_json j = - { policy_name = Util.option_map (Json.lookup j "policy_name") String.of_json - ; cookie_expiration_period = - Util.option_map (Json.lookup j "cookie_expiration_period") Long.of_json - } -end - -module Tag = struct - type t = - { key : String.t - ; value : String.t option - } - - let make ~key ?value () = { key; value } - - let parse xml = - Some - { key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Some ("key", String.to_json v.key) - ]) - - let of_json j = - { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module PolicyAttributeDescription = struct - type t = - { attribute_name : String.t option - ; attribute_value : String.t option - } - - let make ?attribute_name ?attribute_value () = { attribute_name; attribute_value } - - let parse xml = - Some - { attribute_name = Util.option_bind (Xml.member "AttributeName" xml) String.parse - ; attribute_value = Util.option_bind (Xml.member "AttributeValue" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - Query.Pair ("AttributeValue", String.to_query f)) - ; Util.option_map v.attribute_name (fun f -> - Query.Pair ("AttributeName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - "attribute_value", String.to_json f) - ; Util.option_map v.attribute_name (fun f -> "attribute_name", String.to_json f) - ]) - - let of_json j = - { attribute_name = Util.option_map (Json.lookup j "attribute_name") String.of_json - ; attribute_value = Util.option_map (Json.lookup j "attribute_value") String.of_json - } -end - -module PolicyAttributeTypeDescription = struct - type t = - { attribute_name : String.t option - ; attribute_type : String.t option - ; description : String.t option - ; default_value : String.t option - ; cardinality : String.t option - } - - let make ?attribute_name ?attribute_type ?description ?default_value ?cardinality () = - { attribute_name; attribute_type; description; default_value; cardinality } - - let parse xml = - Some - { attribute_name = Util.option_bind (Xml.member "AttributeName" xml) String.parse - ; attribute_type = Util.option_bind (Xml.member "AttributeType" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; default_value = Util.option_bind (Xml.member "DefaultValue" xml) String.parse - ; cardinality = Util.option_bind (Xml.member "Cardinality" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cardinality (fun f -> - Query.Pair ("Cardinality", String.to_query f)) - ; Util.option_map v.default_value (fun f -> - Query.Pair ("DefaultValue", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.attribute_type (fun f -> - Query.Pair ("AttributeType", String.to_query f)) - ; Util.option_map v.attribute_name (fun f -> - Query.Pair ("AttributeName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cardinality (fun f -> "cardinality", String.to_json f) - ; Util.option_map v.default_value (fun f -> "default_value", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.attribute_type (fun f -> "attribute_type", String.to_json f) - ; Util.option_map v.attribute_name (fun f -> "attribute_name", String.to_json f) - ]) - - let of_json j = - { attribute_name = Util.option_map (Json.lookup j "attribute_name") String.of_json - ; attribute_type = Util.option_map (Json.lookup j "attribute_type") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; default_value = Util.option_map (Json.lookup j "default_value") String.of_json - ; cardinality = Util.option_map (Json.lookup j "cardinality") String.of_json - } -end - -module BackendServerDescription = struct - type t = - { instance_port : Integer.t option - ; policy_names : PolicyNames.t - } - - let make ?instance_port ?(policy_names = []) () = { instance_port; policy_names } - - let parse xml = - Some - { instance_port = Util.option_bind (Xml.member "InstancePort" xml) Integer.parse - ; policy_names = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Util.option_map v.instance_port (fun f -> - Query.Pair ("InstancePort", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Util.option_map v.instance_port (fun f -> "instance_port", Integer.to_json f) - ]) - - let of_json j = - { instance_port = Util.option_map (Json.lookup j "instance_port") Integer.of_json - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - } -end - -module Instance = struct - type t = { instance_id : String.t option } - - let make ?instance_id () = { instance_id } - - let parse xml = - Some { instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json } -end - -module ListenerDescription = struct - type t = - { listener : Listener.t option - ; policy_names : PolicyNames.t - } - - let make ?listener ?(policy_names = []) () = { listener; policy_names } - - let parse xml = - Some - { listener = Util.option_bind (Xml.member "Listener" xml) Listener.parse - ; policy_names = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Util.option_map v.listener (fun f -> - Query.Pair ("Listener", Listener.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Util.option_map v.listener (fun f -> "listener", Listener.to_json f) - ]) - - let of_json j = - { listener = Util.option_map (Json.lookup j "listener") Listener.of_json - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - } -end - -module AppCookieStickinessPolicies = struct - type t = AppCookieStickinessPolicy.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AppCookieStickinessPolicy.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AppCookieStickinessPolicy.to_query v - - let to_json v = `List (List.map AppCookieStickinessPolicy.to_json v) - - let of_json j = Json.to_list AppCookieStickinessPolicy.of_json j -end - -module LBCookieStickinessPolicies = struct - type t = LBCookieStickinessPolicy.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LBCookieStickinessPolicy.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LBCookieStickinessPolicy.to_query v - - let to_json v = `List (List.map LBCookieStickinessPolicy.to_json v) - - let of_json j = Json.to_list LBCookieStickinessPolicy.of_json j -end - -module TagList = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module AdditionalAttribute = struct - type t = - { key : String.t option - ; value : String.t option - } - - let make ?key ?value () = { key; value } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module PolicyAttributeDescriptions = struct - type t = PolicyAttributeDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map PolicyAttributeDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list PolicyAttributeDescription.to_query v - - let to_json v = `List (List.map PolicyAttributeDescription.to_json v) - - let of_json j = Json.to_list PolicyAttributeDescription.of_json j -end - -module PolicyAttributeTypeDescriptions = struct - type t = PolicyAttributeTypeDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map PolicyAttributeTypeDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list PolicyAttributeTypeDescription.to_query v - - let to_json v = `List (List.map PolicyAttributeTypeDescription.to_json v) - - let of_json j = Json.to_list PolicyAttributeTypeDescription.of_json j -end - -module AvailabilityZones = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module BackendServerDescriptions = struct - type t = BackendServerDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map BackendServerDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list BackendServerDescription.to_query v - - let to_json v = `List (List.map BackendServerDescription.to_json v) - - let of_json j = Json.to_list BackendServerDescription.of_json j -end - -module HealthCheck = struct - type t = - { target : String.t - ; interval : Integer.t - ; timeout : Integer.t - ; unhealthy_threshold : Integer.t - ; healthy_threshold : Integer.t - } - - let make ~target ~interval ~timeout ~unhealthy_threshold ~healthy_threshold () = - { target; interval; timeout; unhealthy_threshold; healthy_threshold } - - let parse xml = - Some - { target = - Xml.required "Target" (Util.option_bind (Xml.member "Target" xml) String.parse) - ; interval = - Xml.required - "Interval" - (Util.option_bind (Xml.member "Interval" xml) Integer.parse) - ; timeout = - Xml.required - "Timeout" +module PolicyNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Listener = + struct + type t = + { + protocol: String.t ; + load_balancer_port: Integer.t ; + instance_protocol: String.t option ; + instance_port: Integer.t ; + s_s_l_certificate_id: String.t option } + let make ~protocol ~load_balancer_port ?instance_protocol + ~instance_port ?s_s_l_certificate_id () = + { + protocol; + load_balancer_port; + instance_protocol; + instance_port; + s_s_l_certificate_id + } + let parse xml = + Some + { + protocol = + (Xml.required "Protocol" + (Util.option_bind (Xml.member "Protocol" xml) String.parse)); + load_balancer_port = + (Xml.required "LoadBalancerPort" + (Util.option_bind (Xml.member "LoadBalancerPort" xml) + Integer.parse)); + instance_protocol = + (Util.option_bind (Xml.member "InstanceProtocol" xml) + String.parse); + instance_port = + (Xml.required "InstancePort" + (Util.option_bind (Xml.member "InstancePort" xml) + Integer.parse)); + s_s_l_certificate_id = + (Util.option_bind (Xml.member "SSLCertificateId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s_s_l_certificate_id + (fun f -> Query.Pair ("SSLCertificateId", (String.to_query f))); + Some + (Query.Pair ("InstancePort", (Integer.to_query v.instance_port))); + Util.option_map v.instance_protocol + (fun f -> Query.Pair ("InstanceProtocol", (String.to_query f))); + Some + (Query.Pair + ("LoadBalancerPort", (Integer.to_query v.load_balancer_port))); + Some (Query.Pair ("Protocol", (String.to_query v.protocol)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s_s_l_certificate_id + (fun f -> ("s_s_l_certificate_id", (String.to_json f))); + Some ("instance_port", (Integer.to_json v.instance_port)); + Util.option_map v.instance_protocol + (fun f -> ("instance_protocol", (String.to_json f))); + Some + ("load_balancer_port", (Integer.to_json v.load_balancer_port)); + Some ("protocol", (String.to_json v.protocol))]) + let of_json j = + { + protocol = + (String.of_json (Util.of_option_exn (Json.lookup j "protocol"))); + load_balancer_port = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_port"))); + instance_protocol = + (Util.option_map (Json.lookup j "instance_protocol") String.of_json); + instance_port = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_port"))); + s_s_l_certificate_id = + (Util.option_map (Json.lookup j "s_s_l_certificate_id") + String.of_json) + } + end +module AppCookieStickinessPolicy = + struct + type t = { + policy_name: String.t option ; + cookie_name: String.t option } + let make ?policy_name ?cookie_name () = { policy_name; cookie_name } + let parse xml = + Some + { + policy_name = + (Util.option_bind (Xml.member "PolicyName" xml) String.parse); + cookie_name = + (Util.option_bind (Xml.member "CookieName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cookie_name + (fun f -> Query.Pair ("CookieName", (String.to_query f))); + Util.option_map v.policy_name + (fun f -> Query.Pair ("PolicyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cookie_name + (fun f -> ("cookie_name", (String.to_json f))); + Util.option_map v.policy_name + (fun f -> ("policy_name", (String.to_json f)))]) + let of_json j = + { + policy_name = + (Util.option_map (Json.lookup j "policy_name") String.of_json); + cookie_name = + (Util.option_map (Json.lookup j "cookie_name") String.of_json) + } + end +module LBCookieStickinessPolicy = + struct + type t = + { + policy_name: String.t option ; + cookie_expiration_period: Long.t option } + let make ?policy_name ?cookie_expiration_period () = + { policy_name; cookie_expiration_period } + let parse xml = + Some + { + policy_name = + (Util.option_bind (Xml.member "PolicyName" xml) String.parse); + cookie_expiration_period = + (Util.option_bind (Xml.member "CookieExpirationPeriod" xml) + Long.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cookie_expiration_period + (fun f -> + Query.Pair ("CookieExpirationPeriod", (Long.to_query f))); + Util.option_map v.policy_name + (fun f -> Query.Pair ("PolicyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cookie_expiration_period + (fun f -> ("cookie_expiration_period", (Long.to_json f))); + Util.option_map v.policy_name + (fun f -> ("policy_name", (String.to_json f)))]) + let of_json j = + { + policy_name = + (Util.option_map (Json.lookup j "policy_name") String.of_json); + cookie_expiration_period = + (Util.option_map (Json.lookup j "cookie_expiration_period") + Long.of_json) + } + end +module Tag = + struct + type t = { + key: String.t ; + value: String.t option } + let make ~key ?value () = { key; value } + let parse xml = + Some + { + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Some ("key", (String.to_json v.key))]) + let of_json j = + { + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module PolicyAttributeDescription = + struct + type t = + { + attribute_name: String.t option ; + attribute_value: String.t option } + let make ?attribute_name ?attribute_value () = + { attribute_name; attribute_value } + let parse xml = + Some + { + attribute_name = + (Util.option_bind (Xml.member "AttributeName" xml) String.parse); + attribute_value = + (Util.option_bind (Xml.member "AttributeValue" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> Query.Pair ("AttributeValue", (String.to_query f))); + Util.option_map v.attribute_name + (fun f -> Query.Pair ("AttributeName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> ("attribute_value", (String.to_json f))); + Util.option_map v.attribute_name + (fun f -> ("attribute_name", (String.to_json f)))]) + let of_json j = + { + attribute_name = + (Util.option_map (Json.lookup j "attribute_name") String.of_json); + attribute_value = + (Util.option_map (Json.lookup j "attribute_value") String.of_json) + } + end +module PolicyAttributeTypeDescription = + struct + type t = + { + attribute_name: String.t option ; + attribute_type: String.t option ; + description: String.t option ; + default_value: String.t option ; + cardinality: String.t option } + let make ?attribute_name ?attribute_type ?description ?default_value + ?cardinality () = + { + attribute_name; + attribute_type; + description; + default_value; + cardinality + } + let parse xml = + Some + { + attribute_name = + (Util.option_bind (Xml.member "AttributeName" xml) String.parse); + attribute_type = + (Util.option_bind (Xml.member "AttributeType" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + default_value = + (Util.option_bind (Xml.member "DefaultValue" xml) String.parse); + cardinality = + (Util.option_bind (Xml.member "Cardinality" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cardinality + (fun f -> Query.Pair ("Cardinality", (String.to_query f))); + Util.option_map v.default_value + (fun f -> Query.Pair ("DefaultValue", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.attribute_type + (fun f -> Query.Pair ("AttributeType", (String.to_query f))); + Util.option_map v.attribute_name + (fun f -> Query.Pair ("AttributeName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cardinality + (fun f -> ("cardinality", (String.to_json f))); + Util.option_map v.default_value + (fun f -> ("default_value", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.attribute_type + (fun f -> ("attribute_type", (String.to_json f))); + Util.option_map v.attribute_name + (fun f -> ("attribute_name", (String.to_json f)))]) + let of_json j = + { + attribute_name = + (Util.option_map (Json.lookup j "attribute_name") String.of_json); + attribute_type = + (Util.option_map (Json.lookup j "attribute_type") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + default_value = + (Util.option_map (Json.lookup j "default_value") String.of_json); + cardinality = + (Util.option_map (Json.lookup j "cardinality") String.of_json) + } + end +module BackendServerDescription = + struct + type t = { + instance_port: Integer.t option ; + policy_names: PolicyNames.t } + let make ?instance_port ?(policy_names= []) () = + { instance_port; policy_names } + let parse xml = + Some + { + instance_port = + (Util.option_bind (Xml.member "InstancePort" xml) Integer.parse); + policy_names = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyNames.member", + (PolicyNames.to_query v.policy_names))); + Util.option_map v.instance_port + (fun f -> Query.Pair ("InstancePort", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Util.option_map v.instance_port + (fun f -> ("instance_port", (Integer.to_json f)))]) + let of_json j = + { + instance_port = + (Util.option_map (Json.lookup j "instance_port") Integer.of_json); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))) + } + end +module Instance = + struct + type t = { + instance_id: String.t option } + let make ?instance_id () = { instance_id } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json) + } + end +module ListenerDescription = + struct + type t = { + listener: Listener.t option ; + policy_names: PolicyNames.t } + let make ?listener ?(policy_names= []) () = { listener; policy_names } + let parse xml = + Some + { + listener = + (Util.option_bind (Xml.member "Listener" xml) Listener.parse); + policy_names = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyNames.member", + (PolicyNames.to_query v.policy_names))); + Util.option_map v.listener + (fun f -> Query.Pair ("Listener", (Listener.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Util.option_map v.listener + (fun f -> ("listener", (Listener.to_json f)))]) + let of_json j = + { + listener = + (Util.option_map (Json.lookup j "listener") Listener.of_json); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))) + } + end +module AppCookieStickinessPolicies = + struct + type t = AppCookieStickinessPolicy.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AppCookieStickinessPolicy.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list AppCookieStickinessPolicy.to_query v + let to_json v = `List (List.map AppCookieStickinessPolicy.to_json v) + let of_json j = Json.to_list AppCookieStickinessPolicy.of_json j + end +module LBCookieStickinessPolicies = + struct + type t = LBCookieStickinessPolicy.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LBCookieStickinessPolicy.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LBCookieStickinessPolicy.to_query v + let to_json v = `List (List.map LBCookieStickinessPolicy.to_json v) + let of_json j = Json.to_list LBCookieStickinessPolicy.of_json j + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module AdditionalAttribute = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module PolicyAttributeDescriptions = + struct + type t = PolicyAttributeDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PolicyAttributeDescription.parse (Xml.members "member" xml)) + let to_query v = + Query.to_query_list PolicyAttributeDescription.to_query v + let to_json v = `List (List.map PolicyAttributeDescription.to_json v) + let of_json j = Json.to_list PolicyAttributeDescription.of_json j + end +module PolicyAttributeTypeDescriptions = + struct + type t = PolicyAttributeTypeDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PolicyAttributeTypeDescription.parse + (Xml.members "member" xml)) + let to_query v = + Query.to_query_list PolicyAttributeTypeDescription.to_query v + let to_json v = `List (List.map PolicyAttributeTypeDescription.to_json v) + let of_json j = Json.to_list PolicyAttributeTypeDescription.of_json j + end +module AvailabilityZones = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module BackendServerDescriptions = + struct + type t = BackendServerDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BackendServerDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list BackendServerDescription.to_query v + let to_json v = `List (List.map BackendServerDescription.to_json v) + let of_json j = Json.to_list BackendServerDescription.of_json j + end +module HealthCheck = + struct + type t = + { + target: String.t ; + interval: Integer.t ; + timeout: Integer.t ; + unhealthy_threshold: Integer.t ; + healthy_threshold: Integer.t } + let make ~target ~interval ~timeout ~unhealthy_threshold + ~healthy_threshold () = + { target; interval; timeout; unhealthy_threshold; healthy_threshold } + let parse xml = + Some + { + target = + (Xml.required "Target" + (Util.option_bind (Xml.member "Target" xml) String.parse)); + interval = + (Xml.required "Interval" + (Util.option_bind (Xml.member "Interval" xml) Integer.parse)); + timeout = + (Xml.required "Timeout" + (Util.option_bind (Xml.member "Timeout" xml) Integer.parse)); + unhealthy_threshold = + (Xml.required "UnhealthyThreshold" + (Util.option_bind (Xml.member "UnhealthyThreshold" xml) + Integer.parse)); + healthy_threshold = + (Xml.required "HealthyThreshold" + (Util.option_bind (Xml.member "HealthyThreshold" xml) + Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthyThreshold", (Integer.to_query v.healthy_threshold))); + Some + (Query.Pair + ("UnhealthyThreshold", + (Integer.to_query v.unhealthy_threshold))); + Some (Query.Pair ("Timeout", (Integer.to_query v.timeout))); + Some (Query.Pair ("Interval", (Integer.to_query v.interval))); + Some (Query.Pair ("Target", (String.to_query v.target)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("healthy_threshold", (Integer.to_json v.healthy_threshold)); + Some + ("unhealthy_threshold", (Integer.to_json v.unhealthy_threshold)); + Some ("timeout", (Integer.to_json v.timeout)); + Some ("interval", (Integer.to_json v.interval)); + Some ("target", (String.to_json v.target))]) + let of_json j = + { + target = + (String.of_json (Util.of_option_exn (Json.lookup j "target"))); + interval = + (Integer.of_json (Util.of_option_exn (Json.lookup j "interval"))); + timeout = + (Integer.of_json (Util.of_option_exn (Json.lookup j "timeout"))); + unhealthy_threshold = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "unhealthy_threshold"))); + healthy_threshold = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "healthy_threshold"))) + } + end +module Instances = + struct + type t = Instance.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Instance.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Instance.to_query v + let to_json v = `List (List.map Instance.to_json v) + let of_json j = Json.to_list Instance.of_json j + end +module ListenerDescriptions = + struct + type t = ListenerDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ListenerDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ListenerDescription.to_query v + let to_json v = `List (List.map ListenerDescription.to_json v) + let of_json j = Json.to_list ListenerDescription.of_json j + end +module Policies = + struct + type t = + { + app_cookie_stickiness_policies: AppCookieStickinessPolicies.t ; + l_b_cookie_stickiness_policies: LBCookieStickinessPolicies.t ; + other_policies: PolicyNames.t } + let make ?(app_cookie_stickiness_policies= []) + ?(l_b_cookie_stickiness_policies= []) ?(other_policies= []) () = + { + app_cookie_stickiness_policies; + l_b_cookie_stickiness_policies; + other_policies + } + let parse xml = + Some + { + app_cookie_stickiness_policies = + (Util.of_option [] + (Util.option_bind + (Xml.member "AppCookieStickinessPolicies" xml) + AppCookieStickinessPolicies.parse)); + l_b_cookie_stickiness_policies = + (Util.of_option [] + (Util.option_bind + (Xml.member "LBCookieStickinessPolicies" xml) + LBCookieStickinessPolicies.parse)); + other_policies = + (Util.of_option [] + (Util.option_bind (Xml.member "OtherPolicies" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("OtherPolicies.member", + (PolicyNames.to_query v.other_policies))); + Some + (Query.Pair + ("LBCookieStickinessPolicies.member", + (LBCookieStickinessPolicies.to_query + v.l_b_cookie_stickiness_policies))); + Some + (Query.Pair + ("AppCookieStickinessPolicies.member", + (AppCookieStickinessPolicies.to_query + v.app_cookie_stickiness_policies)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("other_policies", (PolicyNames.to_json v.other_policies)); + Some + ("l_b_cookie_stickiness_policies", + (LBCookieStickinessPolicies.to_json + v.l_b_cookie_stickiness_policies)); + Some + ("app_cookie_stickiness_policies", + (AppCookieStickinessPolicies.to_json + v.app_cookie_stickiness_policies))]) + let of_json j = + { + app_cookie_stickiness_policies = + (AppCookieStickinessPolicies.of_json + (Util.of_option_exn + (Json.lookup j "app_cookie_stickiness_policies"))); + l_b_cookie_stickiness_policies = + (LBCookieStickinessPolicies.of_json + (Util.of_option_exn + (Json.lookup j "l_b_cookie_stickiness_policies"))); + other_policies = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "other_policies"))) + } + end +module SecurityGroups = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SourceSecurityGroup = + struct + type t = { + owner_alias: String.t option ; + group_name: String.t option } + let make ?owner_alias ?group_name () = { owner_alias; group_name } + let parse xml = + Some + { + owner_alias = + (Util.option_bind (Xml.member "OwnerAlias" xml) String.parse); + group_name = + (Util.option_bind (Xml.member "GroupName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.group_name + (fun f -> Query.Pair ("GroupName", (String.to_query f))); + Util.option_map v.owner_alias + (fun f -> Query.Pair ("OwnerAlias", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.group_name + (fun f -> ("group_name", (String.to_json f))); + Util.option_map v.owner_alias + (fun f -> ("owner_alias", (String.to_json f)))]) + let of_json j = + { + owner_alias = + (Util.option_map (Json.lookup j "owner_alias") String.of_json); + group_name = + (Util.option_map (Json.lookup j "group_name") String.of_json) + } + end +module Subnets = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module TagDescription = + struct + type t = { + load_balancer_name: String.t option ; + tags: TagList.t } + let make ?load_balancer_name ?(tags= []) () = + { load_balancer_name; tags } + let parse xml = + Some + { + load_balancer_name = + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.load_balancer_name + (fun f -> Query.Pair ("LoadBalancerName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.load_balancer_name + (fun f -> ("load_balancer_name", (String.to_json f)))]) + let of_json j = + { + load_balancer_name = + (Util.option_map (Json.lookup j "load_balancer_name") + String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module AccessLog = + struct + type t = + { + enabled: Boolean.t ; + s3_bucket_name: String.t option ; + emit_interval: Integer.t option ; + s3_bucket_prefix: String.t option } + let make ~enabled ?s3_bucket_name ?emit_interval ?s3_bucket_prefix () + = { enabled; s3_bucket_name; emit_interval; s3_bucket_prefix } + let parse xml = + Some + { + enabled = + (Xml.required "Enabled" + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse)); + s3_bucket_name = + (Util.option_bind (Xml.member "S3BucketName" xml) String.parse); + emit_interval = + (Util.option_bind (Xml.member "EmitInterval" xml) Integer.parse); + s3_bucket_prefix = + (Util.option_bind (Xml.member "S3BucketPrefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.s3_bucket_prefix + (fun f -> Query.Pair ("S3BucketPrefix", (String.to_query f))); + Util.option_map v.emit_interval + (fun f -> Query.Pair ("EmitInterval", (Integer.to_query f))); + Util.option_map v.s3_bucket_name + (fun f -> Query.Pair ("S3BucketName", (String.to_query f))); + Some (Query.Pair ("Enabled", (Boolean.to_query v.enabled)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.s3_bucket_prefix + (fun f -> ("s3_bucket_prefix", (String.to_json f))); + Util.option_map v.emit_interval + (fun f -> ("emit_interval", (Integer.to_json f))); + Util.option_map v.s3_bucket_name + (fun f -> ("s3_bucket_name", (String.to_json f))); + Some ("enabled", (Boolean.to_json v.enabled))]) + let of_json j = + { + enabled = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled"))); + s3_bucket_name = + (Util.option_map (Json.lookup j "s3_bucket_name") String.of_json); + emit_interval = + (Util.option_map (Json.lookup j "emit_interval") Integer.of_json); + s3_bucket_prefix = + (Util.option_map (Json.lookup j "s3_bucket_prefix") String.of_json) + } + end +module AdditionalAttributes = + struct + type t = AdditionalAttribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AdditionalAttribute.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list AdditionalAttribute.to_query v + let to_json v = `List (List.map AdditionalAttribute.to_json v) + let of_json j = Json.to_list AdditionalAttribute.of_json j + end +module ConnectionDraining = + struct + type t = { + enabled: Boolean.t ; + timeout: Integer.t option } + let make ~enabled ?timeout () = { enabled; timeout } + let parse xml = + Some + { + enabled = + (Xml.required "Enabled" + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse)); + timeout = (Util.option_bind (Xml.member "Timeout" xml) Integer.parse) - ; unhealthy_threshold = - Xml.required - "UnhealthyThreshold" - (Util.option_bind (Xml.member "UnhealthyThreshold" xml) Integer.parse) - ; healthy_threshold = - Xml.required - "HealthyThreshold" - (Util.option_bind (Xml.member "HealthyThreshold" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthyThreshold", Integer.to_query v.healthy_threshold)) - ; Some - (Query.Pair ("UnhealthyThreshold", Integer.to_query v.unhealthy_threshold)) - ; Some (Query.Pair ("Timeout", Integer.to_query v.timeout)) - ; Some (Query.Pair ("Interval", Integer.to_query v.interval)) - ; Some (Query.Pair ("Target", String.to_query v.target)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("healthy_threshold", Integer.to_json v.healthy_threshold) - ; Some ("unhealthy_threshold", Integer.to_json v.unhealthy_threshold) - ; Some ("timeout", Integer.to_json v.timeout) - ; Some ("interval", Integer.to_json v.interval) - ; Some ("target", String.to_json v.target) - ]) - - let of_json j = - { target = String.of_json (Util.of_option_exn (Json.lookup j "target")) - ; interval = Integer.of_json (Util.of_option_exn (Json.lookup j "interval")) - ; timeout = Integer.of_json (Util.of_option_exn (Json.lookup j "timeout")) - ; unhealthy_threshold = - Integer.of_json (Util.of_option_exn (Json.lookup j "unhealthy_threshold")) - ; healthy_threshold = - Integer.of_json (Util.of_option_exn (Json.lookup j "healthy_threshold")) - } -end - -module Instances = struct - type t = Instance.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Instance.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Instance.to_query v - - let to_json v = `List (List.map Instance.to_json v) - - let of_json j = Json.to_list Instance.of_json j -end - -module ListenerDescriptions = struct - type t = ListenerDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ListenerDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ListenerDescription.to_query v - - let to_json v = `List (List.map ListenerDescription.to_json v) - - let of_json j = Json.to_list ListenerDescription.of_json j -end - -module Policies = struct - type t = - { app_cookie_stickiness_policies : AppCookieStickinessPolicies.t - ; l_b_cookie_stickiness_policies : LBCookieStickinessPolicies.t - ; other_policies : PolicyNames.t - } - - let make - ?(app_cookie_stickiness_policies = []) - ?(l_b_cookie_stickiness_policies = []) - ?(other_policies = []) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timeout + (fun f -> Query.Pair ("Timeout", (Integer.to_query f))); + Some (Query.Pair ("Enabled", (Boolean.to_query v.enabled)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timeout + (fun f -> ("timeout", (Integer.to_json f))); + Some ("enabled", (Boolean.to_json v.enabled))]) + let of_json j = + { + enabled = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled"))); + timeout = (Util.option_map (Json.lookup j "timeout") Integer.of_json) + } + end +module ConnectionSettings = + struct + type t = { + idle_timeout: Integer.t } + let make ~idle_timeout () = { idle_timeout } + let parse xml = + Some + { + idle_timeout = + (Xml.required "IdleTimeout" + (Util.option_bind (Xml.member "IdleTimeout" xml) Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("IdleTimeout", (Integer.to_query v.idle_timeout)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("idle_timeout", (Integer.to_json v.idle_timeout))]) + let of_json j = + { + idle_timeout = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "idle_timeout"))) + } + end +module CrossZoneLoadBalancing = + struct + type t = { + enabled: Boolean.t } + let make ~enabled () = { enabled } + let parse xml = + Some + { + enabled = + (Xml.required "Enabled" + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Enabled", (Boolean.to_query v.enabled)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("enabled", (Boolean.to_json v.enabled))]) + let of_json j = + { + enabled = + (Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled"))) + } + end +module PolicyAttribute = + struct + type t = + { + attribute_name: String.t option ; + attribute_value: String.t option } + let make ?attribute_name ?attribute_value () = + { attribute_name; attribute_value } + let parse xml = + Some + { + attribute_name = + (Util.option_bind (Xml.member "AttributeName" xml) String.parse); + attribute_value = + (Util.option_bind (Xml.member "AttributeValue" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> Query.Pair ("AttributeValue", (String.to_query f))); + Util.option_map v.attribute_name + (fun f -> Query.Pair ("AttributeName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attribute_value + (fun f -> ("attribute_value", (String.to_json f))); + Util.option_map v.attribute_name + (fun f -> ("attribute_name", (String.to_json f)))]) + let of_json j = + { + attribute_name = + (Util.option_map (Json.lookup j "attribute_name") String.of_json); + attribute_value = + (Util.option_map (Json.lookup j "attribute_value") String.of_json) + } + end +module TagKeyOnly = + struct + type t = { + key: String.t option } + let make ?key () = { key } + let parse xml = + Some { key = (Util.option_bind (Xml.member "Key" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { key = (Util.option_map (Json.lookup j "key") String.of_json) } + end +module PolicyDescription = + struct + type t = + { + policy_name: String.t option ; + policy_type_name: String.t option ; + policy_attribute_descriptions: PolicyAttributeDescriptions.t } + let make ?policy_name ?policy_type_name + ?(policy_attribute_descriptions= []) () = + { policy_name; policy_type_name; policy_attribute_descriptions } + let parse xml = + Some + { + policy_name = + (Util.option_bind (Xml.member "PolicyName" xml) String.parse); + policy_type_name = + (Util.option_bind (Xml.member "PolicyTypeName" xml) String.parse); + policy_attribute_descriptions = + (Util.of_option [] + (Util.option_bind + (Xml.member "PolicyAttributeDescriptions" xml) + PolicyAttributeDescriptions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyAttributeDescriptions.member", + (PolicyAttributeDescriptions.to_query + v.policy_attribute_descriptions))); + Util.option_map v.policy_type_name + (fun f -> Query.Pair ("PolicyTypeName", (String.to_query f))); + Util.option_map v.policy_name + (fun f -> Query.Pair ("PolicyName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_attribute_descriptions", + (PolicyAttributeDescriptions.to_json + v.policy_attribute_descriptions)); + Util.option_map v.policy_type_name + (fun f -> ("policy_type_name", (String.to_json f))); + Util.option_map v.policy_name + (fun f -> ("policy_name", (String.to_json f)))]) + let of_json j = + { + policy_name = + (Util.option_map (Json.lookup j "policy_name") String.of_json); + policy_type_name = + (Util.option_map (Json.lookup j "policy_type_name") String.of_json); + policy_attribute_descriptions = + (PolicyAttributeDescriptions.of_json + (Util.of_option_exn + (Json.lookup j "policy_attribute_descriptions"))) + } + end +module InstanceState = + struct + type t = + { + instance_id: String.t option ; + state: String.t option ; + reason_code: String.t option ; + description: String.t option } + let make ?instance_id ?state ?reason_code ?description () = + { instance_id; state; reason_code; description } + let parse xml = + Some + { + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + state = (Util.option_bind (Xml.member "State" xml) String.parse); + reason_code = + (Util.option_bind (Xml.member "ReasonCode" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.reason_code + (fun f -> Query.Pair ("ReasonCode", (String.to_query f))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (String.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.reason_code + (fun f -> ("reason_code", (String.to_json f))); + Util.option_map v.state (fun f -> ("state", (String.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f)))]) + let of_json j = + { + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + state = (Util.option_map (Json.lookup j "state") String.of_json); + reason_code = + (Util.option_map (Json.lookup j "reason_code") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module PolicyTypeDescription = + struct + type t = + { + policy_type_name: String.t option ; + description: String.t option ; + policy_attribute_type_descriptions: PolicyAttributeTypeDescriptions.t } + let make ?policy_type_name ?description + ?(policy_attribute_type_descriptions= []) () = + { policy_type_name; description; policy_attribute_type_descriptions } + let parse xml = + Some + { + policy_type_name = + (Util.option_bind (Xml.member "PolicyTypeName" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + policy_attribute_type_descriptions = + (Util.of_option [] + (Util.option_bind + (Xml.member "PolicyAttributeTypeDescriptions" xml) + PolicyAttributeTypeDescriptions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyAttributeTypeDescriptions.member", + (PolicyAttributeTypeDescriptions.to_query + v.policy_attribute_type_descriptions))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.policy_type_name + (fun f -> Query.Pair ("PolicyTypeName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_attribute_type_descriptions", + (PolicyAttributeTypeDescriptions.to_json + v.policy_attribute_type_descriptions)); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.policy_type_name + (fun f -> ("policy_type_name", (String.to_json f)))]) + let of_json j = + { + policy_type_name = + (Util.option_map (Json.lookup j "policy_type_name") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + policy_attribute_type_descriptions = + (PolicyAttributeTypeDescriptions.of_json + (Util.of_option_exn + (Json.lookup j "policy_attribute_type_descriptions"))) + } + end +module LoadBalancerDescription = + struct + type t = + { + load_balancer_name: String.t option ; + d_n_s_name: String.t option ; + canonical_hosted_zone_name: String.t option ; + canonical_hosted_zone_name_i_d: String.t option ; + listener_descriptions: ListenerDescriptions.t ; + policies: Policies.t option ; + backend_server_descriptions: BackendServerDescriptions.t ; + availability_zones: AvailabilityZones.t ; + subnets: Subnets.t ; + v_p_c_id: String.t option ; + instances: Instances.t ; + health_check: HealthCheck.t option ; + source_security_group: SourceSecurityGroup.t option ; + security_groups: SecurityGroups.t ; + created_time: DateTime.t option ; + scheme: String.t option } + let make ?load_balancer_name ?d_n_s_name ?canonical_hosted_zone_name + ?canonical_hosted_zone_name_i_d ?(listener_descriptions= []) + ?policies ?(backend_server_descriptions= []) ?(availability_zones= + []) ?(subnets= []) ?v_p_c_id ?(instances= []) ?health_check + ?source_security_group ?(security_groups= []) ?created_time ?scheme () = - { app_cookie_stickiness_policies; l_b_cookie_stickiness_policies; other_policies } - - let parse xml = - Some - { app_cookie_stickiness_policies = - Util.of_option - [] - (Util.option_bind - (Xml.member "AppCookieStickinessPolicies" xml) - AppCookieStickinessPolicies.parse) - ; l_b_cookie_stickiness_policies = - Util.of_option - [] - (Util.option_bind - (Xml.member "LBCookieStickinessPolicies" xml) - LBCookieStickinessPolicies.parse) - ; other_policies = - Util.of_option - [] - (Util.option_bind (Xml.member "OtherPolicies" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("OtherPolicies.member", PolicyNames.to_query v.other_policies)) - ; Some + { + load_balancer_name; + d_n_s_name; + canonical_hosted_zone_name; + canonical_hosted_zone_name_i_d; + listener_descriptions; + policies; + backend_server_descriptions; + availability_zones; + subnets; + v_p_c_id; + instances; + health_check; + source_security_group; + security_groups; + created_time; + scheme + } + let parse xml = + Some + { + load_balancer_name = + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse); + d_n_s_name = + (Util.option_bind (Xml.member "DNSName" xml) String.parse); + canonical_hosted_zone_name = + (Util.option_bind (Xml.member "CanonicalHostedZoneName" xml) + String.parse); + canonical_hosted_zone_name_i_d = + (Util.option_bind (Xml.member "CanonicalHostedZoneNameID" xml) + String.parse); + listener_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "ListenerDescriptions" xml) + ListenerDescriptions.parse)); + policies = + (Util.option_bind (Xml.member "Policies" xml) Policies.parse); + backend_server_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "BackendServerDescriptions" xml) + BackendServerDescriptions.parse)); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)); + v_p_c_id = (Util.option_bind (Xml.member "VPCId" xml) String.parse); + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)); + health_check = + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse); + source_security_group = + (Util.option_bind (Xml.member "SourceSecurityGroup" xml) + SourceSecurityGroup.parse); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)); + created_time = + (Util.option_bind (Xml.member "CreatedTime" xml) DateTime.parse); + scheme = (Util.option_bind (Xml.member "Scheme" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.scheme + (fun f -> Query.Pair ("Scheme", (String.to_query f))); + Util.option_map v.created_time + (fun f -> Query.Pair ("CreatedTime", (DateTime.to_query f))); + Some (Query.Pair - ( "LBCookieStickinessPolicies.member" - , LBCookieStickinessPolicies.to_query v.l_b_cookie_stickiness_policies )) - ; Some + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups))); + Util.option_map v.source_security_group + (fun f -> + Query.Pair + ("SourceSecurityGroup", (SourceSecurityGroup.to_query f))); + Util.option_map v.health_check + (fun f -> Query.Pair ("HealthCheck", (HealthCheck.to_query f))); + Some (Query.Pair - ( "AppCookieStickinessPolicies.member" - , AppCookieStickinessPolicies.to_query v.app_cookie_stickiness_policies )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("other_policies", PolicyNames.to_json v.other_policies) - ; Some - ( "l_b_cookie_stickiness_policies" - , LBCookieStickinessPolicies.to_json v.l_b_cookie_stickiness_policies ) - ; Some - ( "app_cookie_stickiness_policies" - , AppCookieStickinessPolicies.to_json v.app_cookie_stickiness_policies ) - ]) - - let of_json j = - { app_cookie_stickiness_policies = - AppCookieStickinessPolicies.of_json - (Util.of_option_exn (Json.lookup j "app_cookie_stickiness_policies")) - ; l_b_cookie_stickiness_policies = - LBCookieStickinessPolicies.of_json - (Util.of_option_exn (Json.lookup j "l_b_cookie_stickiness_policies")) - ; other_policies = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "other_policies")) - } -end - -module SecurityGroups = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SourceSecurityGroup = struct - type t = - { owner_alias : String.t option - ; group_name : String.t option - } - - let make ?owner_alias ?group_name () = { owner_alias; group_name } - - let parse xml = - Some - { owner_alias = Util.option_bind (Xml.member "OwnerAlias" xml) String.parse - ; group_name = Util.option_bind (Xml.member "GroupName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.group_name (fun f -> - Query.Pair ("GroupName", String.to_query f)) - ; Util.option_map v.owner_alias (fun f -> - Query.Pair ("OwnerAlias", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.group_name (fun f -> "group_name", String.to_json f) - ; Util.option_map v.owner_alias (fun f -> "owner_alias", String.to_json f) - ]) - - let of_json j = - { owner_alias = Util.option_map (Json.lookup j "owner_alias") String.of_json - ; group_name = Util.option_map (Json.lookup j "group_name") String.of_json - } -end - -module Subnets = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module TagDescription = struct - type t = - { load_balancer_name : String.t option - ; tags : TagList.t - } - - let make ?load_balancer_name ?(tags = []) () = { load_balancer_name; tags } - - let parse xml = - Some - { load_balancer_name = - Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.load_balancer_name (fun f -> - Query.Pair ("LoadBalancerName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.load_balancer_name (fun f -> - "load_balancer_name", String.to_json f) - ]) - - let of_json j = - { load_balancer_name = - Util.option_map (Json.lookup j "load_balancer_name") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module AccessLog = struct - type t = - { enabled : Boolean.t - ; s3_bucket_name : String.t option - ; emit_interval : Integer.t option - ; s3_bucket_prefix : String.t option - } - - let make ~enabled ?s3_bucket_name ?emit_interval ?s3_bucket_prefix () = - { enabled; s3_bucket_name; emit_interval; s3_bucket_prefix } - - let parse xml = - Some - { enabled = - Xml.required - "Enabled" - (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) - ; s3_bucket_name = Util.option_bind (Xml.member "S3BucketName" xml) String.parse - ; emit_interval = Util.option_bind (Xml.member "EmitInterval" xml) Integer.parse - ; s3_bucket_prefix = Util.option_bind (Xml.member "S3BucketPrefix" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.s3_bucket_prefix (fun f -> - Query.Pair ("S3BucketPrefix", String.to_query f)) - ; Util.option_map v.emit_interval (fun f -> - Query.Pair ("EmitInterval", Integer.to_query f)) - ; Util.option_map v.s3_bucket_name (fun f -> - Query.Pair ("S3BucketName", String.to_query f)) - ; Some (Query.Pair ("Enabled", Boolean.to_query v.enabled)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.s3_bucket_prefix (fun f -> - "s3_bucket_prefix", String.to_json f) - ; Util.option_map v.emit_interval (fun f -> "emit_interval", Integer.to_json f) - ; Util.option_map v.s3_bucket_name (fun f -> "s3_bucket_name", String.to_json f) - ; Some ("enabled", Boolean.to_json v.enabled) - ]) - - let of_json j = - { enabled = Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled")) - ; s3_bucket_name = Util.option_map (Json.lookup j "s3_bucket_name") String.of_json - ; emit_interval = Util.option_map (Json.lookup j "emit_interval") Integer.of_json - ; s3_bucket_prefix = Util.option_map (Json.lookup j "s3_bucket_prefix") String.of_json - } -end - -module AdditionalAttributes = struct - type t = AdditionalAttribute.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AdditionalAttribute.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list AdditionalAttribute.to_query v - - let to_json v = `List (List.map AdditionalAttribute.to_json v) - - let of_json j = Json.to_list AdditionalAttribute.of_json j -end - -module ConnectionDraining = struct - type t = - { enabled : Boolean.t - ; timeout : Integer.t option - } - - let make ~enabled ?timeout () = { enabled; timeout } - - let parse xml = - Some - { enabled = - Xml.required - "Enabled" - (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) - ; timeout = Util.option_bind (Xml.member "Timeout" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.timeout (fun f -> Query.Pair ("Timeout", Integer.to_query f)) - ; Some (Query.Pair ("Enabled", Boolean.to_query v.enabled)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.timeout (fun f -> "timeout", Integer.to_json f) - ; Some ("enabled", Boolean.to_json v.enabled) - ]) - - let of_json j = - { enabled = Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled")) - ; timeout = Util.option_map (Json.lookup j "timeout") Integer.of_json - } -end - -module ConnectionSettings = struct - type t = { idle_timeout : Integer.t } - - let make ~idle_timeout () = { idle_timeout } - - let parse xml = - Some - { idle_timeout = - Xml.required - "IdleTimeout" - (Util.option_bind (Xml.member "IdleTimeout" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IdleTimeout", Integer.to_query v.idle_timeout)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("idle_timeout", Integer.to_json v.idle_timeout) ]) - - let of_json j = - { idle_timeout = Integer.of_json (Util.of_option_exn (Json.lookup j "idle_timeout")) } -end - -module CrossZoneLoadBalancing = struct - type t = { enabled : Boolean.t } - - let make ~enabled () = { enabled } - - let parse xml = - Some - { enabled = - Xml.required - "Enabled" - (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Enabled", Boolean.to_query v.enabled)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("enabled", Boolean.to_json v.enabled) ]) - - let of_json j = - { enabled = Boolean.of_json (Util.of_option_exn (Json.lookup j "enabled")) } -end - -module PolicyAttribute = struct - type t = - { attribute_name : String.t option - ; attribute_value : String.t option - } - - let make ?attribute_name ?attribute_value () = { attribute_name; attribute_value } - - let parse xml = - Some - { attribute_name = Util.option_bind (Xml.member "AttributeName" xml) String.parse - ; attribute_value = Util.option_bind (Xml.member "AttributeValue" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - Query.Pair ("AttributeValue", String.to_query f)) - ; Util.option_map v.attribute_name (fun f -> - Query.Pair ("AttributeName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attribute_value (fun f -> - "attribute_value", String.to_json f) - ; Util.option_map v.attribute_name (fun f -> "attribute_name", String.to_json f) - ]) - - let of_json j = - { attribute_name = Util.option_map (Json.lookup j "attribute_name") String.of_json - ; attribute_value = Util.option_map (Json.lookup j "attribute_value") String.of_json - } -end - -module TagKeyOnly = struct - type t = { key : String.t option } - - let make ?key () = { key } - - let parse xml = Some { key = Util.option_bind (Xml.member "Key" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Util.option_map v.key (fun f -> "key", String.to_json f) ]) - - let of_json j = { key = Util.option_map (Json.lookup j "key") String.of_json } -end - -module PolicyDescription = struct - type t = - { policy_name : String.t option - ; policy_type_name : String.t option - ; policy_attribute_descriptions : PolicyAttributeDescriptions.t - } - - let make ?policy_name ?policy_type_name ?(policy_attribute_descriptions = []) () = - { policy_name; policy_type_name; policy_attribute_descriptions } - - let parse xml = - Some - { policy_name = Util.option_bind (Xml.member "PolicyName" xml) String.parse - ; policy_type_name = Util.option_bind (Xml.member "PolicyTypeName" xml) String.parse - ; policy_attribute_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "PolicyAttributeDescriptions" xml) - PolicyAttributeDescriptions.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("Instances.member", (Instances.to_query v.instances))); + Util.option_map v.v_p_c_id + (fun f -> Query.Pair ("VPCId", (String.to_query f))); + Some (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets))); + Some (Query.Pair - ( "PolicyAttributeDescriptions.member" - , PolicyAttributeDescriptions.to_query v.policy_attribute_descriptions )) - ; Util.option_map v.policy_type_name (fun f -> - Query.Pair ("PolicyTypeName", String.to_query f)) - ; Util.option_map v.policy_name (fun f -> - Query.Pair ("PolicyName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "policy_attribute_descriptions" - , PolicyAttributeDescriptions.to_json v.policy_attribute_descriptions ) - ; Util.option_map v.policy_type_name (fun f -> - "policy_type_name", String.to_json f) - ; Util.option_map v.policy_name (fun f -> "policy_name", String.to_json f) - ]) - - let of_json j = - { policy_name = Util.option_map (Json.lookup j "policy_name") String.of_json - ; policy_type_name = Util.option_map (Json.lookup j "policy_type_name") String.of_json - ; policy_attribute_descriptions = - PolicyAttributeDescriptions.of_json - (Util.of_option_exn (Json.lookup j "policy_attribute_descriptions")) - } -end - -module InstanceState = struct - type t = - { instance_id : String.t option - ; state : String.t option - ; reason_code : String.t option - ; description : String.t option - } - - let make ?instance_id ?state ?reason_code ?description () = - { instance_id; state; reason_code; description } - - let parse xml = - Some - { instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; state = Util.option_bind (Xml.member "State" xml) String.parse - ; reason_code = Util.option_bind (Xml.member "ReasonCode" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.reason_code (fun f -> - Query.Pair ("ReasonCode", String.to_query f)) - ; Util.option_map v.state (fun f -> Query.Pair ("State", String.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.reason_code (fun f -> "reason_code", String.to_json f) - ; Util.option_map v.state (fun f -> "state", String.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ]) - - let of_json j = - { instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; state = Util.option_map (Json.lookup j "state") String.of_json - ; reason_code = Util.option_map (Json.lookup j "reason_code") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module PolicyTypeDescription = struct - type t = - { policy_type_name : String.t option - ; description : String.t option - ; policy_attribute_type_descriptions : PolicyAttributeTypeDescriptions.t - } - - let make ?policy_type_name ?description ?(policy_attribute_type_descriptions = []) () = - { policy_type_name; description; policy_attribute_type_descriptions } - - let parse xml = - Some - { policy_type_name = Util.option_bind (Xml.member "PolicyTypeName" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; policy_attribute_type_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "PolicyAttributeTypeDescriptions" xml) - PolicyAttributeTypeDescriptions.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Some (Query.Pair - ( "PolicyAttributeTypeDescriptions.member" - , PolicyAttributeTypeDescriptions.to_query - v.policy_attribute_type_descriptions )) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.policy_type_name (fun f -> - Query.Pair ("PolicyTypeName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "policy_attribute_type_descriptions" - , PolicyAttributeTypeDescriptions.to_json - v.policy_attribute_type_descriptions ) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.policy_type_name (fun f -> - "policy_type_name", String.to_json f) - ]) - - let of_json j = - { policy_type_name = Util.option_map (Json.lookup j "policy_type_name") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; policy_attribute_type_descriptions = - PolicyAttributeTypeDescriptions.of_json - (Util.of_option_exn (Json.lookup j "policy_attribute_type_descriptions")) - } -end - -module LoadBalancerDescription = struct - type t = - { load_balancer_name : String.t option - ; d_n_s_name : String.t option - ; canonical_hosted_zone_name : String.t option - ; canonical_hosted_zone_name_i_d : String.t option - ; listener_descriptions : ListenerDescriptions.t - ; policies : Policies.t option - ; backend_server_descriptions : BackendServerDescriptions.t - ; availability_zones : AvailabilityZones.t - ; subnets : Subnets.t - ; v_p_c_id : String.t option - ; instances : Instances.t - ; health_check : HealthCheck.t option - ; source_security_group : SourceSecurityGroup.t option - ; security_groups : SecurityGroups.t - ; created_time : DateTime.t option - ; scheme : String.t option - } - - let make - ?load_balancer_name - ?d_n_s_name - ?canonical_hosted_zone_name - ?canonical_hosted_zone_name_i_d - ?(listener_descriptions = []) - ?policies - ?(backend_server_descriptions = []) - ?(availability_zones = []) - ?(subnets = []) - ?v_p_c_id - ?(instances = []) - ?health_check - ?source_security_group - ?(security_groups = []) - ?created_time - ?scheme - () = - { load_balancer_name - ; d_n_s_name - ; canonical_hosted_zone_name - ; canonical_hosted_zone_name_i_d - ; listener_descriptions - ; policies - ; backend_server_descriptions - ; availability_zones - ; subnets - ; v_p_c_id - ; instances - ; health_check - ; source_security_group - ; security_groups - ; created_time - ; scheme - } - - let parse xml = - Some - { load_balancer_name = - Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse - ; d_n_s_name = Util.option_bind (Xml.member "DNSName" xml) String.parse - ; canonical_hosted_zone_name = - Util.option_bind (Xml.member "CanonicalHostedZoneName" xml) String.parse - ; canonical_hosted_zone_name_i_d = - Util.option_bind (Xml.member "CanonicalHostedZoneNameID" xml) String.parse - ; listener_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "ListenerDescriptions" xml) - ListenerDescriptions.parse) - ; policies = Util.option_bind (Xml.member "Policies" xml) Policies.parse - ; backend_server_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "BackendServerDescriptions" xml) - BackendServerDescriptions.parse) - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - ; v_p_c_id = Util.option_bind (Xml.member "VPCId" xml) String.parse - ; instances = - Util.of_option - [] - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - ; health_check = Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse - ; source_security_group = - Util.option_bind - (Xml.member "SourceSecurityGroup" xml) - SourceSecurityGroup.parse - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - ; created_time = Util.option_bind (Xml.member "CreatedTime" xml) DateTime.parse - ; scheme = Util.option_bind (Xml.member "Scheme" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.scheme (fun f -> Query.Pair ("Scheme", String.to_query f)) - ; Util.option_map v.created_time (fun f -> - Query.Pair ("CreatedTime", DateTime.to_query f)) - ; Some + ("BackendServerDescriptions.member", + (BackendServerDescriptions.to_query + v.backend_server_descriptions))); + Util.option_map v.policies + (fun f -> Query.Pair ("Policies", (Policies.to_query f))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ; Util.option_map v.source_security_group (fun f -> - Query.Pair ("SourceSecurityGroup", SourceSecurityGroup.to_query f)) - ; Util.option_map v.health_check (fun f -> - Query.Pair ("HealthCheck", HealthCheck.to_query f)) - ; Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) - ; Util.option_map v.v_p_c_id (fun f -> Query.Pair ("VPCId", String.to_query f)) - ; Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) - ; Some + ("ListenerDescriptions.member", + (ListenerDescriptions.to_query v.listener_descriptions))); + Util.option_map v.canonical_hosted_zone_name_i_d + (fun f -> + Query.Pair ("CanonicalHostedZoneNameID", (String.to_query f))); + Util.option_map v.canonical_hosted_zone_name + (fun f -> + Query.Pair ("CanonicalHostedZoneName", (String.to_query f))); + Util.option_map v.d_n_s_name + (fun f -> Query.Pair ("DNSName", (String.to_query f))); + Util.option_map v.load_balancer_name + (fun f -> Query.Pair ("LoadBalancerName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.scheme + (fun f -> ("scheme", (String.to_json f))); + Util.option_map v.created_time + (fun f -> ("created_time", (DateTime.to_json f))); + Some + ("security_groups", (SecurityGroups.to_json v.security_groups)); + Util.option_map v.source_security_group + (fun f -> + ("source_security_group", (SourceSecurityGroup.to_json f))); + Util.option_map v.health_check + (fun f -> ("health_check", (HealthCheck.to_json f))); + Some ("instances", (Instances.to_json v.instances)); + Util.option_map v.v_p_c_id + (fun f -> ("v_p_c_id", (String.to_json f))); + Some ("subnets", (Subnets.to_json v.subnets)); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Some + ("backend_server_descriptions", + (BackendServerDescriptions.to_json + v.backend_server_descriptions)); + Util.option_map v.policies + (fun f -> ("policies", (Policies.to_json f))); + Some + ("listener_descriptions", + (ListenerDescriptions.to_json v.listener_descriptions)); + Util.option_map v.canonical_hosted_zone_name_i_d + (fun f -> ("canonical_hosted_zone_name_i_d", (String.to_json f))); + Util.option_map v.canonical_hosted_zone_name + (fun f -> ("canonical_hosted_zone_name", (String.to_json f))); + Util.option_map v.d_n_s_name + (fun f -> ("d_n_s_name", (String.to_json f))); + Util.option_map v.load_balancer_name + (fun f -> ("load_balancer_name", (String.to_json f)))]) + let of_json j = + { + load_balancer_name = + (Util.option_map (Json.lookup j "load_balancer_name") + String.of_json); + d_n_s_name = + (Util.option_map (Json.lookup j "d_n_s_name") String.of_json); + canonical_hosted_zone_name = + (Util.option_map (Json.lookup j "canonical_hosted_zone_name") + String.of_json); + canonical_hosted_zone_name_i_d = + (Util.option_map (Json.lookup j "canonical_hosted_zone_name_i_d") + String.of_json); + listener_descriptions = + (ListenerDescriptions.of_json + (Util.of_option_exn (Json.lookup j "listener_descriptions"))); + policies = + (Util.option_map (Json.lookup j "policies") Policies.of_json); + backend_server_descriptions = + (BackendServerDescriptions.of_json + (Util.of_option_exn + (Json.lookup j "backend_server_descriptions"))); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))); + v_p_c_id = + (Util.option_map (Json.lookup j "v_p_c_id") String.of_json); + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))); + health_check = + (Util.option_map (Json.lookup j "health_check") HealthCheck.of_json); + source_security_group = + (Util.option_map (Json.lookup j "source_security_group") + SourceSecurityGroup.of_json); + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + created_time = + (Util.option_map (Json.lookup j "created_time") DateTime.of_json); + scheme = (Util.option_map (Json.lookup j "scheme") String.of_json) + } + end +module TagDescriptions = + struct + type t = TagDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map TagDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list TagDescription.to_query v + let to_json v = `List (List.map TagDescription.to_json v) + let of_json j = Json.to_list TagDescription.of_json j + end +module LoadBalancerAttributes = + struct + type t = + { + cross_zone_load_balancing: CrossZoneLoadBalancing.t option ; + access_log: AccessLog.t option ; + connection_draining: ConnectionDraining.t option ; + connection_settings: ConnectionSettings.t option ; + additional_attributes: AdditionalAttributes.t } + let make ?cross_zone_load_balancing ?access_log ?connection_draining + ?connection_settings ?(additional_attributes= []) () = + { + cross_zone_load_balancing; + access_log; + connection_draining; + connection_settings; + additional_attributes + } + let parse xml = + Some + { + cross_zone_load_balancing = + (Util.option_bind (Xml.member "CrossZoneLoadBalancing" xml) + CrossZoneLoadBalancing.parse); + access_log = + (Util.option_bind (Xml.member "AccessLog" xml) AccessLog.parse); + connection_draining = + (Util.option_bind (Xml.member "ConnectionDraining" xml) + ConnectionDraining.parse); + connection_settings = + (Util.option_bind (Xml.member "ConnectionSettings" xml) + ConnectionSettings.parse); + additional_attributes = + (Util.of_option [] + (Util.option_bind (Xml.member "AdditionalAttributes" xml) + AdditionalAttributes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AdditionalAttributes.member", + (AdditionalAttributes.to_query v.additional_attributes))); + Util.option_map v.connection_settings + (fun f -> + Query.Pair + ("ConnectionSettings", (ConnectionSettings.to_query f))); + Util.option_map v.connection_draining + (fun f -> + Query.Pair + ("ConnectionDraining", (ConnectionDraining.to_query f))); + Util.option_map v.access_log + (fun f -> Query.Pair ("AccessLog", (AccessLog.to_query f))); + Util.option_map v.cross_zone_load_balancing + (fun f -> + Query.Pair + ("CrossZoneLoadBalancing", + (CrossZoneLoadBalancing.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("additional_attributes", + (AdditionalAttributes.to_json v.additional_attributes)); + Util.option_map v.connection_settings + (fun f -> + ("connection_settings", (ConnectionSettings.to_json f))); + Util.option_map v.connection_draining + (fun f -> + ("connection_draining", (ConnectionDraining.to_json f))); + Util.option_map v.access_log + (fun f -> ("access_log", (AccessLog.to_json f))); + Util.option_map v.cross_zone_load_balancing + (fun f -> + ("cross_zone_load_balancing", + (CrossZoneLoadBalancing.to_json f)))]) + let of_json j = + { + cross_zone_load_balancing = + (Util.option_map (Json.lookup j "cross_zone_load_balancing") + CrossZoneLoadBalancing.of_json); + access_log = + (Util.option_map (Json.lookup j "access_log") AccessLog.of_json); + connection_draining = + (Util.option_map (Json.lookup j "connection_draining") + ConnectionDraining.of_json); + connection_settings = + (Util.option_map (Json.lookup j "connection_settings") + ConnectionSettings.of_json); + additional_attributes = + (AdditionalAttributes.of_json + (Util.of_option_exn (Json.lookup j "additional_attributes"))) + } + end +module LoadBalancerNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Listeners = + struct + type t = Listener.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Listener.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Listener.to_query v + let to_json v = `List (List.map Listener.to_json v) + let of_json j = Json.to_list Listener.of_json j + end +module PolicyAttributes = + struct + type t = PolicyAttribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PolicyAttribute.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list PolicyAttribute.to_query v + let to_json v = `List (List.map PolicyAttribute.to_json v) + let of_json j = Json.to_list PolicyAttribute.of_json j + end +module TagKeyList = + struct + type t = TagKeyOnly.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map TagKeyOnly.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list TagKeyOnly.to_query v + let to_json v = `List (List.map TagKeyOnly.to_json v) + let of_json j = Json.to_list TagKeyOnly.of_json j + end +module PolicyDescriptions = + struct + type t = PolicyDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PolicyDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list PolicyDescription.to_query v + let to_json v = `List (List.map PolicyDescription.to_json v) + let of_json j = Json.to_list PolicyDescription.of_json j + end +module InstanceStates = + struct + type t = InstanceState.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map InstanceState.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list InstanceState.to_query v + let to_json v = `List (List.map InstanceState.to_json v) + let of_json j = Json.to_list InstanceState.of_json j + end +module LoadBalancerNamesMax20 = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module PolicyTypeNames = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Ports = + struct + type t = Integer.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Integer.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Integer.to_query v + let to_json v = `List (List.map Integer.to_json v) + let of_json j = Json.to_list Integer.of_json j + end +module PolicyTypeDescriptions = + struct + type t = PolicyTypeDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PolicyTypeDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list PolicyTypeDescription.to_query v + let to_json v = `List (List.map PolicyTypeDescription.to_json v) + let of_json j = Json.to_list PolicyTypeDescription.of_json j + end +module LoadBalancerDescriptions = + struct + type t = LoadBalancerDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LoadBalancerDescription.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list LoadBalancerDescription.to_query v + let to_json v = `List (List.map LoadBalancerDescription.to_json v) + let of_json j = Json.to_list LoadBalancerDescription.of_json j + end +module DescribeTagsOutput = + struct + type t = { + tag_descriptions: TagDescriptions.t } + let make ?(tag_descriptions= []) () = { tag_descriptions } + let parse xml = + Some + { + tag_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "TagDescriptions" xml) + TagDescriptions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("TagDescriptions.member", + (TagDescriptions.to_query v.tag_descriptions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("tag_descriptions", + (TagDescriptions.to_json v.tag_descriptions))]) + let of_json j = + { + tag_descriptions = + (TagDescriptions.of_json + (Util.of_option_exn (Json.lookup j "tag_descriptions"))) + } + end +module ConfigureHealthCheckOutput = + struct + type t = { + health_check: HealthCheck.t option } + let make ?health_check () = { health_check } + let parse xml = + Some + { + health_check = + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.health_check + (fun f -> Query.Pair ("HealthCheck", (HealthCheck.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.health_check + (fun f -> ("health_check", (HealthCheck.to_json f)))]) + let of_json j = + { + health_check = + (Util.option_map (Json.lookup j "health_check") HealthCheck.of_json) + } + end +module ModifyLoadBalancerAttributesOutput = + struct + type t = + { + load_balancer_name: String.t option ; + load_balancer_attributes: LoadBalancerAttributes.t option } + let make ?load_balancer_name ?load_balancer_attributes () = + { load_balancer_name; load_balancer_attributes } + let parse xml = + Some + { + load_balancer_name = + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse); + load_balancer_attributes = + (Util.option_bind (Xml.member "LoadBalancerAttributes" xml) + LoadBalancerAttributes.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.load_balancer_attributes + (fun f -> + Query.Pair + ("LoadBalancerAttributes", + (LoadBalancerAttributes.to_query f))); + Util.option_map v.load_balancer_name + (fun f -> Query.Pair ("LoadBalancerName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.load_balancer_attributes + (fun f -> + ("load_balancer_attributes", + (LoadBalancerAttributes.to_json f))); + Util.option_map v.load_balancer_name + (fun f -> ("load_balancer_name", (String.to_json f)))]) + let of_json j = + { + load_balancer_name = + (Util.option_map (Json.lookup j "load_balancer_name") + String.of_json); + load_balancer_attributes = + (Util.option_map (Json.lookup j "load_balancer_attributes") + LoadBalancerAttributes.of_json) + } + end +module SetLoadBalancerPoliciesForBackendServerOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AddTagsInput = + struct + type t = { + load_balancer_names: LoadBalancerNames.t ; + tags: TagList.t } + let make ~load_balancer_names ~tags () = { load_balancer_names; tags } + let parse xml = + Some + { + load_balancer_names = + (Xml.required "LoadBalancerNames" + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)); + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Some + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names))]) + let of_json j = + { + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CreateLoadBalancerListenerInput = + struct + type t = { + load_balancer_name: String.t ; + listeners: Listeners.t } + let make ~load_balancer_name ~listeners () = + { load_balancer_name; listeners } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + listeners = + (Xml.required "Listeners" + (Util.option_bind (Xml.member "Listeners" xml) Listeners.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Listeners.member", (Listeners.to_query v.listeners))); + Some (Query.Pair - ( "BackendServerDescriptions.member" - , BackendServerDescriptions.to_query v.backend_server_descriptions )) - ; Util.option_map v.policies (fun f -> - Query.Pair ("Policies", Policies.to_query f)) - ; Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("listeners", (Listeners.to_json v.listeners)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + listeners = + (Listeners.of_json (Util.of_option_exn (Json.lookup j "listeners"))) + } + end +module CreateLoadBalancerPolicyInput = + struct + type t = + { + load_balancer_name: String.t ; + policy_name: String.t ; + policy_type_name: String.t ; + policy_attributes: PolicyAttributes.t } + let make ~load_balancer_name ~policy_name ~policy_type_name + ?(policy_attributes= []) () = + { load_balancer_name; policy_name; policy_type_name; policy_attributes + } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)); + policy_type_name = + (Xml.required "PolicyTypeName" + (Util.option_bind (Xml.member "PolicyTypeName" xml) + String.parse)); + policy_attributes = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyAttributes" xml) + PolicyAttributes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyAttributes.member", + (PolicyAttributes.to_query v.policy_attributes))); + Some (Query.Pair - ( "ListenerDescriptions.member" - , ListenerDescriptions.to_query v.listener_descriptions )) - ; Util.option_map v.canonical_hosted_zone_name_i_d (fun f -> - Query.Pair ("CanonicalHostedZoneNameID", String.to_query f)) - ; Util.option_map v.canonical_hosted_zone_name (fun f -> - Query.Pair ("CanonicalHostedZoneName", String.to_query f)) - ; Util.option_map v.d_n_s_name (fun f -> - Query.Pair ("DNSName", String.to_query f)) - ; Util.option_map v.load_balancer_name (fun f -> - Query.Pair ("LoadBalancerName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.scheme (fun f -> "scheme", String.to_json f) - ; Util.option_map v.created_time (fun f -> "created_time", DateTime.to_json f) - ; Some ("security_groups", SecurityGroups.to_json v.security_groups) - ; Util.option_map v.source_security_group (fun f -> - "source_security_group", SourceSecurityGroup.to_json f) - ; Util.option_map v.health_check (fun f -> "health_check", HealthCheck.to_json f) - ; Some ("instances", Instances.to_json v.instances) - ; Util.option_map v.v_p_c_id (fun f -> "v_p_c_id", String.to_json f) - ; Some ("subnets", Subnets.to_json v.subnets) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Some - ( "backend_server_descriptions" - , BackendServerDescriptions.to_json v.backend_server_descriptions ) - ; Util.option_map v.policies (fun f -> "policies", Policies.to_json f) - ; Some - ( "listener_descriptions" - , ListenerDescriptions.to_json v.listener_descriptions ) - ; Util.option_map v.canonical_hosted_zone_name_i_d (fun f -> - "canonical_hosted_zone_name_i_d", String.to_json f) - ; Util.option_map v.canonical_hosted_zone_name (fun f -> - "canonical_hosted_zone_name", String.to_json f) - ; Util.option_map v.d_n_s_name (fun f -> "d_n_s_name", String.to_json f) - ; Util.option_map v.load_balancer_name (fun f -> - "load_balancer_name", String.to_json f) - ]) - - let of_json j = - { load_balancer_name = - Util.option_map (Json.lookup j "load_balancer_name") String.of_json - ; d_n_s_name = Util.option_map (Json.lookup j "d_n_s_name") String.of_json - ; canonical_hosted_zone_name = - Util.option_map (Json.lookup j "canonical_hosted_zone_name") String.of_json - ; canonical_hosted_zone_name_i_d = - Util.option_map (Json.lookup j "canonical_hosted_zone_name_i_d") String.of_json - ; listener_descriptions = - ListenerDescriptions.of_json - (Util.of_option_exn (Json.lookup j "listener_descriptions")) - ; policies = Util.option_map (Json.lookup j "policies") Policies.of_json - ; backend_server_descriptions = - BackendServerDescriptions.of_json - (Util.of_option_exn (Json.lookup j "backend_server_descriptions")) - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) - ; v_p_c_id = Util.option_map (Json.lookup j "v_p_c_id") String.of_json - ; instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) - ; health_check = Util.option_map (Json.lookup j "health_check") HealthCheck.of_json - ; source_security_group = - Util.option_map - (Json.lookup j "source_security_group") - SourceSecurityGroup.of_json - ; security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; created_time = Util.option_map (Json.lookup j "created_time") DateTime.of_json - ; scheme = Util.option_map (Json.lookup j "scheme") String.of_json - } -end - -module TagDescriptions = struct - type t = TagDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map TagDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list TagDescription.to_query v - - let to_json v = `List (List.map TagDescription.to_json v) - - let of_json j = Json.to_list TagDescription.of_json j -end - -module LoadBalancerAttributes = struct - type t = - { cross_zone_load_balancing : CrossZoneLoadBalancing.t option - ; access_log : AccessLog.t option - ; connection_draining : ConnectionDraining.t option - ; connection_settings : ConnectionSettings.t option - ; additional_attributes : AdditionalAttributes.t - } - - let make - ?cross_zone_load_balancing - ?access_log - ?connection_draining - ?connection_settings - ?(additional_attributes = []) - () = - { cross_zone_load_balancing - ; access_log - ; connection_draining - ; connection_settings - ; additional_attributes - } - - let parse xml = - Some - { cross_zone_load_balancing = - Util.option_bind - (Xml.member "CrossZoneLoadBalancing" xml) - CrossZoneLoadBalancing.parse - ; access_log = Util.option_bind (Xml.member "AccessLog" xml) AccessLog.parse - ; connection_draining = - Util.option_bind (Xml.member "ConnectionDraining" xml) ConnectionDraining.parse - ; connection_settings = - Util.option_bind (Xml.member "ConnectionSettings" xml) ConnectionSettings.parse - ; additional_attributes = - Util.of_option - [] - (Util.option_bind - (Xml.member "AdditionalAttributes" xml) - AdditionalAttributes.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("PolicyTypeName", (String.to_query v.policy_type_name))); + Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Some (Query.Pair - ( "AdditionalAttributes.member" - , AdditionalAttributes.to_query v.additional_attributes )) - ; Util.option_map v.connection_settings (fun f -> - Query.Pair ("ConnectionSettings", ConnectionSettings.to_query f)) - ; Util.option_map v.connection_draining (fun f -> - Query.Pair ("ConnectionDraining", ConnectionDraining.to_query f)) - ; Util.option_map v.access_log (fun f -> - Query.Pair ("AccessLog", AccessLog.to_query f)) - ; Util.option_map v.cross_zone_load_balancing (fun f -> - Query.Pair ("CrossZoneLoadBalancing", CrossZoneLoadBalancing.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "additional_attributes" - , AdditionalAttributes.to_json v.additional_attributes ) - ; Util.option_map v.connection_settings (fun f -> - "connection_settings", ConnectionSettings.to_json f) - ; Util.option_map v.connection_draining (fun f -> - "connection_draining", ConnectionDraining.to_json f) - ; Util.option_map v.access_log (fun f -> "access_log", AccessLog.to_json f) - ; Util.option_map v.cross_zone_load_balancing (fun f -> - "cross_zone_load_balancing", CrossZoneLoadBalancing.to_json f) - ]) - - let of_json j = - { cross_zone_load_balancing = - Util.option_map - (Json.lookup j "cross_zone_load_balancing") - CrossZoneLoadBalancing.of_json - ; access_log = Util.option_map (Json.lookup j "access_log") AccessLog.of_json - ; connection_draining = - Util.option_map (Json.lookup j "connection_draining") ConnectionDraining.of_json - ; connection_settings = - Util.option_map (Json.lookup j "connection_settings") ConnectionSettings.of_json - ; additional_attributes = - AdditionalAttributes.of_json - (Util.of_option_exn (Json.lookup j "additional_attributes")) - } -end - -module LoadBalancerNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Listeners = struct - type t = Listener.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Listener.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Listener.to_query v - - let to_json v = `List (List.map Listener.to_json v) - - let of_json j = Json.to_list Listener.of_json j -end - -module PolicyAttributes = struct - type t = PolicyAttribute.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map PolicyAttribute.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list PolicyAttribute.to_query v - - let to_json v = `List (List.map PolicyAttribute.to_json v) - - let of_json j = Json.to_list PolicyAttribute.of_json j -end - -module TagKeyList = struct - type t = TagKeyOnly.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map TagKeyOnly.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list TagKeyOnly.to_query v - - let to_json v = `List (List.map TagKeyOnly.to_json v) - - let of_json j = Json.to_list TagKeyOnly.of_json j -end - -module PolicyDescriptions = struct - type t = PolicyDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map PolicyDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list PolicyDescription.to_query v - - let to_json v = `List (List.map PolicyDescription.to_json v) - - let of_json j = Json.to_list PolicyDescription.of_json j -end - -module InstanceStates = struct - type t = InstanceState.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map InstanceState.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list InstanceState.to_query v - - let to_json v = `List (List.map InstanceState.to_json v) - - let of_json j = Json.to_list InstanceState.of_json j -end - -module LoadBalancerNamesMax20 = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module PolicyTypeNames = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Ports = struct - type t = Integer.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Integer.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Integer.to_query v - - let to_json v = `List (List.map Integer.to_json v) - - let of_json j = Json.to_list Integer.of_json j -end - -module PolicyTypeDescriptions = struct - type t = PolicyTypeDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map PolicyTypeDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list PolicyTypeDescription.to_query v - - let to_json v = `List (List.map PolicyTypeDescription.to_json v) - - let of_json j = Json.to_list PolicyTypeDescription.of_json j -end - -module LoadBalancerDescriptions = struct - type t = LoadBalancerDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map LoadBalancerDescription.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LoadBalancerDescription.to_query v - - let to_json v = `List (List.map LoadBalancerDescription.to_json v) - - let of_json j = Json.to_list LoadBalancerDescription.of_json j -end - -module DescribeTagsOutput = struct - type t = { tag_descriptions : TagDescriptions.t } - - let make ?(tag_descriptions = []) () = { tag_descriptions } - - let parse xml = - Some - { tag_descriptions = - Util.of_option - [] - (Util.option_bind (Xml.member "TagDescriptions" xml) TagDescriptions.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_attributes", + (PolicyAttributes.to_json v.policy_attributes)); + Some ("policy_type_name", (String.to_json v.policy_type_name)); + Some ("policy_name", (String.to_json v.policy_name)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))); + policy_type_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "policy_type_name"))); + policy_attributes = + (PolicyAttributes.of_json + (Util.of_option_exn (Json.lookup j "policy_attributes"))) + } + end +module DuplicateTagKeysException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateAccessPointOutput = + struct + type t = { + d_n_s_name: String.t option } + let make ?d_n_s_name () = { d_n_s_name } + let parse xml = + Some + { + d_n_s_name = + (Util.option_bind (Xml.member "DNSName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_n_s_name + (fun f -> Query.Pair ("DNSName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_n_s_name + (fun f -> ("d_n_s_name", (String.to_json f)))]) + let of_json j = + { + d_n_s_name = + (Util.option_map (Json.lookup j "d_n_s_name") String.of_json) + } + end +module DescribeLoadBalancerPoliciesInput = + struct + type t = + { + load_balancer_name: String.t option ; + policy_names: PolicyNames.t } + let make ?load_balancer_name ?(policy_names= []) () = + { load_balancer_name; policy_names } + let parse xml = + Some + { + load_balancer_name = + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse); + policy_names = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyNames.member", + (PolicyNames.to_query v.policy_names))); + Util.option_map v.load_balancer_name + (fun f -> Query.Pair ("LoadBalancerName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Util.option_map v.load_balancer_name + (fun f -> ("load_balancer_name", (String.to_json f)))]) + let of_json j = + { + load_balancer_name = + (Util.option_map (Json.lookup j "load_balancer_name") + String.of_json); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))) + } + end +module LoadBalancerAttributeNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module TooManyTagsException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AttachLoadBalancerToSubnetsInput = + struct + type t = { + load_balancer_name: String.t ; + subnets: Subnets.t } + let make ~load_balancer_name ~subnets () = + { load_balancer_name; subnets } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + subnets = + (Xml.required "Subnets" + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets))); + Some (Query.Pair - ("TagDescriptions.member", TagDescriptions.to_query v.tag_descriptions)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tag_descriptions", TagDescriptions.to_json v.tag_descriptions) ]) - - let of_json j = - { tag_descriptions = - TagDescriptions.of_json (Util.of_option_exn (Json.lookup j "tag_descriptions")) - } -end - -module ConfigureHealthCheckOutput = struct - type t = { health_check : HealthCheck.t option } - - let make ?health_check () = { health_check } - - let parse xml = - Some - { health_check = Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.health_check (fun f -> - Query.Pair ("HealthCheck", HealthCheck.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.health_check (fun f -> "health_check", HealthCheck.to_json f) - ]) - - let of_json j = - { health_check = Util.option_map (Json.lookup j "health_check") HealthCheck.of_json } -end - -module ModifyLoadBalancerAttributesOutput = struct - type t = - { load_balancer_name : String.t option - ; load_balancer_attributes : LoadBalancerAttributes.t option - } - - let make ?load_balancer_name ?load_balancer_attributes () = - { load_balancer_name; load_balancer_attributes } - - let parse xml = - Some - { load_balancer_name = - Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse - ; load_balancer_attributes = - Util.option_bind - (Xml.member "LoadBalancerAttributes" xml) - LoadBalancerAttributes.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.load_balancer_attributes (fun f -> - Query.Pair ("LoadBalancerAttributes", LoadBalancerAttributes.to_query f)) - ; Util.option_map v.load_balancer_name (fun f -> - Query.Pair ("LoadBalancerName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.load_balancer_attributes (fun f -> - "load_balancer_attributes", LoadBalancerAttributes.to_json f) - ; Util.option_map v.load_balancer_name (fun f -> - "load_balancer_name", String.to_json f) - ]) - - let of_json j = - { load_balancer_name = - Util.option_map (Json.lookup j "load_balancer_name") String.of_json - ; load_balancer_attributes = - Util.option_map - (Json.lookup j "load_balancer_attributes") - LoadBalancerAttributes.of_json - } -end - -module SetLoadBalancerPoliciesForBackendServerOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AddTagsInput = struct - type t = - { load_balancer_names : LoadBalancerNames.t - ; tags : TagList.t - } - - let make ~load_balancer_names ~tags () = { load_balancer_names; tags } - - let parse xml = - Some - { load_balancer_names = - Xml.required - "LoadBalancerNames" - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) - ; tags = - Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnets", (Subnets.to_json v.subnets)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module DeregisterEndPointsInput = + struct + type t = { + load_balancer_name: String.t ; + instances: Instances.t } + let make ~load_balancer_name ~instances () = + { load_balancer_name; instances } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + instances = + (Xml.required "Instances" + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Instances.member", (Instances.to_query v.instances))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ]) - - let of_json j = - { load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CreateLoadBalancerListenerInput = struct - type t = - { load_balancer_name : String.t - ; listeners : Listeners.t - } - - let make ~load_balancer_name ~listeners () = { load_balancer_name; listeners } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; listeners = - Xml.required - "Listeners" - (Util.option_bind (Xml.member "Listeners" xml) Listeners.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Listeners.member", Listeners.to_query v.listeners)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("listeners", Listeners.to_json v.listeners) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; listeners = Listeners.of_json (Util.of_option_exn (Json.lookup j "listeners")) - } -end - -module CreateLoadBalancerPolicyInput = struct - type t = - { load_balancer_name : String.t - ; policy_name : String.t - ; policy_type_name : String.t - ; policy_attributes : PolicyAttributes.t - } - - let make ~load_balancer_name ~policy_name ~policy_type_name ?(policy_attributes = []) () - = - { load_balancer_name; policy_name; policy_type_name; policy_attributes } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - ; policy_type_name = - Xml.required - "PolicyTypeName" - (Util.option_bind (Xml.member "PolicyTypeName" xml) String.parse) - ; policy_attributes = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyAttributes" xml) PolicyAttributes.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (Instances.to_json v.instances)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module AddAvailabilityZonesOutput = + struct + type t = { + availability_zones: AvailabilityZones.t } + let make ?(availability_zones= []) () = { availability_zones } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))) + } + end +module ListenerNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateLoadBalancerPolicyOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidEndPointException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SubnetNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveTagsInput = + struct + type t = { + load_balancer_names: LoadBalancerNames.t ; + tags: TagKeyList.t } + let make ~load_balancer_names ~tags () = { load_balancer_names; tags } + let parse xml = + Some + { + load_balancer_names = + (Xml.required "LoadBalancerNames" + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)); + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) TagKeyList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagKeyList.to_query v.tags))); + Some (Query.Pair - ("PolicyAttributes.member", PolicyAttributes.to_query v.policy_attributes)) - ; Some (Query.Pair ("PolicyTypeName", String.to_query v.policy_type_name)) - ; Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_attributes", PolicyAttributes.to_json v.policy_attributes) - ; Some ("policy_type_name", String.to_json v.policy_type_name) - ; Some ("policy_name", String.to_json v.policy_name) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - ; policy_type_name = - String.of_json (Util.of_option_exn (Json.lookup j "policy_type_name")) - ; policy_attributes = - PolicyAttributes.of_json (Util.of_option_exn (Json.lookup j "policy_attributes")) - } -end - -module DuplicateTagKeysException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateAccessPointOutput = struct - type t = { d_n_s_name : String.t option } - - let make ?d_n_s_name () = { d_n_s_name } - - let parse xml = - Some { d_n_s_name = Util.option_bind (Xml.member "DNSName" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_n_s_name (fun f -> - Query.Pair ("DNSName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_n_s_name (fun f -> "d_n_s_name", String.to_json f) ]) - - let of_json j = - { d_n_s_name = Util.option_map (Json.lookup j "d_n_s_name") String.of_json } -end - -module DescribeLoadBalancerPoliciesInput = struct - type t = - { load_balancer_name : String.t option - ; policy_names : PolicyNames.t - } - - let make ?load_balancer_name ?(policy_names = []) () = - { load_balancer_name; policy_names } - - let parse xml = - Some - { load_balancer_name = - Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse - ; policy_names = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Util.option_map v.load_balancer_name (fun f -> - Query.Pair ("LoadBalancerName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Util.option_map v.load_balancer_name (fun f -> - "load_balancer_name", String.to_json f) - ]) - - let of_json j = - { load_balancer_name = - Util.option_map (Json.lookup j "load_balancer_name") String.of_json - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - } -end - -module LoadBalancerAttributeNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module TooManyTagsException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AttachLoadBalancerToSubnetsInput = struct - type t = - { load_balancer_name : String.t - ; subnets : Subnets.t - } - - let make ~load_balancer_name ~subnets () = { load_balancer_name; subnets } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; subnets = - Xml.required - "Subnets" - (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnets", Subnets.to_json v.subnets) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) - } -end - -module DeregisterEndPointsInput = struct - type t = - { load_balancer_name : String.t - ; instances : Instances.t - } - - let make ~load_balancer_name ~instances () = { load_balancer_name; instances } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; instances = - Xml.required - "Instances" - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instances", Instances.to_json v.instances) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) - } -end - -module AddAvailabilityZonesOutput = struct - type t = { availability_zones : AvailabilityZones.t } - - let make ?(availability_zones = []) () = { availability_zones } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagKeyList.to_json v.tags)); + Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names))]) + let of_json j = + { + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))); + tags = + (TagKeyList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module SetLoadBalancerPoliciesForBackendServerInput = + struct + type t = + { + load_balancer_name: String.t ; + instance_port: Integer.t ; + policy_names: PolicyNames.t } + let make ~load_balancer_name ~instance_port ~policy_names () = + { load_balancer_name; instance_port; policy_names } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + instance_port = + (Xml.required "InstancePort" + (Util.option_bind (Xml.member "InstancePort" xml) + Integer.parse)); + policy_names = + (Xml.required "PolicyNames" + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyNames.member", + (PolicyNames.to_query v.policy_names))); + Some + (Query.Pair ("InstancePort", (Integer.to_query v.instance_port))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) ]) - - let of_json j = - { availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - } -end - -module ListenerNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateLoadBalancerPolicyOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidEndPointException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SubnetNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RemoveTagsInput = struct - type t = - { load_balancer_names : LoadBalancerNames.t - ; tags : TagKeyList.t - } - - let make ~load_balancer_names ~tags () = { load_balancer_names; tags } - - let parse xml = - Some - { load_balancer_names = - Xml.required - "LoadBalancerNames" - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) - ; tags = - Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) TagKeyList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagKeyList.to_query v.tags)) - ; Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Some ("instance_port", (Integer.to_json v.instance_port)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + instance_port = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "instance_port"))); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))) + } + end +module SetLoadBalancerListenerSSLCertificateOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module TooManyAccessPointsException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateAccessPointInput = + struct + type t = + { + load_balancer_name: String.t ; + listeners: Listeners.t ; + availability_zones: AvailabilityZones.t ; + subnets: Subnets.t ; + security_groups: SecurityGroups.t ; + scheme: String.t option ; + tags: TagList.t } + let make ~load_balancer_name ~listeners ?(availability_zones= []) + ?(subnets= []) ?(security_groups= []) ?scheme ?(tags= []) () = + { + load_balancer_name; + listeners; + availability_zones; + subnets; + security_groups; + scheme; + tags + } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + listeners = + (Xml.required "Listeners" + (Util.option_bind (Xml.member "Listeners" xml) Listeners.parse)); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)); + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)); + scheme = (Util.option_bind (Xml.member "Scheme" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.scheme + (fun f -> Query.Pair ("Scheme", (String.to_query f))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagKeyList.to_json v.tags) - ; Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ]) - - let of_json j = - { load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - ; tags = TagKeyList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module SetLoadBalancerPoliciesForBackendServerInput = struct - type t = - { load_balancer_name : String.t - ; instance_port : Integer.t - ; policy_names : PolicyNames.t - } - - let make ~load_balancer_name ~instance_port ~policy_names () = - { load_balancer_name; instance_port; policy_names } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; instance_port = - Xml.required - "InstancePort" - (Util.option_bind (Xml.member "InstancePort" xml) Integer.parse) - ; policy_names = - Xml.required - "PolicyNames" - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Some (Query.Pair ("InstancePort", Integer.to_query v.instance_port)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Some ("instance_port", Integer.to_json v.instance_port) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; instance_port = Integer.of_json (Util.of_option_exn (Json.lookup j "instance_port")) - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - } -end - -module SetLoadBalancerListenerSSLCertificateOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module TooManyAccessPointsException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateAccessPointInput = struct - type t = - { load_balancer_name : String.t - ; listeners : Listeners.t - ; availability_zones : AvailabilityZones.t - ; subnets : Subnets.t - ; security_groups : SecurityGroups.t - ; scheme : String.t option - ; tags : TagList.t - } - - let make - ~load_balancer_name - ~listeners - ?(availability_zones = []) - ?(subnets = []) - ?(security_groups = []) - ?scheme - ?(tags = []) - () = - { load_balancer_name - ; listeners - ; availability_zones - ; subnets - ; security_groups - ; scheme - ; tags - } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; listeners = - Xml.required - "Listeners" - (Util.option_bind (Xml.member "Listeners" xml) Listeners.parse) - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - ; security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - ; scheme = Util.option_bind (Xml.member "Scheme" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.scheme (fun f -> Query.Pair ("Scheme", String.to_query f)) - ; Some + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups))); + Some (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ; Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) - ; Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Some (Query.Pair ("Listeners.member", Listeners.to_query v.listeners)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.scheme (fun f -> "scheme", String.to_json f) - ; Some ("security_groups", SecurityGroups.to_json v.security_groups) - ; Some ("subnets", Subnets.to_json v.subnets) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Some ("listeners", Listeners.to_json v.listeners) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; listeners = Listeners.of_json (Util.of_option_exn (Json.lookup j "listeners")) - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) - ; security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - ; scheme = Util.option_map (Json.lookup j "scheme") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DescribeAccessPointsInput = struct - type t = - { load_balancer_names : LoadBalancerNames.t - ; marker : String.t option - ; page_size : Integer.t option - } - - let make ?(load_balancer_names = []) ?marker ?page_size () = - { load_balancer_names; marker; page_size } - - let parse xml = - Some - { load_balancer_names = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNames.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; page_size = Util.option_bind (Xml.member "PageSize" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.page_size (fun f -> - Query.Pair ("PageSize", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + ("Listeners.member", (Listeners.to_query v.listeners))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNames.to_query v.load_balancer_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.page_size (fun f -> "page_size", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("load_balancer_names", LoadBalancerNames.to_json v.load_balancer_names) - ]) - - let of_json j = - { load_balancer_names = - LoadBalancerNames.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; page_size = Util.option_map (Json.lookup j "page_size") Integer.of_json - } -end - -module InvalidSchemeException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SetLoadBalancerPoliciesOfListenerOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidSecurityGroupException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateLoadBalancerListenerOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DetachLoadBalancerFromSubnetsOutput = struct - type t = { subnets : Subnets.t } - - let make ?(subnets = []) () = { subnets } - - let parse xml = - Some - { subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("subnets", Subnets.to_json v.subnets) ]) - - let of_json j = - { subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) } -end - -module DescribeLoadBalancerAttributesInput = struct - type t = { load_balancer_name : String.t } - - let make ~load_balancer_name () = { load_balancer_name } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("load_balancer_name", String.to_json v.load_balancer_name) ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - } -end - -module DuplicateListenerException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CertificateNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeLoadBalancerPoliciesOutput = struct - type t = { policy_descriptions : PolicyDescriptions.t } - - let make ?(policy_descriptions = []) () = { policy_descriptions } - - let parse xml = - Some - { policy_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "PolicyDescriptions" xml) - PolicyDescriptions.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.scheme (fun f -> ("scheme", (String.to_json f))); + Some + ("security_groups", (SecurityGroups.to_json v.security_groups)); + Some ("subnets", (Subnets.to_json v.subnets)); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Some ("listeners", (Listeners.to_json v.listeners)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + listeners = + (Listeners.of_json (Util.of_option_exn (Json.lookup j "listeners"))); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))); + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))); + scheme = (Util.option_map (Json.lookup j "scheme") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DescribeAccessPointsInput = + struct + type t = + { + load_balancer_names: LoadBalancerNames.t ; + marker: String.t option ; + page_size: Integer.t option } + let make ?(load_balancer_names= []) ?marker ?page_size () = + { load_balancer_names; marker; page_size } + let parse xml = + Some + { + load_balancer_names = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNames.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + page_size = + (Util.option_bind (Xml.member "PageSize" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.page_size + (fun f -> Query.Pair ("PageSize", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ( "PolicyDescriptions.member" - , PolicyDescriptions.to_query v.policy_descriptions )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_descriptions", PolicyDescriptions.to_json v.policy_descriptions) - ]) - - let of_json j = - { policy_descriptions = - PolicyDescriptions.of_json - (Util.of_option_exn (Json.lookup j "policy_descriptions")) - } -end - -module PolicyTypeNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RemoveAvailabilityZonesInput = struct - type t = - { load_balancer_name : String.t - ; availability_zones : AvailabilityZones.t - } - - let make ~load_balancer_name ~availability_zones () = - { load_balancer_name; availability_zones } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; availability_zones = - Xml.required - "AvailabilityZones" - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerNames.member", + (LoadBalancerNames.to_query v.load_balancer_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.page_size + (fun f -> ("page_size", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Some + ("load_balancer_names", + (LoadBalancerNames.to_json v.load_balancer_names))]) + let of_json j = + { + load_balancer_names = + (LoadBalancerNames.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + page_size = + (Util.option_map (Json.lookup j "page_size") Integer.of_json) + } + end +module InvalidSchemeException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SetLoadBalancerPoliciesOfListenerOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidSecurityGroupException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateLoadBalancerListenerOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DetachLoadBalancerFromSubnetsOutput = + struct + type t = { + subnets: Subnets.t } + let make ?(subnets= []) () = { subnets } + let parse xml = + Some + { + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("subnets", (Subnets.to_json v.subnets))]) + let of_json j = + { + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module DescribeLoadBalancerAttributesInput = + struct + type t = { + load_balancer_name: String.t } + let make ~load_balancer_name () = { load_balancer_name } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))) + } + end +module DuplicateListenerException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CertificateNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeLoadBalancerPoliciesOutput = + struct + type t = { + policy_descriptions: PolicyDescriptions.t } + let make ?(policy_descriptions= []) () = { policy_descriptions } + let parse xml = + Some + { + policy_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyDescriptions" xml) + PolicyDescriptions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyDescriptions.member", + (PolicyDescriptions.to_query v.policy_descriptions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_descriptions", + (PolicyDescriptions.to_json v.policy_descriptions))]) + let of_json j = + { + policy_descriptions = + (PolicyDescriptions.of_json + (Util.of_option_exn (Json.lookup j "policy_descriptions"))) + } + end +module PolicyTypeNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveAvailabilityZonesInput = + struct + type t = + { + load_balancer_name: String.t ; + availability_zones: AvailabilityZones.t } + let make ~load_balancer_name ~availability_zones () = + { load_balancer_name; availability_zones } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + availability_zones = + (Xml.required "AvailabilityZones" + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - } -end - -module InvalidSubnetException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteLoadBalancerPolicyInput = struct - type t = - { load_balancer_name : String.t - ; policy_name : String.t - } - - let make ~load_balancer_name ~policy_name () = { load_balancer_name; policy_name } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_name", String.to_json v.policy_name) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - } -end - -module AttachLoadBalancerToSubnetsOutput = struct - type t = { subnets : Subnets.t } - - let make ?(subnets = []) () = { subnets } - - let parse xml = - Some - { subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("subnets", Subnets.to_json v.subnets) ]) - - let of_json j = - { subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) } -end - -module CreateAppCookieStickinessPolicyOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeEndPointStateOutput = struct - type t = { instance_states : InstanceStates.t } - - let make ?(instance_states = []) () = { instance_states } - - let parse xml = - Some - { instance_states = - Util.of_option - [] - (Util.option_bind (Xml.member "InstanceStates" xml) InstanceStates.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))) + } + end +module InvalidSubnetException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteLoadBalancerPolicyInput = + struct + type t = { + load_balancer_name: String.t ; + policy_name: String.t } + let make ~load_balancer_name ~policy_name () = + { load_balancer_name; policy_name } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Some (Query.Pair - ("InstanceStates.member", InstanceStates.to_query v.instance_states)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_states", InstanceStates.to_json v.instance_states) ]) - - let of_json j = - { instance_states = - InstanceStates.of_json (Util.of_option_exn (Json.lookup j "instance_states")) - } -end - -module AddTagsOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteAccessPointOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RemoveTagsOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RemoveAvailabilityZonesOutput = struct - type t = { availability_zones : AvailabilityZones.t } - - let make ?(availability_zones = []) () = { availability_zones } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_name", (String.to_json v.policy_name)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))) + } + end +module AttachLoadBalancerToSubnetsOutput = + struct + type t = { + subnets: Subnets.t } + let make ?(subnets= []) () = { subnets } + let parse xml = + Some + { + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("subnets", (Subnets.to_json v.subnets))]) + let of_json j = + { + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module CreateAppCookieStickinessPolicyOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeEndPointStateOutput = + struct + type t = { + instance_states: InstanceStates.t } + let make ?(instance_states= []) () = { instance_states } + let parse xml = + Some + { + instance_states = + (Util.of_option [] + (Util.option_bind (Xml.member "InstanceStates" xml) + InstanceStates.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("InstanceStates.member", + (InstanceStates.to_query v.instance_states)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("instance_states", (InstanceStates.to_json v.instance_states))]) + let of_json j = + { + instance_states = + (InstanceStates.of_json + (Util.of_option_exn (Json.lookup j "instance_states"))) + } + end +module AddTagsOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteAccessPointOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveTagsOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RemoveAvailabilityZonesOutput = + struct + type t = { + availability_zones: AvailabilityZones.t } + let make ?(availability_zones= []) () = { availability_zones } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))) + } + end +module ApplySecurityGroupsToLoadBalancerInput = + struct + type t = + { + load_balancer_name: String.t ; + security_groups: SecurityGroups.t } + let make ~load_balancer_name ~security_groups () = + { load_balancer_name; security_groups } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + security_groups = + (Xml.required "SecurityGroups" + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) ]) - - let of_json j = - { availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - } -end - -module ApplySecurityGroupsToLoadBalancerInput = struct - type t = - { load_balancer_name : String.t - ; security_groups : SecurityGroups.t - } - - let make ~load_balancer_name ~security_groups () = - { load_balancer_name; security_groups } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; security_groups = - Xml.required - "SecurityGroups" - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("security_groups", (SecurityGroups.to_json v.security_groups)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))) + } + end +module SetLoadBalancerPoliciesOfListenerInput = + struct + type t = + { + load_balancer_name: String.t ; + load_balancer_port: Integer.t ; + policy_names: PolicyNames.t } + let make ~load_balancer_name ~load_balancer_port ~policy_names () = + { load_balancer_name; load_balancer_port; policy_names } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + load_balancer_port = + (Xml.required "LoadBalancerPort" + (Util.option_bind (Xml.member "LoadBalancerPort" xml) + Integer.parse)); + policy_names = + (Xml.required "PolicyNames" + (Util.option_bind (Xml.member "PolicyNames" xml) + PolicyNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyNames.member", + (PolicyNames.to_query v.policy_names))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("security_groups", SecurityGroups.to_json v.security_groups) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - } -end - -module SetLoadBalancerPoliciesOfListenerInput = struct - type t = - { load_balancer_name : String.t - ; load_balancer_port : Integer.t - ; policy_names : PolicyNames.t - } - - let make ~load_balancer_name ~load_balancer_port ~policy_names () = - { load_balancer_name; load_balancer_port; policy_names } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; load_balancer_port = - Xml.required - "LoadBalancerPort" - (Util.option_bind (Xml.member "LoadBalancerPort" xml) Integer.parse) - ; policy_names = - Xml.required - "PolicyNames" - (Util.option_bind (Xml.member "PolicyNames" xml) PolicyNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PolicyNames.member", PolicyNames.to_query v.policy_names)) - ; Some (Query.Pair ("LoadBalancerPort", Integer.to_query v.load_balancer_port)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_names", PolicyNames.to_json v.policy_names) - ; Some ("load_balancer_port", Integer.to_json v.load_balancer_port) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; load_balancer_port = - Integer.of_json (Util.of_option_exn (Json.lookup j "load_balancer_port")) - ; policy_names = - PolicyNames.of_json (Util.of_option_exn (Json.lookup j "policy_names")) - } -end - -module CreateAppCookieStickinessPolicyInput = struct - type t = - { load_balancer_name : String.t - ; policy_name : String.t - ; cookie_name : String.t - } - - let make ~load_balancer_name ~policy_name ~cookie_name () = - { load_balancer_name; policy_name; cookie_name } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - ; cookie_name = - Xml.required - "CookieName" - (Util.option_bind (Xml.member "CookieName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CookieName", String.to_query v.cookie_name)) - ; Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("cookie_name", String.to_json v.cookie_name) - ; Some ("policy_name", String.to_json v.policy_name) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - ; cookie_name = String.of_json (Util.of_option_exn (Json.lookup j "cookie_name")) - } -end - -module DescribeTagsInput = struct - type t = { load_balancer_names : LoadBalancerNamesMax20.t } - - let make ~load_balancer_names () = { load_balancer_names } - - let parse xml = - Some - { load_balancer_names = - Xml.required - "LoadBalancerNames" - (Util.option_bind - (Xml.member "LoadBalancerNames" xml) - LoadBalancerNamesMax20.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerPort", (Integer.to_query v.load_balancer_port))); + Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy_names", (PolicyNames.to_json v.policy_names)); + Some + ("load_balancer_port", (Integer.to_json v.load_balancer_port)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + load_balancer_port = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_port"))); + policy_names = + (PolicyNames.of_json + (Util.of_option_exn (Json.lookup j "policy_names"))) + } + end +module CreateAppCookieStickinessPolicyInput = + struct + type t = + { + load_balancer_name: String.t ; + policy_name: String.t ; + cookie_name: String.t } + let make ~load_balancer_name ~policy_name ~cookie_name () = + { load_balancer_name; policy_name; cookie_name } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)); + cookie_name = + (Xml.required "CookieName" + (Util.option_bind (Xml.member "CookieName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("CookieName", (String.to_query v.cookie_name))); + Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("cookie_name", (String.to_json v.cookie_name)); + Some ("policy_name", (String.to_json v.policy_name)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))); + cookie_name = + (String.of_json (Util.of_option_exn (Json.lookup j "cookie_name"))) + } + end +module DescribeTagsInput = + struct + type t = { + load_balancer_names: LoadBalancerNamesMax20.t } + let make ~load_balancer_names () = { load_balancer_names } + let parse xml = + Some + { + load_balancer_names = + (Xml.required "LoadBalancerNames" + (Util.option_bind (Xml.member "LoadBalancerNames" xml) + LoadBalancerNamesMax20.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerNames.member", + (LoadBalancerNamesMax20.to_query v.load_balancer_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_names", + (LoadBalancerNamesMax20.to_json v.load_balancer_names))]) + let of_json j = + { + load_balancer_names = + (LoadBalancerNamesMax20.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_names"))) + } + end +module DeleteLoadBalancerPolicyOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DuplicatePolicyNameException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteLoadBalancerListenerOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module TooManyPoliciesException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyLoadBalancerAttributesInput = + struct + type t = + { + load_balancer_name: String.t ; + load_balancer_attributes: LoadBalancerAttributes.t } + let make ~load_balancer_name ~load_balancer_attributes () = + { load_balancer_name; load_balancer_attributes } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + load_balancer_attributes = + (Xml.required "LoadBalancerAttributes" + (Util.option_bind (Xml.member "LoadBalancerAttributes" xml) + LoadBalancerAttributes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerAttributes", + (LoadBalancerAttributes.to_query + v.load_balancer_attributes))); + Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_attributes", + (LoadBalancerAttributes.to_json v.load_balancer_attributes)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + load_balancer_attributes = + (LoadBalancerAttributes.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_attributes"))) + } + end +module CreateLBCookieStickinessPolicyInput = + struct + type t = + { + load_balancer_name: String.t ; + policy_name: String.t ; + cookie_expiration_period: Long.t option } + let make ~load_balancer_name ~policy_name ?cookie_expiration_period () + = { load_balancer_name; policy_name; cookie_expiration_period } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + policy_name = + (Xml.required "PolicyName" + (Util.option_bind (Xml.member "PolicyName" xml) String.parse)); + cookie_expiration_period = + (Util.option_bind (Xml.member "CookieExpirationPeriod" xml) + Long.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cookie_expiration_period + (fun f -> + Query.Pair ("CookieExpirationPeriod", (Long.to_query f))); + Some (Query.Pair ("PolicyName", (String.to_query v.policy_name))); + Some (Query.Pair - ( "LoadBalancerNames.member" - , LoadBalancerNamesMax20.to_query v.load_balancer_names )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("load_balancer_names", LoadBalancerNamesMax20.to_json v.load_balancer_names) - ]) - - let of_json j = - { load_balancer_names = - LoadBalancerNamesMax20.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_names")) - } -end - -module DeleteLoadBalancerPolicyOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DuplicatePolicyNameException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteLoadBalancerListenerOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module TooManyPoliciesException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyLoadBalancerAttributesInput = struct - type t = - { load_balancer_name : String.t - ; load_balancer_attributes : LoadBalancerAttributes.t - } - - let make ~load_balancer_name ~load_balancer_attributes () = - { load_balancer_name; load_balancer_attributes } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; load_balancer_attributes = - Xml.required - "LoadBalancerAttributes" - (Util.option_bind - (Xml.member "LoadBalancerAttributes" xml) + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cookie_expiration_period + (fun f -> ("cookie_expiration_period", (Long.to_json f))); + Some ("policy_name", (String.to_json v.policy_name)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + policy_name = + (String.of_json (Util.of_option_exn (Json.lookup j "policy_name"))); + cookie_expiration_period = + (Util.option_map (Json.lookup j "cookie_expiration_period") + Long.of_json) + } + end +module ApplySecurityGroupsToLoadBalancerOutput = + struct + type t = { + security_groups: SecurityGroups.t } + let make ?(security_groups= []) () = { security_groups } + let parse xml = + Some + { + security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "SecurityGroups" xml) + SecurityGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SecurityGroups.member", + (SecurityGroups.to_query v.security_groups)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("security_groups", (SecurityGroups.to_json v.security_groups))]) + let of_json j = + { + security_groups = + (SecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "security_groups"))) + } + end +module ConfigureHealthCheckInput = + struct + type t = { + load_balancer_name: String.t ; + health_check: HealthCheck.t } + let make ~load_balancer_name ~health_check () = + { load_balancer_name; health_check } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + health_check = + (Xml.required "HealthCheck" + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheck", (HealthCheck.to_query v.health_check))); + Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check", (HealthCheck.to_json v.health_check)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + health_check = + (HealthCheck.of_json + (Util.of_option_exn (Json.lookup j "health_check"))) + } + end +module DuplicateAccessPointNameException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeEndPointStateInput = + struct + type t = { + load_balancer_name: String.t ; + instances: Instances.t } + let make ~load_balancer_name ?(instances= []) () = + { load_balancer_name; instances } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Instances.member", (Instances.to_query v.instances))); + Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (Instances.to_json v.instances)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module DescribeLoadBalancerPolicyTypesInput = + struct + type t = { + policy_type_names: PolicyTypeNames.t } + let make ?(policy_type_names= []) () = { policy_type_names } + let parse xml = + Some + { + policy_type_names = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyTypeNames" xml) + PolicyTypeNames.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyTypeNames.member", + (PolicyTypeNames.to_query v.policy_type_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_type_names", + (PolicyTypeNames.to_json v.policy_type_names))]) + let of_json j = + { + policy_type_names = + (PolicyTypeNames.of_json + (Util.of_option_exn (Json.lookup j "policy_type_names"))) + } + end +module DeregisterEndPointsOutput = + struct + type t = { + instances: Instances.t } + let make ?(instances= []) () = { instances } + let parse xml = + Some + { + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Instances.member", (Instances.to_query v.instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (Instances.to_json v.instances))]) + let of_json j = + { + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module DescribeLoadBalancerAttributesOutput = + struct + type t = { + load_balancer_attributes: LoadBalancerAttributes.t option } + let make ?load_balancer_attributes () = { load_balancer_attributes } + let parse xml = + Some + { + load_balancer_attributes = + (Util.option_bind (Xml.member "LoadBalancerAttributes" xml) LoadBalancerAttributes.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.load_balancer_attributes + (fun f -> + Query.Pair + ("LoadBalancerAttributes", + (LoadBalancerAttributes.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.load_balancer_attributes + (fun f -> + ("load_balancer_attributes", + (LoadBalancerAttributes.to_json f)))]) + let of_json j = + { + load_balancer_attributes = + (Util.option_map (Json.lookup j "load_balancer_attributes") + LoadBalancerAttributes.of_json) + } + end +module SetLoadBalancerListenerSSLCertificateInput = + struct + type t = + { + load_balancer_name: String.t ; + load_balancer_port: Integer.t ; + s_s_l_certificate_id: String.t } + let make ~load_balancer_name ~load_balancer_port ~s_s_l_certificate_id + () = { load_balancer_name; load_balancer_port; s_s_l_certificate_id } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + load_balancer_port = + (Xml.required "LoadBalancerPort" + (Util.option_bind (Xml.member "LoadBalancerPort" xml) + Integer.parse)); + s_s_l_certificate_id = + (Xml.required "SSLCertificateId" + (Util.option_bind (Xml.member "SSLCertificateId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SSLCertificateId", + (String.to_query v.s_s_l_certificate_id))); + Some + (Query.Pair + ("LoadBalancerPort", (Integer.to_query v.load_balancer_port))); + Some (Query.Pair - ( "LoadBalancerAttributes" - , LoadBalancerAttributes.to_query v.load_balancer_attributes )) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "load_balancer_attributes" - , LoadBalancerAttributes.to_json v.load_balancer_attributes ) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; load_balancer_attributes = - LoadBalancerAttributes.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_attributes")) - } -end - -module CreateLBCookieStickinessPolicyInput = struct - type t = - { load_balancer_name : String.t - ; policy_name : String.t - ; cookie_expiration_period : Long.t option - } - - let make ~load_balancer_name ~policy_name ?cookie_expiration_period () = - { load_balancer_name; policy_name; cookie_expiration_period } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; policy_name = - Xml.required - "PolicyName" - (Util.option_bind (Xml.member "PolicyName" xml) String.parse) - ; cookie_expiration_period = - Util.option_bind (Xml.member "CookieExpirationPeriod" xml) Long.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cookie_expiration_period (fun f -> - Query.Pair ("CookieExpirationPeriod", Long.to_query f)) - ; Some (Query.Pair ("PolicyName", String.to_query v.policy_name)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cookie_expiration_period (fun f -> - "cookie_expiration_period", Long.to_json f) - ; Some ("policy_name", String.to_json v.policy_name) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; policy_name = String.of_json (Util.of_option_exn (Json.lookup j "policy_name")) - ; cookie_expiration_period = - Util.option_map (Json.lookup j "cookie_expiration_period") Long.of_json - } -end - -module ApplySecurityGroupsToLoadBalancerOutput = struct - type t = { security_groups : SecurityGroups.t } - - let make ?(security_groups = []) () = { security_groups } - - let parse xml = - Some - { security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "SecurityGroups" xml) SecurityGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("s_s_l_certificate_id", + (String.to_json v.s_s_l_certificate_id)); + Some + ("load_balancer_port", (Integer.to_json v.load_balancer_port)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + load_balancer_port = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_port"))); + s_s_l_certificate_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "s_s_l_certificate_id"))) + } + end +module CreateLBCookieStickinessPolicyOutput = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RegisterEndPointsInput = + struct + type t = { + load_balancer_name: String.t ; + instances: Instances.t } + let make ~load_balancer_name ~instances () = + { load_balancer_name; instances } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + instances = + (Xml.required "Instances" + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Instances.member", (Instances.to_query v.instances))); + Some (Query.Pair - ("SecurityGroups.member", SecurityGroups.to_query v.security_groups)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("security_groups", SecurityGroups.to_json v.security_groups) ]) - - let of_json j = - { security_groups = - SecurityGroups.of_json (Util.of_option_exn (Json.lookup j "security_groups")) - } -end - -module ConfigureHealthCheckInput = struct - type t = - { load_balancer_name : String.t - ; health_check : HealthCheck.t - } - - let make ~load_balancer_name ~health_check () = { load_balancer_name; health_check } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; health_check = - Xml.required - "HealthCheck" - (Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheck", HealthCheck.to_query v.health_check)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check", HealthCheck.to_json v.health_check) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; health_check = - HealthCheck.of_json (Util.of_option_exn (Json.lookup j "health_check")) - } -end - -module DuplicateAccessPointNameException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeEndPointStateInput = struct - type t = - { load_balancer_name : String.t - ; instances : Instances.t - } - - let make ~load_balancer_name ?(instances = []) () = { load_balancer_name; instances } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; instances = - Util.of_option - [] - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instances", Instances.to_json v.instances) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) - } -end - -module DescribeLoadBalancerPolicyTypesInput = struct - type t = { policy_type_names : PolicyTypeNames.t } - - let make ?(policy_type_names = []) () = { policy_type_names } - - let parse xml = - Some - { policy_type_names = - Util.of_option - [] - (Util.option_bind (Xml.member "PolicyTypeNames" xml) PolicyTypeNames.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (Instances.to_json v.instances)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module DeleteLoadBalancerListenerInput = + struct + type t = { + load_balancer_name: String.t ; + load_balancer_ports: Ports.t } + let make ~load_balancer_name ~load_balancer_ports () = + { load_balancer_name; load_balancer_ports } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + load_balancer_ports = + (Xml.required "LoadBalancerPorts" + (Util.option_bind (Xml.member "LoadBalancerPorts" xml) + Ports.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerPorts.member", + (Ports.to_query v.load_balancer_ports))); + Some (Query.Pair - ("PolicyTypeNames.member", PolicyTypeNames.to_query v.policy_type_names)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy_type_names", PolicyTypeNames.to_json v.policy_type_names) ]) - - let of_json j = - { policy_type_names = - PolicyTypeNames.of_json (Util.of_option_exn (Json.lookup j "policy_type_names")) - } -end - -module DeregisterEndPointsOutput = struct - type t = { instances : Instances.t } - - let make ?(instances = []) () = { instances } - - let parse xml = - Some - { instances = - Util.of_option - [] - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("instances", Instances.to_json v.instances) ]) - - let of_json j = - { instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) } -end - -module DescribeLoadBalancerAttributesOutput = struct - type t = { load_balancer_attributes : LoadBalancerAttributes.t option } - - let make ?load_balancer_attributes () = { load_balancer_attributes } - - let parse xml = - Some - { load_balancer_attributes = - Util.option_bind - (Xml.member "LoadBalancerAttributes" xml) - LoadBalancerAttributes.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.load_balancer_attributes (fun f -> - Query.Pair ("LoadBalancerAttributes", LoadBalancerAttributes.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.load_balancer_attributes (fun f -> - "load_balancer_attributes", LoadBalancerAttributes.to_json f) - ]) - - let of_json j = - { load_balancer_attributes = - Util.option_map - (Json.lookup j "load_balancer_attributes") - LoadBalancerAttributes.of_json - } -end - -module SetLoadBalancerListenerSSLCertificateInput = struct - type t = - { load_balancer_name : String.t - ; load_balancer_port : Integer.t - ; s_s_l_certificate_id : String.t - } - - let make ~load_balancer_name ~load_balancer_port ~s_s_l_certificate_id () = - { load_balancer_name; load_balancer_port; s_s_l_certificate_id } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; load_balancer_port = - Xml.required - "LoadBalancerPort" - (Util.option_bind (Xml.member "LoadBalancerPort" xml) Integer.parse) - ; s_s_l_certificate_id = - Xml.required - "SSLCertificateId" - (Util.option_bind (Xml.member "SSLCertificateId" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SSLCertificateId", String.to_query v.s_s_l_certificate_id)) - ; Some (Query.Pair ("LoadBalancerPort", Integer.to_query v.load_balancer_port)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("s_s_l_certificate_id", String.to_json v.s_s_l_certificate_id) - ; Some ("load_balancer_port", Integer.to_json v.load_balancer_port) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; load_balancer_port = - Integer.of_json (Util.of_option_exn (Json.lookup j "load_balancer_port")) - ; s_s_l_certificate_id = - String.of_json (Util.of_option_exn (Json.lookup j "s_s_l_certificate_id")) - } -end - -module CreateLBCookieStickinessPolicyOutput = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RegisterEndPointsInput = struct - type t = - { load_balancer_name : String.t - ; instances : Instances.t - } - - let make ~load_balancer_name ~instances () = { load_balancer_name; instances } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; instances = - Xml.required - "Instances" - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instances", Instances.to_json v.instances) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) - } -end - -module DeleteLoadBalancerListenerInput = struct - type t = - { load_balancer_name : String.t - ; load_balancer_ports : Ports.t - } - - let make ~load_balancer_name ~load_balancer_ports () = - { load_balancer_name; load_balancer_ports } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; load_balancer_ports = - Xml.required - "LoadBalancerPorts" - (Util.option_bind (Xml.member "LoadBalancerPorts" xml) Ports.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("LoadBalancerPorts.member", Ports.to_query v.load_balancer_ports)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("load_balancer_ports", Ports.to_json v.load_balancer_ports) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; load_balancer_ports = - Ports.of_json (Util.of_option_exn (Json.lookup j "load_balancer_ports")) - } -end - -module RegisterEndPointsOutput = struct - type t = { instances : Instances.t } - - let make ?(instances = []) () = { instances } - - let parse xml = - Some - { instances = - Util.of_option - [] - (Util.option_bind (Xml.member "Instances" xml) Instances.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Instances.member", Instances.to_query v.instances)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("instances", Instances.to_json v.instances) ]) - - let of_json j = - { instances = Instances.of_json (Util.of_option_exn (Json.lookup j "instances")) } -end - -module AddAvailabilityZonesInput = struct - type t = - { load_balancer_name : String.t - ; availability_zones : AvailabilityZones.t - } - - let make ~load_balancer_name ~availability_zones () = - { load_balancer_name; availability_zones } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; availability_zones = - Xml.required - "AvailabilityZones" - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_ports", (Ports.to_json v.load_balancer_ports)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + load_balancer_ports = + (Ports.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_ports"))) + } + end +module RegisterEndPointsOutput = + struct + type t = { + instances: Instances.t } + let make ?(instances= []) () = { instances } + let parse xml = + Some + { + instances = + (Util.of_option [] + (Util.option_bind (Xml.member "Instances" xml) Instances.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Instances.member", (Instances.to_query v.instances)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instances", (Instances.to_json v.instances))]) + let of_json j = + { + instances = + (Instances.of_json (Util.of_option_exn (Json.lookup j "instances"))) + } + end +module AddAvailabilityZonesInput = + struct + type t = + { + load_balancer_name: String.t ; + availability_zones: AvailabilityZones.t } + let make ~load_balancer_name ~availability_zones () = + { load_balancer_name; availability_zones } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + availability_zones = + (Xml.required "AvailabilityZones" + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - } -end - -module DescribeLoadBalancerPolicyTypesOutput = struct - type t = { policy_type_descriptions : PolicyTypeDescriptions.t } - - let make ?(policy_type_descriptions = []) () = { policy_type_descriptions } - - let parse xml = - Some - { policy_type_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "PolicyTypeDescriptions" xml) - PolicyTypeDescriptions.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))) + } + end +module DescribeLoadBalancerPolicyTypesOutput = + struct + type t = { + policy_type_descriptions: PolicyTypeDescriptions.t } + let make ?(policy_type_descriptions= []) () = + { policy_type_descriptions } + let parse xml = + Some + { + policy_type_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "PolicyTypeDescriptions" xml) + PolicyTypeDescriptions.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PolicyTypeDescriptions.member", + (PolicyTypeDescriptions.to_query + v.policy_type_descriptions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("policy_type_descriptions", + (PolicyTypeDescriptions.to_json v.policy_type_descriptions))]) + let of_json j = + { + policy_type_descriptions = + (PolicyTypeDescriptions.of_json + (Util.of_option_exn (Json.lookup j "policy_type_descriptions"))) + } + end +module DeleteAccessPointInput = + struct + type t = { + load_balancer_name: String.t } + let make ~load_balancer_name () = { load_balancer_name } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))) + } + end +module DescribeAccessPointsOutput = + struct + type t = + { + load_balancer_descriptions: LoadBalancerDescriptions.t ; + next_marker: String.t option } + let make ?(load_balancer_descriptions= []) ?next_marker () = + { load_balancer_descriptions; next_marker } + let parse xml = + Some + { + load_balancer_descriptions = + (Util.of_option [] + (Util.option_bind (Xml.member "LoadBalancerDescriptions" xml) + LoadBalancerDescriptions.parse)); + next_marker = + (Util.option_bind (Xml.member "NextMarker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_marker + (fun f -> Query.Pair ("NextMarker", (String.to_query f))); + Some (Query.Pair - ( "PolicyTypeDescriptions.member" - , PolicyTypeDescriptions.to_query v.policy_type_descriptions )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "policy_type_descriptions" - , PolicyTypeDescriptions.to_json v.policy_type_descriptions ) - ]) - - let of_json j = - { policy_type_descriptions = - PolicyTypeDescriptions.of_json - (Util.of_option_exn (Json.lookup j "policy_type_descriptions")) - } -end - -module DeleteAccessPointInput = struct - type t = { load_balancer_name : String.t } - - let make ~load_balancer_name () = { load_balancer_name } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("load_balancer_name", String.to_json v.load_balancer_name) ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - } -end - -module DescribeAccessPointsOutput = struct - type t = - { load_balancer_descriptions : LoadBalancerDescriptions.t - ; next_marker : String.t option - } - - let make ?(load_balancer_descriptions = []) ?next_marker () = - { load_balancer_descriptions; next_marker } - - let parse xml = - Some - { load_balancer_descriptions = - Util.of_option - [] - (Util.option_bind - (Xml.member "LoadBalancerDescriptions" xml) - LoadBalancerDescriptions.parse) - ; next_marker = Util.option_bind (Xml.member "NextMarker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_marker (fun f -> - Query.Pair ("NextMarker", String.to_query f)) - ; Some + ("LoadBalancerDescriptions.member", + (LoadBalancerDescriptions.to_query + v.load_balancer_descriptions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_marker + (fun f -> ("next_marker", (String.to_json f))); + Some + ("load_balancer_descriptions", + (LoadBalancerDescriptions.to_json v.load_balancer_descriptions))]) + let of_json j = + { + load_balancer_descriptions = + (LoadBalancerDescriptions.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_descriptions"))); + next_marker = + (Util.option_map (Json.lookup j "next_marker") String.of_json) + } + end +module AccessPointNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DetachLoadBalancerFromSubnetsInput = + struct + type t = { + load_balancer_name: String.t ; + subnets: Subnets.t } + let make ~load_balancer_name ~subnets () = + { load_balancer_name; subnets } + let parse xml = + Some + { + load_balancer_name = + (Xml.required "LoadBalancerName" + (Util.option_bind (Xml.member "LoadBalancerName" xml) + String.parse)); + subnets = + (Xml.required "Subnets" + (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (Subnets.to_query v.subnets))); + Some (Query.Pair - ( "LoadBalancerDescriptions.member" - , LoadBalancerDescriptions.to_query v.load_balancer_descriptions )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_marker (fun f -> "next_marker", String.to_json f) - ; Some - ( "load_balancer_descriptions" - , LoadBalancerDescriptions.to_json v.load_balancer_descriptions ) - ]) - - let of_json j = - { load_balancer_descriptions = - LoadBalancerDescriptions.of_json - (Util.of_option_exn (Json.lookup j "load_balancer_descriptions")) - ; next_marker = Util.option_map (Json.lookup j "next_marker") String.of_json - } -end - -module AccessPointNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DetachLoadBalancerFromSubnetsInput = struct - type t = - { load_balancer_name : String.t - ; subnets : Subnets.t - } - - let make ~load_balancer_name ~subnets () = { load_balancer_name; subnets } - - let parse xml = - Some - { load_balancer_name = - Xml.required - "LoadBalancerName" - (Util.option_bind (Xml.member "LoadBalancerName" xml) String.parse) - ; subnets = - Xml.required - "Subnets" - (Util.option_bind (Xml.member "Subnets" xml) Subnets.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", Subnets.to_query v.subnets)) - ; Some (Query.Pair ("LoadBalancerName", String.to_query v.load_balancer_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnets", Subnets.to_json v.subnets) - ; Some ("load_balancer_name", String.to_json v.load_balancer_name) - ]) - - let of_json j = - { load_balancer_name = - String.of_json (Util.of_option_exn (Json.lookup j "load_balancer_name")) - ; subnets = Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets")) - } -end - -module InvalidConfigurationRequestException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module PolicyNotFoundException = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end + ("LoadBalancerName", (String.to_query v.load_balancer_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnets", (Subnets.to_json v.subnets)); + Some ("load_balancer_name", (String.to_json v.load_balancer_name))]) + let of_json j = + { + load_balancer_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "load_balancer_name"))); + subnets = + (Subnets.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module InvalidConfigurationRequestException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module PolicyNotFoundException = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end \ No newline at end of file diff --git a/libraries/elasticloadbalancing/lib_test/dune b/libraries/elasticloadbalancing/lib_test/dune index 9f33fec28..47994ad49 100644 --- a/libraries/elasticloadbalancing/lib_test/dune +++ b/libraries/elasticloadbalancing/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_elasticloadbalancing_test) - (libraries aws aws_elasticloadbalancing aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_elasticloadbalancing aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/elasticloadbalancing/lib_test/test_async.ml b/libraries/elasticloadbalancing/lib_test/test_async.ml index 2f6bac054..1af303b5b 100644 --- a/libraries/elasticloadbalancing/lib_test/test_async.ml +++ b/libraries/elasticloadbalancing/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_elasticloadbalancing_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/elasticloadbalancing/lib_test/test_lwt.ml b/libraries/elasticloadbalancing/lib_test/test_lwt.ml index 9375a18ad..1b021c3e3 100644 --- a/libraries/elasticloadbalancing/lib_test/test_lwt.ml +++ b/libraries/elasticloadbalancing/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_elasticloadbalancing_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/elasticmapreduce/lib/addInstanceFleet.ml b/libraries/elasticmapreduce/lib/addInstanceFleet.ml index 9a43df61f..f88d48c34 100644 --- a/libraries/elasticmapreduce/lib/addInstanceFleet.ml +++ b/libraries/elasticmapreduce/lib/addInstanceFleet.ml @@ -1,59 +1,57 @@ 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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "AddInstanceFleet" ] ] + [("Version", ["2009-03-31"]); ("Action", ["AddInstanceFleet"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AddInstanceFleetInput.to_query req))))) - in - `POST, uri, [] - + (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) + 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 + 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 - (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 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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addInstanceFleet.mli b/libraries/elasticmapreduce/lib/addInstanceFleet.mli index 3d30c5af9..dab487e60 100644 --- a/libraries/elasticmapreduce/lib/addInstanceFleet.mli +++ b/libraries/elasticmapreduce/lib/addInstanceFleet.mli @@ -1,10 +1,7 @@ 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 + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.ml b/libraries/elasticmapreduce/lib/addInstanceGroups.ml index 863f3343e..43d649ff1 100644 --- a/libraries/elasticmapreduce/lib/addInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.ml @@ -1,59 +1,58 @@ 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 + 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 -> `Error - (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 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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.mli b/libraries/elasticmapreduce/lib/addInstanceGroups.mli index 2abedad93..2d1eb3f37 100644 --- a/libraries/elasticmapreduce/lib/addInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.mli @@ -1,10 +1,7 @@ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml index 7016344a2..0ba93123c 100644 --- a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml @@ -1,58 +1,57 @@ 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 + 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 -> `Error - (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 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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.mli b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli index 4d6479969..934011df5 100644 --- a/libraries/elasticmapreduce/lib/addJobFlowSteps.mli +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.mli @@ -1,10 +1,7 @@ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addTags.ml b/libraries/elasticmapreduce/lib/addTags.ml index ea1aaa99d..731ec5bc6 100644 --- a/libraries/elasticmapreduce/lib/addTags.ml +++ b/libraries/elasticmapreduce/lib/addTags.ml @@ -1,36 +1,28 @@ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/addTags.mli b/libraries/elasticmapreduce/lib/addTags.mli index c407166aa..98213128e 100644 --- a/libraries/elasticmapreduce/lib/addTags.mli +++ b/libraries/elasticmapreduce/lib/addTags.mli @@ -1,10 +1,7 @@ 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/cancelSteps.ml b/libraries/elasticmapreduce/lib/cancelSteps.ml index 7c5bde01d..d07afcd5a 100644 --- a/libraries/elasticmapreduce/lib/cancelSteps.ml +++ b/libraries/elasticmapreduce/lib/cancelSteps.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = CancelStepsInput.t - type output = CancelStepsOutput.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", [ "CancelSteps" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-03-31"]); ("Action", ["CancelSteps"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CancelStepsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CancelStepsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CancelStepsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CancelStepsOutput.parse) + Util.or_error (Util.option_bind resp CancelStepsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CancelStepsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CancelStepsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CancelStepsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CancelStepsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/cancelSteps.mli b/libraries/elasticmapreduce/lib/cancelSteps.mli index 49e909f8f..b9ccf4a5e 100644 --- a/libraries/elasticmapreduce/lib/cancelSteps.mli +++ b/libraries/elasticmapreduce/lib/cancelSteps.mli @@ -1,10 +1,7 @@ open Types - type input = CancelStepsInput.t - type output = CancelStepsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml index 4f580ab7f..7778558a6 100644 --- a/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml +++ b/libraries/elasticmapreduce/lib/createSecurityConfiguration.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CreateSecurityConfigurationInput.t - type output = CreateSecurityConfigurationOutput.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", [ "CreateSecurityConfiguration" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["CreateSecurityConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateSecurityConfigurationInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateSecurityConfigurationInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateSecurityConfigurationOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateSecurityConfigurationOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateSecurityConfigurationOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateSecurityConfigurationOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateSecurityConfigurationOutput - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli index 1ef1d0f21..06b63d242 100644 --- a/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli +++ b/libraries/elasticmapreduce/lib/createSecurityConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = CreateSecurityConfigurationInput.t - type output = CreateSecurityConfigurationOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml index 6b7980ce0..e112f9b89 100644 --- a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml +++ b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DeleteSecurityConfigurationInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "DeleteSecurityConfiguration" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["DeleteSecurityConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteSecurityConfigurationInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteSecurityConfigurationInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli index f5f80664d..e42333082 100644 --- a/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli +++ b/libraries/elasticmapreduce/lib/deleteSecurityConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteSecurityConfigurationInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeCluster.ml b/libraries/elasticmapreduce/lib/describeCluster.ml index d014f1807..3740b91f1 100644 --- a/libraries/elasticmapreduce/lib/describeCluster.ml +++ b/libraries/elasticmapreduce/lib/describeCluster.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = DescribeClusterInput.t - type output = DescribeClusterOutput.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", [ "DescribeCluster" ] ] + [("Version", ["2009-03-31"]); ("Action", ["DescribeCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeClusterInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeClusterInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeClusterResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeClusterOutput.parse) + Util.or_error (Util.option_bind resp DescribeClusterOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeClusterOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeClusterOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeClusterOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeClusterOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeCluster.mli b/libraries/elasticmapreduce/lib/describeCluster.mli index 5ce8ada8f..6eb40f85c 100644 --- a/libraries/elasticmapreduce/lib/describeCluster.mli +++ b/libraries/elasticmapreduce/lib/describeCluster.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeClusterInput.t - type output = DescribeClusterOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.ml b/libraries/elasticmapreduce/lib/describeJobFlows.ml index 1b7e40ef4..b2a69240f 100644 --- a/libraries/elasticmapreduce/lib/describeJobFlows.ml +++ b/libraries/elasticmapreduce/lib/describeJobFlows.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = DescribeJobFlowsInput.t - type output = DescribeJobFlowsOutput.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", [ "DescribeJobFlows" ] ] + [("Version", ["2009-03-31"]); ("Action", ["DescribeJobFlows"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeJobFlowsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeJobFlowsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeJobFlowsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeJobFlowsOutput.parse) + Util.or_error (Util.option_bind resp DescribeJobFlowsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeJobFlowsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeJobFlowsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeJobFlowsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeJobFlowsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.mli b/libraries/elasticmapreduce/lib/describeJobFlows.mli index c524b971a..2e5161249 100644 --- a/libraries/elasticmapreduce/lib/describeJobFlows.mli +++ b/libraries/elasticmapreduce/lib/describeJobFlows.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeJobFlowsInput.t - type output = DescribeJobFlowsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeNotebookExecution.ml b/libraries/elasticmapreduce/lib/describeNotebookExecution.ml new file mode 100644 index 000000000..76a5ae893 --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeNotebookExecution.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = DescribeNotebookExecutionInput.t +type output = DescribeNotebookExecutionOutput.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", ["DescribeNotebookExecution"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DescribeNotebookExecutionInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "DescribeNotebookExecutionResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp DescribeNotebookExecutionOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeNotebookExecutionOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeNotebookExecutionOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeNotebookExecution.mli b/libraries/elasticmapreduce/lib/describeNotebookExecution.mli new file mode 100644 index 000000000..92359944f --- /dev/null +++ b/libraries/elasticmapreduce/lib/describeNotebookExecution.mli @@ -0,0 +1,7 @@ +open Types +type input = DescribeNotebookExecutionInput.t +type output = DescribeNotebookExecutionOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml index 463b92d9d..17a00a7e2 100644 --- a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml +++ b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DescribeSecurityConfigurationInput.t - type output = DescribeSecurityConfigurationOutput.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", [ "DescribeSecurityConfiguration" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["DescribeSecurityConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeSecurityConfigurationInput.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeSecurityConfigurationInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DescribeSecurityConfigurationOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeSecurityConfigurationOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeSecurityConfigurationOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeSecurityConfigurationOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeSecurityConfigurationOutput - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli index fee5c0e1a..4d770ea96 100644 --- a/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli +++ b/libraries/elasticmapreduce/lib/describeSecurityConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeSecurityConfigurationInput.t - type output = DescribeSecurityConfigurationOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeStep.ml b/libraries/elasticmapreduce/lib/describeStep.ml index efe7109b8..953a0cffa 100644 --- a/libraries/elasticmapreduce/lib/describeStep.ml +++ b/libraries/elasticmapreduce/lib/describeStep.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DescribeStepInput.t - type output = DescribeStepOutput.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", [ "DescribeStep" ] ] + [("Version", ["2009-03-31"]); ("Action", ["DescribeStep"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeStepInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeStepInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeStepResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeStepOutput.parse) + Util.or_error (Util.option_bind resp DescribeStepOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DescribeStepOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeStepOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeStepOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeStepOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/describeStep.mli b/libraries/elasticmapreduce/lib/describeStep.mli index 74c79349d..51d7ceaf9 100644 --- a/libraries/elasticmapreduce/lib/describeStep.mli +++ b/libraries/elasticmapreduce/lib/describeStep.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeStepInput.t - type output = DescribeStepOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/dune b/libraries/elasticmapreduce/lib/dune index fd6e572f2..e90c91da4 100644 --- a/libraries/elasticmapreduce/lib/dune +++ b/libraries/elasticmapreduce/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_elasticmapreduce) + (name aws_elasticmapreduce) (public_name aws-elasticmapreduce) (synopsis "aws-Amazon Elastic MapReduce") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/elasticmapreduce/lib/errors_internal.ml b/libraries/elasticmapreduce/lib/errors_internal.ml index 21ef98bf5..834b1eb9f 100644 --- a/libraries/elasticmapreduce/lib/errors_internal.ml +++ b/libraries/elasticmapreduce/lib/errors_internal.ml @@ -1,64 +1,61 @@ type t = - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InternalServerError - | InternalServerException - | InvalidAction - | InvalidClientTokenId - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidRequestException - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InternalServerError + | InternalServerException + | InvalidAction + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidRequestException + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -91,7 +88,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -124,7 +120,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -157,4 +152,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.ml b/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.ml new file mode 100644 index 000000000..f818cd71e --- /dev/null +++ b/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = unit +type output = GetBlockPublicAccessConfigurationOutput.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))) + [("Version", ["2009-03-31"]); + ("Action", ["GetBlockPublicAccessConfiguration"])] in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Xml.member "GetBlockPublicAccessConfigurationResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp GetBlockPublicAccessConfigurationOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBlockPublicAccessConfigurationOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBlockPublicAccessConfigurationOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.mli b/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.mli new file mode 100644 index 000000000..0fc36e8b3 --- /dev/null +++ b/libraries/elasticmapreduce/lib/getBlockPublicAccessConfiguration.mli @@ -0,0 +1,7 @@ +open Types +type input = unit +type output = GetBlockPublicAccessConfigurationOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/getManagedScalingPolicy.ml b/libraries/elasticmapreduce/lib/getManagedScalingPolicy.ml new file mode 100644 index 000000000..9a669446f --- /dev/null +++ b/libraries/elasticmapreduce/lib/getManagedScalingPolicy.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = GetManagedScalingPolicyInput.t +type output = GetManagedScalingPolicyOutput.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", ["GetManagedScalingPolicy"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (GetManagedScalingPolicyInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "GetManagedScalingPolicyResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp GetManagedScalingPolicyOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetManagedScalingPolicyOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetManagedScalingPolicyOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/getManagedScalingPolicy.mli b/libraries/elasticmapreduce/lib/getManagedScalingPolicy.mli new file mode 100644 index 000000000..0d105a441 --- /dev/null +++ b/libraries/elasticmapreduce/lib/getManagedScalingPolicy.mli @@ -0,0 +1,7 @@ +open Types +type input = GetManagedScalingPolicyInput.t +type output = GetManagedScalingPolicyOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.ml b/libraries/elasticmapreduce/lib/listBootstrapActions.ml index d6058ed0d..34cfaf1b8 100644 --- a/libraries/elasticmapreduce/lib/listBootstrapActions.ml +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListBootstrapActionsInput.t - type output = ListBootstrapActionsOutput.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", [ "ListBootstrapActions" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ListBootstrapActions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListBootstrapActionsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListBootstrapActionsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListBootstrapActionsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListBootstrapActionsOutput.parse) + Util.or_error (Util.option_bind resp ListBootstrapActionsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListBootstrapActionsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListBootstrapActionsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListBootstrapActionsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListBootstrapActionsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.mli b/libraries/elasticmapreduce/lib/listBootstrapActions.mli index abb1264d0..677f6aaff 100644 --- a/libraries/elasticmapreduce/lib/listBootstrapActions.mli +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.mli @@ -1,10 +1,7 @@ open Types - type input = ListBootstrapActionsInput.t - type output = ListBootstrapActionsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listClusters.ml b/libraries/elasticmapreduce/lib/listClusters.ml index 81a0660cd..46baea1b7 100644 --- a/libraries/elasticmapreduce/lib/listClusters.ml +++ b/libraries/elasticmapreduce/lib/listClusters.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ListClustersInput.t - type output = ListClustersOutput.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", [ "ListClusters" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ListClusters"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListClustersInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListClustersInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListClustersResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListClustersOutput.parse) + Util.or_error (Util.option_bind resp ListClustersOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListClustersOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListClustersOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListClustersOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListClustersOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listClusters.mli b/libraries/elasticmapreduce/lib/listClusters.mli index 162a86c58..4256f4d75 100644 --- a/libraries/elasticmapreduce/lib/listClusters.mli +++ b/libraries/elasticmapreduce/lib/listClusters.mli @@ -1,10 +1,7 @@ open Types - type input = ListClustersInput.t - type output = ListClustersOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceFleets.ml b/libraries/elasticmapreduce/lib/listInstanceFleets.ml index 59592afba..5c1d98f85 100644 --- a/libraries/elasticmapreduce/lib/listInstanceFleets.ml +++ b/libraries/elasticmapreduce/lib/listInstanceFleets.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListInstanceFleetsInput.t - type output = ListInstanceFleetsOutput.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", [ "ListInstanceFleets" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ListInstanceFleets"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListInstanceFleetsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListInstanceFleetsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListInstanceFleetsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListInstanceFleetsOutput.parse) + Util.or_error (Util.option_bind resp ListInstanceFleetsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListInstanceFleetsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListInstanceFleetsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListInstanceFleetsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListInstanceFleetsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceFleets.mli b/libraries/elasticmapreduce/lib/listInstanceFleets.mli index a920ff8a6..f9c1676c7 100644 --- a/libraries/elasticmapreduce/lib/listInstanceFleets.mli +++ b/libraries/elasticmapreduce/lib/listInstanceFleets.mli @@ -1,10 +1,7 @@ open Types - type input = ListInstanceFleetsInput.t - type output = ListInstanceFleetsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.ml b/libraries/elasticmapreduce/lib/listInstanceGroups.ml index a33d8ea50..995681844 100644 --- a/libraries/elasticmapreduce/lib/listInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListInstanceGroupsInput.t - type output = ListInstanceGroupsOutput.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", [ "ListInstanceGroups" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ListInstanceGroups"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListInstanceGroupsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListInstanceGroupsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListInstanceGroupsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListInstanceGroupsOutput.parse) + Util.or_error (Util.option_bind resp ListInstanceGroupsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListInstanceGroupsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListInstanceGroupsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListInstanceGroupsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListInstanceGroupsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.mli b/libraries/elasticmapreduce/lib/listInstanceGroups.mli index bf03f65ec..210b42c37 100644 --- a/libraries/elasticmapreduce/lib/listInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.mli @@ -1,10 +1,7 @@ open Types - type input = ListInstanceGroupsInput.t - type output = ListInstanceGroupsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstances.ml b/libraries/elasticmapreduce/lib/listInstances.ml index fb8004c39..2bfdd7820 100644 --- a/libraries/elasticmapreduce/lib/listInstances.ml +++ b/libraries/elasticmapreduce/lib/listInstances.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = ListInstancesInput.t - type output = ListInstancesOutput.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", [ "ListInstances" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ListInstances"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListInstancesInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListInstancesInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListInstancesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListInstancesOutput.parse) + Util.or_error (Util.option_bind resp ListInstancesOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListInstancesOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListInstancesOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListInstancesOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListInstancesOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listInstances.mli b/libraries/elasticmapreduce/lib/listInstances.mli index 81f8a294e..369cb8e23 100644 --- a/libraries/elasticmapreduce/lib/listInstances.mli +++ b/libraries/elasticmapreduce/lib/listInstances.mli @@ -1,10 +1,7 @@ open Types - type input = ListInstancesInput.t - type output = ListInstancesOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listNotebookExecutions.ml b/libraries/elasticmapreduce/lib/listNotebookExecutions.ml new file mode 100644 index 000000000..29e8086ef --- /dev/null +++ b/libraries/elasticmapreduce/lib/listNotebookExecutions.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = ListNotebookExecutionsInput.t +type output = ListNotebookExecutionsOutput.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", ["ListNotebookExecutions"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListNotebookExecutionsInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ListNotebookExecutionsResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp ListNotebookExecutionsOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListNotebookExecutionsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListNotebookExecutionsOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listNotebookExecutions.mli b/libraries/elasticmapreduce/lib/listNotebookExecutions.mli new file mode 100644 index 000000000..16654da03 --- /dev/null +++ b/libraries/elasticmapreduce/lib/listNotebookExecutions.mli @@ -0,0 +1,7 @@ +open Types +type input = ListNotebookExecutionsInput.t +type output = ListNotebookExecutionsOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml b/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml index 5e6f9290d..ff304d1e2 100644 --- a/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml +++ b/libraries/elasticmapreduce/lib/listSecurityConfigurations.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ListSecurityConfigurationsInput.t - type output = ListSecurityConfigurationsOutput.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", [ "ListSecurityConfigurations" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["ListSecurityConfigurations"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListSecurityConfigurationsInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (ListSecurityConfigurationsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ListSecurityConfigurationsOutput.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ListSecurityConfigurationsOutput." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListSecurityConfigurationsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListSecurityConfigurationsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListSecurityConfigurationsOutput - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli b/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli index 92fc5a8f3..66350deeb 100644 --- a/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli +++ b/libraries/elasticmapreduce/lib/listSecurityConfigurations.mli @@ -1,10 +1,7 @@ open Types - type input = ListSecurityConfigurationsInput.t - type output = ListSecurityConfigurationsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSteps.ml b/libraries/elasticmapreduce/lib/listSteps.ml index 2879a37b8..462852bf9 100644 --- a/libraries/elasticmapreduce/lib/listSteps.ml +++ b/libraries/elasticmapreduce/lib/listSteps.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = ListStepsInput.t - type output = ListStepsOutput.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", [ "ListSteps" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-03-31"]); ("Action", ["ListSteps"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListStepsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListStepsInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListStepsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListStepsOutput.parse) + Util.or_error (Util.option_bind resp ListStepsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListStepsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ListStepsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListStepsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListStepsOutput - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/listSteps.mli b/libraries/elasticmapreduce/lib/listSteps.mli index 12a0fc6b3..5741548ed 100644 --- a/libraries/elasticmapreduce/lib/listSteps.mli +++ b/libraries/elasticmapreduce/lib/listSteps.mli @@ -1,10 +1,7 @@ open Types - type input = ListStepsInput.t - type output = ListStepsOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyCluster.ml b/libraries/elasticmapreduce/lib/modifyCluster.ml new file mode 100644 index 000000000..3a2a29b05 --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyCluster.ml @@ -0,0 +1,57 @@ +open Types +open Aws +type input = ModifyClusterInput.t +type output = ModifyClusterOutput.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", ["ModifyCluster"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ModifyClusterInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "ModifyClusterResponse" (snd xml) in + try + Util.or_error (Util.option_bind resp ModifyClusterOutput.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed ModifyClusterOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyClusterOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyCluster.mli b/libraries/elasticmapreduce/lib/modifyCluster.mli new file mode 100644 index 000000000..7e6353722 --- /dev/null +++ b/libraries/elasticmapreduce/lib/modifyCluster.mli @@ -0,0 +1,7 @@ +open Types +type input = ModifyClusterInput.t +type output = ModifyClusterOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml b/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml index 955b12201..c0954be21 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml +++ b/libraries/elasticmapreduce/lib/modifyInstanceFleet.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = ModifyInstanceFleetInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "ModifyInstanceFleet" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ModifyInstanceFleet"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyInstanceFleetInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyInstanceFleetInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli b/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli index c45eb271c..a83999a51 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli +++ b/libraries/elasticmapreduce/lib/modifyInstanceFleet.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyInstanceFleetInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml index ae31119d6..369fce8a4 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = ModifyInstanceGroupsInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "ModifyInstanceGroups" ] ] + [("Version", ["2009-03-31"]); ("Action", ["ModifyInstanceGroups"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyInstanceGroupsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyInstanceGroupsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli index e08b0efb8..7ef1ddb6c 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyInstanceGroupsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml index 526b15d85..f8f0bb7fd 100644 --- a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml +++ b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = PutAutoScalingPolicyInput.t - type output = PutAutoScalingPolicyOutput.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", [ "PutAutoScalingPolicy" ] ] + [("Version", ["2009-03-31"]); ("Action", ["PutAutoScalingPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutAutoScalingPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutAutoScalingPolicyInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "PutAutoScalingPolicyResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp PutAutoScalingPolicyOutput.parse) + Util.or_error (Util.option_bind resp PutAutoScalingPolicyOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed PutAutoScalingPolicyOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PutAutoScalingPolicyOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PutAutoScalingPolicyOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PutAutoScalingPolicyOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli index ca2320dae..6093725f8 100644 --- a/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli +++ b/libraries/elasticmapreduce/lib/putAutoScalingPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = PutAutoScalingPolicyInput.t - type output = PutAutoScalingPolicyOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.ml b/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.ml new file mode 100644 index 000000000..990c4f6c6 --- /dev/null +++ b/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.ml @@ -0,0 +1,32 @@ +open Types +open Aws +type input = PutBlockPublicAccessConfigurationInput.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", ["PutBlockPublicAccessConfiguration"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render + (PutBlockPublicAccessConfigurationInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.mli b/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.mli new file mode 100644 index 000000000..edb70958a --- /dev/null +++ b/libraries/elasticmapreduce/lib/putBlockPublicAccessConfiguration.mli @@ -0,0 +1,7 @@ +open Types +type input = PutBlockPublicAccessConfigurationInput.t +type output = unit +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putManagedScalingPolicy.ml b/libraries/elasticmapreduce/lib/putManagedScalingPolicy.ml new file mode 100644 index 000000000..2c10ca85e --- /dev/null +++ b/libraries/elasticmapreduce/lib/putManagedScalingPolicy.ml @@ -0,0 +1,31 @@ +open Types +open Aws +type input = PutManagedScalingPolicyInput.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", ["PutManagedScalingPolicy"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (PutManagedScalingPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/putManagedScalingPolicy.mli b/libraries/elasticmapreduce/lib/putManagedScalingPolicy.mli new file mode 100644 index 000000000..24091017a --- /dev/null +++ b/libraries/elasticmapreduce/lib/putManagedScalingPolicy.mli @@ -0,0 +1,7 @@ +open Types +type input = PutManagedScalingPolicyInput.t +type output = unit +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml index e2b889359..c5965f011 100644 --- a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml +++ b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = RemoveAutoScalingPolicyInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "RemoveAutoScalingPolicy" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["RemoveAutoScalingPolicy"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RemoveAutoScalingPolicyInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (RemoveAutoScalingPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli index e732d46be..21721a363 100644 --- a/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli +++ b/libraries/elasticmapreduce/lib/removeAutoScalingPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveAutoScalingPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.ml b/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.ml new file mode 100644 index 000000000..65e6cbfdc --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.ml @@ -0,0 +1,31 @@ +open Types +open Aws +type input = RemoveManagedScalingPolicyInput.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", ["RemoveManagedScalingPolicy"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (RemoveManagedScalingPolicyInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.mli b/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.mli new file mode 100644 index 000000000..6d51fe13f --- /dev/null +++ b/libraries/elasticmapreduce/lib/removeManagedScalingPolicy.mli @@ -0,0 +1,7 @@ +open Types +type input = RemoveManagedScalingPolicyInput.t +type output = unit +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeTags.ml b/libraries/elasticmapreduce/lib/removeTags.ml index 8e190a4d6..1b64b0008 100644 --- a/libraries/elasticmapreduce/lib/removeTags.ml +++ b/libraries/elasticmapreduce/lib/removeTags.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = RemoveTagsInput.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", [ "RemoveTags" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-03-31"]); ("Action", ["RemoveTags"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RemoveTagsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RemoveTagsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/removeTags.mli b/libraries/elasticmapreduce/lib/removeTags.mli index db40a6a91..ae480b1f0 100644 --- a/libraries/elasticmapreduce/lib/removeTags.mli +++ b/libraries/elasticmapreduce/lib/removeTags.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveTagsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/runJobFlow.ml b/libraries/elasticmapreduce/lib/runJobFlow.ml index 9fd0835e8..271936c8f 100644 --- a/libraries/elasticmapreduce/lib/runJobFlow.ml +++ b/libraries/elasticmapreduce/lib/runJobFlow.ml @@ -1,57 +1,54 @@ open Types open Aws - type input = RunJobFlowInput.t - type output = RunJobFlowOutput.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", [ "RunJobFlow" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-03-31"]); ("Action", ["RunJobFlow"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RunJobFlowInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RunJobFlowInput.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RunJobFlowResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp RunJobFlowOutput.parse) + Util.or_error (Util.option_bind resp RunJobFlowOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed RunJobFlowOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed RunJobFlowOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RunJobFlowOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RunJobFlowOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/runJobFlow.mli b/libraries/elasticmapreduce/lib/runJobFlow.mli index 9ae381049..b6ed40743 100644 --- a/libraries/elasticmapreduce/lib/runJobFlow.mli +++ b/libraries/elasticmapreduce/lib/runJobFlow.mli @@ -1,10 +1,7 @@ open Types - type input = RunJobFlowInput.t - type output = RunJobFlowOutput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.ml b/libraries/elasticmapreduce/lib/setTerminationProtection.ml index 7955461ac..f1bb7c2c1 100644 --- a/libraries/elasticmapreduce/lib/setTerminationProtection.ml +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = SetTerminationProtectionInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "SetTerminationProtection" ] ] + [("Version", ["2009-03-31"]); + ("Action", ["SetTerminationProtection"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (SetTerminationProtectionInput.to_query req))))) - in - `POST, uri, [] - + (Query.render (SetTerminationProtectionInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.mli b/libraries/elasticmapreduce/lib/setTerminationProtection.mli index ded3618de..99ccaefbd 100644 --- a/libraries/elasticmapreduce/lib/setTerminationProtection.mli +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.mli @@ -1,10 +1,7 @@ open Types - type input = SetTerminationProtectionInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml index 9c5bde5d6..6b032f6cb 100644 --- a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = SetVisibleToAllUsersInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "SetVisibleToAllUsers" ] ] + [("Version", ["2009-03-31"]); ("Action", ["SetVisibleToAllUsers"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetVisibleToAllUsersInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetVisibleToAllUsersInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli index 48ff0217c..d6537c54b 100644 --- a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.mli @@ -1,10 +1,7 @@ open Types - type input = SetVisibleToAllUsersInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/startNotebookExecution.ml b/libraries/elasticmapreduce/lib/startNotebookExecution.ml new file mode 100644 index 000000000..46f8cc259 --- /dev/null +++ b/libraries/elasticmapreduce/lib/startNotebookExecution.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = StartNotebookExecutionInput.t +type output = StartNotebookExecutionOutput.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", ["StartNotebookExecution"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (StartNotebookExecutionInput.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = Xml.member "StartNotebookExecutionResponse" (snd xml) in + try + Util.or_error + (Util.option_bind resp StartNotebookExecutionOutput.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed StartNotebookExecutionOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing StartNotebookExecutionOutput - 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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/startNotebookExecution.mli b/libraries/elasticmapreduce/lib/startNotebookExecution.mli new file mode 100644 index 000000000..db1296516 --- /dev/null +++ b/libraries/elasticmapreduce/lib/startNotebookExecution.mli @@ -0,0 +1,7 @@ +open Types +type input = StartNotebookExecutionInput.t +type output = StartNotebookExecutionOutput.t +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/stopNotebookExecution.ml b/libraries/elasticmapreduce/lib/stopNotebookExecution.ml new file mode 100644 index 000000000..0d88828cf --- /dev/null +++ b/libraries/elasticmapreduce/lib/stopNotebookExecution.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = StopNotebookExecutionInput.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", ["StopNotebookExecution"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (StopNotebookExecutionInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/stopNotebookExecution.mli b/libraries/elasticmapreduce/lib/stopNotebookExecution.mli new file mode 100644 index 000000000..a08403e3e --- /dev/null +++ b/libraries/elasticmapreduce/lib/stopNotebookExecution.mli @@ -0,0 +1,7 @@ +open Types +type input = StopNotebookExecutionInput.t +type output = unit +type error = Errors_internal.t +include + Aws.Call with type input := input and type output := output and type + error := error \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.ml b/libraries/elasticmapreduce/lib/terminateJobFlows.ml index 7faab154c..f3c4b8ec1 100644 --- a/libraries/elasticmapreduce/lib/terminateJobFlows.ml +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = TerminateJobFlowsInput.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))) + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append - [ "Version", [ "2009-03-31" ]; "Action", [ "TerminateJobFlows" ] ] + [("Version", ["2009-03-31"]); ("Action", ["TerminateJobFlows"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (TerminateJobFlowsInput.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (TerminateJobFlowsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.mli b/libraries/elasticmapreduce/lib/terminateJobFlows.mli index 575e5557f..482cf652b 100644 --- a/libraries/elasticmapreduce/lib/terminateJobFlows.mli +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.mli @@ -1,10 +1,7 @@ open Types - type input = TerminateJobFlowsInput.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 \ No newline at end of file diff --git a/libraries/elasticmapreduce/lib/types.ml b/libraries/elasticmapreduce/lib/types.ml index 05c3255a1..f6026685a 100644 --- a/libraries/elasticmapreduce/lib/types.ml +++ b/libraries/elasticmapreduce/lib/types.ml @@ -732,6 +732,50 @@ module KeyValueList = struct let of_json j = Json.to_list KeyValue.of_json j end +module OnDemandProvisioningAllocationStrategy = struct + type t = Lowest_price + + let str_to_t = [ "lowest-price", Lowest_price ] + + let t_to_str = [ Lowest_price, "lowest-price" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + +module SpotProvisioningAllocationStrategy = struct + type t = Capacity_optimized + + let str_to_t = [ "capacity-optimized", Capacity_optimized ] + + let t_to_str = [ Capacity_optimized, "capacity-optimized" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module SpotProvisioningTimeoutAction = struct type t = | SWITCH_TO_ON_DEMAND @@ -758,7 +802,20 @@ module SpotProvisioningTimeoutAction = struct let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) end -module ConfigurationList = struct +(* TODO Manual hack to introduce recursive module definition. *) +module rec ConfigurationList : sig + type t = Configuration.t list + + val make : 'a -> unit -> 'a + + val parse : Ezxmlm.nodes -> t option + + val to_query : t -> Query.t + + val to_json : t -> Json.t + + val of_json : Json.t -> t +end = struct type t = Configuration.t list let make elems () = elems @@ -773,7 +830,28 @@ module ConfigurationList = struct let of_json j = Json.to_list Configuration.of_json j end -module Configuration = struct +and Configuration : sig + type t = + { classification : String.t option + ; configurations : ConfigurationList.t + ; properties : StringMap.t option + } + + val make : + ?classification:string + -> ?configurations:ConfigurationList.t + -> ?properties:StringMap.t + -> unit + -> t + + val parse : Ezxmlm.nodes -> t option + + val to_query : t -> Query.t + + val to_json : t -> Json.t + + val of_json : Json.t -> t +end = struct type t = { classification : String.t option ; configurations : ConfigurationList.t @@ -1033,6 +1111,7 @@ module InstanceGroupState = struct | PROVISIONING | BOOTSTRAPPING | RUNNING + | RECONFIGURING | RESIZING | SUSPENDED | TERMINATING @@ -1049,6 +1128,7 @@ module InstanceGroupState = struct ; "TERMINATING", TERMINATING ; "SUSPENDED", SUSPENDED ; "RESIZING", RESIZING + ; "RECONFIGURING", RECONFIGURING ; "RUNNING", RUNNING ; "BOOTSTRAPPING", BOOTSTRAPPING ; "PROVISIONING", PROVISIONING @@ -1062,6 +1142,7 @@ module InstanceGroupState = struct ; TERMINATING, "TERMINATING" ; SUSPENDED, "SUSPENDED" ; RESIZING, "RESIZING" + ; RECONFIGURING, "RECONFIGURING" ; RUNNING, "RUNNING" ; BOOTSTRAPPING, "BOOTSTRAPPING" ; PROVISIONING, "PROVISIONING" @@ -1238,15 +1319,64 @@ module StepExecutionState = struct let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) end +module OnDemandProvisioningSpecification = struct + type t = { allocation_strategy : OnDemandProvisioningAllocationStrategy.t } + + let make ~allocation_strategy () = { allocation_strategy } + + let parse xml = + Some + { allocation_strategy = + Xml.required + "AllocationStrategy" + (Util.option_bind + (Xml.member "AllocationStrategy" xml) + OnDemandProvisioningAllocationStrategy.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "AllocationStrategy" + , OnDemandProvisioningAllocationStrategy.to_query v.allocation_strategy )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "allocation_strategy" + , OnDemandProvisioningAllocationStrategy.to_json v.allocation_strategy ) + ]) + + let of_json j = + { allocation_strategy = + OnDemandProvisioningAllocationStrategy.of_json + (Util.of_option_exn (Json.lookup j "allocation_strategy")) + } +end + module SpotProvisioningSpecification = struct type t = { timeout_duration_minutes : Integer.t ; timeout_action : SpotProvisioningTimeoutAction.t ; block_duration_minutes : Integer.t option + ; allocation_strategy : SpotProvisioningAllocationStrategy.t option } - let make ~timeout_duration_minutes ~timeout_action ?block_duration_minutes () = - { timeout_duration_minutes; timeout_action; block_duration_minutes } + let make + ~timeout_duration_minutes + ~timeout_action + ?block_duration_minutes + ?allocation_strategy + () = + { timeout_duration_minutes + ; timeout_action + ; block_duration_minutes + ; allocation_strategy + } let parse xml = Some @@ -1262,12 +1392,19 @@ module SpotProvisioningSpecification = struct SpotProvisioningTimeoutAction.parse) ; block_duration_minutes = Util.option_bind (Xml.member "BlockDurationMinutes" xml) Integer.parse + ; allocation_strategy = + Util.option_bind + (Xml.member "AllocationStrategy" xml) + SpotProvisioningAllocationStrategy.parse } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.block_duration_minutes (fun f -> + [ Util.option_map v.allocation_strategy (fun f -> + Query.Pair + ("AllocationStrategy", SpotProvisioningAllocationStrategy.to_query f)) + ; Util.option_map v.block_duration_minutes (fun f -> Query.Pair ("BlockDurationMinutes", Integer.to_query f)) ; Some (Query.Pair @@ -1280,7 +1417,9 @@ module SpotProvisioningSpecification = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.block_duration_minutes (fun f -> + [ Util.option_map v.allocation_strategy (fun f -> + "allocation_strategy", SpotProvisioningAllocationStrategy.to_json f) + ; Util.option_map v.block_duration_minutes (fun f -> "block_duration_minutes", Integer.to_json f) ; Some ("timeout_action", SpotProvisioningTimeoutAction.to_json v.timeout_action) ; Some ("timeout_duration_minutes", Integer.to_json v.timeout_duration_minutes) @@ -1294,6 +1433,10 @@ module SpotProvisioningSpecification = struct (Util.of_option_exn (Json.lookup j "timeout_action")) ; block_duration_minutes = Util.option_map (Json.lookup j "block_duration_minutes") Integer.of_json + ; allocation_strategy = + Util.option_map + (Json.lookup j "allocation_strategy") + SpotProvisioningAllocationStrategy.of_json } end @@ -2104,42 +2247,83 @@ module StringList = struct let of_json j = Json.to_list String.of_json j end +module PlacementGroupStrategy = struct + type t = + | SPREAD + | PARTITION + | CLUSTER + | NONE + + let str_to_t = + [ "NONE", NONE; "CLUSTER", CLUSTER; "PARTITION", PARTITION; "SPREAD", SPREAD ] + + let t_to_str = + [ NONE, "NONE"; CLUSTER, "CLUSTER"; PARTITION, "PARTITION"; SPREAD, "SPREAD" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module InstanceFleetProvisioningSpecifications = struct - type t = { spot_specification : SpotProvisioningSpecification.t } + type t = + { spot_specification : SpotProvisioningSpecification.t option + ; on_demand_specification : OnDemandProvisioningSpecification.t option + } - let make ~spot_specification () = { spot_specification } + let make ?spot_specification ?on_demand_specification () = + { spot_specification; on_demand_specification } let parse xml = Some { spot_specification = - Xml.required - "SpotSpecification" - (Util.option_bind - (Xml.member "SpotSpecification" xml) - SpotProvisioningSpecification.parse) + Util.option_bind + (Xml.member "SpotSpecification" xml) + SpotProvisioningSpecification.parse + ; on_demand_specification = + Util.option_bind + (Xml.member "OnDemandSpecification" xml) + OnDemandProvisioningSpecification.parse } let to_query v = Query.List (Util.list_filter_opt - [ Some - (Query.Pair - ( "SpotSpecification" - , SpotProvisioningSpecification.to_query v.spot_specification )) + [ Util.option_map v.on_demand_specification (fun f -> + Query.Pair + ("OnDemandSpecification", OnDemandProvisioningSpecification.to_query f)) + ; Util.option_map v.spot_specification (fun f -> + Query.Pair ("SpotSpecification", SpotProvisioningSpecification.to_query f)) ]) let to_json v = `Assoc (Util.list_filter_opt - [ Some - ( "spot_specification" - , SpotProvisioningSpecification.to_json v.spot_specification ) + [ Util.option_map v.on_demand_specification (fun f -> + "on_demand_specification", OnDemandProvisioningSpecification.to_json f) + ; Util.option_map v.spot_specification (fun f -> + "spot_specification", SpotProvisioningSpecification.to_json f) ]) let of_json j = { spot_specification = - SpotProvisioningSpecification.of_json - (Util.of_option_exn (Json.lookup j "spot_specification")) + Util.option_map + (Json.lookup j "spot_specification") + SpotProvisioningSpecification.of_json + ; on_demand_specification = + Util.option_map + (Json.lookup j "on_demand_specification") + OnDemandProvisioningSpecification.of_json } end @@ -3359,6 +3543,52 @@ module Application = struct } end +module PlacementGroupConfig = struct + type t = + { instance_role : InstanceRoleType.t + ; placement_strategy : PlacementGroupStrategy.t option + } + + let make ~instance_role ?placement_strategy () = { instance_role; placement_strategy } + + let parse xml = + Some + { instance_role = + Xml.required + "InstanceRole" + (Util.option_bind (Xml.member "InstanceRole" xml) InstanceRoleType.parse) + ; placement_strategy = + Util.option_bind + (Xml.member "PlacementStrategy" xml) + PlacementGroupStrategy.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.placement_strategy (fun f -> + Query.Pair ("PlacementStrategy", PlacementGroupStrategy.to_query f)) + ; Some (Query.Pair ("InstanceRole", InstanceRoleType.to_query v.instance_role)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.placement_strategy (fun f -> + "placement_strategy", PlacementGroupStrategy.to_json f) + ; Some ("instance_role", InstanceRoleType.to_json v.instance_role) + ]) + + let of_json j = + { instance_role = + InstanceRoleType.of_json (Util.of_option_exn (Json.lookup j "instance_role")) + ; placement_strategy = + Util.option_map + (Json.lookup j "placement_strategy") + PlacementGroupStrategy.of_json + } +end + module Tag = struct type t = { key : String.t option @@ -3616,6 +3846,33 @@ module InstanceGroupConfig = struct } end +module ComputeLimitsUnitType = struct + type t = + | InstanceFleetUnits + | Instances + | VCPU + + let str_to_t = + [ "VCPU", VCPU; "Instances", Instances; "InstanceFleetUnits", InstanceFleetUnits ] + + let t_to_str = + [ VCPU, "VCPU"; Instances, "Instances"; InstanceFleetUnits, "InstanceFleetUnits" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module InstanceFleetStatus = struct type t = { state : InstanceFleetState.t option @@ -3850,6 +4107,44 @@ module ShrinkPolicy = struct } end +module PortRange = struct + type t = + { min_range : Integer.t + ; max_range : Integer.t option + } + + let make ~min_range ?max_range () = { min_range; max_range } + + let parse xml = + Some + { min_range = + Xml.required + "MinRange" + (Util.option_bind (Xml.member "MinRange" xml) Integer.parse) + ; max_range = Util.option_bind (Xml.member "MaxRange" xml) Integer.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.max_range (fun f -> + Query.Pair ("MaxRange", Integer.to_query f)) + ; Some (Query.Pair ("MinRange", Integer.to_query v.min_range)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.max_range (fun f -> "max_range", Integer.to_json f) + ; Some ("min_range", Integer.to_json v.min_range) + ]) + + let of_json j = + { min_range = Integer.of_json (Util.of_option_exn (Json.lookup j "min_range")) + ; max_range = Util.option_map (Json.lookup j "max_range") Integer.of_json + } +end + module AutoScalingPolicyDescription = struct type t = { status : AutoScalingPolicyStatus.t option @@ -4038,6 +4333,60 @@ module InstanceStatus = struct } end +module NotebookExecutionStatus = struct + type t = + | START_PENDING + | STARTING + | RUNNING + | FINISHING + | FINISHED + | FAILING + | FAILED + | STOP_PENDING + | STOPPING + | STOPPED + + let str_to_t = + [ "STOPPED", STOPPED + ; "STOPPING", STOPPING + ; "STOP_PENDING", STOP_PENDING + ; "FAILED", FAILED + ; "FAILING", FAILING + ; "FINISHED", FINISHED + ; "FINISHING", FINISHING + ; "RUNNING", RUNNING + ; "STARTING", STARTING + ; "START_PENDING", START_PENDING + ] + + let t_to_str = + [ STOPPED, "STOPPED" + ; STOPPING, "STOPPING" + ; STOP_PENDING, "STOP_PENDING" + ; FAILED, "FAILED" + ; FAILING, "FAILING" + ; FINISHED, "FINISHED" + ; FINISHING, "FINISHING" + ; RUNNING, "RUNNING" + ; STARTING, "STARTING" + ; START_PENDING, "START_PENDING" + ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module ClusterStatus = struct type t = { state : ClusterState.t option @@ -4088,6 +4437,28 @@ module ClusterStatus = struct } end +module ExecutionEngineType = struct + type t = EMR + + let str_to_t = [ "EMR", EMR ] + + let t_to_str = [ EMR, "EMR" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module BootstrapActionDetailList = struct type t = BootstrapActionDetail.t list @@ -4728,6 +5099,21 @@ module KerberosAttributes = struct } end +module PlacementGroupConfigList = struct + type t = PlacementGroupConfig.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map PlacementGroupConfig.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list PlacementGroupConfig.to_query v + + let to_json v = `List (List.map PlacementGroupConfig.to_json v) + + let of_json j = Json.to_list PlacementGroupConfig.of_json j +end + module RepoUpgradeOnBoot = struct type t = | SECURITY @@ -4810,15 +5196,100 @@ module SecurityGroupsList = struct let of_json j = Json.to_list String.of_json j end -module SupportedProductConfig = struct +module ComputeLimits = struct type t = - { name : String.t option - ; args : XmlStringList.t + { unit_type : ComputeLimitsUnitType.t + ; minimum_capacity_units : Integer.t + ; maximum_capacity_units : Integer.t + ; maximum_on_demand_capacity_units : Integer.t option + ; maximum_core_capacity_units : Integer.t option } - let make ?name ?(args = []) () = { name; args } - - let parse xml = + let make + ~unit_type + ~minimum_capacity_units + ~maximum_capacity_units + ?maximum_on_demand_capacity_units + ?maximum_core_capacity_units + () = + { unit_type + ; minimum_capacity_units + ; maximum_capacity_units + ; maximum_on_demand_capacity_units + ; maximum_core_capacity_units + } + + let parse xml = + Some + { unit_type = + Xml.required + "UnitType" + (Util.option_bind (Xml.member "UnitType" xml) ComputeLimitsUnitType.parse) + ; minimum_capacity_units = + Xml.required + "MinimumCapacityUnits" + (Util.option_bind (Xml.member "MinimumCapacityUnits" xml) Integer.parse) + ; maximum_capacity_units = + Xml.required + "MaximumCapacityUnits" + (Util.option_bind (Xml.member "MaximumCapacityUnits" xml) Integer.parse) + ; maximum_on_demand_capacity_units = + Util.option_bind (Xml.member "MaximumOnDemandCapacityUnits" xml) Integer.parse + ; maximum_core_capacity_units = + Util.option_bind (Xml.member "MaximumCoreCapacityUnits" xml) Integer.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.maximum_core_capacity_units (fun f -> + Query.Pair ("MaximumCoreCapacityUnits", Integer.to_query f)) + ; Util.option_map v.maximum_on_demand_capacity_units (fun f -> + Query.Pair ("MaximumOnDemandCapacityUnits", Integer.to_query f)) + ; Some + (Query.Pair + ("MaximumCapacityUnits", Integer.to_query v.maximum_capacity_units)) + ; Some + (Query.Pair + ("MinimumCapacityUnits", Integer.to_query v.minimum_capacity_units)) + ; Some (Query.Pair ("UnitType", ComputeLimitsUnitType.to_query v.unit_type)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.maximum_core_capacity_units (fun f -> + "maximum_core_capacity_units", Integer.to_json f) + ; Util.option_map v.maximum_on_demand_capacity_units (fun f -> + "maximum_on_demand_capacity_units", Integer.to_json f) + ; Some ("maximum_capacity_units", Integer.to_json v.maximum_capacity_units) + ; Some ("minimum_capacity_units", Integer.to_json v.minimum_capacity_units) + ; Some ("unit_type", ComputeLimitsUnitType.to_json v.unit_type) + ]) + + let of_json j = + { unit_type = + ComputeLimitsUnitType.of_json (Util.of_option_exn (Json.lookup j "unit_type")) + ; minimum_capacity_units = + Integer.of_json (Util.of_option_exn (Json.lookup j "minimum_capacity_units")) + ; maximum_capacity_units = + Integer.of_json (Util.of_option_exn (Json.lookup j "maximum_capacity_units")) + ; maximum_on_demand_capacity_units = + Util.option_map (Json.lookup j "maximum_on_demand_capacity_units") Integer.of_json + ; maximum_core_capacity_units = + Util.option_map (Json.lookup j "maximum_core_capacity_units") Integer.of_json + } +end + +module SupportedProductConfig = struct + type t = + { name : String.t option + ; args : XmlStringList.t + } + + let make ?name ?(args = []) () = { name; args } + + let parse xml = Some { name = Util.option_bind (Xml.member "Name" xml) String.parse ; args = @@ -5084,6 +5555,7 @@ module InstanceGroupModifyConfig = struct ; instance_count : Integer.t option ; e_c2_instance_ids_to_terminate : EC2InstanceIdsToTerminateList.t ; shrink_policy : ShrinkPolicy.t option + ; configurations : ConfigurationList.t } let make @@ -5091,8 +5563,14 @@ module InstanceGroupModifyConfig = struct ?instance_count ?(e_c2_instance_ids_to_terminate = []) ?shrink_policy + ?(configurations = []) () = - { instance_group_id; instance_count; e_c2_instance_ids_to_terminate; shrink_policy } + { instance_group_id + ; instance_count + ; e_c2_instance_ids_to_terminate + ; shrink_policy + ; configurations + } let parse xml = Some @@ -5109,12 +5587,19 @@ module InstanceGroupModifyConfig = struct EC2InstanceIdsToTerminateList.parse) ; shrink_policy = Util.option_bind (Xml.member "ShrinkPolicy" xml) ShrinkPolicy.parse + ; configurations = + Util.of_option + [] + (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.shrink_policy (fun f -> + [ Some + (Query.Pair + ("Configurations.member", ConfigurationList.to_query v.configurations)) + ; Util.option_map v.shrink_policy (fun f -> Query.Pair ("ShrinkPolicy", ShrinkPolicy.to_query f)) ; Some (Query.Pair @@ -5129,7 +5614,8 @@ module InstanceGroupModifyConfig = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.shrink_policy (fun f -> + [ Some ("configurations", ConfigurationList.to_json v.configurations) + ; Util.option_map v.shrink_policy (fun f -> "shrink_policy", ShrinkPolicy.to_json f) ; Some ( "e_c2_instance_ids_to_terminate" @@ -5146,9 +5632,25 @@ module InstanceGroupModifyConfig = struct EC2InstanceIdsToTerminateList.of_json (Util.of_option_exn (Json.lookup j "e_c2_instance_ids_to_terminate")) ; shrink_policy = Util.option_map (Json.lookup j "shrink_policy") ShrinkPolicy.of_json + ; configurations = + ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) } end +module PortRanges = struct + type t = PortRange.t list + + let make elems () = elems + + let parse xml = Util.option_all (List.map PortRange.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list PortRange.to_query v + + let to_json v = `List (List.map PortRange.to_json v) + + let of_json j = Json.to_list PortRange.of_json j +end + module InstanceGroup = struct type t = { id : String.t option @@ -5161,6 +5663,9 @@ module InstanceGroup = struct ; running_instance_count : Integer.t option ; status : InstanceGroupStatus.t option ; configurations : ConfigurationList.t + ; configurations_version : Long.t option + ; last_successfully_applied_configurations : ConfigurationList.t + ; last_successfully_applied_configurations_version : Long.t option ; ebs_block_devices : EbsBlockDeviceList.t ; ebs_optimized : Boolean.t option ; shrink_policy : ShrinkPolicy.t option @@ -5178,6 +5683,9 @@ module InstanceGroup = struct ?running_instance_count ?status ?(configurations = []) + ?configurations_version + ?(last_successfully_applied_configurations = []) + ?last_successfully_applied_configurations_version ?(ebs_block_devices = []) ?ebs_optimized ?shrink_policy @@ -5193,6 +5701,9 @@ module InstanceGroup = struct ; running_instance_count ; status ; configurations + ; configurations_version + ; last_successfully_applied_configurations + ; last_successfully_applied_configurations_version ; ebs_block_devices ; ebs_optimized ; shrink_policy @@ -5217,6 +5728,18 @@ module InstanceGroup = struct Util.of_option [] (Util.option_bind (Xml.member "Configurations" xml) ConfigurationList.parse) + ; configurations_version = + Util.option_bind (Xml.member "ConfigurationsVersion" xml) Long.parse + ; last_successfully_applied_configurations = + Util.of_option + [] + (Util.option_bind + (Xml.member "LastSuccessfullyAppliedConfigurations" xml) + ConfigurationList.parse) + ; last_successfully_applied_configurations_version = + Util.option_bind + (Xml.member "LastSuccessfullyAppliedConfigurationsVersion" xml) + Long.parse ; ebs_block_devices = Util.of_option [] @@ -5242,6 +5765,14 @@ module InstanceGroup = struct ; Some (Query.Pair ("EbsBlockDevices.member", EbsBlockDeviceList.to_query v.ebs_block_devices)) + ; Util.option_map v.last_successfully_applied_configurations_version (fun f -> + Query.Pair ("LastSuccessfullyAppliedConfigurationsVersion", Long.to_query f)) + ; Some + (Query.Pair + ( "LastSuccessfullyAppliedConfigurations.member" + , ConfigurationList.to_query v.last_successfully_applied_configurations )) + ; Util.option_map v.configurations_version (fun f -> + Query.Pair ("ConfigurationsVersion", Long.to_query f)) ; Some (Query.Pair ("Configurations.member", ConfigurationList.to_query v.configurations)) @@ -5272,6 +5803,13 @@ module InstanceGroup = struct "shrink_policy", ShrinkPolicy.to_json f) ; Util.option_map v.ebs_optimized (fun f -> "ebs_optimized", Boolean.to_json f) ; Some ("ebs_block_devices", EbsBlockDeviceList.to_json v.ebs_block_devices) + ; Util.option_map v.last_successfully_applied_configurations_version (fun f -> + "last_successfully_applied_configurations_version", Long.to_json f) + ; Some + ( "last_successfully_applied_configurations" + , ConfigurationList.to_json v.last_successfully_applied_configurations ) + ; Util.option_map v.configurations_version (fun f -> + "configurations_version", Long.to_json f) ; Some ("configurations", ConfigurationList.to_json v.configurations) ; Util.option_map v.status (fun f -> "status", InstanceGroupStatus.to_json f) ; Util.option_map v.running_instance_count (fun f -> @@ -5302,6 +5840,15 @@ module InstanceGroup = struct ; status = Util.option_map (Json.lookup j "status") InstanceGroupStatus.of_json ; configurations = ConfigurationList.of_json (Util.of_option_exn (Json.lookup j "configurations")) + ; configurations_version = + Util.option_map (Json.lookup j "configurations_version") Long.of_json + ; last_successfully_applied_configurations = + ConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "last_successfully_applied_configurations")) + ; last_successfully_applied_configurations_version = + Util.option_map + (Json.lookup j "last_successfully_applied_configurations_version") + Long.of_json ; ebs_block_devices = EbsBlockDeviceList.of_json (Util.of_option_exn (Json.lookup j "ebs_block_devices")) @@ -5453,16 +6000,98 @@ module Instance = struct } end +module NotebookExecutionSummary = struct + type t = + { notebook_execution_id : String.t option + ; editor_id : String.t option + ; notebook_execution_name : String.t option + ; status : NotebookExecutionStatus.t option + ; start_time : DateTime.t option + ; end_time : DateTime.t option + } + + let make + ?notebook_execution_id + ?editor_id + ?notebook_execution_name + ?status + ?start_time + ?end_time + () = + { notebook_execution_id + ; editor_id + ; notebook_execution_name + ; status + ; start_time + ; end_time + } + + let parse xml = + Some + { notebook_execution_id = + Util.option_bind (Xml.member "NotebookExecutionId" xml) String.parse + ; editor_id = Util.option_bind (Xml.member "EditorId" xml) String.parse + ; notebook_execution_name = + Util.option_bind (Xml.member "NotebookExecutionName" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) NotebookExecutionStatus.parse + ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse + ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.end_time (fun f -> + Query.Pair ("EndTime", DateTime.to_query f)) + ; Util.option_map v.start_time (fun f -> + Query.Pair ("StartTime", DateTime.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", NotebookExecutionStatus.to_query f)) + ; Util.option_map v.notebook_execution_name (fun f -> + Query.Pair ("NotebookExecutionName", String.to_query f)) + ; Util.option_map v.editor_id (fun f -> + Query.Pair ("EditorId", String.to_query f)) + ; Util.option_map v.notebook_execution_id (fun f -> + Query.Pair ("NotebookExecutionId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) + ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) + ; Util.option_map v.status (fun f -> "status", NotebookExecutionStatus.to_json f) + ; Util.option_map v.notebook_execution_name (fun f -> + "notebook_execution_name", String.to_json f) + ; Util.option_map v.editor_id (fun f -> "editor_id", String.to_json f) + ; Util.option_map v.notebook_execution_id (fun f -> + "notebook_execution_id", String.to_json f) + ]) + + let of_json j = + { notebook_execution_id = + Util.option_map (Json.lookup j "notebook_execution_id") String.of_json + ; editor_id = Util.option_map (Json.lookup j "editor_id") String.of_json + ; notebook_execution_name = + Util.option_map (Json.lookup j "notebook_execution_name") String.of_json + ; status = Util.option_map (Json.lookup j "status") NotebookExecutionStatus.of_json + ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json + ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json + } +end + module ClusterSummary = struct type t = { id : String.t option ; name : String.t option ; status : ClusterStatus.t option ; normalized_instance_hours : Integer.t option + ; cluster_arn : String.t option + ; outpost_arn : String.t option } - let make ?id ?name ?status ?normalized_instance_hours () = - { id; name; status; normalized_instance_hours } + let make ?id ?name ?status ?normalized_instance_hours ?cluster_arn ?outpost_arn () = + { id; name; status; normalized_instance_hours; cluster_arn; outpost_arn } let parse xml = Some @@ -5471,12 +6100,18 @@ module ClusterSummary = struct ; status = Util.option_bind (Xml.member "Status" xml) ClusterStatus.parse ; normalized_instance_hours = Util.option_bind (Xml.member "NormalizedInstanceHours" xml) Integer.parse + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse + ; outpost_arn = Util.option_bind (Xml.member "OutpostArn" xml) String.parse } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.normalized_instance_hours (fun f -> + [ Util.option_map v.outpost_arn (fun f -> + Query.Pair ("OutpostArn", String.to_query f)) + ; Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Util.option_map v.normalized_instance_hours (fun f -> Query.Pair ("NormalizedInstanceHours", Integer.to_query f)) ; Util.option_map v.status (fun f -> Query.Pair ("Status", ClusterStatus.to_query f)) @@ -5487,7 +6122,9 @@ module ClusterSummary = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.normalized_instance_hours (fun f -> + [ Util.option_map v.outpost_arn (fun f -> "outpost_arn", String.to_json f) + ; Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Util.option_map v.normalized_instance_hours (fun f -> "normalized_instance_hours", Integer.to_json f) ; Util.option_map v.status (fun f -> "status", ClusterStatus.to_json f) ; Util.option_map v.name (fun f -> "name", String.to_json f) @@ -5500,6 +6137,53 @@ module ClusterSummary = struct ; status = Util.option_map (Json.lookup j "status") ClusterStatus.of_json ; normalized_instance_hours = Util.option_map (Json.lookup j "normalized_instance_hours") Integer.of_json + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + ; outpost_arn = Util.option_map (Json.lookup j "outpost_arn") String.of_json + } +end + +module ExecutionEngineConfig = struct + type t = + { id : String.t + ; type_ : ExecutionEngineType.t option + ; master_instance_security_group_id : String.t option + } + + let make ~id ?type_ ?master_instance_security_group_id () = + { id; type_; master_instance_security_group_id } + + let parse xml = + Some + { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) + ; type_ = Util.option_bind (Xml.member "Type" xml) ExecutionEngineType.parse + ; master_instance_security_group_id = + Util.option_bind (Xml.member "MasterInstanceSecurityGroupId" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.master_instance_security_group_id (fun f -> + Query.Pair ("MasterInstanceSecurityGroupId", String.to_query f)) + ; Util.option_map v.type_ (fun f -> + Query.Pair ("Type", ExecutionEngineType.to_query f)) + ; Some (Query.Pair ("Id", String.to_query v.id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.master_instance_security_group_id (fun f -> + "master_instance_security_group_id", String.to_json f) + ; Util.option_map v.type_ (fun f -> "type_", ExecutionEngineType.to_json f) + ; Some ("id", String.to_json v.id) + ]) + + let of_json j = + { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) + ; type_ = Util.option_map (Json.lookup j "type_") ExecutionEngineType.of_json + ; master_instance_security_group_id = + Util.option_map (Json.lookup j "master_instance_security_group_id") String.of_json } end @@ -5508,6 +6192,7 @@ module JobFlowDetail = struct { job_flow_id : String.t ; name : String.t ; log_uri : String.t option + ; log_encryption_kms_key_id : String.t option ; ami_version : String.t option ; execution_status_detail : JobFlowExecutionStatusDetail.t ; instances : JobFlowInstancesDetail.t @@ -5525,6 +6210,7 @@ module JobFlowDetail = struct ~job_flow_id ~name ?log_uri + ?log_encryption_kms_key_id ?ami_version ~execution_status_detail ~instances @@ -5540,6 +6226,7 @@ module JobFlowDetail = struct { job_flow_id ; name ; log_uri + ; log_encryption_kms_key_id ; ami_version ; execution_status_detail ; instances @@ -5561,6 +6248,8 @@ module JobFlowDetail = struct (Util.option_bind (Xml.member "JobFlowId" xml) String.parse) ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; log_encryption_kms_key_id = + Util.option_bind (Xml.member "LogEncryptionKmsKeyId" xml) String.parse ; ami_version = Util.option_bind (Xml.member "AmiVersion" xml) String.parse ; execution_status_detail = Xml.required @@ -5627,6 +6316,8 @@ module JobFlowDetail = struct , JobFlowExecutionStatusDetail.to_query v.execution_status_detail )) ; Util.option_map v.ami_version (fun f -> Query.Pair ("AmiVersion", String.to_query f)) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + Query.Pair ("LogEncryptionKmsKeyId", String.to_query f)) ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) ; Some (Query.Pair ("Name", String.to_query v.name)) ; Some (Query.Pair ("JobFlowId", String.to_query v.job_flow_id)) @@ -5652,6 +6343,8 @@ module JobFlowDetail = struct ( "execution_status_detail" , JobFlowExecutionStatusDetail.to_json v.execution_status_detail ) ; Util.option_map v.ami_version (fun f -> "ami_version", String.to_json f) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + "log_encryption_kms_key_id", String.to_json f) ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) ; Some ("name", String.to_json v.name) ; Some ("job_flow_id", String.to_json v.job_flow_id) @@ -5661,6 +6354,8 @@ module JobFlowDetail = struct { job_flow_id = String.of_json (Util.of_option_exn (Json.lookup j "job_flow_id")) ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; log_encryption_kms_key_id = + Util.option_map (Json.lookup j "log_encryption_kms_key_id") String.of_json ; ami_version = Util.option_map (Json.lookup j "ami_version") String.of_json ; execution_status_detail = JobFlowExecutionStatusDetail.of_json @@ -5889,6 +6584,32 @@ module Step = struct } end +module StepCancellationOption = struct + type t = + | SEND_INTERRUPT + | TERMINATE_PROCESS + + let str_to_t = + [ "TERMINATE_PROCESS", TERMINATE_PROCESS; "SEND_INTERRUPT", SEND_INTERRUPT ] + + let t_to_str = + [ TERMINATE_PROCESS, "TERMINATE_PROCESS"; SEND_INTERRUPT, "SEND_INTERRUPT" ] + + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + + let make v () = v + + let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) + + let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + + let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + + let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) +end + module StepIdsList = struct type t = String.t list @@ -5911,6 +6632,7 @@ module Cluster = struct ; ec2_instance_attributes : Ec2InstanceAttributes.t option ; instance_collection_type : InstanceCollectionType.t option ; log_uri : String.t option + ; log_encryption_kms_key_id : String.t option ; requested_ami_version : String.t option ; running_ami_version : String.t option ; release_label : String.t option @@ -5930,6 +6652,10 @@ module Cluster = struct ; ebs_root_volume_size : Integer.t option ; repo_upgrade_on_boot : RepoUpgradeOnBoot.t option ; kerberos_attributes : KerberosAttributes.t option + ; cluster_arn : String.t option + ; outpost_arn : String.t option + ; step_concurrency_level : Integer.t option + ; placement_groups : PlacementGroupConfigList.t } let make @@ -5939,6 +6665,7 @@ module Cluster = struct ?ec2_instance_attributes ?instance_collection_type ?log_uri + ?log_encryption_kms_key_id ?requested_ami_version ?running_ami_version ?release_label @@ -5958,6 +6685,10 @@ module Cluster = struct ?ebs_root_volume_size ?repo_upgrade_on_boot ?kerberos_attributes + ?cluster_arn + ?outpost_arn + ?step_concurrency_level + ?(placement_groups = []) () = { id ; name @@ -5965,6 +6696,7 @@ module Cluster = struct ; ec2_instance_attributes ; instance_collection_type ; log_uri + ; log_encryption_kms_key_id ; requested_ami_version ; running_ami_version ; release_label @@ -5984,6 +6716,10 @@ module Cluster = struct ; ebs_root_volume_size ; repo_upgrade_on_boot ; kerberos_attributes + ; cluster_arn + ; outpost_arn + ; step_concurrency_level + ; placement_groups } let parse xml = @@ -6003,6 +6739,8 @@ module Cluster = struct (Xml.member "InstanceCollectionType" xml) InstanceCollectionType.parse ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; log_encryption_kms_key_id = + Util.option_bind (Xml.member "LogEncryptionKmsKeyId" xml) String.parse ; requested_ami_version = Util.option_bind (Xml.member "RequestedAmiVersion" xml) String.parse ; running_ami_version = @@ -6040,12 +6778,32 @@ module Cluster = struct Util.option_bind (Xml.member "RepoUpgradeOnBoot" xml) RepoUpgradeOnBoot.parse ; kerberos_attributes = Util.option_bind (Xml.member "KerberosAttributes" xml) KerberosAttributes.parse + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse + ; outpost_arn = Util.option_bind (Xml.member "OutpostArn" xml) String.parse + ; step_concurrency_level = + Util.option_bind (Xml.member "StepConcurrencyLevel" xml) Integer.parse + ; placement_groups = + Util.of_option + [] + (Util.option_bind + (Xml.member "PlacementGroups" xml) + PlacementGroupConfigList.parse) } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.kerberos_attributes (fun f -> + [ Some + (Query.Pair + ( "PlacementGroups.member" + , PlacementGroupConfigList.to_query v.placement_groups )) + ; Util.option_map v.step_concurrency_level (fun f -> + Query.Pair ("StepConcurrencyLevel", Integer.to_query f)) + ; Util.option_map v.outpost_arn (fun f -> + Query.Pair ("OutpostArn", String.to_query f)) + ; Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Util.option_map v.kerberos_attributes (fun f -> Query.Pair ("KerberosAttributes", KerberosAttributes.to_query f)) ; Util.option_map v.repo_upgrade_on_boot (fun f -> Query.Pair ("RepoUpgradeOnBoot", RepoUpgradeOnBoot.to_query f)) @@ -6083,6 +6841,8 @@ module Cluster = struct Query.Pair ("RunningAmiVersion", String.to_query f)) ; Util.option_map v.requested_ami_version (fun f -> Query.Pair ("RequestedAmiVersion", String.to_query f)) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + Query.Pair ("LogEncryptionKmsKeyId", String.to_query f)) ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) ; Util.option_map v.instance_collection_type (fun f -> Query.Pair ("InstanceCollectionType", InstanceCollectionType.to_query f)) @@ -6096,7 +6856,12 @@ module Cluster = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.kerberos_attributes (fun f -> + [ Some ("placement_groups", PlacementGroupConfigList.to_json v.placement_groups) + ; Util.option_map v.step_concurrency_level (fun f -> + "step_concurrency_level", Integer.to_json f) + ; Util.option_map v.outpost_arn (fun f -> "outpost_arn", String.to_json f) + ; Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Util.option_map v.kerberos_attributes (fun f -> "kerberos_attributes", KerberosAttributes.to_json f) ; Util.option_map v.repo_upgrade_on_boot (fun f -> "repo_upgrade_on_boot", RepoUpgradeOnBoot.to_json f) @@ -6127,6 +6892,8 @@ module Cluster = struct "running_ami_version", String.to_json f) ; Util.option_map v.requested_ami_version (fun f -> "requested_ami_version", String.to_json f) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + "log_encryption_kms_key_id", String.to_json f) ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) ; Util.option_map v.instance_collection_type (fun f -> "instance_collection_type", InstanceCollectionType.to_json f) @@ -6150,6 +6917,8 @@ module Cluster = struct (Json.lookup j "instance_collection_type") InstanceCollectionType.of_json ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; log_encryption_kms_key_id = + Util.option_map (Json.lookup j "log_encryption_kms_key_id") String.of_json ; requested_ami_version = Util.option_map (Json.lookup j "requested_ami_version") String.of_json ; running_ami_version = @@ -6183,6 +6952,13 @@ module Cluster = struct Util.option_map (Json.lookup j "repo_upgrade_on_boot") RepoUpgradeOnBoot.of_json ; kerberos_attributes = Util.option_map (Json.lookup j "kerberos_attributes") KerberosAttributes.of_json + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + ; outpost_arn = Util.option_map (Json.lookup j "outpost_arn") String.of_json + ; step_concurrency_level = + Util.option_map (Json.lookup j "step_concurrency_level") Integer.of_json + ; placement_groups = + PlacementGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "placement_groups")) } end @@ -6434,6 +7210,37 @@ module JobFlowInstancesConfig = struct } end +module ManagedScalingPolicy = struct + type t = { compute_limits : ComputeLimits.t option } + + let make ?compute_limits () = { compute_limits } + + let parse xml = + Some + { compute_limits = + Util.option_bind (Xml.member "ComputeLimits" xml) ComputeLimits.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.compute_limits (fun f -> + Query.Pair ("ComputeLimits", ComputeLimits.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.compute_limits (fun f -> + "compute_limits", ComputeLimits.to_json f) + ]) + + let of_json j = + { compute_limits = + Util.option_map (Json.lookup j "compute_limits") ComputeLimits.of_json + } +end + module NewSupportedProductsList = struct type t = SupportedProductConfig.t list @@ -6523,6 +7330,111 @@ module InstanceGroupModifyConfigList = struct let of_json j = Json.to_list InstanceGroupModifyConfig.of_json j end +module BlockPublicAccessConfiguration = struct + type t = + { block_public_security_group_rules : Boolean.t + ; permitted_public_security_group_rule_ranges : PortRanges.t + } + + let make + ~block_public_security_group_rules + ?(permitted_public_security_group_rule_ranges = []) + () = + { block_public_security_group_rules; permitted_public_security_group_rule_ranges } + + let parse xml = + Some + { block_public_security_group_rules = + Xml.required + "BlockPublicSecurityGroupRules" + (Util.option_bind + (Xml.member "BlockPublicSecurityGroupRules" xml) + Boolean.parse) + ; permitted_public_security_group_rule_ranges = + Util.of_option + [] + (Util.option_bind + (Xml.member "PermittedPublicSecurityGroupRuleRanges" xml) + PortRanges.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "PermittedPublicSecurityGroupRuleRanges.member" + , PortRanges.to_query v.permitted_public_security_group_rule_ranges )) + ; Some + (Query.Pair + ( "BlockPublicSecurityGroupRules" + , Boolean.to_query v.block_public_security_group_rules )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "permitted_public_security_group_rule_ranges" + , PortRanges.to_json v.permitted_public_security_group_rule_ranges ) + ; Some + ( "block_public_security_group_rules" + , Boolean.to_json v.block_public_security_group_rules ) + ]) + + let of_json j = + { block_public_security_group_rules = + Boolean.of_json + (Util.of_option_exn (Json.lookup j "block_public_security_group_rules")) + ; permitted_public_security_group_rule_ranges = + PortRanges.of_json + (Util.of_option_exn + (Json.lookup j "permitted_public_security_group_rule_ranges")) + } +end + +module BlockPublicAccessConfigurationMetadata = struct + type t = + { creation_date_time : DateTime.t + ; created_by_arn : String.t + } + + let make ~creation_date_time ~created_by_arn () = { creation_date_time; created_by_arn } + + let parse xml = + Some + { creation_date_time = + Xml.required + "CreationDateTime" + (Util.option_bind (Xml.member "CreationDateTime" xml) DateTime.parse) + ; created_by_arn = + Xml.required + "CreatedByArn" + (Util.option_bind (Xml.member "CreatedByArn" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("CreatedByArn", String.to_query v.created_by_arn)) + ; Some (Query.Pair ("CreationDateTime", DateTime.to_query v.creation_date_time)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("created_by_arn", String.to_json v.created_by_arn) + ; Some ("creation_date_time", DateTime.to_json v.creation_date_time) + ]) + + let of_json j = + { creation_date_time = + DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date_time")) + ; created_by_arn = + String.of_json (Util.of_option_exn (Json.lookup j "created_by_arn")) + } +end + module InstanceGroupList = struct type t = InstanceGroup.t list @@ -6552,6 +7464,21 @@ module InstanceList = struct let of_json j = Json.to_list Instance.of_json j end +module NotebookExecutionSummaryList = struct + type t = NotebookExecutionSummary.t list + + let make elems () = elems + + let parse xml = + Util.option_all (List.map NotebookExecutionSummary.parse (Xml.members "member" xml)) + + let to_query v = Query.to_query_list NotebookExecutionSummary.to_query v + + let to_json v = `List (List.map NotebookExecutionSummary.to_json v) + + let of_json j = Json.to_list NotebookExecutionSummary.of_json j +end + module ClusterSummaryList = struct type t = ClusterSummary.t list @@ -6581,11 +7508,160 @@ module StepStateList = struct let of_json j = Json.to_list StepState.of_json j end -module JobFlowExecutionStateList = struct - type t = JobFlowExecutionState.t list - - let make elems () = elems - +module NotebookExecution = struct + type t = + { notebook_execution_id : String.t option + ; editor_id : String.t option + ; execution_engine : ExecutionEngineConfig.t option + ; notebook_execution_name : String.t option + ; notebook_params : String.t option + ; status : NotebookExecutionStatus.t option + ; start_time : DateTime.t option + ; end_time : DateTime.t option + ; arn : String.t option + ; output_notebook_u_r_i : String.t option + ; last_state_change_reason : String.t option + ; notebook_instance_security_group_id : String.t option + ; tags : TagList.t + } + + let make + ?notebook_execution_id + ?editor_id + ?execution_engine + ?notebook_execution_name + ?notebook_params + ?status + ?start_time + ?end_time + ?arn + ?output_notebook_u_r_i + ?last_state_change_reason + ?notebook_instance_security_group_id + ?(tags = []) + () = + { notebook_execution_id + ; editor_id + ; execution_engine + ; notebook_execution_name + ; notebook_params + ; status + ; start_time + ; end_time + ; arn + ; output_notebook_u_r_i + ; last_state_change_reason + ; notebook_instance_security_group_id + ; tags + } + + let parse xml = + Some + { notebook_execution_id = + Util.option_bind (Xml.member "NotebookExecutionId" xml) String.parse + ; editor_id = Util.option_bind (Xml.member "EditorId" xml) String.parse + ; execution_engine = + Util.option_bind (Xml.member "ExecutionEngine" xml) ExecutionEngineConfig.parse + ; notebook_execution_name = + Util.option_bind (Xml.member "NotebookExecutionName" xml) String.parse + ; notebook_params = Util.option_bind (Xml.member "NotebookParams" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) NotebookExecutionStatus.parse + ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse + ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse + ; arn = Util.option_bind (Xml.member "Arn" xml) String.parse + ; output_notebook_u_r_i = + Util.option_bind (Xml.member "OutputNotebookURI" xml) String.parse + ; last_state_change_reason = + Util.option_bind (Xml.member "LastStateChangeReason" xml) String.parse + ; notebook_instance_security_group_id = + Util.option_bind (Xml.member "NotebookInstanceSecurityGroupId" xml) String.parse + ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) + ; Util.option_map v.notebook_instance_security_group_id (fun f -> + Query.Pair ("NotebookInstanceSecurityGroupId", String.to_query f)) + ; Util.option_map v.last_state_change_reason (fun f -> + Query.Pair ("LastStateChangeReason", String.to_query f)) + ; Util.option_map v.output_notebook_u_r_i (fun f -> + Query.Pair ("OutputNotebookURI", String.to_query f)) + ; Util.option_map v.arn (fun f -> Query.Pair ("Arn", String.to_query f)) + ; Util.option_map v.end_time (fun f -> + Query.Pair ("EndTime", DateTime.to_query f)) + ; Util.option_map v.start_time (fun f -> + Query.Pair ("StartTime", DateTime.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", NotebookExecutionStatus.to_query f)) + ; Util.option_map v.notebook_params (fun f -> + Query.Pair ("NotebookParams", String.to_query f)) + ; Util.option_map v.notebook_execution_name (fun f -> + Query.Pair ("NotebookExecutionName", String.to_query f)) + ; Util.option_map v.execution_engine (fun f -> + Query.Pair ("ExecutionEngine", ExecutionEngineConfig.to_query f)) + ; Util.option_map v.editor_id (fun f -> + Query.Pair ("EditorId", String.to_query f)) + ; Util.option_map v.notebook_execution_id (fun f -> + Query.Pair ("NotebookExecutionId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("tags", TagList.to_json v.tags) + ; Util.option_map v.notebook_instance_security_group_id (fun f -> + "notebook_instance_security_group_id", String.to_json f) + ; Util.option_map v.last_state_change_reason (fun f -> + "last_state_change_reason", String.to_json f) + ; Util.option_map v.output_notebook_u_r_i (fun f -> + "output_notebook_u_r_i", String.to_json f) + ; Util.option_map v.arn (fun f -> "arn", String.to_json f) + ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) + ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) + ; Util.option_map v.status (fun f -> "status", NotebookExecutionStatus.to_json f) + ; Util.option_map v.notebook_params (fun f -> + "notebook_params", String.to_json f) + ; Util.option_map v.notebook_execution_name (fun f -> + "notebook_execution_name", String.to_json f) + ; Util.option_map v.execution_engine (fun f -> + "execution_engine", ExecutionEngineConfig.to_json f) + ; Util.option_map v.editor_id (fun f -> "editor_id", String.to_json f) + ; Util.option_map v.notebook_execution_id (fun f -> + "notebook_execution_id", String.to_json f) + ]) + + let of_json j = + { notebook_execution_id = + Util.option_map (Json.lookup j "notebook_execution_id") String.of_json + ; editor_id = Util.option_map (Json.lookup j "editor_id") String.of_json + ; execution_engine = + Util.option_map (Json.lookup j "execution_engine") ExecutionEngineConfig.of_json + ; notebook_execution_name = + Util.option_map (Json.lookup j "notebook_execution_name") String.of_json + ; notebook_params = Util.option_map (Json.lookup j "notebook_params") String.of_json + ; status = Util.option_map (Json.lookup j "status") NotebookExecutionStatus.of_json + ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json + ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json + ; arn = Util.option_map (Json.lookup j "arn") String.of_json + ; output_notebook_u_r_i = + Util.option_map (Json.lookup j "output_notebook_u_r_i") String.of_json + ; last_state_change_reason = + Util.option_map (Json.lookup j "last_state_change_reason") String.of_json + ; notebook_instance_security_group_id = + Util.option_map + (Json.lookup j "notebook_instance_security_group_id") + String.of_json + ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) + } +end + +module JobFlowExecutionStateList = struct + type t = JobFlowExecutionState.t list + + let make elems () = elems + let parse xml = Util.option_all (List.map JobFlowExecutionState.parse (Xml.members "member" xml)) @@ -6878,6 +7954,37 @@ module ModifyInstanceFleetInput = struct } end +module ModifyClusterOutput = struct + type t = { step_concurrency_level : Integer.t option } + + let make ?step_concurrency_level () = { step_concurrency_level } + + let parse xml = + Some + { step_concurrency_level = + Util.option_bind (Xml.member "StepConcurrencyLevel" xml) Integer.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.step_concurrency_level (fun f -> + Query.Pair ("StepConcurrencyLevel", Integer.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.step_concurrency_level (fun f -> + "step_concurrency_level", Integer.to_json f) + ]) + + let of_json j = + { step_concurrency_level = + Util.option_map (Json.lookup j "step_concurrency_level") Integer.of_json + } +end + module DescribeStepOutput = struct type t = { step : Step.t option } @@ -6897,6 +8004,58 @@ module DescribeStepOutput = struct let of_json j = { step = Util.option_map (Json.lookup j "step") Step.of_json } end +module ListNotebookExecutionsInput = struct + type t = + { editor_id : String.t option + ; status : NotebookExecutionStatus.t option + ; from : DateTime.t option + ; to_ : DateTime.t option + ; marker : String.t option + } + + let make ?editor_id ?status ?from ?to_ ?marker () = + { editor_id; status; from; to_; marker } + + let parse xml = + Some + { editor_id = Util.option_bind (Xml.member "EditorId" xml) String.parse + ; status = Util.option_bind (Xml.member "Status" xml) NotebookExecutionStatus.parse + ; from = Util.option_bind (Xml.member "From" xml) DateTime.parse + ; to_ = Util.option_bind (Xml.member "To" xml) DateTime.parse + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Util.option_map v.to_ (fun f -> Query.Pair ("To", DateTime.to_query f)) + ; Util.option_map v.from (fun f -> Query.Pair ("From", DateTime.to_query f)) + ; Util.option_map v.status (fun f -> + Query.Pair ("Status", NotebookExecutionStatus.to_query f)) + ; Util.option_map v.editor_id (fun f -> + Query.Pair ("EditorId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Util.option_map v.to_ (fun f -> "to_", DateTime.to_json f) + ; Util.option_map v.from (fun f -> "from", DateTime.to_json f) + ; Util.option_map v.status (fun f -> "status", NotebookExecutionStatus.to_json f) + ; Util.option_map v.editor_id (fun f -> "editor_id", String.to_json f) + ]) + + let of_json j = + { editor_id = Util.option_map (Json.lookup j "editor_id") String.of_json + ; status = Util.option_map (Json.lookup j "status") NotebookExecutionStatus.of_json + ; from = Util.option_map (Json.lookup j "from") DateTime.of_json + ; to_ = Util.option_map (Json.lookup j "to_") DateTime.of_json + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + module AddInstanceGroupsInput = struct type t = { instance_groups : InstanceGroupConfigList.t @@ -7002,39 +8161,55 @@ end module CancelStepsInput = struct type t = - { cluster_id : String.t option + { cluster_id : String.t ; step_ids : StepIdsList.t + ; step_cancellation_option : StepCancellationOption.t option } - let make ?cluster_id ?(step_ids = []) () = { cluster_id; step_ids } + let make ~cluster_id ~step_ids ?step_cancellation_option () = + { cluster_id; step_ids; step_cancellation_option } let parse xml = Some - { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) ; step_ids = - Util.of_option - [] + Xml.required + "StepIds" (Util.option_bind (Xml.member "StepIds" xml) StepIdsList.parse) + ; step_cancellation_option = + Util.option_bind + (Xml.member "StepCancellationOption" xml) + StepCancellationOption.parse } let to_query v = Query.List (Util.list_filter_opt - [ Some (Query.Pair ("StepIds.member", StepIdsList.to_query v.step_ids)) - ; Util.option_map v.cluster_id (fun f -> - Query.Pair ("ClusterId", String.to_query f)) + [ Util.option_map v.step_cancellation_option (fun f -> + Query.Pair ("StepCancellationOption", StepCancellationOption.to_query f)) + ; Some (Query.Pair ("StepIds.member", StepIdsList.to_query v.step_ids)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) ]) let to_json v = `Assoc (Util.list_filter_opt - [ Some ("step_ids", StepIdsList.to_json v.step_ids) - ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) + [ Util.option_map v.step_cancellation_option (fun f -> + "step_cancellation_option", StepCancellationOption.to_json f) + ; Some ("step_ids", StepIdsList.to_json v.step_ids) + ; Some ("cluster_id", String.to_json v.cluster_id) ]) let of_json j = - { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) ; step_ids = StepIdsList.of_json (Util.of_option_exn (Json.lookup j "step_ids")) + ; step_cancellation_option = + Util.option_map + (Json.lookup j "step_cancellation_option") + StepCancellationOption.of_json } end @@ -7224,6 +8399,7 @@ module RunJobFlowInput = struct type t = { name : String.t ; log_uri : String.t option + ; log_encryption_kms_key_id : String.t option ; additional_info : String.t option ; ami_version : String.t option ; release_label : String.t option @@ -7245,11 +8421,15 @@ module RunJobFlowInput = struct ; ebs_root_volume_size : Integer.t option ; repo_upgrade_on_boot : RepoUpgradeOnBoot.t option ; kerberos_attributes : KerberosAttributes.t option + ; step_concurrency_level : Integer.t option + ; managed_scaling_policy : ManagedScalingPolicy.t option + ; placement_group_configs : PlacementGroupConfigList.t } let make ~name ?log_uri + ?log_encryption_kms_key_id ?additional_info ?ami_version ?release_label @@ -7271,9 +8451,13 @@ module RunJobFlowInput = struct ?ebs_root_volume_size ?repo_upgrade_on_boot ?kerberos_attributes + ?step_concurrency_level + ?managed_scaling_policy + ?(placement_group_configs = []) () = { name ; log_uri + ; log_encryption_kms_key_id ; additional_info ; ami_version ; release_label @@ -7295,12 +8479,17 @@ module RunJobFlowInput = struct ; ebs_root_volume_size ; repo_upgrade_on_boot ; kerberos_attributes + ; step_concurrency_level + ; managed_scaling_policy + ; placement_group_configs } let parse xml = Some { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) ; log_uri = Util.option_bind (Xml.member "LogUri" xml) String.parse + ; log_encryption_kms_key_id = + Util.option_bind (Xml.member "LogEncryptionKmsKeyId" xml) String.parse ; additional_info = Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse ; ami_version = Util.option_bind (Xml.member "AmiVersion" xml) String.parse ; release_label = Util.option_bind (Xml.member "ReleaseLabel" xml) String.parse @@ -7356,12 +8545,32 @@ module RunJobFlowInput = struct Util.option_bind (Xml.member "RepoUpgradeOnBoot" xml) RepoUpgradeOnBoot.parse ; kerberos_attributes = Util.option_bind (Xml.member "KerberosAttributes" xml) KerberosAttributes.parse + ; step_concurrency_level = + Util.option_bind (Xml.member "StepConcurrencyLevel" xml) Integer.parse + ; managed_scaling_policy = + Util.option_bind + (Xml.member "ManagedScalingPolicy" xml) + ManagedScalingPolicy.parse + ; placement_group_configs = + Util.of_option + [] + (Util.option_bind + (Xml.member "PlacementGroupConfigs" xml) + PlacementGroupConfigList.parse) } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.kerberos_attributes (fun f -> + [ Some + (Query.Pair + ( "PlacementGroupConfigs.member" + , PlacementGroupConfigList.to_query v.placement_group_configs )) + ; Util.option_map v.managed_scaling_policy (fun f -> + Query.Pair ("ManagedScalingPolicy", ManagedScalingPolicy.to_query f)) + ; Util.option_map v.step_concurrency_level (fun f -> + Query.Pair ("StepConcurrencyLevel", Integer.to_query f)) + ; Util.option_map v.kerberos_attributes (fun f -> Query.Pair ("KerberosAttributes", KerberosAttributes.to_query f)) ; Util.option_map v.repo_upgrade_on_boot (fun f -> Query.Pair ("RepoUpgradeOnBoot", RepoUpgradeOnBoot.to_query f)) @@ -7407,6 +8616,8 @@ module RunJobFlowInput = struct Query.Pair ("AmiVersion", String.to_query f)) ; Util.option_map v.additional_info (fun f -> Query.Pair ("AdditionalInfo", String.to_query f)) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + Query.Pair ("LogEncryptionKmsKeyId", String.to_query f)) ; Util.option_map v.log_uri (fun f -> Query.Pair ("LogUri", String.to_query f)) ; Some (Query.Pair ("Name", String.to_query v.name)) ]) @@ -7414,7 +8625,14 @@ module RunJobFlowInput = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.kerberos_attributes (fun f -> + [ Some + ( "placement_group_configs" + , PlacementGroupConfigList.to_json v.placement_group_configs ) + ; Util.option_map v.managed_scaling_policy (fun f -> + "managed_scaling_policy", ManagedScalingPolicy.to_json f) + ; Util.option_map v.step_concurrency_level (fun f -> + "step_concurrency_level", Integer.to_json f) + ; Util.option_map v.kerberos_attributes (fun f -> "kerberos_attributes", KerberosAttributes.to_json f) ; Util.option_map v.repo_upgrade_on_boot (fun f -> "repo_upgrade_on_boot", RepoUpgradeOnBoot.to_json f) @@ -7446,6 +8664,8 @@ module RunJobFlowInput = struct ; Util.option_map v.ami_version (fun f -> "ami_version", String.to_json f) ; Util.option_map v.additional_info (fun f -> "additional_info", String.to_json f) + ; Util.option_map v.log_encryption_kms_key_id (fun f -> + "log_encryption_kms_key_id", String.to_json f) ; Util.option_map v.log_uri (fun f -> "log_uri", String.to_json f) ; Some ("name", String.to_json v.name) ]) @@ -7453,6 +8673,8 @@ module RunJobFlowInput = struct let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) ; log_uri = Util.option_map (Json.lookup j "log_uri") String.of_json + ; log_encryption_kms_key_id = + Util.option_map (Json.lookup j "log_encryption_kms_key_id") String.of_json ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json ; ami_version = Util.option_map (Json.lookup j "ami_version") String.of_json ; release_label = Util.option_map (Json.lookup j "release_label") String.of_json @@ -7490,6 +8712,15 @@ module RunJobFlowInput = struct Util.option_map (Json.lookup j "repo_upgrade_on_boot") RepoUpgradeOnBoot.of_json ; kerberos_attributes = Util.option_map (Json.lookup j "kerberos_attributes") KerberosAttributes.of_json + ; step_concurrency_level = + Util.option_map (Json.lookup j "step_concurrency_level") Integer.of_json + ; managed_scaling_policy = + Util.option_map + (Json.lookup j "managed_scaling_policy") + ManagedScalingPolicy.of_json + ; placement_group_configs = + PlacementGroupConfigList.of_json + (Util.of_option_exn (Json.lookup j "placement_group_configs")) } end @@ -7757,6 +8988,205 @@ module AddJobFlowStepsInput = struct } end +module PutManagedScalingPolicyInput = struct + type t = + { cluster_id : String.t + ; managed_scaling_policy : ManagedScalingPolicy.t + } + + let make ~cluster_id ~managed_scaling_policy () = { cluster_id; managed_scaling_policy } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; managed_scaling_policy = + Xml.required + "ManagedScalingPolicy" + (Util.option_bind + (Xml.member "ManagedScalingPolicy" xml) + ManagedScalingPolicy.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "ManagedScalingPolicy" + , ManagedScalingPolicy.to_query v.managed_scaling_policy )) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "managed_scaling_policy" + , ManagedScalingPolicy.to_json v.managed_scaling_policy ) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; managed_scaling_policy = + ManagedScalingPolicy.of_json + (Util.of_option_exn (Json.lookup j "managed_scaling_policy")) + } +end + +module PutBlockPublicAccessConfigurationInput = struct + type t = { block_public_access_configuration : BlockPublicAccessConfiguration.t } + + let make ~block_public_access_configuration () = { block_public_access_configuration } + + let parse xml = + Some + { block_public_access_configuration = + Xml.required + "BlockPublicAccessConfiguration" + (Util.option_bind + (Xml.member "BlockPublicAccessConfiguration" xml) + BlockPublicAccessConfiguration.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "BlockPublicAccessConfiguration" + , BlockPublicAccessConfiguration.to_query + v.block_public_access_configuration )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "block_public_access_configuration" + , BlockPublicAccessConfiguration.to_json v.block_public_access_configuration + ) + ]) + + let of_json j = + { block_public_access_configuration = + BlockPublicAccessConfiguration.of_json + (Util.of_option_exn (Json.lookup j "block_public_access_configuration")) + } +end + +module ModifyClusterInput = struct + type t = + { cluster_id : String.t + ; step_concurrency_level : Integer.t option + } + + let make ~cluster_id ?step_concurrency_level () = { cluster_id; step_concurrency_level } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + ; step_concurrency_level = + Util.option_bind (Xml.member "StepConcurrencyLevel" xml) Integer.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.step_concurrency_level (fun f -> + Query.Pair ("StepConcurrencyLevel", Integer.to_query f)) + ; Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.step_concurrency_level (fun f -> + "step_concurrency_level", Integer.to_json f) + ; Some ("cluster_id", String.to_json v.cluster_id) + ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) + ; step_concurrency_level = + Util.option_map (Json.lookup j "step_concurrency_level") Integer.of_json + } +end + +module GetBlockPublicAccessConfigurationOutput = struct + type t = + { block_public_access_configuration : BlockPublicAccessConfiguration.t + ; block_public_access_configuration_metadata : + BlockPublicAccessConfigurationMetadata.t + } + + let make + ~block_public_access_configuration + ~block_public_access_configuration_metadata + () = + { block_public_access_configuration; block_public_access_configuration_metadata } + + let parse xml = + Some + { block_public_access_configuration = + Xml.required + "BlockPublicAccessConfiguration" + (Util.option_bind + (Xml.member "BlockPublicAccessConfiguration" xml) + BlockPublicAccessConfiguration.parse) + ; block_public_access_configuration_metadata = + Xml.required + "BlockPublicAccessConfigurationMetadata" + (Util.option_bind + (Xml.member "BlockPublicAccessConfigurationMetadata" xml) + BlockPublicAccessConfigurationMetadata.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair + ( "BlockPublicAccessConfigurationMetadata" + , BlockPublicAccessConfigurationMetadata.to_query + v.block_public_access_configuration_metadata )) + ; Some + (Query.Pair + ( "BlockPublicAccessConfiguration" + , BlockPublicAccessConfiguration.to_query + v.block_public_access_configuration )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some + ( "block_public_access_configuration_metadata" + , BlockPublicAccessConfigurationMetadata.to_json + v.block_public_access_configuration_metadata ) + ; Some + ( "block_public_access_configuration" + , BlockPublicAccessConfiguration.to_json v.block_public_access_configuration + ) + ]) + + let of_json j = + { block_public_access_configuration = + BlockPublicAccessConfiguration.of_json + (Util.of_option_exn (Json.lookup j "block_public_access_configuration")) + ; block_public_access_configuration_metadata = + BlockPublicAccessConfigurationMetadata.of_json + (Util.of_option_exn + (Json.lookup j "block_public_access_configuration_metadata")) + } +end + module ListInstanceGroupsOutput = struct type t = { instance_groups : InstanceGroupList.t @@ -7903,10 +9333,56 @@ module ListInstancesOutput = struct } end -module InternalServerException = struct - type t = { message : String.t option } - - let make ?message () = { message } +module ListNotebookExecutionsOutput = struct + type t = + { notebook_executions : NotebookExecutionSummaryList.t + ; marker : String.t option + } + + let make ?(notebook_executions = []) ?marker () = { notebook_executions; marker } + + let parse xml = + Some + { notebook_executions = + Util.of_option + [] + (Util.option_bind + (Xml.member "NotebookExecutions" xml) + NotebookExecutionSummaryList.parse) + ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) + ; Some + (Query.Pair + ( "NotebookExecutions.member" + , NotebookExecutionSummaryList.to_query v.notebook_executions )) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.marker (fun f -> "marker", String.to_json f) + ; Some + ( "notebook_executions" + , NotebookExecutionSummaryList.to_json v.notebook_executions ) + ]) + + let of_json j = + { notebook_executions = + NotebookExecutionSummaryList.of_json + (Util.of_option_exn (Json.lookup j "notebook_executions")) + ; marker = Util.option_map (Json.lookup j "marker") String.of_json + } +end + +module InternalServerException = struct + type t = { message : String.t option } + + let make ?message () = { message } let parse xml = Some { message = Util.option_bind (Xml.member "Message" xml) String.parse } @@ -8071,21 +9547,26 @@ module AddInstanceFleetOutput = struct type t = { cluster_id : String.t option ; instance_fleet_id : String.t option + ; cluster_arn : String.t option } - let make ?cluster_id ?instance_fleet_id () = { cluster_id; instance_fleet_id } + let make ?cluster_id ?instance_fleet_id ?cluster_arn () = + { cluster_id; instance_fleet_id; cluster_arn } let parse xml = Some { cluster_id = Util.option_bind (Xml.member "ClusterId" xml) String.parse ; instance_fleet_id = Util.option_bind (Xml.member "InstanceFleetId" xml) String.parse + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.instance_fleet_id (fun f -> + [ Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Util.option_map v.instance_fleet_id (fun f -> Query.Pair ("InstanceFleetId", String.to_query f)) ; Util.option_map v.cluster_id (fun f -> Query.Pair ("ClusterId", String.to_query f)) @@ -8094,7 +9575,8 @@ module AddInstanceFleetOutput = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.instance_fleet_id (fun f -> + [ Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Util.option_map v.instance_fleet_id (fun f -> "instance_fleet_id", String.to_json f) ; Util.option_map v.cluster_id (fun f -> "cluster_id", String.to_json f) ]) @@ -8103,6 +9585,42 @@ module AddInstanceFleetOutput = struct { cluster_id = Util.option_map (Json.lookup j "cluster_id") String.of_json ; instance_fleet_id = Util.option_map (Json.lookup j "instance_fleet_id") String.of_json + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + } +end + +module GetManagedScalingPolicyOutput = struct + type t = { managed_scaling_policy : ManagedScalingPolicy.t option } + + let make ?managed_scaling_policy () = { managed_scaling_policy } + + let parse xml = + Some + { managed_scaling_policy = + Util.option_bind + (Xml.member "ManagedScalingPolicy" xml) + ManagedScalingPolicy.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.managed_scaling_policy (fun f -> + Query.Pair ("ManagedScalingPolicy", ManagedScalingPolicy.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.managed_scaling_policy (fun f -> + "managed_scaling_policy", ManagedScalingPolicy.to_json f) + ]) + + let of_json j = + { managed_scaling_policy = + Util.option_map + (Json.lookup j "managed_scaling_policy") + ManagedScalingPolicy.of_json } end @@ -8120,15 +9638,47 @@ module InternalServerError = struct let of_json j = () end +module DescribeNotebookExecutionOutput = struct + type t = { notebook_execution : NotebookExecution.t option } + + let make ?notebook_execution () = { notebook_execution } + + let parse xml = + Some + { notebook_execution = + Util.option_bind (Xml.member "NotebookExecution" xml) NotebookExecution.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.notebook_execution (fun f -> + Query.Pair ("NotebookExecution", NotebookExecution.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.notebook_execution (fun f -> + "notebook_execution", NotebookExecution.to_json f) + ]) + + let of_json j = + { notebook_execution = + Util.option_map (Json.lookup j "notebook_execution") NotebookExecution.of_json + } +end + module PutAutoScalingPolicyOutput = struct type t = { cluster_id : String.t option ; instance_group_id : String.t option ; auto_scaling_policy : AutoScalingPolicyDescription.t option + ; cluster_arn : String.t option } - let make ?cluster_id ?instance_group_id ?auto_scaling_policy () = - { cluster_id; instance_group_id; auto_scaling_policy } + let make ?cluster_id ?instance_group_id ?auto_scaling_policy ?cluster_arn () = + { cluster_id; instance_group_id; auto_scaling_policy; cluster_arn } let parse xml = Some @@ -8139,12 +9689,15 @@ module PutAutoScalingPolicyOutput = struct Util.option_bind (Xml.member "AutoScalingPolicy" xml) AutoScalingPolicyDescription.parse + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.auto_scaling_policy (fun f -> + [ Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Util.option_map v.auto_scaling_policy (fun f -> Query.Pair ("AutoScalingPolicy", AutoScalingPolicyDescription.to_query f)) ; Util.option_map v.instance_group_id (fun f -> Query.Pair ("InstanceGroupId", String.to_query f)) @@ -8155,7 +9708,8 @@ module PutAutoScalingPolicyOutput = struct let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.auto_scaling_policy (fun f -> + [ Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Util.option_map v.auto_scaling_policy (fun f -> "auto_scaling_policy", AutoScalingPolicyDescription.to_json f) ; Util.option_map v.instance_group_id (fun f -> "instance_group_id", String.to_json f) @@ -8170,6 +9724,38 @@ module PutAutoScalingPolicyOutput = struct Util.option_map (Json.lookup j "auto_scaling_policy") AutoScalingPolicyDescription.of_json + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + } +end + +module StartNotebookExecutionOutput = struct + type t = { notebook_execution_id : String.t option } + + let make ?notebook_execution_id () = { notebook_execution_id } + + let parse xml = + Some + { notebook_execution_id = + Util.option_bind (Xml.member "NotebookExecutionId" xml) String.parse + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Util.option_map v.notebook_execution_id (fun f -> + Query.Pair ("NotebookExecutionId", String.to_query f)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Util.option_map v.notebook_execution_id (fun f -> + "notebook_execution_id", String.to_json f) + ]) + + let of_json j = + { notebook_execution_id = + Util.option_map (Json.lookup j "notebook_execution_id") String.of_json } end @@ -8392,37 +9978,50 @@ module ListBootstrapActionsOutput = struct end module RunJobFlowOutput = struct - type t = { job_flow_id : String.t option } + type t = + { job_flow_id : String.t option + ; cluster_arn : String.t option + } - let make ?job_flow_id () = { job_flow_id } + let make ?job_flow_id ?cluster_arn () = { job_flow_id; cluster_arn } let parse xml = - Some { job_flow_id = Util.option_bind (Xml.member "JobFlowId" xml) String.parse } + Some + { job_flow_id = Util.option_bind (Xml.member "JobFlowId" xml) String.parse + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse + } let to_query v = Query.List (Util.list_filter_opt - [ Util.option_map v.job_flow_id (fun f -> + [ Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Util.option_map v.job_flow_id (fun f -> Query.Pair ("JobFlowId", String.to_query f)) ]) let to_json v = `Assoc (Util.list_filter_opt - [ Util.option_map v.job_flow_id (fun f -> "job_flow_id", String.to_json f) ]) + [ Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Util.option_map v.job_flow_id (fun f -> "job_flow_id", String.to_json f) + ]) let of_json j = - { job_flow_id = Util.option_map (Json.lookup j "job_flow_id") String.of_json } + { job_flow_id = Util.option_map (Json.lookup j "job_flow_id") String.of_json + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + } end module AddInstanceGroupsOutput = struct type t = { job_flow_id : String.t option ; instance_group_ids : InstanceGroupIdsList.t + ; cluster_arn : String.t option } - let make ?job_flow_id ?(instance_group_ids = []) () = - { job_flow_id; instance_group_ids } + let make ?job_flow_id ?(instance_group_ids = []) ?cluster_arn () = + { job_flow_id; instance_group_ids; cluster_arn } let parse xml = Some @@ -8433,12 +10032,15 @@ module AddInstanceGroupsOutput = struct (Util.option_bind (Xml.member "InstanceGroupIds" xml) InstanceGroupIdsList.parse) + ; cluster_arn = Util.option_bind (Xml.member "ClusterArn" xml) String.parse } let to_query v = Query.List (Util.list_filter_opt - [ Some + [ Util.option_map v.cluster_arn (fun f -> + Query.Pair ("ClusterArn", String.to_query f)) + ; Some (Query.Pair ( "InstanceGroupIds.member" , InstanceGroupIdsList.to_query v.instance_group_ids )) @@ -8449,7 +10051,8 @@ module AddInstanceGroupsOutput = struct let to_json v = `Assoc (Util.list_filter_opt - [ Some ("instance_group_ids", InstanceGroupIdsList.to_json v.instance_group_ids) + [ Util.option_map v.cluster_arn (fun f -> "cluster_arn", String.to_json f) + ; Some ("instance_group_ids", InstanceGroupIdsList.to_json v.instance_group_ids) ; Util.option_map v.job_flow_id (fun f -> "job_flow_id", String.to_json f) ]) @@ -8458,6 +10061,164 @@ module AddInstanceGroupsOutput = struct ; instance_group_ids = InstanceGroupIdsList.of_json (Util.of_option_exn (Json.lookup j "instance_group_ids")) + ; cluster_arn = Util.option_map (Json.lookup j "cluster_arn") String.of_json + } +end + +module PutBlockPublicAccessConfigurationOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module StartNotebookExecutionInput = struct + type t = + { editor_id : String.t + ; relative_path : String.t + ; notebook_execution_name : String.t option + ; notebook_params : String.t option + ; execution_engine : ExecutionEngineConfig.t + ; service_role : String.t + ; notebook_instance_security_group_id : String.t option + ; tags : TagList.t + } + + let make + ~editor_id + ~relative_path + ?notebook_execution_name + ?notebook_params + ~execution_engine + ~service_role + ?notebook_instance_security_group_id + ?(tags = []) + () = + { editor_id + ; relative_path + ; notebook_execution_name + ; notebook_params + ; execution_engine + ; service_role + ; notebook_instance_security_group_id + ; tags + } + + let parse xml = + Some + { editor_id = + Xml.required + "EditorId" + (Util.option_bind (Xml.member "EditorId" xml) String.parse) + ; relative_path = + Xml.required + "RelativePath" + (Util.option_bind (Xml.member "RelativePath" xml) String.parse) + ; notebook_execution_name = + Util.option_bind (Xml.member "NotebookExecutionName" xml) String.parse + ; notebook_params = Util.option_bind (Xml.member "NotebookParams" xml) String.parse + ; execution_engine = + Xml.required + "ExecutionEngine" + (Util.option_bind + (Xml.member "ExecutionEngine" xml) + ExecutionEngineConfig.parse) + ; service_role = + Xml.required + "ServiceRole" + (Util.option_bind (Xml.member "ServiceRole" xml) String.parse) + ; notebook_instance_security_group_id = + Util.option_bind (Xml.member "NotebookInstanceSecurityGroupId" xml) String.parse + ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) + ; Util.option_map v.notebook_instance_security_group_id (fun f -> + Query.Pair ("NotebookInstanceSecurityGroupId", String.to_query f)) + ; Some (Query.Pair ("ServiceRole", String.to_query v.service_role)) + ; Some + (Query.Pair + ("ExecutionEngine", ExecutionEngineConfig.to_query v.execution_engine)) + ; Util.option_map v.notebook_params (fun f -> + Query.Pair ("NotebookParams", String.to_query f)) + ; Util.option_map v.notebook_execution_name (fun f -> + Query.Pair ("NotebookExecutionName", String.to_query f)) + ; Some (Query.Pair ("RelativePath", String.to_query v.relative_path)) + ; Some (Query.Pair ("EditorId", String.to_query v.editor_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("tags", TagList.to_json v.tags) + ; Util.option_map v.notebook_instance_security_group_id (fun f -> + "notebook_instance_security_group_id", String.to_json f) + ; Some ("service_role", String.to_json v.service_role) + ; Some ("execution_engine", ExecutionEngineConfig.to_json v.execution_engine) + ; Util.option_map v.notebook_params (fun f -> + "notebook_params", String.to_json f) + ; Util.option_map v.notebook_execution_name (fun f -> + "notebook_execution_name", String.to_json f) + ; Some ("relative_path", String.to_json v.relative_path) + ; Some ("editor_id", String.to_json v.editor_id) + ]) + + let of_json j = + { editor_id = String.of_json (Util.of_option_exn (Json.lookup j "editor_id")) + ; relative_path = String.of_json (Util.of_option_exn (Json.lookup j "relative_path")) + ; notebook_execution_name = + Util.option_map (Json.lookup j "notebook_execution_name") String.of_json + ; notebook_params = Util.option_map (Json.lookup j "notebook_params") String.of_json + ; execution_engine = + ExecutionEngineConfig.of_json + (Util.of_option_exn (Json.lookup j "execution_engine")) + ; service_role = String.of_json (Util.of_option_exn (Json.lookup j "service_role")) + ; notebook_instance_security_group_id = + Util.option_map + (Json.lookup j "notebook_instance_security_group_id") + String.of_json + ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) + } +end + +module DescribeNotebookExecutionInput = struct + type t = { notebook_execution_id : String.t } + + let make ~notebook_execution_id () = { notebook_execution_id } + + let parse xml = + Some + { notebook_execution_id = + Xml.required + "NotebookExecutionId" + (Util.option_bind (Xml.member "NotebookExecutionId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("NotebookExecutionId", String.to_query v.notebook_execution_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("notebook_execution_id", String.to_json v.notebook_execution_id) ]) + + let of_json j = + { notebook_execution_id = + String.of_json (Util.of_option_exn (Json.lookup j "notebook_execution_id")) } end @@ -8502,6 +10263,84 @@ module RemoveAutoScalingPolicyInput = struct } end +module RemoveManagedScalingPolicyInput = struct + type t = { cluster_id : String.t } + + let make ~cluster_id () = { cluster_id } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) ]) + + let to_json v = + `Assoc (Util.list_filter_opt [ Some ("cluster_id", String.to_json v.cluster_id) ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) } +end + +module GetBlockPublicAccessConfigurationInput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + +module GetManagedScalingPolicyInput = struct + type t = { cluster_id : String.t } + + let make ~cluster_id () = { cluster_id } + + let parse xml = + Some + { cluster_id = + Xml.required + "ClusterId" + (Util.option_bind (Xml.member "ClusterId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some (Query.Pair ("ClusterId", String.to_query v.cluster_id)) ]) + + let to_json v = + `Assoc (Util.list_filter_opt [ Some ("cluster_id", String.to_json v.cluster_id) ]) + + let of_json j = + { cluster_id = String.of_json (Util.of_option_exn (Json.lookup j "cluster_id")) } +end + +module RemoveManagedScalingPolicyOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end + module DescribeSecurityConfigurationOutput = struct type t = { name : String.t option @@ -8580,6 +10419,37 @@ module TerminateJobFlowsInput = struct } end +module StopNotebookExecutionInput = struct + type t = { notebook_execution_id : String.t } + + let make ~notebook_execution_id () = { notebook_execution_id } + + let parse xml = + Some + { notebook_execution_id = + Xml.required + "NotebookExecutionId" + (Util.option_bind (Xml.member "NotebookExecutionId" xml) String.parse) + } + + let to_query v = + Query.List + (Util.list_filter_opt + [ Some + (Query.Pair ("NotebookExecutionId", String.to_query v.notebook_execution_id)) + ]) + + let to_json v = + `Assoc + (Util.list_filter_opt + [ Some ("notebook_execution_id", String.to_json v.notebook_execution_id) ]) + + let of_json j = + { notebook_execution_id = + String.of_json (Util.of_option_exn (Json.lookup j "notebook_execution_id")) + } +end + module CancelStepsOutput = struct type t = { cancel_steps_info_list : CancelStepsInfoList.t } @@ -8848,3 +10718,17 @@ module AddInstanceFleetInput = struct InstanceFleetConfig.of_json (Util.of_option_exn (Json.lookup j "instance_fleet")) } end + +module PutManagedScalingPolicyOutput = struct + type t = unit + + let make () = () + + let parse xml = Some () + + let to_query v = Query.List (Util.list_filter_opt []) + + let to_json v = `Assoc (Util.list_filter_opt []) + + let of_json j = () +end diff --git a/libraries/elasticmapreduce/lib_test/dune b/libraries/elasticmapreduce/lib_test/dune index 4d3f2c822..cfafc16d6 100644 --- a/libraries/elasticmapreduce/lib_test/dune +++ b/libraries/elasticmapreduce/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_elasticmapreduce_test) - (libraries aws aws_elasticmapreduce aws-async aws-lwt oUnit yojson async - cohttp-async lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_elasticmapreduce aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/elasticmapreduce/lib_test/test_async.ml b/libraries/elasticmapreduce/lib_test/test_async.ml index 6bd4e6ad0..6ddda6cd5 100644 --- a/libraries/elasticmapreduce/lib_test/test_async.ml +++ b/libraries/elasticmapreduce/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_elasticmapreduce_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/elasticmapreduce/lib_test/test_lwt.ml b/libraries/elasticmapreduce/lib_test/test_lwt.ml index 685831779..5364d5f98 100644 --- a/libraries/elasticmapreduce/lib_test/test_lwt.ml +++ b/libraries/elasticmapreduce/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_elasticmapreduce_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/rds/lib/addSourceIdentifierToSubscription.ml b/libraries/rds/lib/addSourceIdentifierToSubscription.ml index 37f598fc4..329bc14d5 100644 --- a/libraries/rds/lib/addSourceIdentifierToSubscription.ml +++ b/libraries/rds/lib/addSourceIdentifierToSubscription.ml @@ -1,72 +1,66 @@ open Types open Aws - type input = AddSourceIdentifierToSubscriptionMessage.t - type output = AddSourceIdentifierToSubscriptionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "AddSourceIdentifierToSubscription" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["AddSourceIdentifierToSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AddSourceIdentifierToSubscriptionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (AddSourceIdentifierToSubscriptionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "AddSourceIdentifierToSubscriptionResponse" (snd xml)) - (Xml.member "AddSourceIdentifierToSubscriptionResult") - in + (Xml.member "AddSourceIdentifierToSubscriptionResult") in try Util.or_error (Util.option_bind resp AddSourceIdentifierToSubscriptionResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed AddSourceIdentifierToSubscriptionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AddSourceIdentifierToSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AddSourceIdentifierToSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AddSourceIdentifierToSubscriptionResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SourceNotFound; Errors_internal.SubscriptionNotFound ] - @ Errors_internal.common - in + [Errors_internal.SourceNotFound; Errors_internal.SubscriptionNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/addSourceIdentifierToSubscription.mli b/libraries/rds/lib/addSourceIdentifierToSubscription.mli index afc58b814..d09798ce7 100644 --- a/libraries/rds/lib/addSourceIdentifierToSubscription.mli +++ b/libraries/rds/lib/addSourceIdentifierToSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = AddSourceIdentifierToSubscriptionMessage.t - type output = AddSourceIdentifierToSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/addTagsToResource.ml b/libraries/rds/lib/addTagsToResource.ml index 61553c512..4d19e02ee 100644 --- a/libraries/rds/lib/addTagsToResource.ml +++ b/libraries/rds/lib/addTagsToResource.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = AddTagsToResourceMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "AddTagsToResource" ] ] + [("Version", ["2014-10-31"]); ("Action", ["AddTagsToResource"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AddTagsToResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AddTagsToResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound ] - @ Errors_internal.common - in + [Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound] + @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/addTagsToResource.mli b/libraries/rds/lib/addTagsToResource.mli index 4f6416e83..208239bc8 100644 --- a/libraries/rds/lib/addTagsToResource.mli +++ b/libraries/rds/lib/addTagsToResource.mli @@ -1,10 +1,7 @@ open Types - type input = AddTagsToResourceMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/applyPendingMaintenanceAction.ml b/libraries/rds/lib/applyPendingMaintenanceAction.ml index ff9cdd4cb..712df287b 100644 --- a/libraries/rds/lib/applyPendingMaintenanceAction.ml +++ b/libraries/rds/lib/applyPendingMaintenanceAction.ml @@ -1,66 +1,65 @@ open Types open Aws - type input = ApplyPendingMaintenanceActionMessage.t - type output = ApplyPendingMaintenanceActionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ApplyPendingMaintenanceAction" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["ApplyPendingMaintenanceAction"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ApplyPendingMaintenanceActionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ApplyPendingMaintenanceActionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ApplyPendingMaintenanceActionResponse" (snd xml)) - (Xml.member "ApplyPendingMaintenanceActionResult") - in + (Xml.member "ApplyPendingMaintenanceActionResult") in try Util.or_error (Util.option_bind resp ApplyPendingMaintenanceActionResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ApplyPendingMaintenanceActionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ApplyPendingMaintenanceActionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ApplyPendingMaintenanceActionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ApplyPendingMaintenanceActionResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceNotFoundFault ] @ Errors_internal.common in + let errors = + [Errors_internal.ResourceNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/applyPendingMaintenanceAction.mli b/libraries/rds/lib/applyPendingMaintenanceAction.mli index 0c4029a9e..bea1b35fc 100644 --- a/libraries/rds/lib/applyPendingMaintenanceAction.mli +++ b/libraries/rds/lib/applyPendingMaintenanceAction.mli @@ -1,10 +1,7 @@ open Types - type input = ApplyPendingMaintenanceActionMessage.t - type output = ApplyPendingMaintenanceActionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml b/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml index 4f2f5d906..8b1fd3813 100644 --- a/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml +++ b/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml @@ -1,73 +1,68 @@ open Types open Aws - type input = AuthorizeDBSecurityGroupIngressMessage.t - type output = AuthorizeDBSecurityGroupIngressResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "AuthorizeDBSecurityGroupIngress" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["AuthorizeDBSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AuthorizeDBSecurityGroupIngressMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (AuthorizeDBSecurityGroupIngressMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "AuthorizeDBSecurityGroupIngressResponse" (snd xml)) - (Xml.member "AuthorizeDBSecurityGroupIngressResult") - in + (Xml.member "AuthorizeDBSecurityGroupIngressResult") in try Util.or_error (Util.option_bind resp AuthorizeDBSecurityGroupIngressResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed AuthorizeDBSecurityGroupIngressResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AuthorizeDBSecurityGroupIngressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AuthorizeDBSecurityGroupIngressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AuthorizeDBSecurityGroupIngressResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AuthorizationQuotaExceeded - ; Errors_internal.AuthorizationAlreadyExists - ; Errors_internal.InvalidDBSecurityGroupState - ; Errors_internal.DBSecurityGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.AuthorizationQuotaExceeded; + Errors_internal.AuthorizationAlreadyExists; + Errors_internal.InvalidDBSecurityGroupState; + Errors_internal.DBSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/authorizeDBSecurityGroupIngress.mli b/libraries/rds/lib/authorizeDBSecurityGroupIngress.mli index 33797ed7e..823f363bf 100644 --- a/libraries/rds/lib/authorizeDBSecurityGroupIngress.mli +++ b/libraries/rds/lib/authorizeDBSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = AuthorizeDBSecurityGroupIngressMessage.t - type output = AuthorizeDBSecurityGroupIngressResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBClusterSnapshot.ml b/libraries/rds/lib/copyDBClusterSnapshot.ml index 2737873c0..6d88ad4fe 100644 --- a/libraries/rds/lib/copyDBClusterSnapshot.ml +++ b/libraries/rds/lib/copyDBClusterSnapshot.ml @@ -1,70 +1,64 @@ open Types open Aws - type input = CopyDBClusterSnapshotMessage.t - type output = CopyDBClusterSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CopyDBClusterSnapshot" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CopyDBClusterSnapshot"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CopyDBClusterSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CopyDBClusterSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CopyDBClusterSnapshotResponse" (snd xml)) - (Xml.member "CopyDBClusterSnapshotResult") - in + Util.option_bind (Xml.member "CopyDBClusterSnapshotResponse" (snd xml)) + (Xml.member "CopyDBClusterSnapshotResult") in try - Util.or_error - (Util.option_bind resp CopyDBClusterSnapshotResult.parse) + Util.or_error (Util.option_bind resp CopyDBClusterSnapshotResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CopyDBClusterSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CopyDBClusterSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyDBClusterSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyDBClusterSnapshotResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBClusterStateFault - ; Errors_internal.DBClusterSnapshotNotFoundFault - ; Errors_internal.DBClusterSnapshotAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBClusterSnapshotNotFoundFault; + Errors_internal.DBClusterSnapshotAlreadyExistsFault] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBClusterSnapshot.mli b/libraries/rds/lib/copyDBClusterSnapshot.mli index 54c62098a..604fead40 100644 --- a/libraries/rds/lib/copyDBClusterSnapshot.mli +++ b/libraries/rds/lib/copyDBClusterSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CopyDBClusterSnapshotMessage.t - type output = CopyDBClusterSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBParameterGroup.ml b/libraries/rds/lib/copyDBParameterGroup.ml index 2929d1717..e58ed44e2 100644 --- a/libraries/rds/lib/copyDBParameterGroup.ml +++ b/libraries/rds/lib/copyDBParameterGroup.ml @@ -1,70 +1,63 @@ open Types open Aws - type input = CopyDBParameterGroupMessage.t - type output = CopyDBParameterGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CopyDBParameterGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CopyDBParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CopyDBParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CopyDBParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CopyDBParameterGroupResponse" (snd xml)) - (Xml.member "CopyDBParameterGroupResult") - in + Util.option_bind (Xml.member "CopyDBParameterGroupResponse" (snd xml)) + (Xml.member "CopyDBParameterGroupResult") in try - Util.or_error - (Util.option_bind resp CopyDBParameterGroupResult.parse) + Util.or_error (Util.option_bind resp CopyDBParameterGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CopyDBParameterGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CopyDBParameterGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyDBParameterGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyDBParameterGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupQuotaExceeded - ; Errors_internal.DBParameterGroupAlreadyExists - ; Errors_internal.DBParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupQuotaExceeded; + Errors_internal.DBParameterGroupAlreadyExists; + Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBParameterGroup.mli b/libraries/rds/lib/copyDBParameterGroup.mli index 6423f419e..3a68e2978 100644 --- a/libraries/rds/lib/copyDBParameterGroup.mli +++ b/libraries/rds/lib/copyDBParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CopyDBParameterGroupMessage.t - type output = CopyDBParameterGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBSnapshot.ml b/libraries/rds/lib/copyDBSnapshot.ml index 42e77ac1c..ea669ac69 100644 --- a/libraries/rds/lib/copyDBSnapshot.ml +++ b/libraries/rds/lib/copyDBSnapshot.ml @@ -1,68 +1,63 @@ open Types open Aws - type input = CopyDBSnapshotMessage.t - type output = CopyDBSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CopyDBSnapshot" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CopyDBSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopyDBSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CopyDBSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CopyDBSnapshotResponse" (snd xml)) - (Xml.member "CopyDBSnapshotResult") - in + Util.option_bind (Xml.member "CopyDBSnapshotResponse" (snd xml)) + (Xml.member "CopyDBSnapshotResult") in try - Util.or_error - (Util.option_bind resp CopyDBSnapshotResult.parse) + Util.or_error (Util.option_bind resp CopyDBSnapshotResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CopyDBSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CopyDBSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyDBSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyDBSnapshotResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SnapshotQuotaExceeded - ; Errors_internal.InvalidDBSnapshotState - ; Errors_internal.DBSnapshotNotFound - ; Errors_internal.DBSnapshotAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.SnapshotQuotaExceeded; + Errors_internal.InvalidDBSnapshotState; + Errors_internal.DBSnapshotNotFound; + Errors_internal.DBSnapshotAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/copyDBSnapshot.mli b/libraries/rds/lib/copyDBSnapshot.mli index 50b1fe687..817558d79 100644 --- a/libraries/rds/lib/copyDBSnapshot.mli +++ b/libraries/rds/lib/copyDBSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CopyDBSnapshotMessage.t - type output = CopyDBSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/copyOptionGroup.ml b/libraries/rds/lib/copyOptionGroup.ml index 352e8dcb6..59d4a13bd 100644 --- a/libraries/rds/lib/copyOptionGroup.ml +++ b/libraries/rds/lib/copyOptionGroup.ml @@ -1,68 +1,62 @@ open Types open Aws - type input = CopyOptionGroupMessage.t - type output = CopyOptionGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CopyOptionGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CopyOptionGroup"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopyOptionGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CopyOptionGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CopyOptionGroupResponse" (snd xml)) - (Xml.member "CopyOptionGroupResult") - in + Util.option_bind (Xml.member "CopyOptionGroupResponse" (snd xml)) + (Xml.member "CopyOptionGroupResult") in try - Util.or_error - (Util.option_bind resp CopyOptionGroupResult.parse) + Util.or_error (Util.option_bind resp CopyOptionGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CopyOptionGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CopyOptionGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyOptionGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyOptionGroupResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.OptionGroupQuotaExceededFault - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.OptionGroupAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.OptionGroupQuotaExceededFault; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.OptionGroupAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/copyOptionGroup.mli b/libraries/rds/lib/copyOptionGroup.mli index 921f79608..0aa10b9bc 100644 --- a/libraries/rds/lib/copyOptionGroup.mli +++ b/libraries/rds/lib/copyOptionGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CopyOptionGroupMessage.t - type output = CopyOptionGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBCluster.ml b/libraries/rds/lib/createDBCluster.ml index 80e3f0c53..d74d0a887 100644 --- a/libraries/rds/lib/createDBCluster.ml +++ b/libraries/rds/lib/createDBCluster.ml @@ -1,75 +1,69 @@ open Types open Aws - type input = CreateDBClusterMessage.t - type output = CreateDBClusterResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBCluster" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateDBCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDBClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDBClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateDBClusterResponse" (snd xml)) - (Xml.member "CreateDBClusterResult") - in + Util.option_bind (Xml.member "CreateDBClusterResponse" (snd xml)) + (Xml.member "CreateDBClusterResult") in try - Util.or_error - (Util.option_bind resp CreateDBClusterResult.parse) + Util.or_error (Util.option_bind resp CreateDBClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateDBClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBClusterResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBClusterParameterGroupNotFound - ; Errors_internal.InvalidSubnet - ; Errors_internal.InvalidDBSubnetGroupStateFault - ; Errors_internal.InvalidDBClusterStateFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.DBClusterQuotaExceededFault - ; Errors_internal.InsufficientStorageClusterCapacity - ; Errors_internal.DBClusterAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.DBClusterParameterGroupNotFound; + Errors_internal.InvalidSubnet; + Errors_internal.InvalidDBSubnetGroupStateFault; + Errors_internal.InvalidDBClusterStateFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.DBClusterQuotaExceededFault; + Errors_internal.InsufficientStorageClusterCapacity; + Errors_internal.DBClusterAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBCluster.mli b/libraries/rds/lib/createDBCluster.mli index bf5d74f3c..155d7538c 100644 --- a/libraries/rds/lib/createDBCluster.mli +++ b/libraries/rds/lib/createDBCluster.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBClusterMessage.t - type output = CreateDBClusterResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBClusterParameterGroup.ml b/libraries/rds/lib/createDBClusterParameterGroup.ml index 56918daa6..02599c530 100644 --- a/libraries/rds/lib/createDBClusterParameterGroup.ml +++ b/libraries/rds/lib/createDBClusterParameterGroup.ml @@ -1,71 +1,66 @@ open Types open Aws - type input = CreateDBClusterParameterGroupMessage.t - type output = CreateDBClusterParameterGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBClusterParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["CreateDBClusterParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBClusterParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateDBClusterParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateDBClusterParameterGroupResponse" (snd xml)) - (Xml.member "CreateDBClusterParameterGroupResult") - in + (Xml.member "CreateDBClusterParameterGroupResult") in try Util.or_error (Util.option_bind resp CreateDBClusterParameterGroupResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateDBClusterParameterGroupResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBClusterParameterGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBClusterParameterGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBClusterParameterGroupResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupAlreadyExists - ; Errors_internal.DBParameterGroupQuotaExceeded - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupAlreadyExists; + Errors_internal.DBParameterGroupQuotaExceeded] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBClusterParameterGroup.mli b/libraries/rds/lib/createDBClusterParameterGroup.mli index b0fe7b9b9..c1f371ffa 100644 --- a/libraries/rds/lib/createDBClusterParameterGroup.mli +++ b/libraries/rds/lib/createDBClusterParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBClusterParameterGroupMessage.t - type output = CreateDBClusterParameterGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBClusterSnapshot.ml b/libraries/rds/lib/createDBClusterSnapshot.ml index cd40cca78..ae07f0195 100644 --- a/libraries/rds/lib/createDBClusterSnapshot.ml +++ b/libraries/rds/lib/createDBClusterSnapshot.ml @@ -1,71 +1,68 @@ open Types open Aws - type input = CreateDBClusterSnapshotMessage.t - type output = CreateDBClusterSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBClusterSnapshot" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["CreateDBClusterSnapshot"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBClusterSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateDBClusterSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateDBClusterSnapshotResponse" (snd xml)) - (Xml.member "CreateDBClusterSnapshotResult") - in + (Xml.member "CreateDBClusterSnapshotResult") in try Util.or_error (Util.option_bind resp CreateDBClusterSnapshotResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBClusterSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBClusterSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBClusterSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBClusterSnapshotResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SnapshotQuotaExceeded - ; Errors_internal.DBClusterNotFoundFault - ; Errors_internal.InvalidDBClusterStateFault - ; Errors_internal.DBClusterSnapshotAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.SnapshotQuotaExceeded; + Errors_internal.DBClusterNotFoundFault; + Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBClusterSnapshotAlreadyExistsFault] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBClusterSnapshot.mli b/libraries/rds/lib/createDBClusterSnapshot.mli index 00655c73d..c7c85d42e 100644 --- a/libraries/rds/lib/createDBClusterSnapshot.mli +++ b/libraries/rds/lib/createDBClusterSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBClusterSnapshotMessage.t - type output = CreateDBClusterSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBInstance.ml b/libraries/rds/lib/createDBInstance.ml index 398db584f..58f6fa5db 100644 --- a/libraries/rds/lib/createDBInstance.ml +++ b/libraries/rds/lib/createDBInstance.ml @@ -1,85 +1,78 @@ open Types open Aws - type input = CreateDBInstanceMessage.t - type output = CreateDBInstanceResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBInstance" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateDBInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDBInstanceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDBInstanceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateDBInstanceResponse" (snd xml)) - (Xml.member "CreateDBInstanceResult") - in + Util.option_bind (Xml.member "CreateDBInstanceResponse" (snd xml)) + (Xml.member "CreateDBInstanceResult") in try - Util.or_error - (Util.option_bind resp CreateDBInstanceResult.parse) + Util.or_error (Util.option_bind resp CreateDBInstanceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateDBInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBInstanceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientDomainCapacityFault - ; Errors_internal.DomainNotFoundFault - ; Errors_internal.KMSKeyNotAccessibleFault - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.StorageTypeNotSupported - ; Errors_internal.DBClusterNotFoundFault - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.ProvisionedIopsNotAvailableInAZFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.InvalidDBClusterStateFault - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InstanceQuotaExceeded - ; Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InsufficientDBInstanceCapacity - ; Errors_internal.DBInstanceAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InsufficientDomainCapacityFault; + Errors_internal.DomainNotFoundFault; + Errors_internal.KMSKeyNotAccessibleFault; + Errors_internal.AuthorizationNotFound; + Errors_internal.StorageTypeNotSupported; + Errors_internal.DBClusterNotFoundFault; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.ProvisionedIopsNotAvailableInAZFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.InvalidSubnet; + Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InstanceQuotaExceeded; + Errors_internal.DBSecurityGroupNotFound; + Errors_internal.DBParameterGroupNotFound; + Errors_internal.InsufficientDBInstanceCapacity; + Errors_internal.DBInstanceAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBInstance.mli b/libraries/rds/lib/createDBInstance.mli index a58e9cbbd..5bef6b5ad 100644 --- a/libraries/rds/lib/createDBInstance.mli +++ b/libraries/rds/lib/createDBInstance.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBInstanceMessage.t - type output = CreateDBInstanceResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBInstanceReadReplica.ml b/libraries/rds/lib/createDBInstanceReadReplica.ml index 38f21675f..72769f43c 100644 --- a/libraries/rds/lib/createDBInstanceReadReplica.ml +++ b/libraries/rds/lib/createDBInstanceReadReplica.ml @@ -1,87 +1,82 @@ open Types open Aws - type input = CreateDBInstanceReadReplicaMessage.t - type output = CreateDBInstanceReadReplicaResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBInstanceReadReplica" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["CreateDBInstanceReadReplica"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBInstanceReadReplicaMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateDBInstanceReadReplicaMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateDBInstanceReadReplicaResponse" (snd xml)) - (Xml.member "CreateDBInstanceReadReplicaResult") - in + (Xml.member "CreateDBInstanceReadReplicaResult") in try Util.or_error (Util.option_bind resp CreateDBInstanceReadReplicaResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateDBInstanceReadReplicaResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBInstanceReadReplicaResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBInstanceReadReplicaResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBInstanceReadReplicaResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.KMSKeyNotAccessibleFault - ; Errors_internal.StorageTypeNotSupported - ; Errors_internal.InvalidDBSubnetGroupFault - ; Errors_internal.DBSubnetGroupNotAllowedFault - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.ProvisionedIopsNotAvailableInAZFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidDBInstanceState - ; Errors_internal.DBInstanceNotFound - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InstanceQuotaExceeded - ; Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InsufficientDBInstanceCapacity - ; Errors_internal.DBInstanceAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.KMSKeyNotAccessibleFault; + Errors_internal.StorageTypeNotSupported; + Errors_internal.InvalidDBSubnetGroupFault; + Errors_internal.DBSubnetGroupNotAllowedFault; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.ProvisionedIopsNotAvailableInAZFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidDBInstanceState; + Errors_internal.DBInstanceNotFound; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InstanceQuotaExceeded; + Errors_internal.DBSecurityGroupNotFound; + Errors_internal.DBParameterGroupNotFound; + Errors_internal.InsufficientDBInstanceCapacity; + Errors_internal.DBInstanceAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBInstanceReadReplica.mli b/libraries/rds/lib/createDBInstanceReadReplica.mli index d2c23903d..1436fe55b 100644 --- a/libraries/rds/lib/createDBInstanceReadReplica.mli +++ b/libraries/rds/lib/createDBInstanceReadReplica.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBInstanceReadReplicaMessage.t - type output = CreateDBInstanceReadReplicaResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBParameterGroup.ml b/libraries/rds/lib/createDBParameterGroup.ml index 8cbd7bba4..6edd4a923 100644 --- a/libraries/rds/lib/createDBParameterGroup.ml +++ b/libraries/rds/lib/createDBParameterGroup.ml @@ -1,69 +1,65 @@ open Types open Aws - type input = CreateDBParameterGroupMessage.t - type output = CreateDBParameterGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["CreateDBParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateDBParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateDBParameterGroupResponse" (snd xml)) - (Xml.member "CreateDBParameterGroupResult") - in + (Xml.member "CreateDBParameterGroupResult") in try Util.or_error (Util.option_bind resp CreateDBParameterGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBParameterGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBParameterGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBParameterGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBParameterGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupAlreadyExists - ; Errors_internal.DBParameterGroupQuotaExceeded - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupAlreadyExists; + Errors_internal.DBParameterGroupQuotaExceeded] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBParameterGroup.mli b/libraries/rds/lib/createDBParameterGroup.mli index 02c761a7e..4ae3032c5 100644 --- a/libraries/rds/lib/createDBParameterGroup.mli +++ b/libraries/rds/lib/createDBParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBParameterGroupMessage.t - type output = CreateDBParameterGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSecurityGroup.ml b/libraries/rds/lib/createDBSecurityGroup.ml index eb3b67f98..6eaa3ed2f 100644 --- a/libraries/rds/lib/createDBSecurityGroup.ml +++ b/libraries/rds/lib/createDBSecurityGroup.ml @@ -1,70 +1,63 @@ open Types open Aws - type input = CreateDBSecurityGroupMessage.t - type output = CreateDBSecurityGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBSecurityGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateDBSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBSecurityGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateDBSecurityGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateDBSecurityGroupResponse" (snd xml)) - (Xml.member "CreateDBSecurityGroupResult") - in + Util.option_bind (Xml.member "CreateDBSecurityGroupResponse" (snd xml)) + (Xml.member "CreateDBSecurityGroupResult") in try - Util.or_error - (Util.option_bind resp CreateDBSecurityGroupResult.parse) + Util.or_error (Util.option_bind resp CreateDBSecurityGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBSecurityGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBSecurityGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBSecurityGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBSecurityGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBSecurityGroupNotSupported - ; Errors_internal.QuotaExceeded_DBSecurityGroup - ; Errors_internal.DBSecurityGroupAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.DBSecurityGroupNotSupported; + Errors_internal.QuotaExceeded_DBSecurityGroup; + Errors_internal.DBSecurityGroupAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSecurityGroup.mli b/libraries/rds/lib/createDBSecurityGroup.mli index f03941f61..d7aa7d031 100644 --- a/libraries/rds/lib/createDBSecurityGroup.mli +++ b/libraries/rds/lib/createDBSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBSecurityGroupMessage.t - type output = CreateDBSecurityGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSnapshot.ml b/libraries/rds/lib/createDBSnapshot.ml index 5eaa988b5..1eb956f86 100644 --- a/libraries/rds/lib/createDBSnapshot.ml +++ b/libraries/rds/lib/createDBSnapshot.ml @@ -1,70 +1,63 @@ open Types open Aws - type input = CreateDBSnapshotMessage.t - type output = CreateDBSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBSnapshot" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateDBSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDBSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDBSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateDBSnapshotResponse" (snd xml)) - (Xml.member "CreateDBSnapshotResult") - in + Util.option_bind (Xml.member "CreateDBSnapshotResponse" (snd xml)) + (Xml.member "CreateDBSnapshotResult") in try - Util.or_error - (Util.option_bind resp CreateDBSnapshotResult.parse) + Util.or_error (Util.option_bind resp CreateDBSnapshotResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateDBSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBSnapshotResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SnapshotQuotaExceeded - ; Errors_internal.DBInstanceNotFound - ; Errors_internal.InvalidDBInstanceState - ; Errors_internal.DBSnapshotAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.SnapshotQuotaExceeded; + Errors_internal.DBInstanceNotFound; + Errors_internal.InvalidDBInstanceState; + Errors_internal.DBSnapshotAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSnapshot.mli b/libraries/rds/lib/createDBSnapshot.mli index 31b8b6c0d..353357df3 100644 --- a/libraries/rds/lib/createDBSnapshot.mli +++ b/libraries/rds/lib/createDBSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBSnapshotMessage.t - type output = CreateDBSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSubnetGroup.ml b/libraries/rds/lib/createDBSubnetGroup.ml index 425bda0df..611e3d66e 100644 --- a/libraries/rds/lib/createDBSubnetGroup.ml +++ b/libraries/rds/lib/createDBSubnetGroup.ml @@ -1,72 +1,65 @@ open Types open Aws - type input = CreateDBSubnetGroupMessage.t - type output = CreateDBSubnetGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateDBSubnetGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateDBSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateDBSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateDBSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateDBSubnetGroupResponse" (snd xml)) - (Xml.member "CreateDBSubnetGroupResult") - in + Util.option_bind (Xml.member "CreateDBSubnetGroupResponse" (snd xml)) + (Xml.member "CreateDBSubnetGroupResult") in try - Util.or_error - (Util.option_bind resp CreateDBSubnetGroupResult.parse) + Util.or_error (Util.option_bind resp CreateDBSubnetGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateDBSubnetGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateDBSubnetGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDBSubnetGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDBSubnetGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.DBSubnetQuotaExceededFault - ; Errors_internal.DBSubnetGroupQuotaExceeded - ; Errors_internal.DBSubnetGroupAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.DBSubnetQuotaExceededFault; + Errors_internal.DBSubnetGroupQuotaExceeded; + Errors_internal.DBSubnetGroupAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createDBSubnetGroup.mli b/libraries/rds/lib/createDBSubnetGroup.mli index b52b25d4e..4ec2aad86 100644 --- a/libraries/rds/lib/createDBSubnetGroup.mli +++ b/libraries/rds/lib/createDBSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDBSubnetGroupMessage.t - type output = CreateDBSubnetGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createEventSubscription.ml b/libraries/rds/lib/createEventSubscription.ml index 04611b00b..d8e65ad35 100644 --- a/libraries/rds/lib/createEventSubscription.ml +++ b/libraries/rds/lib/createEventSubscription.ml @@ -1,74 +1,70 @@ open Types open Aws - type input = CreateEventSubscriptionMessage.t - type output = CreateEventSubscriptionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateEventSubscription" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["CreateEventSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateEventSubscriptionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateEventSubscriptionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "CreateEventSubscriptionResponse" (snd xml)) - (Xml.member "CreateEventSubscriptionResult") - in + (Xml.member "CreateEventSubscriptionResult") in try Util.or_error (Util.option_bind resp CreateEventSubscriptionResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateEventSubscriptionResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateEventSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateEventSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateEventSubscriptionResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SourceNotFound - ; Errors_internal.SubscriptionCategoryNotFound - ; Errors_internal.SNSTopicArnNotFound - ; Errors_internal.SNSNoAuthorization - ; Errors_internal.SNSInvalidTopic - ; Errors_internal.SubscriptionAlreadyExist - ; Errors_internal.EventSubscriptionQuotaExceeded - ] - @ Errors_internal.common - in + [Errors_internal.SourceNotFound; + Errors_internal.SubscriptionCategoryNotFound; + Errors_internal.SNSTopicArnNotFound; + Errors_internal.SNSNoAuthorization; + Errors_internal.SNSInvalidTopic; + Errors_internal.SubscriptionAlreadyExist; + Errors_internal.EventSubscriptionQuotaExceeded] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createEventSubscription.mli b/libraries/rds/lib/createEventSubscription.mli index f172cd1dc..7509896e9 100644 --- a/libraries/rds/lib/createEventSubscription.mli +++ b/libraries/rds/lib/createEventSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = CreateEventSubscriptionMessage.t - type output = CreateEventSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/createOptionGroup.ml b/libraries/rds/lib/createOptionGroup.ml index c78aa5be5..923fe5e27 100644 --- a/libraries/rds/lib/createOptionGroup.ml +++ b/libraries/rds/lib/createOptionGroup.ml @@ -1,68 +1,62 @@ open Types open Aws - type input = CreateOptionGroupMessage.t - type output = CreateOptionGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "CreateOptionGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["CreateOptionGroup"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateOptionGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateOptionGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateOptionGroupResponse" (snd xml)) - (Xml.member "CreateOptionGroupResult") - in + Util.option_bind (Xml.member "CreateOptionGroupResponse" (snd xml)) + (Xml.member "CreateOptionGroupResult") in try - Util.or_error - (Util.option_bind resp CreateOptionGroupResult.parse) + Util.or_error (Util.option_bind resp CreateOptionGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateOptionGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateOptionGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateOptionGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateOptionGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.OptionGroupQuotaExceededFault - ; Errors_internal.OptionGroupAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.OptionGroupQuotaExceededFault; + Errors_internal.OptionGroupAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/createOptionGroup.mli b/libraries/rds/lib/createOptionGroup.mli index 7f2628c6f..cad260e42 100644 --- a/libraries/rds/lib/createOptionGroup.mli +++ b/libraries/rds/lib/createOptionGroup.mli @@ -1,10 +1,7 @@ open Types - type input = CreateOptionGroupMessage.t - type output = CreateOptionGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBCluster.ml b/libraries/rds/lib/deleteDBCluster.ml index 6f209acdb..514fc6df1 100644 --- a/libraries/rds/lib/deleteDBCluster.ml +++ b/libraries/rds/lib/deleteDBCluster.ml @@ -1,65 +1,61 @@ open Types open Aws - type input = DeleteDBClusterMessage.t - type output = DeleteDBClusterResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBCluster" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteDBCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDBClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDBClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteDBClusterResponse" (snd xml)) - (Xml.member "DeleteDBClusterResult") - in + Util.option_bind (Xml.member "DeleteDBClusterResponse" (snd xml)) + (Xml.member "DeleteDBClusterResult") in try - Util.or_error - (Util.option_bind resp DeleteDBClusterResult.parse) + Util.or_error (Util.option_bind resp DeleteDBClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteDBClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteDBClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteDBClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteDBClusterResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBClusterStateFault; Errors_internal.DBClusterNotFoundFault ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBClusterNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBCluster.mli b/libraries/rds/lib/deleteDBCluster.mli index e36952141..e3a809172 100644 --- a/libraries/rds/lib/deleteDBCluster.mli +++ b/libraries/rds/lib/deleteDBCluster.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBClusterMessage.t - type output = DeleteDBClusterResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBClusterParameterGroup.ml b/libraries/rds/lib/deleteDBClusterParameterGroup.ml index d0dcfa0d6..9bbbc240d 100644 --- a/libraries/rds/lib/deleteDBClusterParameterGroup.ml +++ b/libraries/rds/lib/deleteDBClusterParameterGroup.ml @@ -1,42 +1,34 @@ open Types open Aws - type input = DeleteDBClusterParameterGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBClusterParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DeleteDBClusterParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteDBClusterParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DeleteDBClusterParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InvalidDBParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupNotFound; + Errors_internal.InvalidDBParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBClusterParameterGroup.mli b/libraries/rds/lib/deleteDBClusterParameterGroup.mli index 402e9db78..45c413d05 100644 --- a/libraries/rds/lib/deleteDBClusterParameterGroup.mli +++ b/libraries/rds/lib/deleteDBClusterParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBClusterParameterGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBClusterSnapshot.ml b/libraries/rds/lib/deleteDBClusterSnapshot.ml index da9002372..257b3762f 100644 --- a/libraries/rds/lib/deleteDBClusterSnapshot.ml +++ b/libraries/rds/lib/deleteDBClusterSnapshot.ml @@ -1,69 +1,66 @@ open Types open Aws - type input = DeleteDBClusterSnapshotMessage.t - type output = DeleteDBClusterSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBClusterSnapshot" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DeleteDBClusterSnapshot"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteDBClusterSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteDBClusterSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DeleteDBClusterSnapshotResponse" (snd xml)) - (Xml.member "DeleteDBClusterSnapshotResult") - in + (Xml.member "DeleteDBClusterSnapshotResult") in try Util.or_error (Util.option_bind resp DeleteDBClusterSnapshotResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteDBClusterSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteDBClusterSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteDBClusterSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteDBClusterSnapshotResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBClusterSnapshotNotFoundFault - ; Errors_internal.InvalidDBClusterSnapshotStateFault - ] - @ Errors_internal.common - in + [Errors_internal.DBClusterSnapshotNotFoundFault; + Errors_internal.InvalidDBClusterSnapshotStateFault] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBClusterSnapshot.mli b/libraries/rds/lib/deleteDBClusterSnapshot.mli index db96c1c39..f11836d52 100644 --- a/libraries/rds/lib/deleteDBClusterSnapshot.mli +++ b/libraries/rds/lib/deleteDBClusterSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBClusterSnapshotMessage.t - type output = DeleteDBClusterSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBInstance.ml b/libraries/rds/lib/deleteDBInstance.ml index 7570fc885..79b257855 100644 --- a/libraries/rds/lib/deleteDBInstance.ml +++ b/libraries/rds/lib/deleteDBInstance.ml @@ -1,70 +1,63 @@ open Types open Aws - type input = DeleteDBInstanceMessage.t - type output = DeleteDBInstanceResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBInstance" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteDBInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDBInstanceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDBInstanceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteDBInstanceResponse" (snd xml)) - (Xml.member "DeleteDBInstanceResult") - in + Util.option_bind (Xml.member "DeleteDBInstanceResponse" (snd xml)) + (Xml.member "DeleteDBInstanceResult") in try - Util.or_error - (Util.option_bind resp DeleteDBInstanceResult.parse) + Util.or_error (Util.option_bind resp DeleteDBInstanceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteDBInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteDBInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteDBInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteDBInstanceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SnapshotQuotaExceeded - ; Errors_internal.DBSnapshotAlreadyExists - ; Errors_internal.InvalidDBInstanceState - ; Errors_internal.DBInstanceNotFound - ] - @ Errors_internal.common - in + [Errors_internal.SnapshotQuotaExceeded; + Errors_internal.DBSnapshotAlreadyExists; + Errors_internal.InvalidDBInstanceState; + Errors_internal.DBInstanceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBInstance.mli b/libraries/rds/lib/deleteDBInstance.mli index c106c07dc..8d4f3c179 100644 --- a/libraries/rds/lib/deleteDBInstance.mli +++ b/libraries/rds/lib/deleteDBInstance.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBInstanceMessage.t - type output = DeleteDBInstanceResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBParameterGroup.ml b/libraries/rds/lib/deleteDBParameterGroup.ml index 908f18d7d..e821d02e2 100644 --- a/libraries/rds/lib/deleteDBParameterGroup.ml +++ b/libraries/rds/lib/deleteDBParameterGroup.ml @@ -1,42 +1,33 @@ open Types open Aws - type input = DeleteDBParameterGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DeleteDBParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteDBParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteDBParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InvalidDBParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupNotFound; + Errors_internal.InvalidDBParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBParameterGroup.mli b/libraries/rds/lib/deleteDBParameterGroup.mli index 76c37e5fb..5ecdf69d2 100644 --- a/libraries/rds/lib/deleteDBParameterGroup.mli +++ b/libraries/rds/lib/deleteDBParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBParameterGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSecurityGroup.ml b/libraries/rds/lib/deleteDBSecurityGroup.ml index 84582ac0d..4e089892c 100644 --- a/libraries/rds/lib/deleteDBSecurityGroup.ml +++ b/libraries/rds/lib/deleteDBSecurityGroup.ml @@ -1,42 +1,32 @@ open Types open Aws - type input = DeleteDBSecurityGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBSecurityGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSecurityGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteDBSecurityGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteDBSecurityGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.InvalidDBSecurityGroupState - ] - @ Errors_internal.common - in + [Errors_internal.DBSecurityGroupNotFound; + Errors_internal.InvalidDBSecurityGroupState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSecurityGroup.mli b/libraries/rds/lib/deleteDBSecurityGroup.mli index ce3f24ffd..e96fa51f8 100644 --- a/libraries/rds/lib/deleteDBSecurityGroup.mli +++ b/libraries/rds/lib/deleteDBSecurityGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBSecurityGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSnapshot.ml b/libraries/rds/lib/deleteDBSnapshot.ml index 513189832..aff27e688 100644 --- a/libraries/rds/lib/deleteDBSnapshot.ml +++ b/libraries/rds/lib/deleteDBSnapshot.ml @@ -1,66 +1,61 @@ open Types open Aws - type input = DeleteDBSnapshotMessage.t - type output = DeleteDBSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBSnapshot" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSnapshot"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDBSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDBSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteDBSnapshotResponse" (snd xml)) - (Xml.member "DeleteDBSnapshotResult") - in + Util.option_bind (Xml.member "DeleteDBSnapshotResponse" (snd xml)) + (Xml.member "DeleteDBSnapshotResult") in try - Util.or_error - (Util.option_bind resp DeleteDBSnapshotResult.parse) + Util.or_error (Util.option_bind resp DeleteDBSnapshotResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteDBSnapshotResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteDBSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteDBSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteDBSnapshotResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBSnapshotNotFound; Errors_internal.InvalidDBSnapshotState ] - @ Errors_internal.common - in + [Errors_internal.DBSnapshotNotFound; + Errors_internal.InvalidDBSnapshotState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSnapshot.mli b/libraries/rds/lib/deleteDBSnapshot.mli index a4db1aeb3..8f9c3ef33 100644 --- a/libraries/rds/lib/deleteDBSnapshot.mli +++ b/libraries/rds/lib/deleteDBSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBSnapshotMessage.t - type output = DeleteDBSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSubnetGroup.ml b/libraries/rds/lib/deleteDBSubnetGroup.ml index 1dad049f7..9fbd56146 100644 --- a/libraries/rds/lib/deleteDBSubnetGroup.ml +++ b/libraries/rds/lib/deleteDBSubnetGroup.ml @@ -1,43 +1,33 @@ open Types open Aws - type input = DeleteDBSubnetGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteDBSubnetGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteDBSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteDBSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidDBSubnetStateFault - ; Errors_internal.InvalidDBSubnetGroupStateFault - ] - @ Errors_internal.common - in + [Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidDBSubnetStateFault; + Errors_internal.InvalidDBSubnetGroupStateFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteDBSubnetGroup.mli b/libraries/rds/lib/deleteDBSubnetGroup.mli index ef12b19ab..6e9209ac6 100644 --- a/libraries/rds/lib/deleteDBSubnetGroup.mli +++ b/libraries/rds/lib/deleteDBSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDBSubnetGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteEventSubscription.ml b/libraries/rds/lib/deleteEventSubscription.ml index baa1d3159..4c7c63311 100644 --- a/libraries/rds/lib/deleteEventSubscription.ml +++ b/libraries/rds/lib/deleteEventSubscription.ml @@ -1,69 +1,65 @@ open Types open Aws - type input = DeleteEventSubscriptionMessage.t - type output = DeleteEventSubscriptionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteEventSubscription" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DeleteEventSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteEventSubscriptionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DeleteEventSubscriptionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DeleteEventSubscriptionResponse" (snd xml)) - (Xml.member "DeleteEventSubscriptionResult") - in + (Xml.member "DeleteEventSubscriptionResult") in try Util.or_error (Util.option_bind resp DeleteEventSubscriptionResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteEventSubscriptionResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteEventSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteEventSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteEventSubscriptionResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidEventSubscriptionState - ; Errors_internal.SubscriptionNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidEventSubscriptionState; + Errors_internal.SubscriptionNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteEventSubscription.mli b/libraries/rds/lib/deleteEventSubscription.mli index 532bb1bdd..96d5e88cc 100644 --- a/libraries/rds/lib/deleteEventSubscription.mli +++ b/libraries/rds/lib/deleteEventSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteEventSubscriptionMessage.t - type output = DeleteEventSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteOptionGroup.ml b/libraries/rds/lib/deleteOptionGroup.ml index 8450b35ec..639862102 100644 --- a/libraries/rds/lib/deleteOptionGroup.ml +++ b/libraries/rds/lib/deleteOptionGroup.ml @@ -1,41 +1,32 @@ open Types open Aws - type input = DeleteOptionGroupMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DeleteOptionGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DeleteOptionGroup"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteOptionGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteOptionGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.InvalidOptionGroupStateFault - ; Errors_internal.OptionGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidOptionGroupStateFault; + Errors_internal.OptionGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/deleteOptionGroup.mli b/libraries/rds/lib/deleteOptionGroup.mli index 73a90ccc6..8ffff7092 100644 --- a/libraries/rds/lib/deleteOptionGroup.mli +++ b/libraries/rds/lib/deleteOptionGroup.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteOptionGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeAccountAttributes.ml b/libraries/rds/lib/describeAccountAttributes.ml index 37fd34462..ced87ce0d 100644 --- a/libraries/rds/lib/describeAccountAttributes.ml +++ b/libraries/rds/lib/describeAccountAttributes.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = unit - type output = AccountAttributesMessage.t - type error = Errors_internal.t - let service = "rds" - 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))) - [ "Version", [ "2014-10-31" ]; "Action", [ "DescribeAccountAttributes" ] ] - in - `POST, uri, [] - + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + [("Version", ["2014-10-31"]); + ("Action", ["DescribeAccountAttributes"])] in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeAccountAttributesResponse" (snd xml)) - (Xml.member "DescribeAccountAttributesResult") - in + (Xml.member "DescribeAccountAttributesResult") in try - Util.or_error - (Util.option_bind resp AccountAttributesMessage.parse) + Util.or_error (Util.option_bind resp AccountAttributesMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AccountAttributesMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AccountAttributesMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AccountAttributesMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AccountAttributesMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeAccountAttributes.mli b/libraries/rds/lib/describeAccountAttributes.mli index 7a4402a7e..66e4d0bb0 100644 --- a/libraries/rds/lib/describeAccountAttributes.mli +++ b/libraries/rds/lib/describeAccountAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = unit - type output = AccountAttributesMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeCertificates.ml b/libraries/rds/lib/describeCertificates.ml index 38f563dce..985be5ee7 100644 --- a/libraries/rds/lib/describeCertificates.ml +++ b/libraries/rds/lib/describeCertificates.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = DescribeCertificatesMessage.t - type output = CertificateMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeCertificates" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeCertificates"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeCertificatesMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeCertificatesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeCertificatesResponse" (snd xml)) - (Xml.member "DescribeCertificatesResult") - in + Util.option_bind (Xml.member "DescribeCertificatesResponse" (snd xml)) + (Xml.member "DescribeCertificatesResult") in try - Util.or_error - (Util.option_bind resp CertificateMessage.parse) + Util.or_error (Util.option_bind resp CertificateMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CertificateMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CertificateMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CertificateMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CertificateMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.CertificateNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.CertificateNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeCertificates.mli b/libraries/rds/lib/describeCertificates.mli index c7053d6ab..e6afc5ca7 100644 --- a/libraries/rds/lib/describeCertificates.mli +++ b/libraries/rds/lib/describeCertificates.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeCertificatesMessage.t - type output = CertificateMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterParameterGroups.ml b/libraries/rds/lib/describeDBClusterParameterGroups.ml index e484619af..82b23a29a 100644 --- a/libraries/rds/lib/describeDBClusterParameterGroups.ml +++ b/libraries/rds/lib/describeDBClusterParameterGroups.ml @@ -1,66 +1,65 @@ open Types open Aws - type input = DescribeDBClusterParameterGroupsMessage.t - type output = DBClusterParameterGroupsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBClusterParameterGroups" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBClusterParameterGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBClusterParameterGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeDBClusterParameterGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBClusterParameterGroupsResponse" (snd xml)) - (Xml.member "DescribeDBClusterParameterGroupsResult") - in + (Xml.member "DescribeDBClusterParameterGroupsResult") in try Util.or_error (Util.option_bind resp DBClusterParameterGroupsMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DBClusterParameterGroupsMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBClusterParameterGroupsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterParameterGroupsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterParameterGroupsMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBParameterGroupNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterParameterGroups.mli b/libraries/rds/lib/describeDBClusterParameterGroups.mli index 1182b303b..bcd17937e 100644 --- a/libraries/rds/lib/describeDBClusterParameterGroups.mli +++ b/libraries/rds/lib/describeDBClusterParameterGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBClusterParameterGroupsMessage.t - type output = DBClusterParameterGroupsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterParameters.ml b/libraries/rds/lib/describeDBClusterParameters.ml index d5c7ab020..185270984 100644 --- a/libraries/rds/lib/describeDBClusterParameters.ml +++ b/libraries/rds/lib/describeDBClusterParameters.ml @@ -1,64 +1,65 @@ open Types open Aws - type input = DescribeDBClusterParametersMessage.t - type output = DBClusterParameterGroupDetails.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBClusterParameters" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBClusterParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBClusterParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeDBClusterParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBClusterParametersResponse" (snd xml)) - (Xml.member "DescribeDBClusterParametersResult") - in + (Xml.member "DescribeDBClusterParametersResult") in try Util.or_error (Util.option_bind resp DBClusterParameterGroupDetails.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBClusterParameterGroupDetails." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBClusterParameterGroupDetails." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterParameterGroupDetails - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterParameterGroupDetails - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBParameterGroupNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterParameters.mli b/libraries/rds/lib/describeDBClusterParameters.mli index 87408d4a2..c87f691bd 100644 --- a/libraries/rds/lib/describeDBClusterParameters.mli +++ b/libraries/rds/lib/describeDBClusterParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBClusterParametersMessage.t - type output = DBClusterParameterGroupDetails.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterSnapshots.ml b/libraries/rds/lib/describeDBClusterSnapshots.ml index 02fc0bdf8..5403bc008 100644 --- a/libraries/rds/lib/describeDBClusterSnapshots.ml +++ b/libraries/rds/lib/describeDBClusterSnapshots.ml @@ -1,66 +1,63 @@ open Types open Aws - type input = DescribeDBClusterSnapshotsMessage.t - type output = DBClusterSnapshotMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBClusterSnapshots" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBClusterSnapshots"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBClusterSnapshotsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBClusterSnapshotsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBClusterSnapshotsResponse" (snd xml)) - (Xml.member "DescribeDBClusterSnapshotsResult") - in + (Xml.member "DescribeDBClusterSnapshotsResult") in try - Util.or_error - (Util.option_bind resp DBClusterSnapshotMessage.parse) + Util.or_error (Util.option_bind resp DBClusterSnapshotMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBClusterSnapshotMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBClusterSnapshotMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterSnapshotMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterSnapshotMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBClusterSnapshotNotFoundFault ] @ Errors_internal.common - in + [Errors_internal.DBClusterSnapshotNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusterSnapshots.mli b/libraries/rds/lib/describeDBClusterSnapshots.mli index f172ba7e1..f0ae96c9b 100644 --- a/libraries/rds/lib/describeDBClusterSnapshots.mli +++ b/libraries/rds/lib/describeDBClusterSnapshots.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBClusterSnapshotsMessage.t - type output = DBClusterSnapshotMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusters.ml b/libraries/rds/lib/describeDBClusters.ml index 4f71c6ba4..c2e417ee1 100644 --- a/libraries/rds/lib/describeDBClusters.ml +++ b/libraries/rds/lib/describeDBClusters.ml @@ -1,61 +1,58 @@ open Types open Aws - type input = DescribeDBClustersMessage.t - type output = DBClusterMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBClusters" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeDBClusters"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeDBClustersMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeDBClustersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeDBClustersResponse" (snd xml)) - (Xml.member "DescribeDBClustersResult") - in + Util.option_bind (Xml.member "DescribeDBClustersResponse" (snd xml)) + (Xml.member "DescribeDBClustersResult") in try - Util.or_error - (Util.option_bind resp DBClusterMessage.parse) + Util.or_error (Util.option_bind resp DBClusterMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DBClusterMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed DBClusterMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBClusterNotFoundFault ] @ Errors_internal.common in + let errors = + [Errors_internal.DBClusterNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBClusters.mli b/libraries/rds/lib/describeDBClusters.mli index 9194d11bd..b3de06d8d 100644 --- a/libraries/rds/lib/describeDBClusters.mli +++ b/libraries/rds/lib/describeDBClusters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBClustersMessage.t - type output = DBClusterMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBEngineVersions.ml b/libraries/rds/lib/describeDBEngineVersions.ml index 9944b0699..49084a65e 100644 --- a/libraries/rds/lib/describeDBEngineVersions.ml +++ b/libraries/rds/lib/describeDBEngineVersions.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = DescribeDBEngineVersionsMessage.t - type output = DBEngineVersionMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBEngineVersions" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBEngineVersions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBEngineVersionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBEngineVersionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBEngineVersionsResponse" (snd xml)) - (Xml.member "DescribeDBEngineVersionsResult") - in + (Xml.member "DescribeDBEngineVersionsResult") in try - Util.or_error - (Util.option_bind resp DBEngineVersionMessage.parse) + Util.or_error (Util.option_bind resp DBEngineVersionMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBEngineVersionMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DBEngineVersionMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBEngineVersionMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBEngineVersionMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBEngineVersions.mli b/libraries/rds/lib/describeDBEngineVersions.mli index df79cda3b..cf5ab2aa6 100644 --- a/libraries/rds/lib/describeDBEngineVersions.mli +++ b/libraries/rds/lib/describeDBEngineVersions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBEngineVersionsMessage.t - type output = DBEngineVersionMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBInstances.ml b/libraries/rds/lib/describeDBInstances.ml index ab42f9162..ec43dc353 100644 --- a/libraries/rds/lib/describeDBInstances.ml +++ b/libraries/rds/lib/describeDBInstances.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = DescribeDBInstancesMessage.t - type output = DBInstanceMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBInstances" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeDBInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBInstancesMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBInstancesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeDBInstancesResponse" (snd xml)) - (Xml.member "DescribeDBInstancesResult") - in + Util.option_bind (Xml.member "DescribeDBInstancesResponse" (snd xml)) + (Xml.member "DescribeDBInstancesResult") in try - Util.or_error - (Util.option_bind resp DBInstanceMessage.parse) + Util.or_error (Util.option_bind resp DBInstanceMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DBInstanceMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DBInstanceMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBInstanceMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBInstanceMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBInstanceNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.DBInstanceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBInstances.mli b/libraries/rds/lib/describeDBInstances.mli index cf9f7aa47..6328a3872 100644 --- a/libraries/rds/lib/describeDBInstances.mli +++ b/libraries/rds/lib/describeDBInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBInstancesMessage.t - type output = DBInstanceMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBLogFiles.ml b/libraries/rds/lib/describeDBLogFiles.ml index b17c8f646..d5bf105d5 100644 --- a/libraries/rds/lib/describeDBLogFiles.ml +++ b/libraries/rds/lib/describeDBLogFiles.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = DescribeDBLogFilesMessage.t - type output = DescribeDBLogFilesResponse.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBLogFiles" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeDBLogFiles"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeDBLogFilesMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeDBLogFilesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeDBLogFilesResponse" (snd xml)) - (Xml.member "DescribeDBLogFilesResult") - in + Util.option_bind (Xml.member "DescribeDBLogFilesResponse" (snd xml)) + (Xml.member "DescribeDBLogFilesResult") in try - Util.or_error - (Util.option_bind resp DescribeDBLogFilesResponse.parse) + Util.or_error (Util.option_bind resp DescribeDBLogFilesResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeDBLogFilesResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeDBLogFilesResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeDBLogFilesResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeDBLogFilesResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBInstanceNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.DBInstanceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBLogFiles.mli b/libraries/rds/lib/describeDBLogFiles.mli index 92ab0d6a2..6cb5fee8b 100644 --- a/libraries/rds/lib/describeDBLogFiles.mli +++ b/libraries/rds/lib/describeDBLogFiles.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBLogFilesMessage.t - type output = DescribeDBLogFilesResponse.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBParameterGroups.ml b/libraries/rds/lib/describeDBParameterGroups.ml index 6f5a40ac3..e62fc0034 100644 --- a/libraries/rds/lib/describeDBParameterGroups.ml +++ b/libraries/rds/lib/describeDBParameterGroups.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeDBParameterGroupsMessage.t - type output = DBParameterGroupsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBParameterGroups" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBParameterGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBParameterGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBParameterGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBParameterGroupsResponse" (snd xml)) - (Xml.member "DescribeDBParameterGroupsResult") - in + (Xml.member "DescribeDBParameterGroupsResult") in try - Util.or_error - (Util.option_bind resp DBParameterGroupsMessage.parse) + Util.or_error (Util.option_bind resp DBParameterGroupsMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBParameterGroupsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBParameterGroupsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBParameterGroupsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBParameterGroupsMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBParameterGroupNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBParameterGroups.mli b/libraries/rds/lib/describeDBParameterGroups.mli index 4046bc616..41d5bcdc0 100644 --- a/libraries/rds/lib/describeDBParameterGroups.mli +++ b/libraries/rds/lib/describeDBParameterGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBParameterGroupsMessage.t - type output = DBParameterGroupsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBParameters.ml b/libraries/rds/lib/describeDBParameters.ml index 95432a72e..87228afb8 100644 --- a/libraries/rds/lib/describeDBParameters.ml +++ b/libraries/rds/lib/describeDBParameters.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = DescribeDBParametersMessage.t - type output = DBParameterGroupDetails.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBParameters" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeDBParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeDBParametersResponse" (snd xml)) - (Xml.member "DescribeDBParametersResult") - in + Util.option_bind (Xml.member "DescribeDBParametersResponse" (snd xml)) + (Xml.member "DescribeDBParametersResult") in try - Util.or_error - (Util.option_bind resp DBParameterGroupDetails.parse) + Util.or_error (Util.option_bind resp DBParameterGroupDetails.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBParameterGroupDetails." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBParameterGroupDetails." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBParameterGroupDetails - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBParameterGroupDetails - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBParameterGroupNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBParameters.mli b/libraries/rds/lib/describeDBParameters.mli index d89efe7c7..a4e21a43f 100644 --- a/libraries/rds/lib/describeDBParameters.mli +++ b/libraries/rds/lib/describeDBParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBParametersMessage.t - type output = DBParameterGroupDetails.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSecurityGroups.ml b/libraries/rds/lib/describeDBSecurityGroups.ml index 80d01967a..d33524e1d 100644 --- a/libraries/rds/lib/describeDBSecurityGroups.ml +++ b/libraries/rds/lib/describeDBSecurityGroups.ml @@ -1,64 +1,62 @@ open Types open Aws - type input = DescribeDBSecurityGroupsMessage.t - type output = DBSecurityGroupMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBSecurityGroups" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBSecurityGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBSecurityGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBSecurityGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBSecurityGroupsResponse" (snd xml)) - (Xml.member "DescribeDBSecurityGroupsResult") - in + (Xml.member "DescribeDBSecurityGroupsResult") in try - Util.or_error - (Util.option_bind resp DBSecurityGroupMessage.parse) + Util.or_error (Util.option_bind resp DBSecurityGroupMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBSecurityGroupMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DBSecurityGroupMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBSecurityGroupMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBSecurityGroupMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBSecurityGroupNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.DBSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSecurityGroups.mli b/libraries/rds/lib/describeDBSecurityGroups.mli index 173ecba3e..99a491627 100644 --- a/libraries/rds/lib/describeDBSecurityGroups.mli +++ b/libraries/rds/lib/describeDBSecurityGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBSecurityGroupsMessage.t - type output = DBSecurityGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSnapshots.ml b/libraries/rds/lib/describeDBSnapshots.ml index b035b6ef8..d4fcb8067 100644 --- a/libraries/rds/lib/describeDBSnapshots.ml +++ b/libraries/rds/lib/describeDBSnapshots.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = DescribeDBSnapshotsMessage.t - type output = DBSnapshotMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBSnapshots" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeDBSnapshots"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBSnapshotsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBSnapshotsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeDBSnapshotsResponse" (snd xml)) - (Xml.member "DescribeDBSnapshotsResult") - in + Util.option_bind (Xml.member "DescribeDBSnapshotsResponse" (snd xml)) + (Xml.member "DescribeDBSnapshotsResult") in try - Util.or_error - (Util.option_bind resp DBSnapshotMessage.parse) + Util.or_error (Util.option_bind resp DBSnapshotMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DBSnapshotMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DBSnapshotMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBSnapshotMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBSnapshotMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBSnapshotNotFound ] @ Errors_internal.common in + let errors = [Errors_internal.DBSnapshotNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSnapshots.mli b/libraries/rds/lib/describeDBSnapshots.mli index 8fd92e037..13c666ec6 100644 --- a/libraries/rds/lib/describeDBSnapshots.mli +++ b/libraries/rds/lib/describeDBSnapshots.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBSnapshotsMessage.t - type output = DBSnapshotMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSubnetGroups.ml b/libraries/rds/lib/describeDBSubnetGroups.ml index 4250913f9..c672fa557 100644 --- a/libraries/rds/lib/describeDBSubnetGroups.ml +++ b/libraries/rds/lib/describeDBSubnetGroups.ml @@ -1,62 +1,62 @@ open Types open Aws - type input = DescribeDBSubnetGroupsMessage.t - type output = DBSubnetGroupMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeDBSubnetGroups" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeDBSubnetGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeDBSubnetGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeDBSubnetGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeDBSubnetGroupsResponse" (snd xml)) - (Xml.member "DescribeDBSubnetGroupsResult") - in + (Xml.member "DescribeDBSubnetGroupsResult") in try - Util.or_error - (Util.option_bind resp DBSubnetGroupMessage.parse) + Util.or_error (Util.option_bind resp DBSubnetGroupMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DBSubnetGroupMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DBSubnetGroupMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBSubnetGroupMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBSubnetGroupMessage - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.DBSubnetGroupNotFoundFault ] @ Errors_internal.common in + let errors = + [Errors_internal.DBSubnetGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeDBSubnetGroups.mli b/libraries/rds/lib/describeDBSubnetGroups.mli index 4d515692a..bb5d44ad0 100644 --- a/libraries/rds/lib/describeDBSubnetGroups.mli +++ b/libraries/rds/lib/describeDBSubnetGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDBSubnetGroupsMessage.t - type output = DBSubnetGroupMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEngineDefaultClusterParameters.ml b/libraries/rds/lib/describeEngineDefaultClusterParameters.ml index ff1198933..6dba9fd75 100644 --- a/libraries/rds/lib/describeEngineDefaultClusterParameters.ml +++ b/libraries/rds/lib/describeEngineDefaultClusterParameters.ml @@ -1,69 +1,66 @@ open Types open Aws - type input = DescribeEngineDefaultClusterParametersMessage.t - type output = DescribeEngineDefaultClusterParametersResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "DescribeEngineDefaultClusterParameters" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeEngineDefaultClusterParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEngineDefaultClusterParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeEngineDefaultClusterParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind - (Xml.member "DescribeEngineDefaultClusterParametersResponse" (snd xml)) - (Xml.member "DescribeEngineDefaultClusterParametersResult") - in + (Xml.member "DescribeEngineDefaultClusterParametersResponse" + (snd xml)) + (Xml.member "DescribeEngineDefaultClusterParametersResult") in try Util.or_error - (Util.option_bind resp DescribeEngineDefaultClusterParametersResult.parse) + (Util.option_bind resp + DescribeEngineDefaultClusterParametersResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed DescribeEngineDefaultClusterParametersResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeEngineDefaultClusterParametersResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeEngineDefaultClusterParametersResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeEngineDefaultClusterParametersResult - missing \ - field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEngineDefaultClusterParameters.mli b/libraries/rds/lib/describeEngineDefaultClusterParameters.mli index 123d3c0c3..9a9ef08e0 100644 --- a/libraries/rds/lib/describeEngineDefaultClusterParameters.mli +++ b/libraries/rds/lib/describeEngineDefaultClusterParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEngineDefaultClusterParametersMessage.t - type output = DescribeEngineDefaultClusterParametersResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEngineDefaultParameters.ml b/libraries/rds/lib/describeEngineDefaultParameters.ml index 209f4610a..e2b0375bb 100644 --- a/libraries/rds/lib/describeEngineDefaultParameters.ml +++ b/libraries/rds/lib/describeEngineDefaultParameters.ml @@ -1,66 +1,64 @@ open Types open Aws - type input = DescribeEngineDefaultParametersMessage.t - type output = DescribeEngineDefaultParametersResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeEngineDefaultParameters" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeEngineDefaultParameters"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEngineDefaultParametersMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeEngineDefaultParametersMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeEngineDefaultParametersResponse" (snd xml)) - (Xml.member "DescribeEngineDefaultParametersResult") - in + (Xml.member "DescribeEngineDefaultParametersResult") in try Util.or_error (Util.option_bind resp DescribeEngineDefaultParametersResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DescribeEngineDefaultParametersResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeEngineDefaultParametersResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeEngineDefaultParametersResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeEngineDefaultParametersResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEngineDefaultParameters.mli b/libraries/rds/lib/describeEngineDefaultParameters.mli index a13373a91..050bc140f 100644 --- a/libraries/rds/lib/describeEngineDefaultParameters.mli +++ b/libraries/rds/lib/describeEngineDefaultParameters.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEngineDefaultParametersMessage.t - type output = DescribeEngineDefaultParametersResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEventCategories.ml b/libraries/rds/lib/describeEventCategories.ml index 37570daa0..2c64b835b 100644 --- a/libraries/rds/lib/describeEventCategories.ml +++ b/libraries/rds/lib/describeEventCategories.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = DescribeEventCategoriesMessage.t - type output = EventCategoriesMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeEventCategories" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeEventCategories"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEventCategoriesMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeEventCategoriesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeEventCategoriesResponse" (snd xml)) - (Xml.member "DescribeEventCategoriesResult") - in + (Xml.member "DescribeEventCategoriesResult") in try - Util.or_error - (Util.option_bind resp EventCategoriesMessage.parse) + Util.or_error (Util.option_bind resp EventCategoriesMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed EventCategoriesMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed EventCategoriesMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EventCategoriesMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EventCategoriesMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEventCategories.mli b/libraries/rds/lib/describeEventCategories.mli index 9a5e22187..9d4c279b0 100644 --- a/libraries/rds/lib/describeEventCategories.mli +++ b/libraries/rds/lib/describeEventCategories.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEventCategoriesMessage.t - type output = EventCategoriesMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEventSubscriptions.ml b/libraries/rds/lib/describeEventSubscriptions.ml index 35cdc80f6..79d76273a 100644 --- a/libraries/rds/lib/describeEventSubscriptions.ml +++ b/libraries/rds/lib/describeEventSubscriptions.ml @@ -1,64 +1,63 @@ open Types open Aws - type input = DescribeEventSubscriptionsMessage.t - type output = EventSubscriptionsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeEventSubscriptions" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeEventSubscriptions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeEventSubscriptionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeEventSubscriptionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeEventSubscriptionsResponse" (snd xml)) - (Xml.member "DescribeEventSubscriptionsResult") - in + (Xml.member "DescribeEventSubscriptionsResult") in try - Util.or_error - (Util.option_bind resp EventSubscriptionsMessage.parse) + Util.or_error (Util.option_bind resp EventSubscriptionsMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed EventSubscriptionsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed EventSubscriptionsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EventSubscriptionsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EventSubscriptionsMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.SubscriptionNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.SubscriptionNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEventSubscriptions.mli b/libraries/rds/lib/describeEventSubscriptions.mli index 6de3b5600..373308a70 100644 --- a/libraries/rds/lib/describeEventSubscriptions.mli +++ b/libraries/rds/lib/describeEventSubscriptions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEventSubscriptionsMessage.t - type output = EventSubscriptionsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEvents.ml b/libraries/rds/lib/describeEvents.ml index 0f9a8fab8..e6d72b7d2 100644 --- a/libraries/rds/lib/describeEvents.ml +++ b/libraries/rds/lib/describeEvents.ml @@ -1,60 +1,56 @@ open Types open Aws - type input = DescribeEventsMessage.t - type output = EventsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeEvents" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeEvents"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeEventsMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeEventsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeEventsResponse" (snd xml)) - (Xml.member "DescribeEventsResult") - in + Util.option_bind (Xml.member "DescribeEventsResponse" (snd xml)) + (Xml.member "DescribeEventsResult") in try - Util.or_error - (Util.option_bind resp EventsMessage.parse) + Util.or_error (Util.option_bind resp EventsMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed EventsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed EventsMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing EventsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing EventsMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeEvents.mli b/libraries/rds/lib/describeEvents.mli index f285c481a..76d92f846 100644 --- a/libraries/rds/lib/describeEvents.mli +++ b/libraries/rds/lib/describeEvents.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeEventsMessage.t - type output = EventsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOptionGroupOptions.ml b/libraries/rds/lib/describeOptionGroupOptions.ml index 7e8d82ba7..b5d0ea9e6 100644 --- a/libraries/rds/lib/describeOptionGroupOptions.ml +++ b/libraries/rds/lib/describeOptionGroupOptions.ml @@ -1,64 +1,62 @@ open Types open Aws - type input = DescribeOptionGroupOptionsMessage.t - type output = OptionGroupOptionsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeOptionGroupOptions" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeOptionGroupOptions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeOptionGroupOptionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeOptionGroupOptionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeOptionGroupOptionsResponse" (snd xml)) - (Xml.member "DescribeOptionGroupOptionsResult") - in + (Xml.member "DescribeOptionGroupOptionsResult") in try - Util.or_error - (Util.option_bind resp OptionGroupOptionsMessage.parse) + Util.or_error (Util.option_bind resp OptionGroupOptionsMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed OptionGroupOptionsMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed OptionGroupOptionsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing OptionGroupOptionsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing OptionGroupOptionsMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOptionGroupOptions.mli b/libraries/rds/lib/describeOptionGroupOptions.mli index 1b7767cf4..701f1b1fc 100644 --- a/libraries/rds/lib/describeOptionGroupOptions.mli +++ b/libraries/rds/lib/describeOptionGroupOptions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeOptionGroupOptionsMessage.t - type output = OptionGroupOptionsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOptionGroups.ml b/libraries/rds/lib/describeOptionGroups.ml index f00f634ca..16ca6eb5f 100644 --- a/libraries/rds/lib/describeOptionGroups.ml +++ b/libraries/rds/lib/describeOptionGroups.ml @@ -1,61 +1,57 @@ open Types open Aws - type input = DescribeOptionGroupsMessage.t - type output = OptionGroups.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeOptionGroups" ] ] + [("Version", ["2014-10-31"]); ("Action", ["DescribeOptionGroups"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeOptionGroupsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeOptionGroupsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DescribeOptionGroupsResponse" (snd xml)) - (Xml.member "DescribeOptionGroupsResult") - in + Util.option_bind (Xml.member "DescribeOptionGroupsResponse" (snd xml)) + (Xml.member "DescribeOptionGroupsResult") in try - Util.or_error - (Util.option_bind resp OptionGroups.parse) + Util.or_error (Util.option_bind resp OptionGroups.parse) (let open Error in - BadResponse { body; message = "Could not find well formed OptionGroups." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed OptionGroups." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing OptionGroups - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing OptionGroups - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.OptionGroupNotFoundFault ] @ Errors_internal.common in + let errors = + [Errors_internal.OptionGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOptionGroups.mli b/libraries/rds/lib/describeOptionGroups.mli index 4dd011bab..fa61b0ec8 100644 --- a/libraries/rds/lib/describeOptionGroups.mli +++ b/libraries/rds/lib/describeOptionGroups.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeOptionGroupsMessage.t - type output = OptionGroups.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOrderableDBInstanceOptions.ml b/libraries/rds/lib/describeOrderableDBInstanceOptions.ml index 1517255a2..773fcd26b 100644 --- a/libraries/rds/lib/describeOrderableDBInstanceOptions.ml +++ b/libraries/rds/lib/describeOrderableDBInstanceOptions.ml @@ -1,68 +1,64 @@ open Types open Aws - type input = DescribeOrderableDBInstanceOptionsMessage.t - type output = OrderableDBInstanceOptionsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "DescribeOrderableDBInstanceOptions" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeOrderableDBInstanceOptions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeOrderableDBInstanceOptionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeOrderableDBInstanceOptionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeOrderableDBInstanceOptionsResponse" (snd xml)) - (Xml.member "DescribeOrderableDBInstanceOptionsResult") - in + (Xml.member "DescribeOrderableDBInstanceOptionsResult") in try Util.or_error (Util.option_bind resp OrderableDBInstanceOptionsMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed OrderableDBInstanceOptionsMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed OrderableDBInstanceOptionsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing OrderableDBInstanceOptionsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing OrderableDBInstanceOptionsMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeOrderableDBInstanceOptions.mli b/libraries/rds/lib/describeOrderableDBInstanceOptions.mli index 38245890a..e134afb37 100644 --- a/libraries/rds/lib/describeOrderableDBInstanceOptions.mli +++ b/libraries/rds/lib/describeOrderableDBInstanceOptions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeOrderableDBInstanceOptionsMessage.t - type output = OrderableDBInstanceOptionsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describePendingMaintenanceActions.ml b/libraries/rds/lib/describePendingMaintenanceActions.ml index fb68f3cda..de733038d 100644 --- a/libraries/rds/lib/describePendingMaintenanceActions.ml +++ b/libraries/rds/lib/describePendingMaintenanceActions.ml @@ -1,68 +1,65 @@ open Types open Aws - type input = DescribePendingMaintenanceActionsMessage.t - type output = PendingMaintenanceActionsMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "DescribePendingMaintenanceActions" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribePendingMaintenanceActions"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribePendingMaintenanceActionsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribePendingMaintenanceActionsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribePendingMaintenanceActionsResponse" (snd xml)) - (Xml.member "DescribePendingMaintenanceActionsResult") - in + (Xml.member "DescribePendingMaintenanceActionsResult") in try Util.or_error (Util.option_bind resp PendingMaintenanceActionsMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed PendingMaintenanceActionsMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PendingMaintenanceActionsMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PendingMaintenanceActionsMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PendingMaintenanceActionsMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ResourceNotFoundFault ] @ Errors_internal.common in + let errors = + [Errors_internal.ResourceNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describePendingMaintenanceActions.mli b/libraries/rds/lib/describePendingMaintenanceActions.mli index 764245818..ceb2e063b 100644 --- a/libraries/rds/lib/describePendingMaintenanceActions.mli +++ b/libraries/rds/lib/describePendingMaintenanceActions.mli @@ -1,10 +1,7 @@ open Types - type input = DescribePendingMaintenanceActionsMessage.t - type output = PendingMaintenanceActionsMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeReservedDBInstances.ml b/libraries/rds/lib/describeReservedDBInstances.ml index d0fec90f5..98b8fd438 100644 --- a/libraries/rds/lib/describeReservedDBInstances.ml +++ b/libraries/rds/lib/describeReservedDBInstances.ml @@ -1,64 +1,64 @@ open Types open Aws - type input = DescribeReservedDBInstancesMessage.t - type output = ReservedDBInstanceMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DescribeReservedDBInstances" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeReservedDBInstances"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedDBInstancesMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedDBInstancesMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeReservedDBInstancesResponse" (snd xml)) - (Xml.member "DescribeReservedDBInstancesResult") - in + (Xml.member "DescribeReservedDBInstancesResult") in try - Util.or_error - (Util.option_bind resp ReservedDBInstanceMessage.parse) + Util.or_error (Util.option_bind resp ReservedDBInstanceMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ReservedDBInstanceMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReservedDBInstanceMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReservedDBInstanceMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReservedDBInstanceMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.ReservedDBInstanceNotFound ] @ Errors_internal.common in + let errors = + [Errors_internal.ReservedDBInstanceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeReservedDBInstances.mli b/libraries/rds/lib/describeReservedDBInstances.mli index 2315c5953..ebdf08818 100644 --- a/libraries/rds/lib/describeReservedDBInstances.mli +++ b/libraries/rds/lib/describeReservedDBInstances.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedDBInstancesMessage.t - type output = ReservedDBInstanceMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/describeReservedDBInstancesOfferings.ml b/libraries/rds/lib/describeReservedDBInstancesOfferings.ml index dc330b931..b358ad670 100644 --- a/libraries/rds/lib/describeReservedDBInstancesOfferings.ml +++ b/libraries/rds/lib/describeReservedDBInstancesOfferings.ml @@ -1,70 +1,66 @@ open Types open Aws - type input = DescribeReservedDBInstancesOfferingsMessage.t - type output = ReservedDBInstancesOfferingMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "DescribeReservedDBInstancesOfferings" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["DescribeReservedDBInstancesOfferings"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeReservedDBInstancesOfferingsMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DescribeReservedDBInstancesOfferingsMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DescribeReservedDBInstancesOfferingsResponse" (snd xml)) - (Xml.member "DescribeReservedDBInstancesOfferingsResult") - in + (Xml.member "DescribeReservedDBInstancesOfferingsResult") in try Util.or_error (Util.option_bind resp ReservedDBInstancesOfferingMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ReservedDBInstancesOfferingMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ReservedDBInstancesOfferingMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReservedDBInstancesOfferingMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReservedDBInstancesOfferingMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ReservedDBInstancesOfferingNotFound ] @ Errors_internal.common - in + [Errors_internal.ReservedDBInstancesOfferingNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/describeReservedDBInstancesOfferings.mli b/libraries/rds/lib/describeReservedDBInstancesOfferings.mli index 40ff56b1b..32ea7b29b 100644 --- a/libraries/rds/lib/describeReservedDBInstancesOfferings.mli +++ b/libraries/rds/lib/describeReservedDBInstancesOfferings.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeReservedDBInstancesOfferingsMessage.t - type output = ReservedDBInstancesOfferingMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/downloadDBLogFilePortion.ml b/libraries/rds/lib/downloadDBLogFilePortion.ml index ad2536f7a..2abd127ae 100644 --- a/libraries/rds/lib/downloadDBLogFilePortion.ml +++ b/libraries/rds/lib/downloadDBLogFilePortion.ml @@ -1,69 +1,65 @@ open Types open Aws - type input = DownloadDBLogFilePortionMessage.t - type output = DownloadDBLogFilePortionDetails.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "DownloadDBLogFilePortion" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["DownloadDBLogFilePortion"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DownloadDBLogFilePortionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (DownloadDBLogFilePortionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DownloadDBLogFilePortionResponse" (snd xml)) - (Xml.member "DownloadDBLogFilePortionResult") - in + (Xml.member "DownloadDBLogFilePortionResult") in try Util.or_error (Util.option_bind resp DownloadDBLogFilePortionDetails.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DownloadDBLogFilePortionDetails." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DownloadDBLogFilePortionDetails." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DownloadDBLogFilePortionDetails - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DownloadDBLogFilePortionDetails - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBLogFileNotFoundFault; Errors_internal.DBInstanceNotFound ] - @ Errors_internal.common - in + [Errors_internal.DBLogFileNotFoundFault; + Errors_internal.DBInstanceNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/downloadDBLogFilePortion.mli b/libraries/rds/lib/downloadDBLogFilePortion.mli index 197c7b35e..293cc7d82 100644 --- a/libraries/rds/lib/downloadDBLogFilePortion.mli +++ b/libraries/rds/lib/downloadDBLogFilePortion.mli @@ -1,10 +1,7 @@ open Types - type input = DownloadDBLogFilePortionMessage.t - type output = DownloadDBLogFilePortionDetails.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 \ No newline at end of file diff --git a/libraries/rds/lib/dune b/libraries/rds/lib/dune index 06b836a77..d69a585b6 100644 --- a/libraries/rds/lib/dune +++ b/libraries/rds/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_rds) + (name aws_rds) (public_name aws-rds) (synopsis "aws-Amazon Relational Database Service") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/rds/lib/errors_internal.ml b/libraries/rds/lib/errors_internal.ml index b4e57322f..707b7f3c5 100644 --- a/libraries/rds/lib/errors_internal.ml +++ b/libraries/rds/lib/errors_internal.ml @@ -1,133 +1,130 @@ type t = - | AuthFailure - | AuthorizationAlreadyExists - | AuthorizationNotFound - | AuthorizationQuotaExceeded - | Blocked - | CertificateNotFound - | DBClusterAlreadyExistsFault - | DBClusterNotFoundFault - | DBClusterParameterGroupNotFound - | DBClusterQuotaExceededFault - | DBClusterSnapshotAlreadyExistsFault - | DBClusterSnapshotNotFoundFault - | DBInstanceAlreadyExists - | DBInstanceNotFound - | DBLogFileNotFoundFault - | DBParameterGroupAlreadyExists - | DBParameterGroupNotFound - | DBParameterGroupQuotaExceeded - | DBSecurityGroupAlreadyExists - | DBSecurityGroupNotFound - | DBSecurityGroupNotSupported - | DBSnapshotAlreadyExists - | DBSnapshotNotFound - | DBSubnetGroupAlreadyExists - | DBSubnetGroupDoesNotCoverEnoughAZs - | DBSubnetGroupNotAllowedFault - | DBSubnetGroupNotFoundFault - | DBSubnetGroupQuotaExceeded - | DBSubnetQuotaExceededFault - | DBUpgradeDependencyFailure - | DomainNotFoundFault - | DryRunOperation - | EventSubscriptionQuotaExceeded - | IdempotentParameterMismatch - | IncompleteSignature - | InstanceQuotaExceeded - | InsufficientDBClusterCapacityFault - | InsufficientDBInstanceCapacity - | InsufficientDomainCapacityFault - | InsufficientStorageClusterCapacity - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidDBClusterSnapshotStateFault - | InvalidDBClusterStateFault - | InvalidDBInstanceState - | InvalidDBParameterGroupState - | InvalidDBSecurityGroupState - | InvalidDBSnapshotState - | InvalidDBSubnetGroupFault - | InvalidDBSubnetGroupStateFault - | InvalidDBSubnetStateFault - | InvalidEventSubscriptionState - | InvalidOptionGroupStateFault - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidRestoreFault - | InvalidSubnet - | InvalidVPCNetworkStateFault - | KMSKeyNotAccessibleFault - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | OptionGroupAlreadyExistsFault - | OptionGroupNotFoundFault - | OptionGroupQuotaExceededFault - | PendingVerification - | PointInTimeRestoreNotEnabled - | ProvisionedIopsNotAvailableInAZFault - | QuotaExceeded_DBSecurityGroup - | RequestExpired - | RequestLimitExceeded - | ReservedDBInstanceAlreadyExists - | ReservedDBInstanceNotFound - | ReservedDBInstanceQuotaExceeded - | ReservedDBInstancesOfferingNotFound - | ResourceNotFoundFault - | SNSInvalidTopic - | SNSNoAuthorization - | SNSTopicArnNotFound - | ServiceUnavailable - | SnapshotQuotaExceeded - | SourceNotFound - | StorageQuotaExceeded - | StorageTypeNotSupported - | SubnetAlreadyInUse - | SubscriptionAlreadyExist - | SubscriptionCategoryNotFound - | SubscriptionNotFound - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | AuthorizationAlreadyExists + | AuthorizationNotFound + | AuthorizationQuotaExceeded + | Blocked + | CertificateNotFound + | DBClusterAlreadyExistsFault + | DBClusterNotFoundFault + | DBClusterParameterGroupNotFound + | DBClusterQuotaExceededFault + | DBClusterSnapshotAlreadyExistsFault + | DBClusterSnapshotNotFoundFault + | DBInstanceAlreadyExists + | DBInstanceNotFound + | DBLogFileNotFoundFault + | DBParameterGroupAlreadyExists + | DBParameterGroupNotFound + | DBParameterGroupQuotaExceeded + | DBSecurityGroupAlreadyExists + | DBSecurityGroupNotFound + | DBSecurityGroupNotSupported + | DBSnapshotAlreadyExists + | DBSnapshotNotFound + | DBSubnetGroupAlreadyExists + | DBSubnetGroupDoesNotCoverEnoughAZs + | DBSubnetGroupNotAllowedFault + | DBSubnetGroupNotFoundFault + | DBSubnetGroupQuotaExceeded + | DBSubnetQuotaExceededFault + | DBUpgradeDependencyFailure + | DomainNotFoundFault + | DryRunOperation + | EventSubscriptionQuotaExceeded + | IdempotentParameterMismatch + | IncompleteSignature + | InstanceQuotaExceeded + | InsufficientDBClusterCapacityFault + | InsufficientDBInstanceCapacity + | InsufficientDomainCapacityFault + | InsufficientStorageClusterCapacity + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidDBClusterSnapshotStateFault + | InvalidDBClusterStateFault + | InvalidDBInstanceState + | InvalidDBParameterGroupState + | InvalidDBSecurityGroupState + | InvalidDBSnapshotState + | InvalidDBSubnetGroupFault + | InvalidDBSubnetGroupStateFault + | InvalidDBSubnetStateFault + | InvalidEventSubscriptionState + | InvalidOptionGroupStateFault + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidRestoreFault + | InvalidSubnet + | InvalidVPCNetworkStateFault + | KMSKeyNotAccessibleFault + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | OptionGroupAlreadyExistsFault + | OptionGroupNotFoundFault + | OptionGroupQuotaExceededFault + | PendingVerification + | PointInTimeRestoreNotEnabled + | ProvisionedIopsNotAvailableInAZFault + | QuotaExceeded_DBSecurityGroup + | RequestExpired + | RequestLimitExceeded + | ReservedDBInstanceAlreadyExists + | ReservedDBInstanceNotFound + | ReservedDBInstanceQuotaExceeded + | ReservedDBInstancesOfferingNotFound + | ResourceNotFoundFault + | SNSInvalidTopic + | SNSNoAuthorization + | SNSTopicArnNotFound + | ServiceUnavailable + | SnapshotQuotaExceeded + | SourceNotFound + | StorageQuotaExceeded + | StorageTypeNotSupported + | SubnetAlreadyInUse + | SubscriptionAlreadyExist + | SubscriptionCategoryNotFound + | SubscriptionNotFound + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -229,7 +226,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -242,7 +238,8 @@ let to_string e = | DBClusterNotFoundFault -> "DBClusterNotFoundFault" | DBClusterParameterGroupNotFound -> "DBClusterParameterGroupNotFound" | DBClusterQuotaExceededFault -> "DBClusterQuotaExceededFault" - | DBClusterSnapshotAlreadyExistsFault -> "DBClusterSnapshotAlreadyExistsFault" + | DBClusterSnapshotAlreadyExistsFault -> + "DBClusterSnapshotAlreadyExistsFault" | DBClusterSnapshotNotFoundFault -> "DBClusterSnapshotNotFoundFault" | DBInstanceAlreadyExists -> "DBInstanceAlreadyExists" | DBInstanceNotFound -> "DBInstanceNotFound" @@ -256,7 +253,8 @@ let to_string e = | DBSnapshotAlreadyExists -> "DBSnapshotAlreadyExists" | DBSnapshotNotFound -> "DBSnapshotNotFound" | DBSubnetGroupAlreadyExists -> "DBSubnetGroupAlreadyExists" - | DBSubnetGroupDoesNotCoverEnoughAZs -> "DBSubnetGroupDoesNotCoverEnoughAZs" + | DBSubnetGroupDoesNotCoverEnoughAZs -> + "DBSubnetGroupDoesNotCoverEnoughAZs" | DBSubnetGroupNotAllowedFault -> "DBSubnetGroupNotAllowedFault" | DBSubnetGroupNotFoundFault -> "DBSubnetGroupNotFoundFault" | DBSubnetGroupQuotaExceeded -> "DBSubnetGroupQuotaExceeded" @@ -268,14 +266,17 @@ let to_string e = | IdempotentParameterMismatch -> "IdempotentParameterMismatch" | IncompleteSignature -> "IncompleteSignature" | InstanceQuotaExceeded -> "InstanceQuotaExceeded" - | InsufficientDBClusterCapacityFault -> "InsufficientDBClusterCapacityFault" + | InsufficientDBClusterCapacityFault -> + "InsufficientDBClusterCapacityFault" | InsufficientDBInstanceCapacity -> "InsufficientDBInstanceCapacity" | InsufficientDomainCapacityFault -> "InsufficientDomainCapacityFault" - | InsufficientStorageClusterCapacity -> "InsufficientStorageClusterCapacity" + | InsufficientStorageClusterCapacity -> + "InsufficientStorageClusterCapacity" | InternalFailure -> "InternalFailure" | InvalidAction -> "InvalidAction" | InvalidClientTokenId -> "InvalidClientTokenId" - | InvalidDBClusterSnapshotStateFault -> "InvalidDBClusterSnapshotStateFault" + | InvalidDBClusterSnapshotStateFault -> + "InvalidDBClusterSnapshotStateFault" | InvalidDBClusterStateFault -> "InvalidDBClusterStateFault" | InvalidDBInstanceState -> "InvalidDBInstanceState" | InvalidDBParameterGroupState -> "InvalidDBParameterGroupState" @@ -304,14 +305,16 @@ let to_string e = | OptionGroupQuotaExceededFault -> "OptionGroupQuotaExceededFault" | PendingVerification -> "PendingVerification" | PointInTimeRestoreNotEnabled -> "PointInTimeRestoreNotEnabled" - | ProvisionedIopsNotAvailableInAZFault -> "ProvisionedIopsNotAvailableInAZFault" + | ProvisionedIopsNotAvailableInAZFault -> + "ProvisionedIopsNotAvailableInAZFault" | QuotaExceeded_DBSecurityGroup -> "QuotaExceeded.DBSecurityGroup" | RequestExpired -> "RequestExpired" | RequestLimitExceeded -> "RequestLimitExceeded" | ReservedDBInstanceAlreadyExists -> "ReservedDBInstanceAlreadyExists" | ReservedDBInstanceNotFound -> "ReservedDBInstanceNotFound" | ReservedDBInstanceQuotaExceeded -> "ReservedDBInstanceQuotaExceeded" - | ReservedDBInstancesOfferingNotFound -> "ReservedDBInstancesOfferingNotFound" + | ReservedDBInstancesOfferingNotFound -> + "ReservedDBInstancesOfferingNotFound" | ResourceNotFoundFault -> "ResourceNotFoundFault" | SNSInvalidTopic -> "SNSInvalidTopic" | SNSNoAuthorization -> "SNSNoAuthorization" @@ -331,7 +334,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -344,7 +346,8 @@ let of_string e = | "DBClusterNotFoundFault" -> Some DBClusterNotFoundFault | "DBClusterParameterGroupNotFound" -> Some DBClusterParameterGroupNotFound | "DBClusterQuotaExceededFault" -> Some DBClusterQuotaExceededFault - | "DBClusterSnapshotAlreadyExistsFault" -> Some DBClusterSnapshotAlreadyExistsFault + | "DBClusterSnapshotAlreadyExistsFault" -> + Some DBClusterSnapshotAlreadyExistsFault | "DBClusterSnapshotNotFoundFault" -> Some DBClusterSnapshotNotFoundFault | "DBInstanceAlreadyExists" -> Some DBInstanceAlreadyExists | "DBInstanceNotFound" -> Some DBInstanceNotFound @@ -358,7 +361,8 @@ let of_string e = | "DBSnapshotAlreadyExists" -> Some DBSnapshotAlreadyExists | "DBSnapshotNotFound" -> Some DBSnapshotNotFound | "DBSubnetGroupAlreadyExists" -> Some DBSubnetGroupAlreadyExists - | "DBSubnetGroupDoesNotCoverEnoughAZs" -> Some DBSubnetGroupDoesNotCoverEnoughAZs + | "DBSubnetGroupDoesNotCoverEnoughAZs" -> + Some DBSubnetGroupDoesNotCoverEnoughAZs | "DBSubnetGroupNotAllowedFault" -> Some DBSubnetGroupNotAllowedFault | "DBSubnetGroupNotFoundFault" -> Some DBSubnetGroupNotFoundFault | "DBSubnetGroupQuotaExceeded" -> Some DBSubnetGroupQuotaExceeded @@ -370,14 +374,17 @@ let of_string e = | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch | "IncompleteSignature" -> Some IncompleteSignature | "InstanceQuotaExceeded" -> Some InstanceQuotaExceeded - | "InsufficientDBClusterCapacityFault" -> Some InsufficientDBClusterCapacityFault + | "InsufficientDBClusterCapacityFault" -> + Some InsufficientDBClusterCapacityFault | "InsufficientDBInstanceCapacity" -> Some InsufficientDBInstanceCapacity | "InsufficientDomainCapacityFault" -> Some InsufficientDomainCapacityFault - | "InsufficientStorageClusterCapacity" -> Some InsufficientStorageClusterCapacity + | "InsufficientStorageClusterCapacity" -> + Some InsufficientStorageClusterCapacity | "InternalFailure" -> Some InternalFailure | "InvalidAction" -> Some InvalidAction | "InvalidClientTokenId" -> Some InvalidClientTokenId - | "InvalidDBClusterSnapshotStateFault" -> Some InvalidDBClusterSnapshotStateFault + | "InvalidDBClusterSnapshotStateFault" -> + Some InvalidDBClusterSnapshotStateFault | "InvalidDBClusterStateFault" -> Some InvalidDBClusterStateFault | "InvalidDBInstanceState" -> Some InvalidDBInstanceState | "InvalidDBParameterGroupState" -> Some InvalidDBParameterGroupState @@ -406,14 +413,16 @@ let of_string e = | "OptionGroupQuotaExceededFault" -> Some OptionGroupQuotaExceededFault | "PendingVerification" -> Some PendingVerification | "PointInTimeRestoreNotEnabled" -> Some PointInTimeRestoreNotEnabled - | "ProvisionedIopsNotAvailableInAZFault" -> Some ProvisionedIopsNotAvailableInAZFault + | "ProvisionedIopsNotAvailableInAZFault" -> + Some ProvisionedIopsNotAvailableInAZFault | "QuotaExceeded.DBSecurityGroup" -> Some QuotaExceeded_DBSecurityGroup | "RequestExpired" -> Some RequestExpired | "RequestLimitExceeded" -> Some RequestLimitExceeded | "ReservedDBInstanceAlreadyExists" -> Some ReservedDBInstanceAlreadyExists | "ReservedDBInstanceNotFound" -> Some ReservedDBInstanceNotFound | "ReservedDBInstanceQuotaExceeded" -> Some ReservedDBInstanceQuotaExceeded - | "ReservedDBInstancesOfferingNotFound" -> Some ReservedDBInstancesOfferingNotFound + | "ReservedDBInstancesOfferingNotFound" -> + Some ReservedDBInstancesOfferingNotFound | "ResourceNotFoundFault" -> Some ResourceNotFoundFault | "SNSInvalidTopic" -> Some SNSInvalidTopic | "SNSNoAuthorization" -> Some SNSNoAuthorization @@ -433,4 +442,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/rds/lib/failoverDBCluster.ml b/libraries/rds/lib/failoverDBCluster.ml index 23b7ddef3..710df549c 100644 --- a/libraries/rds/lib/failoverDBCluster.ml +++ b/libraries/rds/lib/failoverDBCluster.ml @@ -1,66 +1,62 @@ open Types open Aws - type input = FailoverDBClusterMessage.t - type output = FailoverDBClusterResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "FailoverDBCluster" ] ] + [("Version", ["2014-10-31"]); ("Action", ["FailoverDBCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (FailoverDBClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (FailoverDBClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "FailoverDBClusterResponse" (snd xml)) - (Xml.member "FailoverDBClusterResult") - in + Util.option_bind (Xml.member "FailoverDBClusterResponse" (snd xml)) + (Xml.member "FailoverDBClusterResult") in try - Util.or_error - (Util.option_bind resp FailoverDBClusterResult.parse) + Util.or_error (Util.option_bind resp FailoverDBClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed FailoverDBClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed FailoverDBClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing FailoverDBClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing FailoverDBClusterResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBClusterStateFault; Errors_internal.DBClusterNotFoundFault ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBClusterNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/failoverDBCluster.mli b/libraries/rds/lib/failoverDBCluster.mli index ea54ad490..81b691984 100644 --- a/libraries/rds/lib/failoverDBCluster.mli +++ b/libraries/rds/lib/failoverDBCluster.mli @@ -1,10 +1,7 @@ open Types - type input = FailoverDBClusterMessage.t - type output = FailoverDBClusterResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/listTagsForResource.ml b/libraries/rds/lib/listTagsForResource.ml index fd8c749fa..05bdec820 100644 --- a/libraries/rds/lib/listTagsForResource.ml +++ b/libraries/rds/lib/listTagsForResource.ml @@ -1,64 +1,58 @@ open Types open Aws - type input = ListTagsForResourceMessage.t - type output = TagListMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ListTagsForResource" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListTagsForResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ListTagsForResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListTagsForResourceResponse" (snd xml)) - (Xml.member "ListTagsForResourceResult") - in + Util.option_bind (Xml.member "ListTagsForResourceResponse" (snd xml)) + (Xml.member "ListTagsForResourceResult") in try - Util.or_error - (Util.option_bind resp TagListMessage.parse) + Util.or_error (Util.option_bind resp TagListMessage.parse) (let open Error in - BadResponse { body; message = "Could not find well formed TagListMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed TagListMessage." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing TagListMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing TagListMessage - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound ] - @ Errors_internal.common - in + [Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound] + @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/listTagsForResource.mli b/libraries/rds/lib/listTagsForResource.mli index 4b5c9405c..bf19038f1 100644 --- a/libraries/rds/lib/listTagsForResource.mli +++ b/libraries/rds/lib/listTagsForResource.mli @@ -1,10 +1,7 @@ open Types - type input = ListTagsForResourceMessage.t - type output = TagListMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBCluster.ml b/libraries/rds/lib/modifyDBCluster.ml index 9ec46c967..17c792032 100644 --- a/libraries/rds/lib/modifyDBCluster.ml +++ b/libraries/rds/lib/modifyDBCluster.ml @@ -1,75 +1,69 @@ open Types open Aws - type input = ModifyDBClusterMessage.t - type output = ModifyDBClusterResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyDBCluster" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ModifyDBCluster"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyDBClusterMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyDBClusterMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ModifyDBClusterResponse" (snd xml)) - (Xml.member "ModifyDBClusterResult") - in + Util.option_bind (Xml.member "ModifyDBClusterResponse" (snd xml)) + (Xml.member "ModifyDBClusterResult") in try - Util.or_error - (Util.option_bind resp ModifyDBClusterResult.parse) + Util.or_error (Util.option_bind resp ModifyDBClusterResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyDBClusterResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ModifyDBClusterResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyDBClusterResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyDBClusterResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBInstanceState - ; Errors_internal.InvalidDBSecurityGroupState - ; Errors_internal.DBClusterParameterGroupNotFound - ; Errors_internal.InvalidSubnet - ; Errors_internal.InvalidDBSubnetGroupStateFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InvalidDBClusterStateFault - ; Errors_internal.DBClusterNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBInstanceState; + Errors_internal.InvalidDBSecurityGroupState; + Errors_internal.DBClusterParameterGroupNotFound; + Errors_internal.InvalidSubnet; + Errors_internal.InvalidDBSubnetGroupStateFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InvalidDBClusterStateFault; + Errors_internal.DBClusterNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBCluster.mli b/libraries/rds/lib/modifyDBCluster.mli index 6cdd9a061..79b646c3b 100644 --- a/libraries/rds/lib/modifyDBCluster.mli +++ b/libraries/rds/lib/modifyDBCluster.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyDBClusterMessage.t - type output = ModifyDBClusterResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBClusterParameterGroup.ml b/libraries/rds/lib/modifyDBClusterParameterGroup.ml index df50fd630..ff7d6dc93 100644 --- a/libraries/rds/lib/modifyDBClusterParameterGroup.ml +++ b/libraries/rds/lib/modifyDBClusterParameterGroup.ml @@ -1,71 +1,66 @@ open Types open Aws - type input = ModifyDBClusterParameterGroupMessage.t - type output = DBClusterParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyDBClusterParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["ModifyDBClusterParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyDBClusterParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ModifyDBClusterParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyDBClusterParameterGroupResponse" (snd xml)) - (Xml.member "ModifyDBClusterParameterGroupResult") - in + (Xml.member "ModifyDBClusterParameterGroupResult") in try Util.or_error (Util.option_bind resp DBClusterParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DBClusterParameterGroupNameMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBClusterParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterParameterGroupNameMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBParameterGroupState - ; Errors_internal.DBParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBParameterGroupState; + Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBClusterParameterGroup.mli b/libraries/rds/lib/modifyDBClusterParameterGroup.mli index cbae88b9f..aa0f86219 100644 --- a/libraries/rds/lib/modifyDBClusterParameterGroup.mli +++ b/libraries/rds/lib/modifyDBClusterParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyDBClusterParameterGroupMessage.t - type output = DBClusterParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBInstance.ml b/libraries/rds/lib/modifyDBInstance.ml index 0434c89ab..39c3515a7 100644 --- a/libraries/rds/lib/modifyDBInstance.ml +++ b/libraries/rds/lib/modifyDBInstance.ml @@ -1,83 +1,76 @@ open Types open Aws - type input = ModifyDBInstanceMessage.t - type output = ModifyDBInstanceResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyDBInstance" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ModifyDBInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyDBInstanceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyDBInstanceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ModifyDBInstanceResponse" (snd xml)) - (Xml.member "ModifyDBInstanceResult") - in + Util.option_bind (Xml.member "ModifyDBInstanceResponse" (snd xml)) + (Xml.member "ModifyDBInstanceResult") in try - Util.or_error - (Util.option_bind resp ModifyDBInstanceResult.parse) + Util.or_error (Util.option_bind resp ModifyDBInstanceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyDBInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ModifyDBInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyDBInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyDBInstanceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientDomainCapacityFault - ; Errors_internal.DomainNotFoundFault - ; Errors_internal.CertificateNotFound - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.StorageTypeNotSupported - ; Errors_internal.DBUpgradeDependencyFailure - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.ProvisionedIopsNotAvailableInAZFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InsufficientDBInstanceCapacity - ; Errors_internal.DBParameterGroupNotFound - ; Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.DBInstanceNotFound - ; Errors_internal.DBInstanceAlreadyExists - ; Errors_internal.InvalidDBSecurityGroupState - ; Errors_internal.InvalidDBInstanceState - ] - @ Errors_internal.common - in + [Errors_internal.InsufficientDomainCapacityFault; + Errors_internal.DomainNotFoundFault; + Errors_internal.CertificateNotFound; + Errors_internal.AuthorizationNotFound; + Errors_internal.StorageTypeNotSupported; + Errors_internal.DBUpgradeDependencyFailure; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.ProvisionedIopsNotAvailableInAZFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InsufficientDBInstanceCapacity; + Errors_internal.DBParameterGroupNotFound; + Errors_internal.DBSecurityGroupNotFound; + Errors_internal.DBInstanceNotFound; + Errors_internal.DBInstanceAlreadyExists; + Errors_internal.InvalidDBSecurityGroupState; + Errors_internal.InvalidDBInstanceState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBInstance.mli b/libraries/rds/lib/modifyDBInstance.mli index ac449c902..7a302b3e9 100644 --- a/libraries/rds/lib/modifyDBInstance.mli +++ b/libraries/rds/lib/modifyDBInstance.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyDBInstanceMessage.t - type output = ModifyDBInstanceResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBParameterGroup.ml b/libraries/rds/lib/modifyDBParameterGroup.ml index cbb480a68..0ae7c63f7 100644 --- a/libraries/rds/lib/modifyDBParameterGroup.ml +++ b/libraries/rds/lib/modifyDBParameterGroup.ml @@ -1,69 +1,64 @@ open Types open Aws - type input = ModifyDBParameterGroupMessage.t - type output = DBParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyDBParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["ModifyDBParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyDBParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyDBParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyDBParameterGroupResponse" (snd xml)) - (Xml.member "ModifyDBParameterGroupResult") - in + (Xml.member "ModifyDBParameterGroupResult") in try - Util.or_error - (Util.option_bind resp DBParameterGroupNameMessage.parse) + Util.or_error (Util.option_bind resp DBParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBParameterGroupNameMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBParameterGroupNameMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBParameterGroupState - ; Errors_internal.DBParameterGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBParameterGroupState; + Errors_internal.DBParameterGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBParameterGroup.mli b/libraries/rds/lib/modifyDBParameterGroup.mli index 124eb7cf5..2b2a6b7d0 100644 --- a/libraries/rds/lib/modifyDBParameterGroup.mli +++ b/libraries/rds/lib/modifyDBParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyDBParameterGroupMessage.t - type output = DBParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBSubnetGroup.ml b/libraries/rds/lib/modifyDBSubnetGroup.ml index aa5864a06..4f3bfcbc8 100644 --- a/libraries/rds/lib/modifyDBSubnetGroup.ml +++ b/libraries/rds/lib/modifyDBSubnetGroup.ml @@ -1,72 +1,65 @@ open Types open Aws - type input = ModifyDBSubnetGroupMessage.t - type output = ModifyDBSubnetGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyDBSubnetGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ModifyDBSubnetGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyDBSubnetGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyDBSubnetGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ModifyDBSubnetGroupResponse" (snd xml)) - (Xml.member "ModifyDBSubnetGroupResult") - in + Util.option_bind (Xml.member "ModifyDBSubnetGroupResponse" (snd xml)) + (Xml.member "ModifyDBSubnetGroupResult") in try - Util.or_error - (Util.option_bind resp ModifyDBSubnetGroupResult.parse) + Util.or_error (Util.option_bind resp ModifyDBSubnetGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyDBSubnetGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyDBSubnetGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyDBSubnetGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyDBSubnetGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.SubnetAlreadyInUse - ; Errors_internal.DBSubnetQuotaExceededFault - ; Errors_internal.DBSubnetGroupNotFoundFault - ] - @ Errors_internal.common - in + [Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.SubnetAlreadyInUse; + Errors_internal.DBSubnetQuotaExceededFault; + Errors_internal.DBSubnetGroupNotFoundFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyDBSubnetGroup.mli b/libraries/rds/lib/modifyDBSubnetGroup.mli index 0bfc81768..5f662717a 100644 --- a/libraries/rds/lib/modifyDBSubnetGroup.mli +++ b/libraries/rds/lib/modifyDBSubnetGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyDBSubnetGroupMessage.t - type output = ModifyDBSubnetGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyEventSubscription.ml b/libraries/rds/lib/modifyEventSubscription.ml index 6c4ef317f..1af081f14 100644 --- a/libraries/rds/lib/modifyEventSubscription.ml +++ b/libraries/rds/lib/modifyEventSubscription.ml @@ -1,73 +1,69 @@ open Types open Aws - type input = ModifyEventSubscriptionMessage.t - type output = ModifyEventSubscriptionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyEventSubscription" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["ModifyEventSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ModifyEventSubscriptionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ModifyEventSubscriptionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ModifyEventSubscriptionResponse" (snd xml)) - (Xml.member "ModifyEventSubscriptionResult") - in + (Xml.member "ModifyEventSubscriptionResult") in try Util.or_error (Util.option_bind resp ModifyEventSubscriptionResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyEventSubscriptionResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyEventSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyEventSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyEventSubscriptionResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SubscriptionCategoryNotFound - ; Errors_internal.SNSTopicArnNotFound - ; Errors_internal.SNSNoAuthorization - ; Errors_internal.SNSInvalidTopic - ; Errors_internal.SubscriptionNotFound - ; Errors_internal.EventSubscriptionQuotaExceeded - ] - @ Errors_internal.common - in + [Errors_internal.SubscriptionCategoryNotFound; + Errors_internal.SNSTopicArnNotFound; + Errors_internal.SNSNoAuthorization; + Errors_internal.SNSInvalidTopic; + Errors_internal.SubscriptionNotFound; + Errors_internal.EventSubscriptionQuotaExceeded] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyEventSubscription.mli b/libraries/rds/lib/modifyEventSubscription.mli index 8f2064bfd..b1e7552a1 100644 --- a/libraries/rds/lib/modifyEventSubscription.mli +++ b/libraries/rds/lib/modifyEventSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyEventSubscriptionMessage.t - type output = ModifyEventSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyOptionGroup.ml b/libraries/rds/lib/modifyOptionGroup.ml index 7e01e859f..81e59f953 100644 --- a/libraries/rds/lib/modifyOptionGroup.ml +++ b/libraries/rds/lib/modifyOptionGroup.ml @@ -1,68 +1,62 @@ open Types open Aws - type input = ModifyOptionGroupMessage.t - type output = ModifyOptionGroupResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ModifyOptionGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ModifyOptionGroup"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ModifyOptionGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ModifyOptionGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ModifyOptionGroupResponse" (snd xml)) - (Xml.member "ModifyOptionGroupResult") - in + Util.option_bind (Xml.member "ModifyOptionGroupResponse" (snd xml)) + (Xml.member "ModifyOptionGroupResult") in try - Util.or_error - (Util.option_bind resp ModifyOptionGroupResult.parse) + Util.or_error (Util.option_bind resp ModifyOptionGroupResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ModifyOptionGroupResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ModifyOptionGroupResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ModifyOptionGroupResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ModifyOptionGroupResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.InvalidOptionGroupStateFault - ] - @ Errors_internal.common - in + [Errors_internal.OptionGroupNotFoundFault; + Errors_internal.InvalidOptionGroupStateFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/modifyOptionGroup.mli b/libraries/rds/lib/modifyOptionGroup.mli index 0bab512dd..25efa5474 100644 --- a/libraries/rds/lib/modifyOptionGroup.mli +++ b/libraries/rds/lib/modifyOptionGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ModifyOptionGroupMessage.t - type output = ModifyOptionGroupResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/promoteReadReplica.ml b/libraries/rds/lib/promoteReadReplica.ml index 0a37140c9..4cc4adb82 100644 --- a/libraries/rds/lib/promoteReadReplica.ml +++ b/libraries/rds/lib/promoteReadReplica.ml @@ -1,66 +1,62 @@ open Types open Aws - type input = PromoteReadReplicaMessage.t - type output = PromoteReadReplicaResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "PromoteReadReplica" ] ] + [("Version", ["2014-10-31"]); ("Action", ["PromoteReadReplica"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PromoteReadReplicaMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PromoteReadReplicaMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "PromoteReadReplicaResponse" (snd xml)) - (Xml.member "PromoteReadReplicaResult") - in + Util.option_bind (Xml.member "PromoteReadReplicaResponse" (snd xml)) + (Xml.member "PromoteReadReplicaResult") in try - Util.or_error - (Util.option_bind resp PromoteReadReplicaResult.parse) + Util.or_error (Util.option_bind resp PromoteReadReplicaResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed PromoteReadReplicaResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PromoteReadReplicaResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PromoteReadReplicaResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PromoteReadReplicaResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBInstanceNotFound; Errors_internal.InvalidDBInstanceState ] - @ Errors_internal.common - in + [Errors_internal.DBInstanceNotFound; + Errors_internal.InvalidDBInstanceState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/promoteReadReplica.mli b/libraries/rds/lib/promoteReadReplica.mli index e9f8e3820..5e9e5f2ce 100644 --- a/libraries/rds/lib/promoteReadReplica.mli +++ b/libraries/rds/lib/promoteReadReplica.mli @@ -1,10 +1,7 @@ open Types - type input = PromoteReadReplicaMessage.t - type output = PromoteReadReplicaResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml b/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml index cdc8156d2..1012c5bbf 100644 --- a/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml +++ b/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml @@ -1,75 +1,69 @@ open Types open Aws - type input = PurchaseReservedDBInstancesOfferingMessage.t - type output = PurchaseReservedDBInstancesOfferingResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "PurchaseReservedDBInstancesOffering" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["PurchaseReservedDBInstancesOffering"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PurchaseReservedDBInstancesOfferingMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (PurchaseReservedDBInstancesOfferingMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "PurchaseReservedDBInstancesOfferingResponse" (snd xml)) - (Xml.member "PurchaseReservedDBInstancesOfferingResult") - in + (Xml.member "PurchaseReservedDBInstancesOfferingResult") in try Util.or_error - (Util.option_bind resp PurchaseReservedDBInstancesOfferingResult.parse) + (Util.option_bind resp + PurchaseReservedDBInstancesOfferingResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed PurchaseReservedDBInstancesOfferingResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed PurchaseReservedDBInstancesOfferingResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PurchaseReservedDBInstancesOfferingResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PurchaseReservedDBInstancesOfferingResult - missing field \ - in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ReservedDBInstanceQuotaExceeded - ; Errors_internal.ReservedDBInstanceAlreadyExists - ; Errors_internal.ReservedDBInstancesOfferingNotFound - ] - @ Errors_internal.common - in + [Errors_internal.ReservedDBInstanceQuotaExceeded; + Errors_internal.ReservedDBInstanceAlreadyExists; + Errors_internal.ReservedDBInstancesOfferingNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/purchaseReservedDBInstancesOffering.mli b/libraries/rds/lib/purchaseReservedDBInstancesOffering.mli index ad14e3f65..4361e94fe 100644 --- a/libraries/rds/lib/purchaseReservedDBInstancesOffering.mli +++ b/libraries/rds/lib/purchaseReservedDBInstancesOffering.mli @@ -1,10 +1,7 @@ open Types - type input = PurchaseReservedDBInstancesOfferingMessage.t - type output = PurchaseReservedDBInstancesOfferingResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/rebootDBInstance.ml b/libraries/rds/lib/rebootDBInstance.ml index 804d10071..3233f564a 100644 --- a/libraries/rds/lib/rebootDBInstance.ml +++ b/libraries/rds/lib/rebootDBInstance.ml @@ -1,66 +1,61 @@ open Types open Aws - type input = RebootDBInstanceMessage.t - type output = RebootDBInstanceResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RebootDBInstance" ] ] + [("Version", ["2014-10-31"]); ("Action", ["RebootDBInstance"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RebootDBInstanceMessage.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RebootDBInstanceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "RebootDBInstanceResponse" (snd xml)) - (Xml.member "RebootDBInstanceResult") - in + Util.option_bind (Xml.member "RebootDBInstanceResponse" (snd xml)) + (Xml.member "RebootDBInstanceResult") in try - Util.or_error - (Util.option_bind resp RebootDBInstanceResult.parse) + Util.or_error (Util.option_bind resp RebootDBInstanceResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed RebootDBInstanceResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed RebootDBInstanceResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RebootDBInstanceResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RebootDBInstanceResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBInstanceNotFound; Errors_internal.InvalidDBInstanceState ] - @ Errors_internal.common - in + [Errors_internal.DBInstanceNotFound; + Errors_internal.InvalidDBInstanceState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/rebootDBInstance.mli b/libraries/rds/lib/rebootDBInstance.mli index 911418673..65a3b2134 100644 --- a/libraries/rds/lib/rebootDBInstance.mli +++ b/libraries/rds/lib/rebootDBInstance.mli @@ -1,10 +1,7 @@ open Types - type input = RebootDBInstanceMessage.t - type output = RebootDBInstanceResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml b/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml index 627f26362..4e9f4aabf 100644 --- a/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml +++ b/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml @@ -1,72 +1,68 @@ open Types open Aws - type input = RemoveSourceIdentifierFromSubscriptionMessage.t - type output = RemoveSourceIdentifierFromSubscriptionResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ] - ; "Action", [ "RemoveSourceIdentifierFromSubscription" ] - ] + [("Version", ["2014-10-31"]); + ("Action", ["RemoveSourceIdentifierFromSubscription"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RemoveSourceIdentifierFromSubscriptionMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RemoveSourceIdentifierFromSubscriptionMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind - (Xml.member "RemoveSourceIdentifierFromSubscriptionResponse" (snd xml)) - (Xml.member "RemoveSourceIdentifierFromSubscriptionResult") - in + (Xml.member "RemoveSourceIdentifierFromSubscriptionResponse" + (snd xml)) + (Xml.member "RemoveSourceIdentifierFromSubscriptionResult") in try Util.or_error - (Util.option_bind resp RemoveSourceIdentifierFromSubscriptionResult.parse) + (Util.option_bind resp + RemoveSourceIdentifierFromSubscriptionResult.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed RemoveSourceIdentifierFromSubscriptionResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RemoveSourceIdentifierFromSubscriptionResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RemoveSourceIdentifierFromSubscriptionResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RemoveSourceIdentifierFromSubscriptionResult - missing \ - field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.SourceNotFound; Errors_internal.SubscriptionNotFound ] - @ Errors_internal.common - in + [Errors_internal.SourceNotFound; Errors_internal.SubscriptionNotFound] @ + 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 \ No newline at end of file diff --git a/libraries/rds/lib/removeSourceIdentifierFromSubscription.mli b/libraries/rds/lib/removeSourceIdentifierFromSubscription.mli index 4f648e4fc..b964c8f4e 100644 --- a/libraries/rds/lib/removeSourceIdentifierFromSubscription.mli +++ b/libraries/rds/lib/removeSourceIdentifierFromSubscription.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveSourceIdentifierFromSubscriptionMessage.t - type output = RemoveSourceIdentifierFromSubscriptionResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/removeTagsFromResource.ml b/libraries/rds/lib/removeTagsFromResource.ml index f4dc33ca9..857cc132b 100644 --- a/libraries/rds/lib/removeTagsFromResource.ml +++ b/libraries/rds/lib/removeTagsFromResource.ml @@ -1,40 +1,33 @@ open Types open Aws - type input = RemoveTagsFromResourceMessage.t - type output = unit - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RemoveTagsFromResource" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RemoveTagsFromResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RemoveTagsFromResourceMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (RemoveTagsFromResourceMessage.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound ] - @ Errors_internal.common - in + [Errors_internal.DBSnapshotNotFound; Errors_internal.DBInstanceNotFound] + @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/removeTagsFromResource.mli b/libraries/rds/lib/removeTagsFromResource.mli index 8a922bb84..e1b6c0df2 100644 --- a/libraries/rds/lib/removeTagsFromResource.mli +++ b/libraries/rds/lib/removeTagsFromResource.mli @@ -1,10 +1,7 @@ open Types - type input = RemoveTagsFromResourceMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/resetDBClusterParameterGroup.ml b/libraries/rds/lib/resetDBClusterParameterGroup.ml index 4eedcea3b..cc7856c32 100644 --- a/libraries/rds/lib/resetDBClusterParameterGroup.ml +++ b/libraries/rds/lib/resetDBClusterParameterGroup.ml @@ -1,71 +1,66 @@ open Types open Aws - type input = ResetDBClusterParameterGroupMessage.t - type output = DBClusterParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ResetDBClusterParameterGroup" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["ResetDBClusterParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetDBClusterParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ResetDBClusterParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ResetDBClusterParameterGroupResponse" (snd xml)) - (Xml.member "ResetDBClusterParameterGroupResult") - in + (Xml.member "ResetDBClusterParameterGroupResult") in try Util.or_error (Util.option_bind resp DBClusterParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DBClusterParameterGroupNameMessage." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBClusterParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBClusterParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBClusterParameterGroupNameMessage - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InvalidDBParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupNotFound; + Errors_internal.InvalidDBParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/resetDBClusterParameterGroup.mli b/libraries/rds/lib/resetDBClusterParameterGroup.mli index d3b8decbd..43eedb852 100644 --- a/libraries/rds/lib/resetDBClusterParameterGroup.mli +++ b/libraries/rds/lib/resetDBClusterParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ResetDBClusterParameterGroupMessage.t - type output = DBClusterParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/resetDBParameterGroup.ml b/libraries/rds/lib/resetDBParameterGroup.ml index 23dcebcec..6d20240e5 100644 --- a/libraries/rds/lib/resetDBParameterGroup.ml +++ b/libraries/rds/lib/resetDBParameterGroup.ml @@ -1,69 +1,62 @@ open Types open Aws - type input = ResetDBParameterGroupMessage.t - type output = DBParameterGroupNameMessage.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "ResetDBParameterGroup" ] ] + [("Version", ["2014-10-31"]); ("Action", ["ResetDBParameterGroup"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ResetDBParameterGroupMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render (ResetDBParameterGroupMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ResetDBParameterGroupResponse" (snd xml)) - (Xml.member "ResetDBParameterGroupResult") - in + Util.option_bind (Xml.member "ResetDBParameterGroupResponse" (snd xml)) + (Xml.member "ResetDBParameterGroupResult") in try - Util.or_error - (Util.option_bind resp DBParameterGroupNameMessage.parse) + Util.or_error (Util.option_bind resp DBParameterGroupNameMessage.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DBParameterGroupNameMessage." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DBParameterGroupNameMessage." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DBParameterGroupNameMessage - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DBParameterGroupNameMessage - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DBParameterGroupNotFound - ; Errors_internal.InvalidDBParameterGroupState - ] - @ Errors_internal.common - in + [Errors_internal.DBParameterGroupNotFound; + Errors_internal.InvalidDBParameterGroupState] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/resetDBParameterGroup.mli b/libraries/rds/lib/resetDBParameterGroup.mli index fe461b4f3..ba54b3d01 100644 --- a/libraries/rds/lib/resetDBParameterGroup.mli +++ b/libraries/rds/lib/resetDBParameterGroup.mli @@ -1,10 +1,7 @@ open Types - type input = ResetDBParameterGroupMessage.t - type output = DBParameterGroupNameMessage.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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBClusterFromSnapshot.ml b/libraries/rds/lib/restoreDBClusterFromSnapshot.ml index ce142400b..03043708f 100644 --- a/libraries/rds/lib/restoreDBClusterFromSnapshot.ml +++ b/libraries/rds/lib/restoreDBClusterFromSnapshot.ml @@ -1,85 +1,80 @@ open Types open Aws - type input = RestoreDBClusterFromSnapshotMessage.t - type output = RestoreDBClusterFromSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RestoreDBClusterFromSnapshot" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RestoreDBClusterFromSnapshot"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RestoreDBClusterFromSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RestoreDBClusterFromSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RestoreDBClusterFromSnapshotResponse" (snd xml)) - (Xml.member "RestoreDBClusterFromSnapshotResult") - in + (Xml.member "RestoreDBClusterFromSnapshotResult") in try Util.or_error (Util.option_bind resp RestoreDBClusterFromSnapshotResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RestoreDBClusterFromSnapshotResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RestoreDBClusterFromSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreDBClusterFromSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreDBClusterFromSnapshotResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidRestoreFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InvalidDBClusterSnapshotStateFault - ; Errors_internal.InvalidDBSnapshotState - ; Errors_internal.InsufficientStorageClusterCapacity - ; Errors_internal.InsufficientDBClusterCapacityFault - ; Errors_internal.DBClusterSnapshotNotFoundFault - ; Errors_internal.DBSnapshotNotFound - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.DBClusterQuotaExceededFault - ; Errors_internal.DBClusterAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.OptionGroupNotFoundFault; + Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidRestoreFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InvalidDBClusterSnapshotStateFault; + Errors_internal.InvalidDBSnapshotState; + Errors_internal.InsufficientStorageClusterCapacity; + Errors_internal.InsufficientDBClusterCapacityFault; + Errors_internal.DBClusterSnapshotNotFoundFault; + Errors_internal.DBSnapshotNotFound; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.DBClusterQuotaExceededFault; + Errors_internal.DBClusterAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBClusterFromSnapshot.mli b/libraries/rds/lib/restoreDBClusterFromSnapshot.mli index a320ba64f..2c3fc84ed 100644 --- a/libraries/rds/lib/restoreDBClusterFromSnapshot.mli +++ b/libraries/rds/lib/restoreDBClusterFromSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreDBClusterFromSnapshotMessage.t - type output = RestoreDBClusterFromSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBClusterToPointInTime.ml b/libraries/rds/lib/restoreDBClusterToPointInTime.ml index 813448ae0..aa9e6d008 100644 --- a/libraries/rds/lib/restoreDBClusterToPointInTime.ml +++ b/libraries/rds/lib/restoreDBClusterToPointInTime.ml @@ -1,84 +1,79 @@ open Types open Aws - type input = RestoreDBClusterToPointInTimeMessage.t - type output = RestoreDBClusterToPointInTimeResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RestoreDBClusterToPointInTime" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RestoreDBClusterToPointInTime"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RestoreDBClusterToPointInTimeMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RestoreDBClusterToPointInTimeMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RestoreDBClusterToPointInTimeResponse" (snd xml)) - (Xml.member "RestoreDBClusterToPointInTimeResult") - in + (Xml.member "RestoreDBClusterToPointInTimeResult") in try Util.or_error (Util.option_bind resp RestoreDBClusterToPointInTimeResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RestoreDBClusterToPointInTimeResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RestoreDBClusterToPointInTimeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreDBClusterToPointInTimeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreDBClusterToPointInTimeResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidRestoreFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InvalidDBClusterSnapshotStateFault - ; Errors_internal.InvalidDBSnapshotState - ; Errors_internal.InsufficientDBClusterCapacityFault - ; Errors_internal.DBClusterSnapshotNotFoundFault - ; Errors_internal.DBClusterNotFoundFault - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.DBClusterQuotaExceededFault - ; Errors_internal.DBClusterAlreadyExistsFault - ] - @ Errors_internal.common - in + [Errors_internal.OptionGroupNotFoundFault; + Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidRestoreFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InvalidDBClusterSnapshotStateFault; + Errors_internal.InvalidDBSnapshotState; + Errors_internal.InsufficientDBClusterCapacityFault; + Errors_internal.DBClusterSnapshotNotFoundFault; + Errors_internal.DBClusterNotFoundFault; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.DBClusterQuotaExceededFault; + Errors_internal.DBClusterAlreadyExistsFault] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBClusterToPointInTime.mli b/libraries/rds/lib/restoreDBClusterToPointInTime.mli index 750bdee23..62a0af3dc 100644 --- a/libraries/rds/lib/restoreDBClusterToPointInTime.mli +++ b/libraries/rds/lib/restoreDBClusterToPointInTime.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreDBClusterToPointInTimeMessage.t - type output = RestoreDBClusterToPointInTimeResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml index 46b4a7ae7..912e6924e 100644 --- a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml +++ b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml @@ -1,88 +1,83 @@ open Types open Aws - type input = RestoreDBInstanceFromDBSnapshotMessage.t - type output = RestoreDBInstanceFromDBSnapshotResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RestoreDBInstanceFromDBSnapshot" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RestoreDBInstanceFromDBSnapshot"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RestoreDBInstanceFromDBSnapshotMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RestoreDBInstanceFromDBSnapshotMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RestoreDBInstanceFromDBSnapshotResponse" (snd xml)) - (Xml.member "RestoreDBInstanceFromDBSnapshotResult") - in + (Xml.member "RestoreDBInstanceFromDBSnapshotResult") in try Util.or_error (Util.option_bind resp RestoreDBInstanceFromDBSnapshotResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RestoreDBInstanceFromDBSnapshotResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RestoreDBInstanceFromDBSnapshotResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreDBInstanceFromDBSnapshotResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreDBInstanceFromDBSnapshotResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientDomainCapacityFault - ; Errors_internal.DomainNotFoundFault - ; Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.KMSKeyNotAccessibleFault - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.StorageTypeNotSupported - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.ProvisionedIopsNotAvailableInAZFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidRestoreFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.InvalidDBSnapshotState - ; Errors_internal.InsufficientDBInstanceCapacity - ; Errors_internal.InstanceQuotaExceeded - ; Errors_internal.DBSnapshotNotFound - ; Errors_internal.DBInstanceAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InsufficientDomainCapacityFault; + Errors_internal.DomainNotFoundFault; + Errors_internal.DBSecurityGroupNotFound; + Errors_internal.KMSKeyNotAccessibleFault; + Errors_internal.AuthorizationNotFound; + Errors_internal.StorageTypeNotSupported; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.ProvisionedIopsNotAvailableInAZFault; + Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidRestoreFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.InvalidDBSnapshotState; + Errors_internal.InsufficientDBInstanceCapacity; + Errors_internal.InstanceQuotaExceeded; + Errors_internal.DBSnapshotNotFound; + Errors_internal.DBInstanceAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.mli b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.mli index cd7d56854..0b999330f 100644 --- a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.mli +++ b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreDBInstanceFromDBSnapshotMessage.t - type output = RestoreDBInstanceFromDBSnapshotResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBInstanceToPointInTime.ml b/libraries/rds/lib/restoreDBInstanceToPointInTime.ml index 401fcaef7..82b1996b3 100644 --- a/libraries/rds/lib/restoreDBInstanceToPointInTime.ml +++ b/libraries/rds/lib/restoreDBInstanceToPointInTime.ml @@ -1,89 +1,84 @@ open Types open Aws - type input = RestoreDBInstanceToPointInTimeMessage.t - type output = RestoreDBInstanceToPointInTimeResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RestoreDBInstanceToPointInTime" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RestoreDBInstanceToPointInTime"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RestoreDBInstanceToPointInTimeMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RestoreDBInstanceToPointInTimeMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RestoreDBInstanceToPointInTimeResponse" (snd xml)) - (Xml.member "RestoreDBInstanceToPointInTimeResult") - in + (Xml.member "RestoreDBInstanceToPointInTimeResult") in try Util.or_error (Util.option_bind resp RestoreDBInstanceToPointInTimeResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RestoreDBInstanceToPointInTimeResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RestoreDBInstanceToPointInTimeResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreDBInstanceToPointInTimeResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreDBInstanceToPointInTimeResult - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InsufficientDomainCapacityFault - ; Errors_internal.DomainNotFoundFault - ; Errors_internal.DBSecurityGroupNotFound - ; Errors_internal.KMSKeyNotAccessibleFault - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.StorageTypeNotSupported - ; Errors_internal.OptionGroupNotFoundFault - ; Errors_internal.ProvisionedIopsNotAvailableInAZFault - ; Errors_internal.InvalidSubnet - ; Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs - ; Errors_internal.DBSubnetGroupNotFoundFault - ; Errors_internal.InvalidRestoreFault - ; Errors_internal.InvalidVPCNetworkStateFault - ; Errors_internal.StorageQuotaExceeded - ; Errors_internal.PointInTimeRestoreNotEnabled - ; Errors_internal.InvalidDBInstanceState - ; Errors_internal.InsufficientDBInstanceCapacity - ; Errors_internal.InstanceQuotaExceeded - ; Errors_internal.DBInstanceNotFound - ; Errors_internal.DBInstanceAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InsufficientDomainCapacityFault; + Errors_internal.DomainNotFoundFault; + Errors_internal.DBSecurityGroupNotFound; + Errors_internal.KMSKeyNotAccessibleFault; + Errors_internal.AuthorizationNotFound; + Errors_internal.StorageTypeNotSupported; + Errors_internal.OptionGroupNotFoundFault; + Errors_internal.ProvisionedIopsNotAvailableInAZFault; + Errors_internal.InvalidSubnet; + Errors_internal.DBSubnetGroupDoesNotCoverEnoughAZs; + Errors_internal.DBSubnetGroupNotFoundFault; + Errors_internal.InvalidRestoreFault; + Errors_internal.InvalidVPCNetworkStateFault; + Errors_internal.StorageQuotaExceeded; + Errors_internal.PointInTimeRestoreNotEnabled; + Errors_internal.InvalidDBInstanceState; + Errors_internal.InsufficientDBInstanceCapacity; + Errors_internal.InstanceQuotaExceeded; + Errors_internal.DBInstanceNotFound; + Errors_internal.DBInstanceAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/restoreDBInstanceToPointInTime.mli b/libraries/rds/lib/restoreDBInstanceToPointInTime.mli index d85dad4ab..20e0280ab 100644 --- a/libraries/rds/lib/restoreDBInstanceToPointInTime.mli +++ b/libraries/rds/lib/restoreDBInstanceToPointInTime.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreDBInstanceToPointInTimeMessage.t - type output = RestoreDBInstanceToPointInTimeResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/revokeDBSecurityGroupIngress.ml b/libraries/rds/lib/revokeDBSecurityGroupIngress.ml index 709ef7235..b7cae4f6b 100644 --- a/libraries/rds/lib/revokeDBSecurityGroupIngress.ml +++ b/libraries/rds/lib/revokeDBSecurityGroupIngress.ml @@ -1,72 +1,67 @@ open Types open Aws - type input = RevokeDBSecurityGroupIngressMessage.t - type output = RevokeDBSecurityGroupIngressResult.t - type error = Errors_internal.t - let service = "rds" - 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", [ "2014-10-31" ]; "Action", [ "RevokeDBSecurityGroupIngress" ] ] + [("Version", ["2014-10-31"]); + ("Action", ["RevokeDBSecurityGroupIngress"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (RevokeDBSecurityGroupIngressMessage.to_query req))))) - in - `POST, uri, [] - + (Query.render + (RevokeDBSecurityGroupIngressMessage.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "RevokeDBSecurityGroupIngressResponse" (snd xml)) - (Xml.member "RevokeDBSecurityGroupIngressResult") - in + (Xml.member "RevokeDBSecurityGroupIngressResult") in try Util.or_error (Util.option_bind resp RevokeDBSecurityGroupIngressResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed RevokeDBSecurityGroupIngressResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed RevokeDBSecurityGroupIngressResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RevokeDBSecurityGroupIngressResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RevokeDBSecurityGroupIngressResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDBSecurityGroupState - ; Errors_internal.AuthorizationNotFound - ; Errors_internal.DBSecurityGroupNotFound - ] - @ Errors_internal.common - in + [Errors_internal.InvalidDBSecurityGroupState; + Errors_internal.AuthorizationNotFound; + Errors_internal.DBSecurityGroupNotFound] @ 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 \ No newline at end of file diff --git a/libraries/rds/lib/revokeDBSecurityGroupIngress.mli b/libraries/rds/lib/revokeDBSecurityGroupIngress.mli index 23cadcd40..bb6510cf3 100644 --- a/libraries/rds/lib/revokeDBSecurityGroupIngress.mli +++ b/libraries/rds/lib/revokeDBSecurityGroupIngress.mli @@ -1,10 +1,7 @@ open Types - type input = RevokeDBSecurityGroupIngressMessage.t - type output = RevokeDBSecurityGroupIngressResult.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 \ No newline at end of file diff --git a/libraries/rds/lib/types.ml b/libraries/rds/lib/types.ml index 02b775478..828386f5c 100644 --- a/libraries/rds/lib/types.ml +++ b/libraries/rds/lib/types.ml @@ -1,14188 +1,14313 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module AvailabilityZone = struct - type t = { name : String.t option } - - let make ?name () = { name } - - let parse xml = Some { name = Util.option_bind (Xml.member "Name" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> "name", String.to_json f) ]) - - let of_json j = { name = Util.option_map (Json.lookup j "name") String.of_json } -end - -module DBSecurityGroupMembership = struct - type t = - { d_b_security_group_name : String.t option - ; status : String.t option - } - - let make ?d_b_security_group_name ?status () = { d_b_security_group_name; status } - - let parse xml = - Some - { d_b_security_group_name = - Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.d_b_security_group_name (fun f -> - Query.Pair ("DBSecurityGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.d_b_security_group_name (fun f -> - "d_b_security_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_security_group_name = - Util.option_map (Json.lookup j "d_b_security_group_name") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module OptionSetting = struct - type t = - { name : String.t option - ; value : String.t option - ; default_value : String.t option - ; description : String.t option - ; apply_type : String.t option - ; data_type : String.t option - ; allowed_values : String.t option - ; is_modifiable : Boolean.t option - ; is_collection : Boolean.t option - } - - let make - ?name - ?value - ?default_value - ?description - ?apply_type - ?data_type - ?allowed_values - ?is_modifiable - ?is_collection - () = - { name - ; value - ; default_value - ; description - ; apply_type - ; data_type - ; allowed_values - ; is_modifiable - ; is_collection - } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - ; default_value = Util.option_bind (Xml.member "DefaultValue" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; apply_type = Util.option_bind (Xml.member "ApplyType" xml) String.parse - ; data_type = Util.option_bind (Xml.member "DataType" xml) String.parse - ; allowed_values = Util.option_bind (Xml.member "AllowedValues" xml) String.parse - ; is_modifiable = Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse - ; is_collection = Util.option_bind (Xml.member "IsCollection" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.is_collection (fun f -> - Query.Pair ("IsCollection", Boolean.to_query f)) - ; Util.option_map v.is_modifiable (fun f -> - Query.Pair ("IsModifiable", Boolean.to_query f)) - ; Util.option_map v.allowed_values (fun f -> - Query.Pair ("AllowedValues", String.to_query f)) - ; Util.option_map v.data_type (fun f -> - Query.Pair ("DataType", String.to_query f)) - ; Util.option_map v.apply_type (fun f -> - Query.Pair ("ApplyType", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.default_value (fun f -> - Query.Pair ("DefaultValue", String.to_query f)) - ; Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.is_collection (fun f -> "is_collection", Boolean.to_json f) - ; Util.option_map v.is_modifiable (fun f -> "is_modifiable", Boolean.to_json f) - ; Util.option_map v.allowed_values (fun f -> "allowed_values", String.to_json f) - ; Util.option_map v.data_type (fun f -> "data_type", String.to_json f) - ; Util.option_map v.apply_type (fun f -> "apply_type", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.default_value (fun f -> "default_value", String.to_json f) - ; Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - ; default_value = Util.option_map (Json.lookup j "default_value") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; apply_type = Util.option_map (Json.lookup j "apply_type") String.of_json - ; data_type = Util.option_map (Json.lookup j "data_type") String.of_json - ; allowed_values = Util.option_map (Json.lookup j "allowed_values") String.of_json - ; is_modifiable = Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json - ; is_collection = Util.option_map (Json.lookup j "is_collection") Boolean.of_json - } -end - -module VpcSecurityGroupMembership = struct - type t = - { vpc_security_group_id : String.t option - ; status : String.t option - } - - let make ?vpc_security_group_id ?status () = { vpc_security_group_id; status } - - let parse xml = - Some - { vpc_security_group_id = - Util.option_bind (Xml.member "VpcSecurityGroupId" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.vpc_security_group_id (fun f -> - Query.Pair ("VpcSecurityGroupId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.vpc_security_group_id (fun f -> - "vpc_security_group_id", String.to_json f) - ]) - - let of_json j = - { vpc_security_group_id = - Util.option_map (Json.lookup j "vpc_security_group_id") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module Subnet = struct - type t = - { subnet_identifier : String.t option - ; subnet_availability_zone : AvailabilityZone.t option - ; subnet_status : String.t option - } - - let make ?subnet_identifier ?subnet_availability_zone ?subnet_status () = - { subnet_identifier; subnet_availability_zone; subnet_status } - - let parse xml = - Some - { subnet_identifier = - Util.option_bind (Xml.member "SubnetIdentifier" xml) String.parse - ; subnet_availability_zone = - Util.option_bind - (Xml.member "SubnetAvailabilityZone" xml) - AvailabilityZone.parse - ; subnet_status = Util.option_bind (Xml.member "SubnetStatus" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subnet_status (fun f -> - Query.Pair ("SubnetStatus", String.to_query f)) - ; Util.option_map v.subnet_availability_zone (fun f -> - Query.Pair ("SubnetAvailabilityZone", AvailabilityZone.to_query f)) - ; Util.option_map v.subnet_identifier (fun f -> - Query.Pair ("SubnetIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subnet_status (fun f -> "subnet_status", String.to_json f) - ; Util.option_map v.subnet_availability_zone (fun f -> - "subnet_availability_zone", AvailabilityZone.to_json f) - ; Util.option_map v.subnet_identifier (fun f -> - "subnet_identifier", String.to_json f) - ]) - - let of_json j = - { subnet_identifier = - Util.option_map (Json.lookup j "subnet_identifier") String.of_json - ; subnet_availability_zone = - Util.option_map - (Json.lookup j "subnet_availability_zone") - AvailabilityZone.of_json - ; subnet_status = Util.option_map (Json.lookup j "subnet_status") String.of_json - } -end - -module DBSecurityGroupMembershipList = struct - type t = DBSecurityGroupMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBSecurityGroupMembership.parse (Xml.members "DBSecurityGroup" xml)) - - let to_query v = Query.to_query_list DBSecurityGroupMembership.to_query v - - let to_json v = `List (List.map DBSecurityGroupMembership.to_json v) - - let of_json j = Json.to_list DBSecurityGroupMembership.of_json j -end - -module OptionSettingConfigurationList = struct - type t = OptionSetting.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map OptionSetting.parse (Xml.members "OptionSetting" xml)) - - let to_query v = Query.to_query_list OptionSetting.to_query v - - let to_json v = `List (List.map OptionSetting.to_json v) - - let of_json j = Json.to_list OptionSetting.of_json j -end - -module VpcSecurityGroupMembershipList = struct - type t = VpcSecurityGroupMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - VpcSecurityGroupMembership.parse - (Xml.members "VpcSecurityGroupMembership" xml)) - - let to_query v = Query.to_query_list VpcSecurityGroupMembership.to_query v - - let to_json v = `List (List.map VpcSecurityGroupMembership.to_json v) - - let of_json j = Json.to_list VpcSecurityGroupMembership.of_json j -end - -module OptionGroupOptionSetting = struct - type t = - { setting_name : String.t option - ; setting_description : String.t option - ; default_value : String.t option - ; apply_type : String.t option - ; allowed_values : String.t option - ; is_modifiable : Boolean.t option - } - - let make - ?setting_name - ?setting_description - ?default_value - ?apply_type - ?allowed_values - ?is_modifiable - () = - { setting_name - ; setting_description - ; default_value - ; apply_type - ; allowed_values - ; is_modifiable - } - - let parse xml = - Some - { setting_name = Util.option_bind (Xml.member "SettingName" xml) String.parse - ; setting_description = - Util.option_bind (Xml.member "SettingDescription" xml) String.parse - ; default_value = Util.option_bind (Xml.member "DefaultValue" xml) String.parse - ; apply_type = Util.option_bind (Xml.member "ApplyType" xml) String.parse - ; allowed_values = Util.option_bind (Xml.member "AllowedValues" xml) String.parse - ; is_modifiable = Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.is_modifiable (fun f -> - Query.Pair ("IsModifiable", Boolean.to_query f)) - ; Util.option_map v.allowed_values (fun f -> - Query.Pair ("AllowedValues", String.to_query f)) - ; Util.option_map v.apply_type (fun f -> - Query.Pair ("ApplyType", String.to_query f)) - ; Util.option_map v.default_value (fun f -> - Query.Pair ("DefaultValue", String.to_query f)) - ; Util.option_map v.setting_description (fun f -> - Query.Pair ("SettingDescription", String.to_query f)) - ; Util.option_map v.setting_name (fun f -> - Query.Pair ("SettingName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.is_modifiable (fun f -> "is_modifiable", Boolean.to_json f) - ; Util.option_map v.allowed_values (fun f -> "allowed_values", String.to_json f) - ; Util.option_map v.apply_type (fun f -> "apply_type", String.to_json f) - ; Util.option_map v.default_value (fun f -> "default_value", String.to_json f) - ; Util.option_map v.setting_description (fun f -> - "setting_description", String.to_json f) - ; Util.option_map v.setting_name (fun f -> "setting_name", String.to_json f) - ]) - - let of_json j = - { setting_name = Util.option_map (Json.lookup j "setting_name") String.of_json - ; setting_description = - Util.option_map (Json.lookup j "setting_description") String.of_json - ; default_value = Util.option_map (Json.lookup j "default_value") String.of_json - ; apply_type = Util.option_map (Json.lookup j "apply_type") String.of_json - ; allowed_values = Util.option_map (Json.lookup j "allowed_values") String.of_json - ; is_modifiable = Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json - } -end - -module ApplyMethod = struct - type t = - | Immediate - | Pending_reboot - - let str_to_t = [ "pending-reboot", Pending_reboot; "immediate", Immediate ] - - let t_to_str = [ Pending_reboot, "pending-reboot"; Immediate, "immediate" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RecurringCharge = struct - type t = - { recurring_charge_amount : Double.t option - ; recurring_charge_frequency : String.t option - } - - let make ?recurring_charge_amount ?recurring_charge_frequency () = - { recurring_charge_amount; recurring_charge_frequency } - - let parse xml = - Some - { recurring_charge_amount = - Util.option_bind (Xml.member "RecurringChargeAmount" xml) Double.parse - ; recurring_charge_frequency = - Util.option_bind (Xml.member "RecurringChargeFrequency" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.recurring_charge_frequency (fun f -> - Query.Pair ("RecurringChargeFrequency", String.to_query f)) - ; Util.option_map v.recurring_charge_amount (fun f -> - Query.Pair ("RecurringChargeAmount", Double.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.recurring_charge_frequency (fun f -> - "recurring_charge_frequency", String.to_json f) - ; Util.option_map v.recurring_charge_amount (fun f -> - "recurring_charge_amount", Double.to_json f) - ]) - - let of_json j = - { recurring_charge_amount = - Util.option_map (Json.lookup j "recurring_charge_amount") Double.of_json - ; recurring_charge_frequency = - Util.option_map (Json.lookup j "recurring_charge_frequency") String.of_json - } -end - -module PendingMaintenanceAction = struct - type t = - { action : String.t option - ; auto_applied_after_date : DateTime.t option - ; forced_apply_date : DateTime.t option - ; opt_in_status : String.t option - ; current_apply_date : DateTime.t option - ; description : String.t option - } - - let make - ?action - ?auto_applied_after_date - ?forced_apply_date - ?opt_in_status - ?current_apply_date - ?description - () = - { action - ; auto_applied_after_date - ; forced_apply_date - ; opt_in_status - ; current_apply_date - ; description - } - - let parse xml = - Some - { action = Util.option_bind (Xml.member "Action" xml) String.parse - ; auto_applied_after_date = - Util.option_bind (Xml.member "AutoAppliedAfterDate" xml) DateTime.parse - ; forced_apply_date = - Util.option_bind (Xml.member "ForcedApplyDate" xml) DateTime.parse - ; opt_in_status = Util.option_bind (Xml.member "OptInStatus" xml) String.parse - ; current_apply_date = - Util.option_bind (Xml.member "CurrentApplyDate" xml) DateTime.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.current_apply_date (fun f -> - Query.Pair ("CurrentApplyDate", DateTime.to_query f)) - ; Util.option_map v.opt_in_status (fun f -> - Query.Pair ("OptInStatus", String.to_query f)) - ; Util.option_map v.forced_apply_date (fun f -> - Query.Pair ("ForcedApplyDate", DateTime.to_query f)) - ; Util.option_map v.auto_applied_after_date (fun f -> - Query.Pair ("AutoAppliedAfterDate", DateTime.to_query f)) - ; Util.option_map v.action (fun f -> Query.Pair ("Action", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.current_apply_date (fun f -> - "current_apply_date", DateTime.to_json f) - ; Util.option_map v.opt_in_status (fun f -> "opt_in_status", String.to_json f) - ; Util.option_map v.forced_apply_date (fun f -> - "forced_apply_date", DateTime.to_json f) - ; Util.option_map v.auto_applied_after_date (fun f -> - "auto_applied_after_date", DateTime.to_json f) - ; Util.option_map v.action (fun f -> "action", String.to_json f) - ]) - - let of_json j = - { action = Util.option_map (Json.lookup j "action") String.of_json - ; auto_applied_after_date = - Util.option_map (Json.lookup j "auto_applied_after_date") DateTime.of_json - ; forced_apply_date = - Util.option_map (Json.lookup j "forced_apply_date") DateTime.of_json - ; opt_in_status = Util.option_map (Json.lookup j "opt_in_status") String.of_json - ; current_apply_date = - Util.option_map (Json.lookup j "current_apply_date") DateTime.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module CharacterSet = struct - type t = - { character_set_name : String.t option - ; character_set_description : String.t option - } - - let make ?character_set_name ?character_set_description () = - { character_set_name; character_set_description } - - let parse xml = - Some - { character_set_name = - Util.option_bind (Xml.member "CharacterSetName" xml) String.parse - ; character_set_description = - Util.option_bind (Xml.member "CharacterSetDescription" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.character_set_description (fun f -> - Query.Pair ("CharacterSetDescription", String.to_query f)) - ; Util.option_map v.character_set_name (fun f -> - Query.Pair ("CharacterSetName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.character_set_description (fun f -> - "character_set_description", String.to_json f) - ; Util.option_map v.character_set_name (fun f -> - "character_set_name", String.to_json f) - ]) - - let of_json j = - { character_set_name = - Util.option_map (Json.lookup j "character_set_name") String.of_json - ; character_set_description = - Util.option_map (Json.lookup j "character_set_description") String.of_json - } -end - -module DBInstanceStatusInfo = struct - type t = - { status_type : String.t option - ; normal : Boolean.t option - ; status : String.t option - ; message : String.t option - } - - let make ?status_type ?normal ?status ?message () = - { status_type; normal; status; message } - - let parse xml = - Some - { status_type = Util.option_bind (Xml.member "StatusType" xml) String.parse - ; normal = Util.option_bind (Xml.member "Normal" xml) Boolean.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; message = Util.option_bind (Xml.member "Message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.normal (fun f -> Query.Pair ("Normal", Boolean.to_query f)) - ; Util.option_map v.status_type (fun f -> - Query.Pair ("StatusType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.normal (fun f -> "normal", Boolean.to_json f) - ; Util.option_map v.status_type (fun f -> "status_type", String.to_json f) - ]) - - let of_json j = - { status_type = Util.option_map (Json.lookup j "status_type") String.of_json - ; normal = Util.option_map (Json.lookup j "normal") Boolean.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module DBParameterGroupStatus = struct - type t = - { d_b_parameter_group_name : String.t option - ; parameter_apply_status : String.t option - } - - let make ?d_b_parameter_group_name ?parameter_apply_status () = - { d_b_parameter_group_name; parameter_apply_status } - - let parse xml = - Some - { d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - ; parameter_apply_status = - Util.option_bind (Xml.member "ParameterApplyStatus" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.parameter_apply_status (fun f -> - Query.Pair ("ParameterApplyStatus", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.parameter_apply_status (fun f -> - "parameter_apply_status", String.to_json f) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - ; parameter_apply_status = - Util.option_map (Json.lookup j "parameter_apply_status") String.of_json - } -end - -module SubnetList = struct - type t = Subnet.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Subnet.parse (Xml.members "Subnet" xml)) - - let to_query v = Query.to_query_list Subnet.to_query v - - let to_json v = `List (List.map Subnet.to_json v) - - let of_json j = Json.to_list Subnet.of_json j -end - -module DomainMembership = struct - type t = - { domain : String.t option - ; status : String.t option - ; connectivity : String.t option - } - - let make ?domain ?status ?connectivity () = { domain; status; connectivity } - - let parse xml = - Some - { domain = Util.option_bind (Xml.member "Domain" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; connectivity = Util.option_bind (Xml.member "Connectivity" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.connectivity (fun f -> - Query.Pair ("Connectivity", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.domain (fun f -> Query.Pair ("Domain", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.connectivity (fun f -> "connectivity", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.domain (fun f -> "domain", String.to_json f) - ]) - - let of_json j = - { domain = Util.option_map (Json.lookup j "domain") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; connectivity = Util.option_map (Json.lookup j "connectivity") String.of_json - } -end - -module OptionGroupMembership = struct - type t = - { option_group_name : String.t option - ; status : String.t option - } - - let make ?option_group_name ?status () = { option_group_name; status } - - let parse xml = - Some - { option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ]) - - let of_json j = - { option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module Option = struct - type t = - { option_name : String.t option - ; option_description : String.t option - ; persistent : Boolean.t option - ; permanent : Boolean.t option - ; port : Integer.t option - ; option_settings : OptionSettingConfigurationList.t - ; d_b_security_group_memberships : DBSecurityGroupMembershipList.t - ; vpc_security_group_memberships : VpcSecurityGroupMembershipList.t - } - - let make - ?option_name - ?option_description - ?persistent - ?permanent - ?port - ?(option_settings = []) - ?(d_b_security_group_memberships = []) - ?(vpc_security_group_memberships = []) - () = - { option_name - ; option_description - ; persistent - ; permanent - ; port - ; option_settings - ; d_b_security_group_memberships - ; vpc_security_group_memberships - } - - let parse xml = - Some - { option_name = Util.option_bind (Xml.member "OptionName" xml) String.parse - ; option_description = - Util.option_bind (Xml.member "OptionDescription" xml) String.parse - ; persistent = Util.option_bind (Xml.member "Persistent" xml) Boolean.parse - ; permanent = Util.option_bind (Xml.member "Permanent" xml) Boolean.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; option_settings = - Util.of_option - [] - (Util.option_bind - (Xml.member "OptionSettings" xml) - OptionSettingConfigurationList.parse) - ; d_b_security_group_memberships = - Util.of_option - [] +module AvailabilityZone = + struct + type t = { + name: String.t option } + let make ?name () = { name } + let parse xml = + Some { name = (Util.option_bind (Xml.member "Name" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { name = (Util.option_map (Json.lookup j "name") String.of_json) } + end +module DBSecurityGroupMembership = + struct + type t = + { + d_b_security_group_name: String.t option ; + status: String.t option } + let make ?d_b_security_group_name ?status () = + { d_b_security_group_name; status } + let parse xml = + Some + { + d_b_security_group_name = + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.d_b_security_group_name + (fun f -> + Query.Pair ("DBSecurityGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.d_b_security_group_name + (fun f -> ("d_b_security_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_security_group_name = + (Util.option_map (Json.lookup j "d_b_security_group_name") + String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module OptionSetting = + struct + type t = + { + name: String.t option ; + value: String.t option ; + default_value: String.t option ; + description: String.t option ; + apply_type: String.t option ; + data_type: String.t option ; + allowed_values: String.t option ; + is_modifiable: Boolean.t option ; + is_collection: Boolean.t option } + let make ?name ?value ?default_value ?description ?apply_type + ?data_type ?allowed_values ?is_modifiable ?is_collection () = + { + name; + value; + default_value; + description; + apply_type; + data_type; + allowed_values; + is_modifiable; + is_collection + } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse); + default_value = + (Util.option_bind (Xml.member "DefaultValue" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + apply_type = + (Util.option_bind (Xml.member "ApplyType" xml) String.parse); + data_type = + (Util.option_bind (Xml.member "DataType" xml) String.parse); + allowed_values = + (Util.option_bind (Xml.member "AllowedValues" xml) String.parse); + is_modifiable = + (Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse); + is_collection = + (Util.option_bind (Xml.member "IsCollection" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.is_collection + (fun f -> Query.Pair ("IsCollection", (Boolean.to_query f))); + Util.option_map v.is_modifiable + (fun f -> Query.Pair ("IsModifiable", (Boolean.to_query f))); + Util.option_map v.allowed_values + (fun f -> Query.Pair ("AllowedValues", (String.to_query f))); + Util.option_map v.data_type + (fun f -> Query.Pair ("DataType", (String.to_query f))); + Util.option_map v.apply_type + (fun f -> Query.Pair ("ApplyType", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.default_value + (fun f -> Query.Pair ("DefaultValue", (String.to_query f))); + Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.is_collection + (fun f -> ("is_collection", (Boolean.to_json f))); + Util.option_map v.is_modifiable + (fun f -> ("is_modifiable", (Boolean.to_json f))); + Util.option_map v.allowed_values + (fun f -> ("allowed_values", (String.to_json f))); + Util.option_map v.data_type + (fun f -> ("data_type", (String.to_json f))); + Util.option_map v.apply_type + (fun f -> ("apply_type", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.default_value + (fun f -> ("default_value", (String.to_json f))); + Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json); + default_value = + (Util.option_map (Json.lookup j "default_value") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + apply_type = + (Util.option_map (Json.lookup j "apply_type") String.of_json); + data_type = + (Util.option_map (Json.lookup j "data_type") String.of_json); + allowed_values = + (Util.option_map (Json.lookup j "allowed_values") String.of_json); + is_modifiable = + (Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json); + is_collection = + (Util.option_map (Json.lookup j "is_collection") Boolean.of_json) + } + end +module VpcSecurityGroupMembership = + struct + type t = + { + vpc_security_group_id: String.t option ; + status: String.t option } + let make ?vpc_security_group_id ?status () = + { vpc_security_group_id; status } + let parse xml = + Some + { + vpc_security_group_id = + (Util.option_bind (Xml.member "VpcSecurityGroupId" xml) + String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.vpc_security_group_id + (fun f -> Query.Pair ("VpcSecurityGroupId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.vpc_security_group_id + (fun f -> ("vpc_security_group_id", (String.to_json f)))]) + let of_json j = + { + vpc_security_group_id = + (Util.option_map (Json.lookup j "vpc_security_group_id") + String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module Subnet = + struct + type t = + { + subnet_identifier: String.t option ; + subnet_availability_zone: AvailabilityZone.t option ; + subnet_status: String.t option } + let make ?subnet_identifier ?subnet_availability_zone ?subnet_status + () = { subnet_identifier; subnet_availability_zone; subnet_status } + let parse xml = + Some + { + subnet_identifier = + (Util.option_bind (Xml.member "SubnetIdentifier" xml) + String.parse); + subnet_availability_zone = + (Util.option_bind (Xml.member "SubnetAvailabilityZone" xml) + AvailabilityZone.parse); + subnet_status = + (Util.option_bind (Xml.member "SubnetStatus" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subnet_status + (fun f -> Query.Pair ("SubnetStatus", (String.to_query f))); + Util.option_map v.subnet_availability_zone + (fun f -> + Query.Pair + ("SubnetAvailabilityZone", (AvailabilityZone.to_query f))); + Util.option_map v.subnet_identifier + (fun f -> Query.Pair ("SubnetIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subnet_status + (fun f -> ("subnet_status", (String.to_json f))); + Util.option_map v.subnet_availability_zone + (fun f -> + ("subnet_availability_zone", (AvailabilityZone.to_json f))); + Util.option_map v.subnet_identifier + (fun f -> ("subnet_identifier", (String.to_json f)))]) + let of_json j = + { + subnet_identifier = + (Util.option_map (Json.lookup j "subnet_identifier") String.of_json); + subnet_availability_zone = + (Util.option_map (Json.lookup j "subnet_availability_zone") + AvailabilityZone.of_json); + subnet_status = + (Util.option_map (Json.lookup j "subnet_status") String.of_json) + } + end +module DBSecurityGroupMembershipList = + struct + type t = DBSecurityGroupMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBSecurityGroupMembership.parse + (Xml.members "DBSecurityGroup" xml)) + let to_query v = Query.to_query_list DBSecurityGroupMembership.to_query v + let to_json v = `List (List.map DBSecurityGroupMembership.to_json v) + let of_json j = Json.to_list DBSecurityGroupMembership.of_json j + end +module OptionSettingConfigurationList = + struct + type t = OptionSetting.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionSetting.parse (Xml.members "OptionSetting" xml)) + let to_query v = Query.to_query_list OptionSetting.to_query v + let to_json v = `List (List.map OptionSetting.to_json v) + let of_json j = Json.to_list OptionSetting.of_json j + end +module VpcSecurityGroupMembershipList = + struct + type t = VpcSecurityGroupMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map VpcSecurityGroupMembership.parse + (Xml.members "VpcSecurityGroupMembership" xml)) + let to_query v = + Query.to_query_list VpcSecurityGroupMembership.to_query v + let to_json v = `List (List.map VpcSecurityGroupMembership.to_json v) + let of_json j = Json.to_list VpcSecurityGroupMembership.of_json j + end +module OptionGroupOptionSetting = + struct + type t = + { + setting_name: String.t option ; + setting_description: String.t option ; + default_value: String.t option ; + apply_type: String.t option ; + allowed_values: String.t option ; + is_modifiable: Boolean.t option } + let make ?setting_name ?setting_description ?default_value ?apply_type + ?allowed_values ?is_modifiable () = + { + setting_name; + setting_description; + default_value; + apply_type; + allowed_values; + is_modifiable + } + let parse xml = + Some + { + setting_name = + (Util.option_bind (Xml.member "SettingName" xml) String.parse); + setting_description = + (Util.option_bind (Xml.member "SettingDescription" xml) + String.parse); + default_value = + (Util.option_bind (Xml.member "DefaultValue" xml) String.parse); + apply_type = + (Util.option_bind (Xml.member "ApplyType" xml) String.parse); + allowed_values = + (Util.option_bind (Xml.member "AllowedValues" xml) String.parse); + is_modifiable = + (Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.is_modifiable + (fun f -> Query.Pair ("IsModifiable", (Boolean.to_query f))); + Util.option_map v.allowed_values + (fun f -> Query.Pair ("AllowedValues", (String.to_query f))); + Util.option_map v.apply_type + (fun f -> Query.Pair ("ApplyType", (String.to_query f))); + Util.option_map v.default_value + (fun f -> Query.Pair ("DefaultValue", (String.to_query f))); + Util.option_map v.setting_description + (fun f -> Query.Pair ("SettingDescription", (String.to_query f))); + Util.option_map v.setting_name + (fun f -> Query.Pair ("SettingName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.is_modifiable + (fun f -> ("is_modifiable", (Boolean.to_json f))); + Util.option_map v.allowed_values + (fun f -> ("allowed_values", (String.to_json f))); + Util.option_map v.apply_type + (fun f -> ("apply_type", (String.to_json f))); + Util.option_map v.default_value + (fun f -> ("default_value", (String.to_json f))); + Util.option_map v.setting_description + (fun f -> ("setting_description", (String.to_json f))); + Util.option_map v.setting_name + (fun f -> ("setting_name", (String.to_json f)))]) + let of_json j = + { + setting_name = + (Util.option_map (Json.lookup j "setting_name") String.of_json); + setting_description = + (Util.option_map (Json.lookup j "setting_description") + String.of_json); + default_value = + (Util.option_map (Json.lookup j "default_value") String.of_json); + apply_type = + (Util.option_map (Json.lookup j "apply_type") String.of_json); + allowed_values = + (Util.option_map (Json.lookup j "allowed_values") String.of_json); + is_modifiable = + (Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json) + } + end +module ApplyMethod = + struct + type t = + | Immediate + | Pending_reboot + let str_to_t = + [("pending-reboot", Pending_reboot); ("immediate", Immediate)] + let t_to_str = + [(Pending_reboot, "pending-reboot"); (Immediate, "immediate")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RecurringCharge = + struct + type t = + { + recurring_charge_amount: Double.t option ; + recurring_charge_frequency: String.t option } + let make ?recurring_charge_amount ?recurring_charge_frequency () = + { recurring_charge_amount; recurring_charge_frequency } + let parse xml = + Some + { + recurring_charge_amount = + (Util.option_bind (Xml.member "RecurringChargeAmount" xml) + Double.parse); + recurring_charge_frequency = + (Util.option_bind (Xml.member "RecurringChargeFrequency" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.recurring_charge_frequency + (fun f -> + Query.Pair ("RecurringChargeFrequency", (String.to_query f))); + Util.option_map v.recurring_charge_amount + (fun f -> + Query.Pair ("RecurringChargeAmount", (Double.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.recurring_charge_frequency + (fun f -> ("recurring_charge_frequency", (String.to_json f))); + Util.option_map v.recurring_charge_amount + (fun f -> ("recurring_charge_amount", (Double.to_json f)))]) + let of_json j = + { + recurring_charge_amount = + (Util.option_map (Json.lookup j "recurring_charge_amount") + Double.of_json); + recurring_charge_frequency = + (Util.option_map (Json.lookup j "recurring_charge_frequency") + String.of_json) + } + end +module PendingMaintenanceAction = + struct + type t = + { + action: String.t option ; + auto_applied_after_date: DateTime.t option ; + forced_apply_date: DateTime.t option ; + opt_in_status: String.t option ; + current_apply_date: DateTime.t option ; + description: String.t option } + let make ?action ?auto_applied_after_date ?forced_apply_date + ?opt_in_status ?current_apply_date ?description () = + { + action; + auto_applied_after_date; + forced_apply_date; + opt_in_status; + current_apply_date; + description + } + let parse xml = + Some + { + action = (Util.option_bind (Xml.member "Action" xml) String.parse); + auto_applied_after_date = + (Util.option_bind (Xml.member "AutoAppliedAfterDate" xml) + DateTime.parse); + forced_apply_date = + (Util.option_bind (Xml.member "ForcedApplyDate" xml) + DateTime.parse); + opt_in_status = + (Util.option_bind (Xml.member "OptInStatus" xml) String.parse); + current_apply_date = + (Util.option_bind (Xml.member "CurrentApplyDate" xml) + DateTime.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.current_apply_date + (fun f -> Query.Pair ("CurrentApplyDate", (DateTime.to_query f))); + Util.option_map v.opt_in_status + (fun f -> Query.Pair ("OptInStatus", (String.to_query f))); + Util.option_map v.forced_apply_date + (fun f -> Query.Pair ("ForcedApplyDate", (DateTime.to_query f))); + Util.option_map v.auto_applied_after_date + (fun f -> + Query.Pair ("AutoAppliedAfterDate", (DateTime.to_query f))); + Util.option_map v.action + (fun f -> Query.Pair ("Action", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.current_apply_date + (fun f -> ("current_apply_date", (DateTime.to_json f))); + Util.option_map v.opt_in_status + (fun f -> ("opt_in_status", (String.to_json f))); + Util.option_map v.forced_apply_date + (fun f -> ("forced_apply_date", (DateTime.to_json f))); + Util.option_map v.auto_applied_after_date + (fun f -> ("auto_applied_after_date", (DateTime.to_json f))); + Util.option_map v.action (fun f -> ("action", (String.to_json f)))]) + let of_json j = + { + action = (Util.option_map (Json.lookup j "action") String.of_json); + auto_applied_after_date = + (Util.option_map (Json.lookup j "auto_applied_after_date") + DateTime.of_json); + forced_apply_date = + (Util.option_map (Json.lookup j "forced_apply_date") + DateTime.of_json); + opt_in_status = + (Util.option_map (Json.lookup j "opt_in_status") String.of_json); + current_apply_date = + (Util.option_map (Json.lookup j "current_apply_date") + DateTime.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module CharacterSet = + struct + type t = + { + character_set_name: String.t option ; + character_set_description: String.t option } + let make ?character_set_name ?character_set_description () = + { character_set_name; character_set_description } + let parse xml = + Some + { + character_set_name = + (Util.option_bind (Xml.member "CharacterSetName" xml) + String.parse); + character_set_description = + (Util.option_bind (Xml.member "CharacterSetDescription" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.character_set_description + (fun f -> + Query.Pair ("CharacterSetDescription", (String.to_query f))); + Util.option_map v.character_set_name + (fun f -> Query.Pair ("CharacterSetName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.character_set_description + (fun f -> ("character_set_description", (String.to_json f))); + Util.option_map v.character_set_name + (fun f -> ("character_set_name", (String.to_json f)))]) + let of_json j = + { + character_set_name = + (Util.option_map (Json.lookup j "character_set_name") + String.of_json); + character_set_description = + (Util.option_map (Json.lookup j "character_set_description") + String.of_json) + } + end +module DBInstanceStatusInfo = + struct + type t = + { + status_type: String.t option ; + normal: Boolean.t option ; + status: String.t option ; + message: String.t option } + let make ?status_type ?normal ?status ?message () = + { status_type; normal; status; message } + let parse xml = + Some + { + status_type = + (Util.option_bind (Xml.member "StatusType" xml) String.parse); + normal = (Util.option_bind (Xml.member "Normal" xml) Boolean.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.normal + (fun f -> Query.Pair ("Normal", (Boolean.to_query f))); + Util.option_map v.status_type + (fun f -> Query.Pair ("StatusType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.normal + (fun f -> ("normal", (Boolean.to_json f))); + Util.option_map v.status_type + (fun f -> ("status_type", (String.to_json f)))]) + let of_json j = + { + status_type = + (Util.option_map (Json.lookup j "status_type") String.of_json); + normal = (Util.option_map (Json.lookup j "normal") Boolean.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module DBParameterGroupStatus = + struct + type t = + { + d_b_parameter_group_name: String.t option ; + parameter_apply_status: String.t option } + let make ?d_b_parameter_group_name ?parameter_apply_status () = + { d_b_parameter_group_name; parameter_apply_status } + let parse xml = + Some + { + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse); + parameter_apply_status = + (Util.option_bind (Xml.member "ParameterApplyStatus" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.parameter_apply_status + (fun f -> + Query.Pair ("ParameterApplyStatus", (String.to_query f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.parameter_apply_status + (fun f -> ("parameter_apply_status", (String.to_json f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json); + parameter_apply_status = + (Util.option_map (Json.lookup j "parameter_apply_status") + String.of_json) + } + end +module SubnetList = + struct + type t = Subnet.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Subnet.parse (Xml.members "Subnet" xml)) + let to_query v = Query.to_query_list Subnet.to_query v + let to_json v = `List (List.map Subnet.to_json v) + let of_json j = Json.to_list Subnet.of_json j + end +module DomainMembership = + struct + type t = + { + domain: String.t option ; + status: String.t option ; + connectivity: String.t option } + let make ?domain ?status ?connectivity () = + { domain; status; connectivity } + let parse xml = + Some + { + domain = (Util.option_bind (Xml.member "Domain" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + connectivity = + (Util.option_bind (Xml.member "Connectivity" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.connectivity + (fun f -> Query.Pair ("Connectivity", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.connectivity + (fun f -> ("connectivity", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.domain (fun f -> ("domain", (String.to_json f)))]) + let of_json j = + { + domain = (Util.option_map (Json.lookup j "domain") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + connectivity = + (Util.option_map (Json.lookup j "connectivity") String.of_json) + } + end +module OptionGroupMembership = + struct + type t = { + option_group_name: String.t option ; + status: String.t option } + let make ?option_group_name ?status () = { option_group_name; status } + let parse xml = + Some + { + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f)))]) + let of_json j = + { + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module Option = + struct + type t = + { + option_name: String.t option ; + option_description: String.t option ; + persistent: Boolean.t option ; + permanent: Boolean.t option ; + port: Integer.t option ; + option_settings: OptionSettingConfigurationList.t ; + d_b_security_group_memberships: DBSecurityGroupMembershipList.t ; + vpc_security_group_memberships: VpcSecurityGroupMembershipList.t } + let make ?option_name ?option_description ?persistent ?permanent + ?port ?(option_settings= []) ?(d_b_security_group_memberships= []) + ?(vpc_security_group_memberships= []) () = + { + option_name; + option_description; + persistent; + permanent; + port; + option_settings; + d_b_security_group_memberships; + vpc_security_group_memberships + } + let parse xml = + Some + { + option_name = + (Util.option_bind (Xml.member "OptionName" xml) String.parse); + option_description = + (Util.option_bind (Xml.member "OptionDescription" xml) + String.parse); + persistent = + (Util.option_bind (Xml.member "Persistent" xml) Boolean.parse); + permanent = + (Util.option_bind (Xml.member "Permanent" xml) Boolean.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + option_settings = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionSettings" xml) + OptionSettingConfigurationList.parse)); + d_b_security_group_memberships = + (Util.of_option [] + (Util.option_bind + (Xml.member "DBSecurityGroupMemberships" xml) + DBSecurityGroupMembershipList.parse)); + vpc_security_group_memberships = + (Util.of_option [] + (Util.option_bind + (Xml.member "VpcSecurityGroupMemberships" xml) + VpcSecurityGroupMembershipList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcSecurityGroupMemberships.member", + (VpcSecurityGroupMembershipList.to_query + v.vpc_security_group_memberships))); + Some + (Query.Pair + ("DBSecurityGroupMemberships.member", + (DBSecurityGroupMembershipList.to_query + v.d_b_security_group_memberships))); + Some + (Query.Pair + ("OptionSettings.member", + (OptionSettingConfigurationList.to_query v.option_settings))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.permanent + (fun f -> Query.Pair ("Permanent", (Boolean.to_query f))); + Util.option_map v.persistent + (fun f -> Query.Pair ("Persistent", (Boolean.to_query f))); + Util.option_map v.option_description + (fun f -> Query.Pair ("OptionDescription", (String.to_query f))); + Util.option_map v.option_name + (fun f -> Query.Pair ("OptionName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_security_group_memberships", + (VpcSecurityGroupMembershipList.to_json + v.vpc_security_group_memberships)); + Some + ("d_b_security_group_memberships", + (DBSecurityGroupMembershipList.to_json + v.d_b_security_group_memberships)); + Some + ("option_settings", + (OptionSettingConfigurationList.to_json v.option_settings)); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.permanent + (fun f -> ("permanent", (Boolean.to_json f))); + Util.option_map v.persistent + (fun f -> ("persistent", (Boolean.to_json f))); + Util.option_map v.option_description + (fun f -> ("option_description", (String.to_json f))); + Util.option_map v.option_name + (fun f -> ("option_name", (String.to_json f)))]) + let of_json j = + { + option_name = + (Util.option_map (Json.lookup j "option_name") String.of_json); + option_description = + (Util.option_map (Json.lookup j "option_description") + String.of_json); + persistent = + (Util.option_map (Json.lookup j "persistent") Boolean.of_json); + permanent = + (Util.option_map (Json.lookup j "permanent") Boolean.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + option_settings = + (OptionSettingConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "option_settings"))); + d_b_security_group_memberships = + (DBSecurityGroupMembershipList.of_json + (Util.of_option_exn + (Json.lookup j "d_b_security_group_memberships"))); + vpc_security_group_memberships = + (VpcSecurityGroupMembershipList.of_json + (Util.of_option_exn + (Json.lookup j "vpc_security_group_memberships"))) + } + end +module DBClusterMember = + struct + type t = + { + d_b_instance_identifier: String.t option ; + is_cluster_writer: Boolean.t option ; + d_b_cluster_parameter_group_status: String.t option } + let make ?d_b_instance_identifier ?is_cluster_writer + ?d_b_cluster_parameter_group_status () = + { + d_b_instance_identifier; + is_cluster_writer; + d_b_cluster_parameter_group_status + } + let parse xml = + Some + { + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + is_cluster_writer = + (Util.option_bind (Xml.member "IsClusterWriter" xml) + Boolean.parse); + d_b_cluster_parameter_group_status = (Util.option_bind - (Xml.member "DBSecurityGroupMemberships" xml) - DBSecurityGroupMembershipList.parse) - ; vpc_security_group_memberships = - Util.of_option - [] + (Xml.member "DBClusterParameterGroupStatus" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group_status + (fun f -> + Query.Pair + ("DBClusterParameterGroupStatus", (String.to_query f))); + Util.option_map v.is_cluster_writer + (fun f -> Query.Pair ("IsClusterWriter", (Boolean.to_query f))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group_status + (fun f -> + ("d_b_cluster_parameter_group_status", (String.to_json f))); + Util.option_map v.is_cluster_writer + (fun f -> ("is_cluster_writer", (Boolean.to_json f))); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + is_cluster_writer = + (Util.option_map (Json.lookup j "is_cluster_writer") + Boolean.of_json); + d_b_cluster_parameter_group_status = + (Util.option_map + (Json.lookup j "d_b_cluster_parameter_group_status") + String.of_json) + } + end +module DBClusterOptionGroupStatus = + struct + type t = + { + d_b_cluster_option_group_name: String.t option ; + status: String.t option } + let make ?d_b_cluster_option_group_name ?status () = + { d_b_cluster_option_group_name; status } + let parse xml = + Some + { + d_b_cluster_option_group_name = + (Util.option_bind (Xml.member "DBClusterOptionGroupName" xml) + String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.d_b_cluster_option_group_name + (fun f -> + Query.Pair ("DBClusterOptionGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (String.to_json f))); + Util.option_map v.d_b_cluster_option_group_name + (fun f -> ("d_b_cluster_option_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_option_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_option_group_name") + String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json) + } + end +module EC2SecurityGroup = + struct + type t = + { + status: String.t option ; + e_c2_security_group_name: String.t option ; + e_c2_security_group_id: String.t option ; + e_c2_security_group_owner_id: String.t option } + let make ?status ?e_c2_security_group_name ?e_c2_security_group_id + ?e_c2_security_group_owner_id () = + { + status; + e_c2_security_group_name; + e_c2_security_group_id; + e_c2_security_group_owner_id + } + let parse xml = + Some + { + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + e_c2_security_group_name = + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse); + e_c2_security_group_id = + (Util.option_bind (Xml.member "EC2SecurityGroupId" xml) + String.parse); + e_c2_security_group_owner_id = + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> + Query.Pair ("EC2SecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.e_c2_security_group_id + (fun f -> Query.Pair ("EC2SecurityGroupId", (String.to_query f))); + Util.option_map v.e_c2_security_group_name + (fun f -> + Query.Pair ("EC2SecurityGroupName", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> ("e_c2_security_group_owner_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_id + (fun f -> ("e_c2_security_group_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_name + (fun f -> ("e_c2_security_group_name", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f)))]) + let of_json j = + { + status = (Util.option_map (Json.lookup j "status") String.of_json); + e_c2_security_group_name = + (Util.option_map (Json.lookup j "e_c2_security_group_name") + String.of_json); + e_c2_security_group_id = + (Util.option_map (Json.lookup j "e_c2_security_group_id") + String.of_json); + e_c2_security_group_owner_id = + (Util.option_map (Json.lookup j "e_c2_security_group_owner_id") + String.of_json) + } + end +module IPRange = + struct + type t = { + status: String.t option ; + c_i_d_r_i_p: String.t option } + let make ?status ?c_i_d_r_i_p () = { status; c_i_d_r_i_p } + let parse xml = + Some + { + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + c_i_d_r_i_p = + (Util.option_bind (Xml.member "CIDRIP" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.c_i_d_r_i_p + (fun f -> Query.Pair ("CIDRIP", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.c_i_d_r_i_p + (fun f -> ("c_i_d_r_i_p", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f)))]) + let of_json j = + { + status = (Util.option_map (Json.lookup j "status") String.of_json); + c_i_d_r_i_p = + (Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json) + } + end +module OptionGroupOptionSettingsList = + struct + type t = OptionGroupOptionSetting.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionGroupOptionSetting.parse + (Xml.members "OptionGroupOptionSetting" xml)) + let to_query v = Query.to_query_list OptionGroupOptionSetting.to_query v + let to_json v = `List (List.map OptionGroupOptionSetting.to_json v) + let of_json j = Json.to_list OptionGroupOptionSetting.of_json j + end +module OptionsDependedOn = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "OptionName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module FilterValueList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "Value" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Parameter = + struct + type t = + { + parameter_name: String.t option ; + parameter_value: String.t option ; + description: String.t option ; + source: String.t option ; + apply_type: String.t option ; + data_type: String.t option ; + allowed_values: String.t option ; + is_modifiable: Boolean.t option ; + minimum_engine_version: String.t option ; + apply_method: ApplyMethod.t option } + let make ?parameter_name ?parameter_value ?description ?source + ?apply_type ?data_type ?allowed_values ?is_modifiable + ?minimum_engine_version ?apply_method () = + { + parameter_name; + parameter_value; + description; + source; + apply_type; + data_type; + allowed_values; + is_modifiable; + minimum_engine_version; + apply_method + } + let parse xml = + Some + { + parameter_name = + (Util.option_bind (Xml.member "ParameterName" xml) String.parse); + parameter_value = + (Util.option_bind (Xml.member "ParameterValue" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + apply_type = + (Util.option_bind (Xml.member "ApplyType" xml) String.parse); + data_type = + (Util.option_bind (Xml.member "DataType" xml) String.parse); + allowed_values = + (Util.option_bind (Xml.member "AllowedValues" xml) String.parse); + is_modifiable = + (Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse); + minimum_engine_version = + (Util.option_bind (Xml.member "MinimumEngineVersion" xml) + String.parse); + apply_method = + (Util.option_bind (Xml.member "ApplyMethod" xml) + ApplyMethod.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.apply_method + (fun f -> Query.Pair ("ApplyMethod", (ApplyMethod.to_query f))); + Util.option_map v.minimum_engine_version + (fun f -> + Query.Pair ("MinimumEngineVersion", (String.to_query f))); + Util.option_map v.is_modifiable + (fun f -> Query.Pair ("IsModifiable", (Boolean.to_query f))); + Util.option_map v.allowed_values + (fun f -> Query.Pair ("AllowedValues", (String.to_query f))); + Util.option_map v.data_type + (fun f -> Query.Pair ("DataType", (String.to_query f))); + Util.option_map v.apply_type + (fun f -> Query.Pair ("ApplyType", (String.to_query f))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.parameter_value + (fun f -> Query.Pair ("ParameterValue", (String.to_query f))); + Util.option_map v.parameter_name + (fun f -> Query.Pair ("ParameterName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.apply_method + (fun f -> ("apply_method", (ApplyMethod.to_json f))); + Util.option_map v.minimum_engine_version + (fun f -> ("minimum_engine_version", (String.to_json f))); + Util.option_map v.is_modifiable + (fun f -> ("is_modifiable", (Boolean.to_json f))); + Util.option_map v.allowed_values + (fun f -> ("allowed_values", (String.to_json f))); + Util.option_map v.data_type + (fun f -> ("data_type", (String.to_json f))); + Util.option_map v.apply_type + (fun f -> ("apply_type", (String.to_json f))); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.parameter_value + (fun f -> ("parameter_value", (String.to_json f))); + Util.option_map v.parameter_name + (fun f -> ("parameter_name", (String.to_json f)))]) + let of_json j = + { + parameter_name = + (Util.option_map (Json.lookup j "parameter_name") String.of_json); + parameter_value = + (Util.option_map (Json.lookup j "parameter_value") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + source = (Util.option_map (Json.lookup j "source") String.of_json); + apply_type = + (Util.option_map (Json.lookup j "apply_type") String.of_json); + data_type = + (Util.option_map (Json.lookup j "data_type") String.of_json); + allowed_values = + (Util.option_map (Json.lookup j "allowed_values") String.of_json); + is_modifiable = + (Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json); + minimum_engine_version = + (Util.option_map (Json.lookup j "minimum_engine_version") + String.of_json); + apply_method = + (Util.option_map (Json.lookup j "apply_method") ApplyMethod.of_json) + } + end +module EventCategoriesList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "EventCategory" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SourceIdsList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "SourceId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DBSecurityGroupNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "DBSecurityGroupName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module OptionSettingsList = + struct + type t = OptionSetting.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionSetting.parse (Xml.members "OptionSetting" xml)) + let to_query v = Query.to_query_list OptionSetting.to_query v + let to_json v = `List (List.map OptionSetting.to_json v) + let of_json j = Json.to_list OptionSetting.of_json j + end +module VpcSecurityGroupIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "VpcSecurityGroupId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module RecurringChargeList = + struct + type t = RecurringCharge.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map RecurringCharge.parse (Xml.members "RecurringCharge" xml)) + let to_query v = Query.to_query_list RecurringCharge.to_query v + let to_json v = `List (List.map RecurringCharge.to_json v) + let of_json j = Json.to_list RecurringCharge.of_json j + end +module PendingMaintenanceActionDetails = + struct + type t = PendingMaintenanceAction.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map PendingMaintenanceAction.parse + (Xml.members "PendingMaintenanceAction" xml)) + let to_query v = Query.to_query_list PendingMaintenanceAction.to_query v + let to_json v = `List (List.map PendingMaintenanceAction.to_json v) + let of_json j = Json.to_list PendingMaintenanceAction.of_json j + end +module SupportedCharacterSetsList = + struct + type t = CharacterSet.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CharacterSet.parse (Xml.members "CharacterSet" xml)) + let to_query v = Query.to_query_list CharacterSet.to_query v + let to_json v = `List (List.map CharacterSet.to_json v) + let of_json j = Json.to_list CharacterSet.of_json j + end +module DBInstanceStatusInfoList = + struct + type t = DBInstanceStatusInfo.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBInstanceStatusInfo.parse + (Xml.members "DBInstanceStatusInfo" xml)) + let to_query v = Query.to_query_list DBInstanceStatusInfo.to_query v + let to_json v = `List (List.map DBInstanceStatusInfo.to_json v) + let of_json j = Json.to_list DBInstanceStatusInfo.of_json j + end +module DBParameterGroupStatusList = + struct + type t = DBParameterGroupStatus.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBParameterGroupStatus.parse + (Xml.members "DBParameterGroup" xml)) + let to_query v = Query.to_query_list DBParameterGroupStatus.to_query v + let to_json v = `List (List.map DBParameterGroupStatus.to_json v) + let of_json j = Json.to_list DBParameterGroupStatus.of_json j + end +module DBSubnetGroup = + struct + type t = + { + d_b_subnet_group_name: String.t option ; + d_b_subnet_group_description: String.t option ; + vpc_id: String.t option ; + subnet_group_status: String.t option ; + subnets: SubnetList.t } + let make ?d_b_subnet_group_name ?d_b_subnet_group_description ?vpc_id + ?subnet_group_status ?(subnets= []) () = + { + d_b_subnet_group_name; + d_b_subnet_group_description; + vpc_id; + subnet_group_status; + subnets + } + let parse xml = + Some + { + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + d_b_subnet_group_description = + (Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) + String.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + subnet_group_status = + (Util.option_bind (Xml.member "SubnetGroupStatus" xml) + String.parse); + subnets = + (Util.of_option [] + (Util.option_bind (Xml.member "Subnets" xml) SubnetList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Subnets.member", (SubnetList.to_query v.subnets))); + Util.option_map v.subnet_group_status + (fun f -> Query.Pair ("SubnetGroupStatus", (String.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.d_b_subnet_group_description + (fun f -> + Query.Pair ("DBSubnetGroupDescription", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnets", (SubnetList.to_json v.subnets)); + Util.option_map v.subnet_group_status + (fun f -> ("subnet_group_status", (String.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.d_b_subnet_group_description + (fun f -> ("d_b_subnet_group_description", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + d_b_subnet_group_description = + (Util.option_map (Json.lookup j "d_b_subnet_group_description") + String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + subnet_group_status = + (Util.option_map (Json.lookup j "subnet_group_status") + String.of_json); + subnets = + (SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets"))) + } + end +module DomainMembershipList = + struct + type t = DomainMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DomainMembership.parse (Xml.members "DomainMembership" xml)) + let to_query v = Query.to_query_list DomainMembership.to_query v + let to_json v = `List (List.map DomainMembership.to_json v) + let of_json j = Json.to_list DomainMembership.of_json j + end +module Endpoint = + struct + type t = { + address: String.t option ; + port: Integer.t option } + let make ?address ?port () = { address; port } + let parse xml = + Some + { + address = + (Util.option_bind (Xml.member "Address" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.address + (fun f -> Query.Pair ("Address", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.address + (fun f -> ("address", (String.to_json f)))]) + let of_json j = + { + address = (Util.option_map (Json.lookup j "address") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json) + } + end +module OptionGroupMembershipList = + struct + type t = OptionGroupMembership.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionGroupMembership.parse + (Xml.members "OptionGroupMembership" xml)) + let to_query v = Query.to_query_list OptionGroupMembership.to_query v + let to_json v = `List (List.map OptionGroupMembership.to_json v) + let of_json j = Json.to_list OptionGroupMembership.of_json j + end +module PendingModifiedValues = + struct + type t = + { + d_b_instance_class: String.t option ; + allocated_storage: Integer.t option ; + master_user_password: String.t option ; + port: Integer.t option ; + backup_retention_period: Integer.t option ; + multi_a_z: Boolean.t option ; + engine_version: String.t option ; + iops: Integer.t option ; + d_b_instance_identifier: String.t option ; + storage_type: String.t option ; + c_a_certificate_identifier: String.t option } + let make ?d_b_instance_class ?allocated_storage ?master_user_password + ?port ?backup_retention_period ?multi_a_z ?engine_version ?iops + ?d_b_instance_identifier ?storage_type ?c_a_certificate_identifier + () = + { + d_b_instance_class; + allocated_storage; + master_user_password; + port; + backup_retention_period; + multi_a_z; + engine_version; + iops; + d_b_instance_identifier; + storage_type; + c_a_certificate_identifier + } + let parse xml = + Some + { + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + master_user_password = + (Util.option_bind (Xml.member "MasterUserPassword" xml) + String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + c_a_certificate_identifier = + (Util.option_bind (Xml.member "CACertificateIdentifier" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.c_a_certificate_identifier + (fun f -> + Query.Pair ("CACertificateIdentifier", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.master_user_password + (fun f -> Query.Pair ("MasterUserPassword", (String.to_query f))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.c_a_certificate_identifier + (fun f -> ("c_a_certificate_identifier", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.master_user_password + (fun f -> ("master_user_password", (String.to_json f))); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f)))]) + let of_json j = + { + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + master_user_password = + (Util.option_map (Json.lookup j "master_user_password") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + c_a_certificate_identifier = + (Util.option_map (Json.lookup j "c_a_certificate_identifier") + String.of_json) + } + end +module ReadReplicaDBInstanceIdentifierList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse + (Xml.members "ReadReplicaDBInstanceIdentifier" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module SourceType = + struct + type t = + | Db_instance + | Db_parameter_group + | Db_security_group + | Db_snapshot + let str_to_t = + [("db-snapshot", Db_snapshot); + ("db-security-group", Db_security_group); + ("db-parameter-group", Db_parameter_group); + ("db-instance", Db_instance)] + let t_to_str = + [(Db_snapshot, "db-snapshot"); + (Db_security_group, "db-security-group"); + (Db_parameter_group, "db-parameter-group"); + (Db_instance, "db-instance")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module OptionsList = + struct + type t = Option.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Option.parse (Xml.members "Option" xml)) + let to_query v = Query.to_query_list Option.to_query v + let to_json v = `List (List.map Option.to_json v) + let of_json j = Json.to_list Option.of_json j + end +module AvailabilityZoneList = + struct + type t = AvailabilityZone.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AvailabilityZone.parse (Xml.members "AvailabilityZone" xml)) + let to_query v = Query.to_query_list AvailabilityZone.to_query v + let to_json v = `List (List.map AvailabilityZone.to_json v) + let of_json j = Json.to_list AvailabilityZone.of_json j + end +module AvailabilityZones = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AvailabilityZone" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DBClusterMemberList = + struct + type t = DBClusterMember.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBClusterMember.parse (Xml.members "DBClusterMember" xml)) + let to_query v = Query.to_query_list DBClusterMember.to_query v + let to_json v = `List (List.map DBClusterMember.to_json v) + let of_json j = Json.to_list DBClusterMember.of_json j + end +module DBClusterOptionGroupMemberships = + struct + type t = DBClusterOptionGroupStatus.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBClusterOptionGroupStatus.parse + (Xml.members "DBClusterOptionGroup" xml)) + let to_query v = + Query.to_query_list DBClusterOptionGroupStatus.to_query v + let to_json v = `List (List.map DBClusterOptionGroupStatus.to_json v) + let of_json j = Json.to_list DBClusterOptionGroupStatus.of_json j + end +module EC2SecurityGroupList = + struct + type t = EC2SecurityGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map EC2SecurityGroup.parse (Xml.members "EC2SecurityGroup" xml)) + let to_query v = Query.to_query_list EC2SecurityGroup.to_query v + let to_json v = `List (List.map EC2SecurityGroup.to_json v) + let of_json j = Json.to_list EC2SecurityGroup.of_json j + end +module IPRangeList = + struct + type t = IPRange.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map IPRange.parse (Xml.members "IPRange" xml)) + let to_query v = Query.to_query_list IPRange.to_query v + let to_json v = `List (List.map IPRange.to_json v) + let of_json j = Json.to_list IPRange.of_json j + end +module Tag = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module OptionGroupOption = + struct + type t = + { + name: String.t option ; + description: String.t option ; + engine_name: String.t option ; + major_engine_version: String.t option ; + minimum_required_minor_engine_version: String.t option ; + port_required: Boolean.t option ; + default_port: Integer.t option ; + options_depended_on: OptionsDependedOn.t ; + persistent: Boolean.t option ; + permanent: Boolean.t option ; + option_group_option_settings: OptionGroupOptionSettingsList.t } + let make ?name ?description ?engine_name ?major_engine_version + ?minimum_required_minor_engine_version ?port_required ?default_port + ?(options_depended_on= []) ?persistent ?permanent + ?(option_group_option_settings= []) () = + { + name; + description; + engine_name; + major_engine_version; + minimum_required_minor_engine_version; + port_required; + default_port; + options_depended_on; + persistent; + permanent; + option_group_option_settings + } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse); + engine_name = + (Util.option_bind (Xml.member "EngineName" xml) String.parse); + major_engine_version = + (Util.option_bind (Xml.member "MajorEngineVersion" xml) + String.parse); + minimum_required_minor_engine_version = (Util.option_bind - (Xml.member "VpcSecurityGroupMemberships" xml) - VpcSecurityGroupMembershipList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "MinimumRequiredMinorEngineVersion" xml) + String.parse); + port_required = + (Util.option_bind (Xml.member "PortRequired" xml) Boolean.parse); + default_port = + (Util.option_bind (Xml.member "DefaultPort" xml) Integer.parse); + options_depended_on = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionsDependedOn" xml) + OptionsDependedOn.parse)); + persistent = + (Util.option_bind (Xml.member "Persistent" xml) Boolean.parse); + permanent = + (Util.option_bind (Xml.member "Permanent" xml) Boolean.parse); + option_group_option_settings = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionGroupOptionSettings" xml) + OptionGroupOptionSettingsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("OptionGroupOptionSettings.member", + (OptionGroupOptionSettingsList.to_query + v.option_group_option_settings))); + Util.option_map v.permanent + (fun f -> Query.Pair ("Permanent", (Boolean.to_query f))); + Util.option_map v.persistent + (fun f -> Query.Pair ("Persistent", (Boolean.to_query f))); + Some (Query.Pair - ( "VpcSecurityGroupMemberships.member" - , VpcSecurityGroupMembershipList.to_query v.vpc_security_group_memberships - )) - ; Some + ("OptionsDependedOn.member", + (OptionsDependedOn.to_query v.options_depended_on))); + Util.option_map v.default_port + (fun f -> Query.Pair ("DefaultPort", (Integer.to_query f))); + Util.option_map v.port_required + (fun f -> Query.Pair ("PortRequired", (Boolean.to_query f))); + Util.option_map v.minimum_required_minor_engine_version + (fun f -> + Query.Pair + ("MinimumRequiredMinorEngineVersion", (String.to_query f))); + Util.option_map v.major_engine_version + (fun f -> Query.Pair ("MajorEngineVersion", (String.to_query f))); + Util.option_map v.engine_name + (fun f -> Query.Pair ("EngineName", (String.to_query f))); + Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("option_group_option_settings", + (OptionGroupOptionSettingsList.to_json + v.option_group_option_settings)); + Util.option_map v.permanent + (fun f -> ("permanent", (Boolean.to_json f))); + Util.option_map v.persistent + (fun f -> ("persistent", (Boolean.to_json f))); + Some + ("options_depended_on", + (OptionsDependedOn.to_json v.options_depended_on)); + Util.option_map v.default_port + (fun f -> ("default_port", (Integer.to_json f))); + Util.option_map v.port_required + (fun f -> ("port_required", (Boolean.to_json f))); + Util.option_map v.minimum_required_minor_engine_version + (fun f -> + ("minimum_required_minor_engine_version", (String.to_json f))); + Util.option_map v.major_engine_version + (fun f -> ("major_engine_version", (String.to_json f))); + Util.option_map v.engine_name + (fun f -> ("engine_name", (String.to_json f))); + Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json); + engine_name = + (Util.option_map (Json.lookup j "engine_name") String.of_json); + major_engine_version = + (Util.option_map (Json.lookup j "major_engine_version") + String.of_json); + minimum_required_minor_engine_version = + (Util.option_map + (Json.lookup j "minimum_required_minor_engine_version") + String.of_json); + port_required = + (Util.option_map (Json.lookup j "port_required") Boolean.of_json); + default_port = + (Util.option_map (Json.lookup j "default_port") Integer.of_json); + options_depended_on = + (OptionsDependedOn.of_json + (Util.of_option_exn (Json.lookup j "options_depended_on"))); + persistent = + (Util.option_map (Json.lookup j "persistent") Boolean.of_json); + permanent = + (Util.option_map (Json.lookup j "permanent") Boolean.of_json); + option_group_option_settings = + (OptionGroupOptionSettingsList.of_json + (Util.of_option_exn + (Json.lookup j "option_group_option_settings"))) + } + end +module Filter = + struct + type t = { + name: String.t ; + values: FilterValueList.t } + let make ~name ~values () = { name; values } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + values = + (Xml.required "Values" + (Util.option_bind (Xml.member "Values" xml) + FilterValueList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Values.member", (FilterValueList.to_query v.values))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("values", (FilterValueList.to_json v.values)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + values = + (FilterValueList.of_json + (Util.of_option_exn (Json.lookup j "values"))) + } + end +module ParametersList = + struct + type t = Parameter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Parameter.parse (Xml.members "Parameter" xml)) + let to_query v = Query.to_query_list Parameter.to_query v + let to_json v = `List (List.map Parameter.to_json v) + let of_json j = Json.to_list Parameter.of_json j + end +module EventSubscription = + struct + type t = + { + customer_aws_id: String.t option ; + cust_subscription_id: String.t option ; + sns_topic_arn: String.t option ; + status: String.t option ; + subscription_creation_time: String.t option ; + source_type: String.t option ; + source_ids_list: SourceIdsList.t ; + event_categories_list: EventCategoriesList.t ; + enabled: Boolean.t option } + let make ?customer_aws_id ?cust_subscription_id ?sns_topic_arn ?status + ?subscription_creation_time ?source_type ?(source_ids_list= []) + ?(event_categories_list= []) ?enabled () = + { + customer_aws_id; + cust_subscription_id; + sns_topic_arn; + status; + subscription_creation_time; + source_type; + source_ids_list; + event_categories_list; + enabled + } + let parse xml = + Some + { + customer_aws_id = + (Util.option_bind (Xml.member "CustomerAwsId" xml) String.parse); + cust_subscription_id = + (Util.option_bind (Xml.member "CustSubscriptionId" xml) + String.parse); + sns_topic_arn = + (Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + subscription_creation_time = + (Util.option_bind (Xml.member "SubscriptionCreationTime" xml) + String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) String.parse); + source_ids_list = + (Util.of_option [] + (Util.option_bind (Xml.member "SourceIdsList" xml) + SourceIdsList.parse)); + event_categories_list = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategoriesList" xml) + EventCategoriesList.parse)); + enabled = + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> Query.Pair ("Enabled", (Boolean.to_query f))); + Some (Query.Pair - ( "DBSecurityGroupMemberships.member" - , DBSecurityGroupMembershipList.to_query v.d_b_security_group_memberships - )) - ; Some + ("EventCategoriesList.member", + (EventCategoriesList.to_query v.event_categories_list))); + Some (Query.Pair - ( "OptionSettings.member" - , OptionSettingConfigurationList.to_query v.option_settings )) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.permanent (fun f -> - Query.Pair ("Permanent", Boolean.to_query f)) - ; Util.option_map v.persistent (fun f -> - Query.Pair ("Persistent", Boolean.to_query f)) - ; Util.option_map v.option_description (fun f -> - Query.Pair ("OptionDescription", String.to_query f)) - ; Util.option_map v.option_name (fun f -> - Query.Pair ("OptionName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "vpc_security_group_memberships" - , VpcSecurityGroupMembershipList.to_json v.vpc_security_group_memberships ) - ; Some - ( "d_b_security_group_memberships" - , DBSecurityGroupMembershipList.to_json v.d_b_security_group_memberships ) - ; Some - ("option_settings", OptionSettingConfigurationList.to_json v.option_settings) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.permanent (fun f -> "permanent", Boolean.to_json f) - ; Util.option_map v.persistent (fun f -> "persistent", Boolean.to_json f) - ; Util.option_map v.option_description (fun f -> - "option_description", String.to_json f) - ; Util.option_map v.option_name (fun f -> "option_name", String.to_json f) - ]) - - let of_json j = - { option_name = Util.option_map (Json.lookup j "option_name") String.of_json - ; option_description = - Util.option_map (Json.lookup j "option_description") String.of_json - ; persistent = Util.option_map (Json.lookup j "persistent") Boolean.of_json - ; permanent = Util.option_map (Json.lookup j "permanent") Boolean.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; option_settings = - OptionSettingConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "option_settings")) - ; d_b_security_group_memberships = - DBSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_group_memberships")) - ; vpc_security_group_memberships = - VpcSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_memberships")) - } -end - -module DBClusterMember = struct - type t = - { d_b_instance_identifier : String.t option - ; is_cluster_writer : Boolean.t option - ; d_b_cluster_parameter_group_status : String.t option - } - - let make - ?d_b_instance_identifier - ?is_cluster_writer - ?d_b_cluster_parameter_group_status - () = - { d_b_instance_identifier; is_cluster_writer; d_b_cluster_parameter_group_status } - - let parse xml = - Some - { d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; is_cluster_writer = - Util.option_bind (Xml.member "IsClusterWriter" xml) Boolean.parse - ; d_b_cluster_parameter_group_status = - Util.option_bind (Xml.member "DBClusterParameterGroupStatus" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group_status (fun f -> - Query.Pair ("DBClusterParameterGroupStatus", String.to_query f)) - ; Util.option_map v.is_cluster_writer (fun f -> - Query.Pair ("IsClusterWriter", Boolean.to_query f)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group_status (fun f -> - "d_b_cluster_parameter_group_status", String.to_json f) - ; Util.option_map v.is_cluster_writer (fun f -> - "is_cluster_writer", Boolean.to_json f) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; is_cluster_writer = - Util.option_map (Json.lookup j "is_cluster_writer") Boolean.of_json - ; d_b_cluster_parameter_group_status = - Util.option_map - (Json.lookup j "d_b_cluster_parameter_group_status") - String.of_json - } -end - -module DBClusterOptionGroupStatus = struct - type t = - { d_b_cluster_option_group_name : String.t option - ; status : String.t option - } - - let make ?d_b_cluster_option_group_name ?status () = - { d_b_cluster_option_group_name; status } - - let parse xml = - Some - { d_b_cluster_option_group_name = - Util.option_bind (Xml.member "DBClusterOptionGroupName" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.d_b_cluster_option_group_name (fun f -> - Query.Pair ("DBClusterOptionGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.d_b_cluster_option_group_name (fun f -> - "d_b_cluster_option_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_option_group_name = - Util.option_map (Json.lookup j "d_b_cluster_option_group_name") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - } -end - -module EC2SecurityGroup = struct - type t = - { status : String.t option - ; e_c2_security_group_name : String.t option - ; e_c2_security_group_id : String.t option - ; e_c2_security_group_owner_id : String.t option - } - - let make - ?status - ?e_c2_security_group_name - ?e_c2_security_group_id - ?e_c2_security_group_owner_id - () = - { status - ; e_c2_security_group_name - ; e_c2_security_group_id - ; e_c2_security_group_owner_id - } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "Status" xml) String.parse - ; e_c2_security_group_name = - Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse - ; e_c2_security_group_id = - Util.option_bind (Xml.member "EC2SecurityGroupId" xml) String.parse - ; e_c2_security_group_owner_id = - Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - Query.Pair ("EC2SecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_id (fun f -> - Query.Pair ("EC2SecurityGroupId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_name (fun f -> - Query.Pair ("EC2SecurityGroupName", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - "e_c2_security_group_owner_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_id (fun f -> - "e_c2_security_group_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_name (fun f -> - "e_c2_security_group_name", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") String.of_json - ; e_c2_security_group_name = - Util.option_map (Json.lookup j "e_c2_security_group_name") String.of_json - ; e_c2_security_group_id = - Util.option_map (Json.lookup j "e_c2_security_group_id") String.of_json - ; e_c2_security_group_owner_id = - Util.option_map (Json.lookup j "e_c2_security_group_owner_id") String.of_json - } -end - -module IPRange = struct - type t = - { status : String.t option - ; c_i_d_r_i_p : String.t option - } - - let make ?status ?c_i_d_r_i_p () = { status; c_i_d_r_i_p } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "Status" xml) String.parse - ; c_i_d_r_i_p = Util.option_bind (Xml.member "CIDRIP" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.c_i_d_r_i_p (fun f -> - Query.Pair ("CIDRIP", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.c_i_d_r_i_p (fun f -> "c_i_d_r_i_p", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") String.of_json - ; c_i_d_r_i_p = Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json - } -end - -module OptionGroupOptionSettingsList = struct - type t = OptionGroupOptionSetting.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - OptionGroupOptionSetting.parse - (Xml.members "OptionGroupOptionSetting" xml)) - - let to_query v = Query.to_query_list OptionGroupOptionSetting.to_query v - - let to_json v = `List (List.map OptionGroupOptionSetting.to_json v) - - let of_json j = Json.to_list OptionGroupOptionSetting.of_json j -end - -module OptionsDependedOn = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "OptionName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module FilterValueList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "Value" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Parameter = struct - type t = - { parameter_name : String.t option - ; parameter_value : String.t option - ; description : String.t option - ; source : String.t option - ; apply_type : String.t option - ; data_type : String.t option - ; allowed_values : String.t option - ; is_modifiable : Boolean.t option - ; minimum_engine_version : String.t option - ; apply_method : ApplyMethod.t option - } - - let make - ?parameter_name - ?parameter_value - ?description - ?source - ?apply_type - ?data_type - ?allowed_values - ?is_modifiable - ?minimum_engine_version - ?apply_method - () = - { parameter_name - ; parameter_value - ; description - ; source - ; apply_type - ; data_type - ; allowed_values - ; is_modifiable - ; minimum_engine_version - ; apply_method - } - - let parse xml = - Some - { parameter_name = Util.option_bind (Xml.member "ParameterName" xml) String.parse - ; parameter_value = Util.option_bind (Xml.member "ParameterValue" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; apply_type = Util.option_bind (Xml.member "ApplyType" xml) String.parse - ; data_type = Util.option_bind (Xml.member "DataType" xml) String.parse - ; allowed_values = Util.option_bind (Xml.member "AllowedValues" xml) String.parse - ; is_modifiable = Util.option_bind (Xml.member "IsModifiable" xml) Boolean.parse - ; minimum_engine_version = - Util.option_bind (Xml.member "MinimumEngineVersion" xml) String.parse - ; apply_method = Util.option_bind (Xml.member "ApplyMethod" xml) ApplyMethod.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.apply_method (fun f -> - Query.Pair ("ApplyMethod", ApplyMethod.to_query f)) - ; Util.option_map v.minimum_engine_version (fun f -> - Query.Pair ("MinimumEngineVersion", String.to_query f)) - ; Util.option_map v.is_modifiable (fun f -> - Query.Pair ("IsModifiable", Boolean.to_query f)) - ; Util.option_map v.allowed_values (fun f -> - Query.Pair ("AllowedValues", String.to_query f)) - ; Util.option_map v.data_type (fun f -> - Query.Pair ("DataType", String.to_query f)) - ; Util.option_map v.apply_type (fun f -> - Query.Pair ("ApplyType", String.to_query f)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.parameter_value (fun f -> - Query.Pair ("ParameterValue", String.to_query f)) - ; Util.option_map v.parameter_name (fun f -> - Query.Pair ("ParameterName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.apply_method (fun f -> "apply_method", ApplyMethod.to_json f) - ; Util.option_map v.minimum_engine_version (fun f -> - "minimum_engine_version", String.to_json f) - ; Util.option_map v.is_modifiable (fun f -> "is_modifiable", Boolean.to_json f) - ; Util.option_map v.allowed_values (fun f -> "allowed_values", String.to_json f) - ; Util.option_map v.data_type (fun f -> "data_type", String.to_json f) - ; Util.option_map v.apply_type (fun f -> "apply_type", String.to_json f) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.parameter_value (fun f -> - "parameter_value", String.to_json f) - ; Util.option_map v.parameter_name (fun f -> "parameter_name", String.to_json f) - ]) - - let of_json j = - { parameter_name = Util.option_map (Json.lookup j "parameter_name") String.of_json - ; parameter_value = Util.option_map (Json.lookup j "parameter_value") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; apply_type = Util.option_map (Json.lookup j "apply_type") String.of_json - ; data_type = Util.option_map (Json.lookup j "data_type") String.of_json - ; allowed_values = Util.option_map (Json.lookup j "allowed_values") String.of_json - ; is_modifiable = Util.option_map (Json.lookup j "is_modifiable") Boolean.of_json - ; minimum_engine_version = - Util.option_map (Json.lookup j "minimum_engine_version") String.of_json - ; apply_method = Util.option_map (Json.lookup j "apply_method") ApplyMethod.of_json - } -end - -module EventCategoriesList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "EventCategory" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SourceIdsList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "SourceId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DBSecurityGroupNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "DBSecurityGroupName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module OptionSettingsList = struct - type t = OptionSetting.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map OptionSetting.parse (Xml.members "OptionSetting" xml)) - - let to_query v = Query.to_query_list OptionSetting.to_query v - - let to_json v = `List (List.map OptionSetting.to_json v) - - let of_json j = Json.to_list OptionSetting.of_json j -end - -module VpcSecurityGroupIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "VpcSecurityGroupId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module RecurringChargeList = struct - type t = RecurringCharge.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map RecurringCharge.parse (Xml.members "RecurringCharge" xml)) - - let to_query v = Query.to_query_list RecurringCharge.to_query v - - let to_json v = `List (List.map RecurringCharge.to_json v) - - let of_json j = Json.to_list RecurringCharge.of_json j -end - -module PendingMaintenanceActionDetails = struct - type t = PendingMaintenanceAction.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - PendingMaintenanceAction.parse - (Xml.members "PendingMaintenanceAction" xml)) - - let to_query v = Query.to_query_list PendingMaintenanceAction.to_query v - - let to_json v = `List (List.map PendingMaintenanceAction.to_json v) - - let of_json j = Json.to_list PendingMaintenanceAction.of_json j -end - -module SupportedCharacterSetsList = struct - type t = CharacterSet.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CharacterSet.parse (Xml.members "CharacterSet" xml)) - - let to_query v = Query.to_query_list CharacterSet.to_query v - - let to_json v = `List (List.map CharacterSet.to_json v) - - let of_json j = Json.to_list CharacterSet.of_json j -end - -module DBInstanceStatusInfoList = struct - type t = DBInstanceStatusInfo.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBInstanceStatusInfo.parse (Xml.members "DBInstanceStatusInfo" xml)) - - let to_query v = Query.to_query_list DBInstanceStatusInfo.to_query v - - let to_json v = `List (List.map DBInstanceStatusInfo.to_json v) - - let of_json j = Json.to_list DBInstanceStatusInfo.of_json j -end - -module DBParameterGroupStatusList = struct - type t = DBParameterGroupStatus.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBParameterGroupStatus.parse (Xml.members "DBParameterGroup" xml)) - - let to_query v = Query.to_query_list DBParameterGroupStatus.to_query v - - let to_json v = `List (List.map DBParameterGroupStatus.to_json v) - - let of_json j = Json.to_list DBParameterGroupStatus.of_json j -end - -module DBSubnetGroup = struct - type t = - { d_b_subnet_group_name : String.t option - ; d_b_subnet_group_description : String.t option - ; vpc_id : String.t option - ; subnet_group_status : String.t option - ; subnets : SubnetList.t - } - - let make - ?d_b_subnet_group_name - ?d_b_subnet_group_description - ?vpc_id - ?subnet_group_status - ?(subnets = []) - () = - { d_b_subnet_group_name - ; d_b_subnet_group_description - ; vpc_id - ; subnet_group_status - ; subnets - } - - let parse xml = - Some - { d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; d_b_subnet_group_description = - Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; subnet_group_status = - Util.option_bind (Xml.member "SubnetGroupStatus" xml) String.parse - ; subnets = - Util.of_option [] (Util.option_bind (Xml.member "Subnets" xml) SubnetList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Subnets.member", SubnetList.to_query v.subnets)) - ; Util.option_map v.subnet_group_status (fun f -> - Query.Pair ("SubnetGroupStatus", String.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_description (fun f -> - Query.Pair ("DBSubnetGroupDescription", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnets", SubnetList.to_json v.subnets) - ; Util.option_map v.subnet_group_status (fun f -> - "subnet_group_status", String.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.d_b_subnet_group_description (fun f -> - "d_b_subnet_group_description", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; d_b_subnet_group_description = - Util.option_map (Json.lookup j "d_b_subnet_group_description") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; subnet_group_status = - Util.option_map (Json.lookup j "subnet_group_status") String.of_json - ; subnets = SubnetList.of_json (Util.of_option_exn (Json.lookup j "subnets")) - } -end - -module DomainMembershipList = struct - type t = DomainMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DomainMembership.parse (Xml.members "DomainMembership" xml)) - - let to_query v = Query.to_query_list DomainMembership.to_query v - - let to_json v = `List (List.map DomainMembership.to_json v) - - let of_json j = Json.to_list DomainMembership.of_json j -end - -module Endpoint = struct - type t = - { address : String.t option - ; port : Integer.t option - } - - let make ?address ?port () = { address; port } - - let parse xml = - Some - { address = Util.option_bind (Xml.member "Address" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.address (fun f -> Query.Pair ("Address", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.address (fun f -> "address", String.to_json f) - ]) - - let of_json j = - { address = Util.option_map (Json.lookup j "address") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - } -end - -module OptionGroupMembershipList = struct - type t = OptionGroupMembership.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map OptionGroupMembership.parse (Xml.members "OptionGroupMembership" xml)) - - let to_query v = Query.to_query_list OptionGroupMembership.to_query v - - let to_json v = `List (List.map OptionGroupMembership.to_json v) - - let of_json j = Json.to_list OptionGroupMembership.of_json j -end - -module PendingModifiedValues = struct - type t = - { d_b_instance_class : String.t option - ; allocated_storage : Integer.t option - ; master_user_password : String.t option - ; port : Integer.t option - ; backup_retention_period : Integer.t option - ; multi_a_z : Boolean.t option - ; engine_version : String.t option - ; iops : Integer.t option - ; d_b_instance_identifier : String.t option - ; storage_type : String.t option - ; c_a_certificate_identifier : String.t option - } - - let make - ?d_b_instance_class - ?allocated_storage - ?master_user_password - ?port - ?backup_retention_period - ?multi_a_z - ?engine_version - ?iops - ?d_b_instance_identifier - ?storage_type - ?c_a_certificate_identifier - () = - { d_b_instance_class - ; allocated_storage - ; master_user_password - ; port - ; backup_retention_period - ; multi_a_z - ; engine_version - ; iops - ; d_b_instance_identifier - ; storage_type - ; c_a_certificate_identifier - } - - let parse xml = - Some - { d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; master_user_password = - Util.option_bind (Xml.member "MasterUserPassword" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; c_a_certificate_identifier = - Util.option_bind (Xml.member "CACertificateIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.c_a_certificate_identifier (fun f -> - Query.Pair ("CACertificateIdentifier", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.master_user_password (fun f -> - Query.Pair ("MasterUserPassword", String.to_query f)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.c_a_certificate_identifier (fun f -> - "c_a_certificate_identifier", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.master_user_password (fun f -> - "master_user_password", String.to_json f) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ]) - - let of_json j = - { d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; master_user_password = - Util.option_map (Json.lookup j "master_user_password") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; c_a_certificate_identifier = - Util.option_map (Json.lookup j "c_a_certificate_identifier") String.of_json - } -end - -module ReadReplicaDBInstanceIdentifierList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map String.parse (Xml.members "ReadReplicaDBInstanceIdentifier" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module SourceType = struct - type t = - | Db_instance - | Db_parameter_group - | Db_security_group - | Db_snapshot - - let str_to_t = - [ "db-snapshot", Db_snapshot - ; "db-security-group", Db_security_group - ; "db-parameter-group", Db_parameter_group - ; "db-instance", Db_instance - ] - - let t_to_str = - [ Db_snapshot, "db-snapshot" - ; Db_security_group, "db-security-group" - ; Db_parameter_group, "db-parameter-group" - ; Db_instance, "db-instance" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module OptionsList = struct - type t = Option.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Option.parse (Xml.members "Option" xml)) - - let to_query v = Query.to_query_list Option.to_query v - - let to_json v = `List (List.map Option.to_json v) - - let of_json j = Json.to_list Option.of_json j -end - -module AvailabilityZoneList = struct - type t = AvailabilityZone.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AvailabilityZone.parse (Xml.members "AvailabilityZone" xml)) - - let to_query v = Query.to_query_list AvailabilityZone.to_query v - - let to_json v = `List (List.map AvailabilityZone.to_json v) - - let of_json j = Json.to_list AvailabilityZone.of_json j -end - -module AvailabilityZones = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "AvailabilityZone" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DBClusterMemberList = struct - type t = DBClusterMember.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBClusterMember.parse (Xml.members "DBClusterMember" xml)) - - let to_query v = Query.to_query_list DBClusterMember.to_query v - - let to_json v = `List (List.map DBClusterMember.to_json v) - - let of_json j = Json.to_list DBClusterMember.of_json j -end - -module DBClusterOptionGroupMemberships = struct - type t = DBClusterOptionGroupStatus.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBClusterOptionGroupStatus.parse (Xml.members "DBClusterOptionGroup" xml)) - - let to_query v = Query.to_query_list DBClusterOptionGroupStatus.to_query v - - let to_json v = `List (List.map DBClusterOptionGroupStatus.to_json v) - - let of_json j = Json.to_list DBClusterOptionGroupStatus.of_json j -end - -module EC2SecurityGroupList = struct - type t = EC2SecurityGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map EC2SecurityGroup.parse (Xml.members "EC2SecurityGroup" xml)) - - let to_query v = Query.to_query_list EC2SecurityGroup.to_query v - - let to_json v = `List (List.map EC2SecurityGroup.to_json v) - - let of_json j = Json.to_list EC2SecurityGroup.of_json j -end - -module IPRangeList = struct - type t = IPRange.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map IPRange.parse (Xml.members "IPRange" xml)) - - let to_query v = Query.to_query_list IPRange.to_query v - - let to_json v = `List (List.map IPRange.to_json v) - - let of_json j = Json.to_list IPRange.of_json j -end - -module Tag = struct - type t = - { key : String.t option - ; value : String.t option - } - - let make ?key ?value () = { key; value } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module OptionGroupOption = struct - type t = - { name : String.t option - ; description : String.t option - ; engine_name : String.t option - ; major_engine_version : String.t option - ; minimum_required_minor_engine_version : String.t option - ; port_required : Boolean.t option - ; default_port : Integer.t option - ; options_depended_on : OptionsDependedOn.t - ; persistent : Boolean.t option - ; permanent : Boolean.t option - ; option_group_option_settings : OptionGroupOptionSettingsList.t - } - - let make - ?name - ?description - ?engine_name - ?major_engine_version - ?minimum_required_minor_engine_version - ?port_required - ?default_port - ?(options_depended_on = []) - ?persistent - ?permanent - ?(option_group_option_settings = []) - () = - { name - ; description - ; engine_name - ; major_engine_version - ; minimum_required_minor_engine_version - ; port_required - ; default_port - ; options_depended_on - ; persistent - ; permanent - ; option_group_option_settings - } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - ; engine_name = Util.option_bind (Xml.member "EngineName" xml) String.parse - ; major_engine_version = - Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse - ; minimum_required_minor_engine_version = - Util.option_bind - (Xml.member "MinimumRequiredMinorEngineVersion" xml) - String.parse - ; port_required = Util.option_bind (Xml.member "PortRequired" xml) Boolean.parse - ; default_port = Util.option_bind (Xml.member "DefaultPort" xml) Integer.parse - ; options_depended_on = - Util.of_option - [] + ("SourceIdsList.member", + (SourceIdsList.to_query v.source_ids_list))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (String.to_query f))); + Util.option_map v.subscription_creation_time + (fun f -> + Query.Pair ("SubscriptionCreationTime", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.sns_topic_arn + (fun f -> Query.Pair ("SnsTopicArn", (String.to_query f))); + Util.option_map v.cust_subscription_id + (fun f -> Query.Pair ("CustSubscriptionId", (String.to_query f))); + Util.option_map v.customer_aws_id + (fun f -> Query.Pair ("CustomerAwsId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> ("enabled", (Boolean.to_json f))); + Some + ("event_categories_list", + (EventCategoriesList.to_json v.event_categories_list)); + Some + ("source_ids_list", (SourceIdsList.to_json v.source_ids_list)); + Util.option_map v.source_type + (fun f -> ("source_type", (String.to_json f))); + Util.option_map v.subscription_creation_time + (fun f -> ("subscription_creation_time", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.sns_topic_arn + (fun f -> ("sns_topic_arn", (String.to_json f))); + Util.option_map v.cust_subscription_id + (fun f -> ("cust_subscription_id", (String.to_json f))); + Util.option_map v.customer_aws_id + (fun f -> ("customer_aws_id", (String.to_json f)))]) + let of_json j = + { + customer_aws_id = + (Util.option_map (Json.lookup j "customer_aws_id") String.of_json); + cust_subscription_id = + (Util.option_map (Json.lookup j "cust_subscription_id") + String.of_json); + sns_topic_arn = + (Util.option_map (Json.lookup j "sns_topic_arn") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + subscription_creation_time = + (Util.option_map (Json.lookup j "subscription_creation_time") + String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") String.of_json); + source_ids_list = + (SourceIdsList.of_json + (Util.of_option_exn (Json.lookup j "source_ids_list"))); + event_categories_list = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories_list"))); + enabled = (Util.option_map (Json.lookup j "enabled") Boolean.of_json) + } + end +module OptionConfiguration = + struct + type t = + { + option_name: String.t ; + port: Integer.t option ; + d_b_security_group_memberships: DBSecurityGroupNameList.t ; + vpc_security_group_memberships: VpcSecurityGroupIdList.t ; + option_settings: OptionSettingsList.t } + let make ~option_name ?port ?(d_b_security_group_memberships= []) + ?(vpc_security_group_memberships= []) ?(option_settings= []) () = + { + option_name; + port; + d_b_security_group_memberships; + vpc_security_group_memberships; + option_settings + } + let parse xml = + Some + { + option_name = + (Xml.required "OptionName" + (Util.option_bind (Xml.member "OptionName" xml) String.parse)); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + d_b_security_group_memberships = + (Util.of_option [] + (Util.option_bind + (Xml.member "DBSecurityGroupMemberships" xml) + DBSecurityGroupNameList.parse)); + vpc_security_group_memberships = + (Util.of_option [] + (Util.option_bind + (Xml.member "VpcSecurityGroupMemberships" xml) + VpcSecurityGroupIdList.parse)); + option_settings = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionSettings" xml) + OptionSettingsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("OptionSettings.member", + (OptionSettingsList.to_query v.option_settings))); + Some + (Query.Pair + ("VpcSecurityGroupMemberships.member", + (VpcSecurityGroupIdList.to_query + v.vpc_security_group_memberships))); + Some + (Query.Pair + ("DBSecurityGroupMemberships.member", + (DBSecurityGroupNameList.to_query + v.d_b_security_group_memberships))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Some (Query.Pair ("OptionName", (String.to_query v.option_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("option_settings", + (OptionSettingsList.to_json v.option_settings)); + Some + ("vpc_security_group_memberships", + (VpcSecurityGroupIdList.to_json + v.vpc_security_group_memberships)); + Some + ("d_b_security_group_memberships", + (DBSecurityGroupNameList.to_json + v.d_b_security_group_memberships)); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Some ("option_name", (String.to_json v.option_name))]) + let of_json j = + { + option_name = + (String.of_json (Util.of_option_exn (Json.lookup j "option_name"))); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + d_b_security_group_memberships = + (DBSecurityGroupNameList.of_json + (Util.of_option_exn + (Json.lookup j "d_b_security_group_memberships"))); + vpc_security_group_memberships = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn + (Json.lookup j "vpc_security_group_memberships"))); + option_settings = + (OptionSettingsList.of_json + (Util.of_option_exn (Json.lookup j "option_settings"))) + } + end +module ReservedDBInstance = + struct + type t = + { + reserved_d_b_instance_id: String.t option ; + reserved_d_b_instances_offering_id: String.t option ; + d_b_instance_class: String.t option ; + start_time: DateTime.t option ; + duration: Integer.t option ; + fixed_price: Double.t option ; + usage_price: Double.t option ; + currency_code: String.t option ; + d_b_instance_count: Integer.t option ; + product_description: String.t option ; + offering_type: String.t option ; + multi_a_z: Boolean.t option ; + state: String.t option ; + recurring_charges: RecurringChargeList.t } + let make ?reserved_d_b_instance_id ?reserved_d_b_instances_offering_id + ?d_b_instance_class ?start_time ?duration ?fixed_price ?usage_price + ?currency_code ?d_b_instance_count ?product_description + ?offering_type ?multi_a_z ?state ?(recurring_charges= []) () = + { + reserved_d_b_instance_id; + reserved_d_b_instances_offering_id; + d_b_instance_class; + start_time; + duration; + fixed_price; + usage_price; + currency_code; + d_b_instance_count; + product_description; + offering_type; + multi_a_z; + state; + recurring_charges + } + let parse xml = + Some + { + reserved_d_b_instance_id = + (Util.option_bind (Xml.member "ReservedDBInstanceId" xml) + String.parse); + reserved_d_b_instances_offering_id = (Util.option_bind - (Xml.member "OptionsDependedOn" xml) - OptionsDependedOn.parse) - ; persistent = Util.option_bind (Xml.member "Persistent" xml) Boolean.parse - ; permanent = Util.option_bind (Xml.member "Permanent" xml) Boolean.parse - ; option_group_option_settings = - Util.of_option - [] + (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + fixed_price = + (Util.option_bind (Xml.member "FixedPrice" xml) Double.parse); + usage_price = + (Util.option_bind (Xml.member "UsagePrice" xml) Double.parse); + currency_code = + (Util.option_bind (Xml.member "CurrencyCode" xml) String.parse); + d_b_instance_count = + (Util.option_bind (Xml.member "DBInstanceCount" xml) + Integer.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + state = (Util.option_bind (Xml.member "State" xml) String.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "RecurringCharges" xml) + RecurringChargeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RecurringCharges.member", + (RecurringChargeList.to_query v.recurring_charges))); + Util.option_map v.state + (fun f -> Query.Pair ("State", (String.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.d_b_instance_count + (fun f -> Query.Pair ("DBInstanceCount", (Integer.to_query f))); + Util.option_map v.currency_code + (fun f -> Query.Pair ("CurrencyCode", (String.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Double.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Double.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + Query.Pair + ("ReservedDBInstancesOfferingId", (String.to_query f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> + Query.Pair ("ReservedDBInstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("recurring_charges", + (RecurringChargeList.to_json v.recurring_charges)); + Util.option_map v.state (fun f -> ("state", (String.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.d_b_instance_count + (fun f -> ("d_b_instance_count", (Integer.to_json f))); + Util.option_map v.currency_code + (fun f -> ("currency_code", (String.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Double.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Double.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + ("reserved_d_b_instances_offering_id", (String.to_json f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> ("reserved_d_b_instance_id", (String.to_json f)))]) + let of_json j = + { + reserved_d_b_instance_id = + (Util.option_map (Json.lookup j "reserved_d_b_instance_id") + String.of_json); + reserved_d_b_instances_offering_id = + (Util.option_map + (Json.lookup j "reserved_d_b_instances_offering_id") + String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Double.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Double.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") String.of_json); + d_b_instance_count = + (Util.option_map (Json.lookup j "d_b_instance_count") + Integer.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + state = (Util.option_map (Json.lookup j "state") String.of_json); + recurring_charges = + (RecurringChargeList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))) + } + end +module ResourcePendingMaintenanceActions = + struct + type t = + { + resource_identifier: String.t option ; + pending_maintenance_action_details: PendingMaintenanceActionDetails.t } + let make ?resource_identifier ?(pending_maintenance_action_details= []) + () = { resource_identifier; pending_maintenance_action_details } + let parse xml = + Some + { + resource_identifier = + (Util.option_bind (Xml.member "ResourceIdentifier" xml) + String.parse); + pending_maintenance_action_details = + (Util.of_option [] + (Util.option_bind + (Xml.member "PendingMaintenanceActionDetails" xml) + PendingMaintenanceActionDetails.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("PendingMaintenanceActionDetails.member", + (PendingMaintenanceActionDetails.to_query + v.pending_maintenance_action_details))); + Util.option_map v.resource_identifier + (fun f -> Query.Pair ("ResourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("pending_maintenance_action_details", + (PendingMaintenanceActionDetails.to_json + v.pending_maintenance_action_details)); + Util.option_map v.resource_identifier + (fun f -> ("resource_identifier", (String.to_json f)))]) + let of_json j = + { + resource_identifier = + (Util.option_map (Json.lookup j "resource_identifier") + String.of_json); + pending_maintenance_action_details = + (PendingMaintenanceActionDetails.of_json + (Util.of_option_exn + (Json.lookup j "pending_maintenance_action_details"))) + } + end +module DBEngineVersion = + struct + type t = + { + engine: String.t option ; + engine_version: String.t option ; + d_b_parameter_group_family: String.t option ; + d_b_engine_description: String.t option ; + d_b_engine_version_description: String.t option ; + default_character_set: CharacterSet.t option ; + supported_character_sets: SupportedCharacterSetsList.t } + let make ?engine ?engine_version ?d_b_parameter_group_family + ?d_b_engine_description ?d_b_engine_version_description + ?default_character_set ?(supported_character_sets= []) () = + { + engine; + engine_version; + d_b_parameter_group_family; + d_b_engine_description; + d_b_engine_version_description; + default_character_set; + supported_character_sets + } + let parse xml = + Some + { + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + d_b_parameter_group_family = + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse); + d_b_engine_description = + (Util.option_bind (Xml.member "DBEngineDescription" xml) + String.parse); + d_b_engine_version_description = + (Util.option_bind (Xml.member "DBEngineVersionDescription" xml) + String.parse); + default_character_set = + (Util.option_bind (Xml.member "DefaultCharacterSet" xml) + CharacterSet.parse); + supported_character_sets = + (Util.of_option [] + (Util.option_bind (Xml.member "SupportedCharacterSets" xml) + SupportedCharacterSetsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SupportedCharacterSets.member", + (SupportedCharacterSetsList.to_query + v.supported_character_sets))); + Util.option_map v.default_character_set + (fun f -> + Query.Pair ("DefaultCharacterSet", (CharacterSet.to_query f))); + Util.option_map v.d_b_engine_version_description + (fun f -> + Query.Pair + ("DBEngineVersionDescription", (String.to_query f))); + Util.option_map v.d_b_engine_description + (fun f -> + Query.Pair ("DBEngineDescription", (String.to_query f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> + Query.Pair ("DBParameterGroupFamily", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("supported_character_sets", + (SupportedCharacterSetsList.to_json + v.supported_character_sets)); + Util.option_map v.default_character_set + (fun f -> ("default_character_set", (CharacterSet.to_json f))); + Util.option_map v.d_b_engine_version_description + (fun f -> ("d_b_engine_version_description", (String.to_json f))); + Util.option_map v.d_b_engine_description + (fun f -> ("d_b_engine_description", (String.to_json f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> ("d_b_parameter_group_family", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f)))]) + let of_json j = + { + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + d_b_parameter_group_family = + (Util.option_map (Json.lookup j "d_b_parameter_group_family") + String.of_json); + d_b_engine_description = + (Util.option_map (Json.lookup j "d_b_engine_description") + String.of_json); + d_b_engine_version_description = + (Util.option_map (Json.lookup j "d_b_engine_version_description") + String.of_json); + default_character_set = + (Util.option_map (Json.lookup j "default_character_set") + CharacterSet.of_json); + supported_character_sets = + (SupportedCharacterSetsList.of_json + (Util.of_option_exn (Json.lookup j "supported_character_sets"))) + } + end +module DBSnapshot = + struct + type t = + { + d_b_snapshot_identifier: String.t option ; + d_b_instance_identifier: String.t option ; + snapshot_create_time: DateTime.t option ; + engine: String.t option ; + allocated_storage: Integer.t option ; + status: String.t option ; + port: Integer.t option ; + availability_zone: String.t option ; + vpc_id: String.t option ; + instance_create_time: DateTime.t option ; + master_username: String.t option ; + engine_version: String.t option ; + license_model: String.t option ; + snapshot_type: String.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + percent_progress: Integer.t option ; + source_region: String.t option ; + source_d_b_snapshot_identifier: String.t option ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + encrypted: Boolean.t option ; + kms_key_id: String.t option } + let make ?d_b_snapshot_identifier ?d_b_instance_identifier + ?snapshot_create_time ?engine ?allocated_storage ?status ?port + ?availability_zone ?vpc_id ?instance_create_time ?master_username + ?engine_version ?license_model ?snapshot_type ?iops + ?option_group_name ?percent_progress ?source_region + ?source_d_b_snapshot_identifier ?storage_type ?tde_credential_arn + ?encrypted ?kms_key_id () = + { + d_b_snapshot_identifier; + d_b_instance_identifier; + snapshot_create_time; + engine; + allocated_storage; + status; + port; + availability_zone; + vpc_id; + instance_create_time; + master_username; + engine_version; + license_model; + snapshot_type; + iops; + option_group_name; + percent_progress; + source_region; + source_d_b_snapshot_identifier; + storage_type; + tde_credential_arn; + encrypted; + kms_key_id + } + let parse xml = + Some + { + d_b_snapshot_identifier = + (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) + String.parse); + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + snapshot_create_time = + (Util.option_bind (Xml.member "SnapshotCreateTime" xml) + DateTime.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + instance_create_time = + (Util.option_bind (Xml.member "InstanceCreateTime" xml) + DateTime.parse); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + snapshot_type = + (Util.option_bind (Xml.member "SnapshotType" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + percent_progress = + (Util.option_bind (Xml.member "PercentProgress" xml) + Integer.parse); + source_region = + (Util.option_bind (Xml.member "SourceRegion" xml) String.parse); + source_d_b_snapshot_identifier = + (Util.option_bind (Xml.member "SourceDBSnapshotIdentifier" xml) + String.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + encrypted = + (Util.option_bind (Xml.member "Encrypted" xml) Boolean.parse); + kms_key_id = + (Util.option_bind (Xml.member "KmsKeyId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Util.option_map v.encrypted + (fun f -> Query.Pair ("Encrypted", (Boolean.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.source_d_b_snapshot_identifier + (fun f -> + Query.Pair + ("SourceDBSnapshotIdentifier", (String.to_query f))); + Util.option_map v.source_region + (fun f -> Query.Pair ("SourceRegion", (String.to_query f))); + Util.option_map v.percent_progress + (fun f -> Query.Pair ("PercentProgress", (Integer.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.snapshot_type + (fun f -> Query.Pair ("SnapshotType", (String.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Util.option_map v.instance_create_time + (fun f -> + Query.Pair ("InstanceCreateTime", (DateTime.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.snapshot_create_time + (fun f -> + Query.Pair ("SnapshotCreateTime", (DateTime.to_query f))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f))); + Util.option_map v.d_b_snapshot_identifier + (fun f -> + Query.Pair ("DBSnapshotIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Util.option_map v.encrypted + (fun f -> ("encrypted", (Boolean.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.source_d_b_snapshot_identifier + (fun f -> ("source_d_b_snapshot_identifier", (String.to_json f))); + Util.option_map v.source_region + (fun f -> ("source_region", (String.to_json f))); + Util.option_map v.percent_progress + (fun f -> ("percent_progress", (Integer.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.snapshot_type + (fun f -> ("snapshot_type", (String.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Util.option_map v.instance_create_time + (fun f -> ("instance_create_time", (DateTime.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.snapshot_create_time + (fun f -> ("snapshot_create_time", (DateTime.to_json f))); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f))); + Util.option_map v.d_b_snapshot_identifier + (fun f -> ("d_b_snapshot_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_snapshot_identifier = + (Util.option_map (Json.lookup j "d_b_snapshot_identifier") + String.of_json); + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + snapshot_create_time = + (Util.option_map (Json.lookup j "snapshot_create_time") + DateTime.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + instance_create_time = + (Util.option_map (Json.lookup j "instance_create_time") + DateTime.of_json); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + snapshot_type = + (Util.option_map (Json.lookup j "snapshot_type") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + percent_progress = + (Util.option_map (Json.lookup j "percent_progress") Integer.of_json); + source_region = + (Util.option_map (Json.lookup j "source_region") String.of_json); + source_d_b_snapshot_identifier = + (Util.option_map (Json.lookup j "source_d_b_snapshot_identifier") + String.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + encrypted = + (Util.option_map (Json.lookup j "encrypted") Boolean.of_json); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json) + } + end +module EventCategoriesMap = + struct + type t = + { + source_type: String.t option ; + event_categories: EventCategoriesList.t } + let make ?source_type ?(event_categories= []) () = + { source_type; event_categories } + let parse xml = + Some + { + source_type = + (Util.option_bind (Xml.member "SourceType" xml) String.parse); + event_categories = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategories" xml) + EventCategoriesList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EventCategories.member", + (EventCategoriesList.to_query v.event_categories))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("event_categories", + (EventCategoriesList.to_json v.event_categories)); + Util.option_map v.source_type + (fun f -> ("source_type", (String.to_json f)))]) + let of_json j = + { + source_type = + (Util.option_map (Json.lookup j "source_type") String.of_json); + event_categories = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories"))) + } + end +module DBInstance = + struct + type t = + { + d_b_instance_identifier: String.t option ; + d_b_instance_class: String.t option ; + engine: String.t option ; + d_b_instance_status: String.t option ; + master_username: String.t option ; + d_b_name: String.t option ; + endpoint: Endpoint.t option ; + allocated_storage: Integer.t option ; + instance_create_time: DateTime.t option ; + preferred_backup_window: String.t option ; + backup_retention_period: Integer.t option ; + d_b_security_groups: DBSecurityGroupMembershipList.t ; + vpc_security_groups: VpcSecurityGroupMembershipList.t ; + d_b_parameter_groups: DBParameterGroupStatusList.t ; + availability_zone: String.t option ; + d_b_subnet_group: DBSubnetGroup.t option ; + preferred_maintenance_window: String.t option ; + pending_modified_values: PendingModifiedValues.t option ; + latest_restorable_time: DateTime.t option ; + multi_a_z: Boolean.t option ; + engine_version: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + read_replica_source_d_b_instance_identifier: String.t option ; + read_replica_d_b_instance_identifiers: + ReadReplicaDBInstanceIdentifierList.t ; + license_model: String.t option ; + iops: Integer.t option ; + option_group_memberships: OptionGroupMembershipList.t ; + character_set_name: String.t option ; + secondary_availability_zone: String.t option ; + publicly_accessible: Boolean.t option ; + status_infos: DBInstanceStatusInfoList.t ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + db_instance_port: Integer.t option ; + d_b_cluster_identifier: String.t option ; + storage_encrypted: Boolean.t option ; + kms_key_id: String.t option ; + dbi_resource_id: String.t option ; + c_a_certificate_identifier: String.t option ; + domain_memberships: DomainMembershipList.t ; + copy_tags_to_snapshot: Boolean.t option } + let make ?d_b_instance_identifier ?d_b_instance_class ?engine + ?d_b_instance_status ?master_username ?d_b_name ?endpoint + ?allocated_storage ?instance_create_time ?preferred_backup_window + ?backup_retention_period ?(d_b_security_groups= []) + ?(vpc_security_groups= []) ?(d_b_parameter_groups= []) + ?availability_zone ?d_b_subnet_group ?preferred_maintenance_window + ?pending_modified_values ?latest_restorable_time ?multi_a_z + ?engine_version ?auto_minor_version_upgrade + ?read_replica_source_d_b_instance_identifier + ?(read_replica_d_b_instance_identifiers= []) ?license_model ?iops + ?(option_group_memberships= []) ?character_set_name + ?secondary_availability_zone ?publicly_accessible ?(status_infos= []) + ?storage_type ?tde_credential_arn ?db_instance_port + ?d_b_cluster_identifier ?storage_encrypted ?kms_key_id + ?dbi_resource_id ?c_a_certificate_identifier ?(domain_memberships= + []) ?copy_tags_to_snapshot () = + { + d_b_instance_identifier; + d_b_instance_class; + engine; + d_b_instance_status; + master_username; + d_b_name; + endpoint; + allocated_storage; + instance_create_time; + preferred_backup_window; + backup_retention_period; + d_b_security_groups; + vpc_security_groups; + d_b_parameter_groups; + availability_zone; + d_b_subnet_group; + preferred_maintenance_window; + pending_modified_values; + latest_restorable_time; + multi_a_z; + engine_version; + auto_minor_version_upgrade; + read_replica_source_d_b_instance_identifier; + read_replica_d_b_instance_identifiers; + license_model; + iops; + option_group_memberships; + character_set_name; + secondary_availability_zone; + publicly_accessible; + status_infos; + storage_type; + tde_credential_arn; + db_instance_port; + d_b_cluster_identifier; + storage_encrypted; + kms_key_id; + dbi_resource_id; + c_a_certificate_identifier; + domain_memberships; + copy_tags_to_snapshot + } + let parse xml = + Some + { + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + d_b_instance_status = + (Util.option_bind (Xml.member "DBInstanceStatus" xml) + String.parse); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + d_b_name = + (Util.option_bind (Xml.member "DBName" xml) String.parse); + endpoint = + (Util.option_bind (Xml.member "Endpoint" xml) Endpoint.parse); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + instance_create_time = + (Util.option_bind (Xml.member "InstanceCreateTime" xml) + DateTime.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroupMembershipList.parse)); + vpc_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroups" xml) + VpcSecurityGroupMembershipList.parse)); + d_b_parameter_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBParameterGroups" xml) + DBParameterGroupStatusList.parse)); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + d_b_subnet_group = + (Util.option_bind (Xml.member "DBSubnetGroup" xml) + DBSubnetGroup.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + pending_modified_values = + (Util.option_bind (Xml.member "PendingModifiedValues" xml) + PendingModifiedValues.parse); + latest_restorable_time = + (Util.option_bind (Xml.member "LatestRestorableTime" xml) + DateTime.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + read_replica_source_d_b_instance_identifier = (Util.option_bind - (Xml.member "OptionGroupOptionSettings" xml) - OptionGroupOptionSettingsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "ReadReplicaSourceDBInstanceIdentifier" xml) + String.parse); + read_replica_d_b_instance_identifiers = + (Util.of_option [] + (Util.option_bind + (Xml.member "ReadReplicaDBInstanceIdentifiers" xml) + ReadReplicaDBInstanceIdentifierList.parse)); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_memberships = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionGroupMemberships" xml) + OptionGroupMembershipList.parse)); + character_set_name = + (Util.option_bind (Xml.member "CharacterSetName" xml) + String.parse); + secondary_availability_zone = + (Util.option_bind (Xml.member "SecondaryAvailabilityZone" xml) + String.parse); + publicly_accessible = + (Util.option_bind (Xml.member "PubliclyAccessible" xml) + Boolean.parse); + status_infos = + (Util.of_option [] + (Util.option_bind (Xml.member "StatusInfos" xml) + DBInstanceStatusInfoList.parse)); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + db_instance_port = + (Util.option_bind (Xml.member "DbInstancePort" xml) Integer.parse); + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + storage_encrypted = + (Util.option_bind (Xml.member "StorageEncrypted" xml) + Boolean.parse); + kms_key_id = + (Util.option_bind (Xml.member "KmsKeyId" xml) String.parse); + dbi_resource_id = + (Util.option_bind (Xml.member "DbiResourceId" xml) String.parse); + c_a_certificate_identifier = + (Util.option_bind (Xml.member "CACertificateIdentifier" xml) + String.parse); + domain_memberships = + (Util.of_option [] + (Util.option_bind (Xml.member "DomainMemberships" xml) + DomainMembershipList.parse)); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Some (Query.Pair - ( "OptionGroupOptionSettings.member" - , OptionGroupOptionSettingsList.to_query v.option_group_option_settings )) - ; Util.option_map v.permanent (fun f -> - Query.Pair ("Permanent", Boolean.to_query f)) - ; Util.option_map v.persistent (fun f -> - Query.Pair ("Persistent", Boolean.to_query f)) - ; Some + ("DomainMemberships.member", + (DomainMembershipList.to_query v.domain_memberships))); + Util.option_map v.c_a_certificate_identifier + (fun f -> + Query.Pair ("CACertificateIdentifier", (String.to_query f))); + Util.option_map v.dbi_resource_id + (fun f -> Query.Pair ("DbiResourceId", (String.to_query f))); + Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Util.option_map v.storage_encrypted + (fun f -> Query.Pair ("StorageEncrypted", (Boolean.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f))); + Util.option_map v.db_instance_port + (fun f -> Query.Pair ("DbInstancePort", (Integer.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Some (Query.Pair - ( "OptionsDependedOn.member" - , OptionsDependedOn.to_query v.options_depended_on )) - ; Util.option_map v.default_port (fun f -> - Query.Pair ("DefaultPort", Integer.to_query f)) - ; Util.option_map v.port_required (fun f -> - Query.Pair ("PortRequired", Boolean.to_query f)) - ; Util.option_map v.minimum_required_minor_engine_version (fun f -> - Query.Pair ("MinimumRequiredMinorEngineVersion", String.to_query f)) - ; Util.option_map v.major_engine_version (fun f -> - Query.Pair ("MajorEngineVersion", String.to_query f)) - ; Util.option_map v.engine_name (fun f -> - Query.Pair ("EngineName", String.to_query f)) - ; Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "option_group_option_settings" - , OptionGroupOptionSettingsList.to_json v.option_group_option_settings ) - ; Util.option_map v.permanent (fun f -> "permanent", Boolean.to_json f) - ; Util.option_map v.persistent (fun f -> "persistent", Boolean.to_json f) - ; Some ("options_depended_on", OptionsDependedOn.to_json v.options_depended_on) - ; Util.option_map v.default_port (fun f -> "default_port", Integer.to_json f) - ; Util.option_map v.port_required (fun f -> "port_required", Boolean.to_json f) - ; Util.option_map v.minimum_required_minor_engine_version (fun f -> - "minimum_required_minor_engine_version", String.to_json f) - ; Util.option_map v.major_engine_version (fun f -> - "major_engine_version", String.to_json f) - ; Util.option_map v.engine_name (fun f -> "engine_name", String.to_json f) - ; Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - ; engine_name = Util.option_map (Json.lookup j "engine_name") String.of_json - ; major_engine_version = - Util.option_map (Json.lookup j "major_engine_version") String.of_json - ; minimum_required_minor_engine_version = - Util.option_map - (Json.lookup j "minimum_required_minor_engine_version") - String.of_json - ; port_required = Util.option_map (Json.lookup j "port_required") Boolean.of_json - ; default_port = Util.option_map (Json.lookup j "default_port") Integer.of_json - ; options_depended_on = - OptionsDependedOn.of_json - (Util.of_option_exn (Json.lookup j "options_depended_on")) - ; persistent = Util.option_map (Json.lookup j "persistent") Boolean.of_json - ; permanent = Util.option_map (Json.lookup j "permanent") Boolean.of_json - ; option_group_option_settings = - OptionGroupOptionSettingsList.of_json - (Util.of_option_exn (Json.lookup j "option_group_option_settings")) - } -end - -module Filter = struct - type t = - { name : String.t - ; values : FilterValueList.t - } - - let make ~name ~values () = { name; values } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; values = - Xml.required - "Values" - (Util.option_bind (Xml.member "Values" xml) FilterValueList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Values.member", FilterValueList.to_query v.values)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("values", FilterValueList.to_json v.values) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; values = FilterValueList.of_json (Util.of_option_exn (Json.lookup j "values")) - } -end - -module ParametersList = struct - type t = Parameter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Parameter.parse (Xml.members "Parameter" xml)) - - let to_query v = Query.to_query_list Parameter.to_query v - - let to_json v = `List (List.map Parameter.to_json v) - - let of_json j = Json.to_list Parameter.of_json j -end - -module EventSubscription = struct - type t = - { customer_aws_id : String.t option - ; cust_subscription_id : String.t option - ; sns_topic_arn : String.t option - ; status : String.t option - ; subscription_creation_time : String.t option - ; source_type : String.t option - ; source_ids_list : SourceIdsList.t - ; event_categories_list : EventCategoriesList.t - ; enabled : Boolean.t option - } - - let make - ?customer_aws_id - ?cust_subscription_id - ?sns_topic_arn - ?status - ?subscription_creation_time - ?source_type - ?(source_ids_list = []) - ?(event_categories_list = []) - ?enabled - () = - { customer_aws_id - ; cust_subscription_id - ; sns_topic_arn - ; status - ; subscription_creation_time - ; source_type - ; source_ids_list - ; event_categories_list - ; enabled - } - - let parse xml = - Some - { customer_aws_id = Util.option_bind (Xml.member "CustomerAwsId" xml) String.parse - ; cust_subscription_id = - Util.option_bind (Xml.member "CustSubscriptionId" xml) String.parse - ; sns_topic_arn = Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; subscription_creation_time = - Util.option_bind (Xml.member "SubscriptionCreationTime" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) String.parse - ; source_ids_list = - Util.of_option - [] - (Util.option_bind (Xml.member "SourceIdsList" xml) SourceIdsList.parse) - ; event_categories_list = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategoriesList" xml) - EventCategoriesList.parse) - ; enabled = Util.option_bind (Xml.member "Enabled" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> Query.Pair ("Enabled", Boolean.to_query f)) - ; Some + ("StatusInfos.member", + (DBInstanceStatusInfoList.to_query v.status_infos))); + Util.option_map v.publicly_accessible + (fun f -> + Query.Pair ("PubliclyAccessible", (Boolean.to_query f))); + Util.option_map v.secondary_availability_zone + (fun f -> + Query.Pair ("SecondaryAvailabilityZone", (String.to_query f))); + Util.option_map v.character_set_name + (fun f -> Query.Pair ("CharacterSetName", (String.to_query f))); + Some (Query.Pair - ( "EventCategoriesList.member" - , EventCategoriesList.to_query v.event_categories_list )) - ; Some - (Query.Pair ("SourceIdsList.member", SourceIdsList.to_query v.source_ids_list)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", String.to_query f)) - ; Util.option_map v.subscription_creation_time (fun f -> - Query.Pair ("SubscriptionCreationTime", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.sns_topic_arn (fun f -> - Query.Pair ("SnsTopicArn", String.to_query f)) - ; Util.option_map v.cust_subscription_id (fun f -> - Query.Pair ("CustSubscriptionId", String.to_query f)) - ; Util.option_map v.customer_aws_id (fun f -> - Query.Pair ("CustomerAwsId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> "enabled", Boolean.to_json f) - ; Some - ("event_categories_list", EventCategoriesList.to_json v.event_categories_list) - ; Some ("source_ids_list", SourceIdsList.to_json v.source_ids_list) - ; Util.option_map v.source_type (fun f -> "source_type", String.to_json f) - ; Util.option_map v.subscription_creation_time (fun f -> - "subscription_creation_time", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.sns_topic_arn (fun f -> "sns_topic_arn", String.to_json f) - ; Util.option_map v.cust_subscription_id (fun f -> - "cust_subscription_id", String.to_json f) - ; Util.option_map v.customer_aws_id (fun f -> - "customer_aws_id", String.to_json f) - ]) - - let of_json j = - { customer_aws_id = Util.option_map (Json.lookup j "customer_aws_id") String.of_json - ; cust_subscription_id = - Util.option_map (Json.lookup j "cust_subscription_id") String.of_json - ; sns_topic_arn = Util.option_map (Json.lookup j "sns_topic_arn") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; subscription_creation_time = - Util.option_map (Json.lookup j "subscription_creation_time") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") String.of_json - ; source_ids_list = - SourceIdsList.of_json (Util.of_option_exn (Json.lookup j "source_ids_list")) - ; event_categories_list = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories_list")) - ; enabled = Util.option_map (Json.lookup j "enabled") Boolean.of_json - } -end - -module OptionConfiguration = struct - type t = - { option_name : String.t - ; port : Integer.t option - ; d_b_security_group_memberships : DBSecurityGroupNameList.t - ; vpc_security_group_memberships : VpcSecurityGroupIdList.t - ; option_settings : OptionSettingsList.t - } - - let make - ~option_name - ?port - ?(d_b_security_group_memberships = []) - ?(vpc_security_group_memberships = []) - ?(option_settings = []) - () = - { option_name - ; port - ; d_b_security_group_memberships - ; vpc_security_group_memberships - ; option_settings - } - - let parse xml = - Some - { option_name = - Xml.required - "OptionName" - (Util.option_bind (Xml.member "OptionName" xml) String.parse) - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; d_b_security_group_memberships = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBSecurityGroupMemberships" xml) - DBSecurityGroupNameList.parse) - ; vpc_security_group_memberships = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupMemberships" xml) - VpcSecurityGroupIdList.parse) - ; option_settings = - Util.of_option - [] - (Util.option_bind (Xml.member "OptionSettings" xml) OptionSettingsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("OptionGroupMemberships.member", + (OptionGroupMembershipList.to_query + v.option_group_memberships))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Some (Query.Pair - ("OptionSettings.member", OptionSettingsList.to_query v.option_settings)) - ; Some + ("ReadReplicaDBInstanceIdentifiers.member", + (ReadReplicaDBInstanceIdentifierList.to_query + v.read_replica_d_b_instance_identifiers))); + Util.option_map v.read_replica_source_d_b_instance_identifier + (fun f -> + Query.Pair + ("ReadReplicaSourceDBInstanceIdentifier", + (String.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.latest_restorable_time + (fun f -> + Query.Pair ("LatestRestorableTime", (DateTime.to_query f))); + Util.option_map v.pending_modified_values + (fun f -> + Query.Pair + ("PendingModifiedValues", + (PendingModifiedValues.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.d_b_subnet_group + (fun f -> + Query.Pair ("DBSubnetGroup", (DBSubnetGroup.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Some (Query.Pair - ( "VpcSecurityGroupMemberships.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_memberships )) - ; Some + ("DBParameterGroups.member", + (DBParameterGroupStatusList.to_query v.d_b_parameter_groups))); + Some (Query.Pair - ( "DBSecurityGroupMemberships.member" - , DBSecurityGroupNameList.to_query v.d_b_security_group_memberships )) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Some (Query.Pair ("OptionName", String.to_query v.option_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("option_settings", OptionSettingsList.to_json v.option_settings) - ; Some - ( "vpc_security_group_memberships" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_memberships ) - ; Some - ( "d_b_security_group_memberships" - , DBSecurityGroupNameList.to_json v.d_b_security_group_memberships ) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Some ("option_name", String.to_json v.option_name) - ]) - - let of_json j = - { option_name = String.of_json (Util.of_option_exn (Json.lookup j "option_name")) - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; d_b_security_group_memberships = - DBSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_group_memberships")) - ; vpc_security_group_memberships = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_memberships")) - ; option_settings = - OptionSettingsList.of_json (Util.of_option_exn (Json.lookup j "option_settings")) - } -end - -module ReservedDBInstance = struct - type t = - { reserved_d_b_instance_id : String.t option - ; reserved_d_b_instances_offering_id : String.t option - ; d_b_instance_class : String.t option - ; start_time : DateTime.t option - ; duration : Integer.t option - ; fixed_price : Double.t option - ; usage_price : Double.t option - ; currency_code : String.t option - ; d_b_instance_count : Integer.t option - ; product_description : String.t option - ; offering_type : String.t option - ; multi_a_z : Boolean.t option - ; state : String.t option - ; recurring_charges : RecurringChargeList.t - } - - let make - ?reserved_d_b_instance_id - ?reserved_d_b_instances_offering_id - ?d_b_instance_class - ?start_time - ?duration - ?fixed_price - ?usage_price - ?currency_code - ?d_b_instance_count - ?product_description - ?offering_type - ?multi_a_z - ?state - ?(recurring_charges = []) - () = - { reserved_d_b_instance_id - ; reserved_d_b_instances_offering_id - ; d_b_instance_class - ; start_time - ; duration - ; fixed_price - ; usage_price - ; currency_code - ; d_b_instance_count - ; product_description - ; offering_type - ; multi_a_z - ; state - ; recurring_charges - } - - let parse xml = - Some - { reserved_d_b_instance_id = - Util.option_bind (Xml.member "ReservedDBInstanceId" xml) String.parse - ; reserved_d_b_instances_offering_id = - Util.option_bind (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; fixed_price = Util.option_bind (Xml.member "FixedPrice" xml) Double.parse - ; usage_price = Util.option_bind (Xml.member "UsagePrice" xml) Double.parse - ; currency_code = Util.option_bind (Xml.member "CurrencyCode" xml) String.parse - ; d_b_instance_count = - Util.option_bind (Xml.member "DBInstanceCount" xml) Integer.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; state = Util.option_bind (Xml.member "State" xml) String.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "RecurringCharges" xml) - RecurringChargeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("VpcSecurityGroups.member", + (VpcSecurityGroupMembershipList.to_query + v.vpc_security_groups))); + Some (Query.Pair - ( "RecurringCharges.member" - , RecurringChargeList.to_query v.recurring_charges )) - ; Util.option_map v.state (fun f -> Query.Pair ("State", String.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.d_b_instance_count (fun f -> - Query.Pair ("DBInstanceCount", Integer.to_query f)) - ; Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", String.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Double.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Double.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - Query.Pair ("ReservedDBInstancesOfferingId", String.to_query f)) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - Query.Pair ("ReservedDBInstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("recurring_charges", RecurringChargeList.to_json v.recurring_charges) - ; Util.option_map v.state (fun f -> "state", String.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.d_b_instance_count (fun f -> - "d_b_instance_count", Integer.to_json f) - ; Util.option_map v.currency_code (fun f -> "currency_code", String.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Double.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Double.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - "reserved_d_b_instances_offering_id", String.to_json f) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - "reserved_d_b_instance_id", String.to_json f) - ]) - - let of_json j = - { reserved_d_b_instance_id = - Util.option_map (Json.lookup j "reserved_d_b_instance_id") String.of_json - ; reserved_d_b_instances_offering_id = - Util.option_map - (Json.lookup j "reserved_d_b_instances_offering_id") - String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Double.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Double.of_json - ; currency_code = Util.option_map (Json.lookup j "currency_code") String.of_json - ; d_b_instance_count = - Util.option_map (Json.lookup j "d_b_instance_count") Integer.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; state = Util.option_map (Json.lookup j "state") String.of_json - ; recurring_charges = - RecurringChargeList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - } -end - -module ResourcePendingMaintenanceActions = struct - type t = - { resource_identifier : String.t option - ; pending_maintenance_action_details : PendingMaintenanceActionDetails.t - } - - let make ?resource_identifier ?(pending_maintenance_action_details = []) () = - { resource_identifier; pending_maintenance_action_details } - - let parse xml = - Some - { resource_identifier = - Util.option_bind (Xml.member "ResourceIdentifier" xml) String.parse - ; pending_maintenance_action_details = - Util.of_option - [] - (Util.option_bind - (Xml.member "PendingMaintenanceActionDetails" xml) - PendingMaintenanceActionDetails.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBSecurityGroups.member", + (DBSecurityGroupMembershipList.to_query + v.d_b_security_groups))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.instance_create_time + (fun f -> + Query.Pair ("InstanceCreateTime", (DateTime.to_query f))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Util.option_map v.endpoint + (fun f -> Query.Pair ("Endpoint", (Endpoint.to_query f))); + Util.option_map v.d_b_name + (fun f -> Query.Pair ("DBName", (String.to_query f))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Util.option_map v.d_b_instance_status + (fun f -> Query.Pair ("DBInstanceStatus", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Some + ("domain_memberships", + (DomainMembershipList.to_json v.domain_memberships)); + Util.option_map v.c_a_certificate_identifier + (fun f -> ("c_a_certificate_identifier", (String.to_json f))); + Util.option_map v.dbi_resource_id + (fun f -> ("dbi_resource_id", (String.to_json f))); + Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Util.option_map v.storage_encrypted + (fun f -> ("storage_encrypted", (Boolean.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f))); + Util.option_map v.db_instance_port + (fun f -> ("db_instance_port", (Integer.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Some + ("status_infos", + (DBInstanceStatusInfoList.to_json v.status_infos)); + Util.option_map v.publicly_accessible + (fun f -> ("publicly_accessible", (Boolean.to_json f))); + Util.option_map v.secondary_availability_zone + (fun f -> ("secondary_availability_zone", (String.to_json f))); + Util.option_map v.character_set_name + (fun f -> ("character_set_name", (String.to_json f))); + Some + ("option_group_memberships", + (OptionGroupMembershipList.to_json v.option_group_memberships)); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Some + ("read_replica_d_b_instance_identifiers", + (ReadReplicaDBInstanceIdentifierList.to_json + v.read_replica_d_b_instance_identifiers)); + Util.option_map v.read_replica_source_d_b_instance_identifier + (fun f -> + ("read_replica_source_d_b_instance_identifier", + (String.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.latest_restorable_time + (fun f -> ("latest_restorable_time", (DateTime.to_json f))); + Util.option_map v.pending_modified_values + (fun f -> + ("pending_modified_values", + (PendingModifiedValues.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.d_b_subnet_group + (fun f -> ("d_b_subnet_group", (DBSubnetGroup.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Some + ("d_b_parameter_groups", + (DBParameterGroupStatusList.to_json v.d_b_parameter_groups)); + Some + ("vpc_security_groups", + (VpcSecurityGroupMembershipList.to_json v.vpc_security_groups)); + Some + ("d_b_security_groups", + (DBSecurityGroupMembershipList.to_json v.d_b_security_groups)); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.instance_create_time + (fun f -> ("instance_create_time", (DateTime.to_json f))); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Util.option_map v.endpoint + (fun f -> ("endpoint", (Endpoint.to_json f))); + Util.option_map v.d_b_name + (fun f -> ("d_b_name", (String.to_json f))); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Util.option_map v.d_b_instance_status + (fun f -> ("d_b_instance_status", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + d_b_instance_status = + (Util.option_map (Json.lookup j "d_b_instance_status") + String.of_json); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + d_b_name = + (Util.option_map (Json.lookup j "d_b_name") String.of_json); + endpoint = + (Util.option_map (Json.lookup j "endpoint") Endpoint.of_json); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + instance_create_time = + (Util.option_map (Json.lookup j "instance_create_time") + DateTime.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + d_b_security_groups = + (DBSecurityGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))); + vpc_security_groups = + (VpcSecurityGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_groups"))); + d_b_parameter_groups = + (DBParameterGroupStatusList.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_groups"))); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + d_b_subnet_group = + (Util.option_map (Json.lookup j "d_b_subnet_group") + DBSubnetGroup.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + pending_modified_values = + (Util.option_map (Json.lookup j "pending_modified_values") + PendingModifiedValues.of_json); + latest_restorable_time = + (Util.option_map (Json.lookup j "latest_restorable_time") + DateTime.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + read_replica_source_d_b_instance_identifier = + (Util.option_map + (Json.lookup j "read_replica_source_d_b_instance_identifier") + String.of_json); + read_replica_d_b_instance_identifiers = + (ReadReplicaDBInstanceIdentifierList.of_json + (Util.of_option_exn + (Json.lookup j "read_replica_d_b_instance_identifiers"))); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_memberships = + (OptionGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "option_group_memberships"))); + character_set_name = + (Util.option_map (Json.lookup j "character_set_name") + String.of_json); + secondary_availability_zone = + (Util.option_map (Json.lookup j "secondary_availability_zone") + String.of_json); + publicly_accessible = + (Util.option_map (Json.lookup j "publicly_accessible") + Boolean.of_json); + status_infos = + (DBInstanceStatusInfoList.of_json + (Util.of_option_exn (Json.lookup j "status_infos"))); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + db_instance_port = + (Util.option_map (Json.lookup j "db_instance_port") Integer.of_json); + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + storage_encrypted = + (Util.option_map (Json.lookup j "storage_encrypted") + Boolean.of_json); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json); + dbi_resource_id = + (Util.option_map (Json.lookup j "dbi_resource_id") String.of_json); + c_a_certificate_identifier = + (Util.option_map (Json.lookup j "c_a_certificate_identifier") + String.of_json); + domain_memberships = + (DomainMembershipList.of_json + (Util.of_option_exn (Json.lookup j "domain_memberships"))); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json) + } + end +module AccountQuota = + struct + type t = + { + account_quota_name: String.t option ; + used: Long.t option ; + max: Long.t option } + let make ?account_quota_name ?used ?max () = + { account_quota_name; used; max } + let parse xml = + Some + { + account_quota_name = + (Util.option_bind (Xml.member "AccountQuotaName" xml) + String.parse); + used = (Util.option_bind (Xml.member "Used" xml) Long.parse); + max = (Util.option_bind (Xml.member "Max" xml) Long.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max + (fun f -> Query.Pair ("Max", (Long.to_query f))); + Util.option_map v.used + (fun f -> Query.Pair ("Used", (Long.to_query f))); + Util.option_map v.account_quota_name + (fun f -> Query.Pair ("AccountQuotaName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max (fun f -> ("max", (Long.to_json f))); + Util.option_map v.used (fun f -> ("used", (Long.to_json f))); + Util.option_map v.account_quota_name + (fun f -> ("account_quota_name", (String.to_json f)))]) + let of_json j = + { + account_quota_name = + (Util.option_map (Json.lookup j "account_quota_name") + String.of_json); + used = (Util.option_map (Json.lookup j "used") Long.of_json); + max = (Util.option_map (Json.lookup j "max") Long.of_json) + } + end +module DBClusterParameterGroup = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t option ; + d_b_parameter_group_family: String.t option ; + description: String.t option } + let make ?d_b_cluster_parameter_group_name ?d_b_parameter_group_family + ?description () = + { + d_b_cluster_parameter_group_name; + d_b_parameter_group_family; + description + } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) + String.parse); + d_b_parameter_group_family = + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> + Query.Pair ("DBParameterGroupFamily", (String.to_query f))); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + Query.Pair + ("DBClusterParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> ("d_b_parameter_group_family", (String.to_json f))); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + ("d_b_cluster_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") + String.of_json); + d_b_parameter_group_family = + (Util.option_map (Json.lookup j "d_b_parameter_group_family") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module DescribeDBLogFilesDetails = + struct + type t = + { + log_file_name: String.t option ; + last_written: Long.t option ; + size: Long.t option } + let make ?log_file_name ?last_written ?size () = + { log_file_name; last_written; size } + let parse xml = + Some + { + log_file_name = + (Util.option_bind (Xml.member "LogFileName" xml) String.parse); + last_written = + (Util.option_bind (Xml.member "LastWritten" xml) Long.parse); + size = (Util.option_bind (Xml.member "Size" xml) Long.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.size + (fun f -> Query.Pair ("Size", (Long.to_query f))); + Util.option_map v.last_written + (fun f -> Query.Pair ("LastWritten", (Long.to_query f))); + Util.option_map v.log_file_name + (fun f -> Query.Pair ("LogFileName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.size (fun f -> ("size", (Long.to_json f))); + Util.option_map v.last_written + (fun f -> ("last_written", (Long.to_json f))); + Util.option_map v.log_file_name + (fun f -> ("log_file_name", (String.to_json f)))]) + let of_json j = + { + log_file_name = + (Util.option_map (Json.lookup j "log_file_name") String.of_json); + last_written = + (Util.option_map (Json.lookup j "last_written") Long.of_json); + size = (Util.option_map (Json.lookup j "size") Long.of_json) + } + end +module DBParameterGroup = + struct + type t = + { + d_b_parameter_group_name: String.t option ; + d_b_parameter_group_family: String.t option ; + description: String.t option } + let make ?d_b_parameter_group_name ?d_b_parameter_group_family + ?description () = + { d_b_parameter_group_name; d_b_parameter_group_family; description } + let parse xml = + Some + { + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse); + d_b_parameter_group_family = + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse); + description = + (Util.option_bind (Xml.member "Description" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> Query.Pair ("Description", (String.to_query f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> + Query.Pair ("DBParameterGroupFamily", (String.to_query f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.description + (fun f -> ("description", (String.to_json f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> ("d_b_parameter_group_family", (String.to_json f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json); + d_b_parameter_group_family = + (Util.option_map (Json.lookup j "d_b_parameter_group_family") + String.of_json); + description = + (Util.option_map (Json.lookup j "description") String.of_json) + } + end +module Event = + struct + type t = + { + source_identifier: String.t option ; + source_type: SourceType.t option ; + message: String.t option ; + event_categories: EventCategoriesList.t ; + date: DateTime.t option } + let make ?source_identifier ?source_type ?message ?(event_categories= + []) ?date () = + { source_identifier; source_type; message; event_categories; date } + let parse xml = + Some + { + source_identifier = + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) SourceType.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse); + event_categories = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategories" xml) + EventCategoriesList.parse)); + date = (Util.option_bind (Xml.member "Date" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.date + (fun f -> Query.Pair ("Date", (DateTime.to_query f))); + Some (Query.Pair - ( "PendingMaintenanceActionDetails.member" - , PendingMaintenanceActionDetails.to_query - v.pending_maintenance_action_details )) - ; Util.option_map v.resource_identifier (fun f -> - Query.Pair ("ResourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "pending_maintenance_action_details" - , PendingMaintenanceActionDetails.to_json - v.pending_maintenance_action_details ) - ; Util.option_map v.resource_identifier (fun f -> - "resource_identifier", String.to_json f) - ]) - - let of_json j = - { resource_identifier = - Util.option_map (Json.lookup j "resource_identifier") String.of_json - ; pending_maintenance_action_details = - PendingMaintenanceActionDetails.of_json - (Util.of_option_exn (Json.lookup j "pending_maintenance_action_details")) - } -end - -module DBEngineVersion = struct - type t = - { engine : String.t option - ; engine_version : String.t option - ; d_b_parameter_group_family : String.t option - ; d_b_engine_description : String.t option - ; d_b_engine_version_description : String.t option - ; default_character_set : CharacterSet.t option - ; supported_character_sets : SupportedCharacterSetsList.t - } - - let make - ?engine - ?engine_version - ?d_b_parameter_group_family - ?d_b_engine_description - ?d_b_engine_version_description - ?default_character_set - ?(supported_character_sets = []) - () = - { engine - ; engine_version - ; d_b_parameter_group_family - ; d_b_engine_description - ; d_b_engine_version_description - ; default_character_set - ; supported_character_sets - } - - let parse xml = - Some - { engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; d_b_parameter_group_family = - Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse - ; d_b_engine_description = - Util.option_bind (Xml.member "DBEngineDescription" xml) String.parse - ; d_b_engine_version_description = - Util.option_bind (Xml.member "DBEngineVersionDescription" xml) String.parse - ; default_character_set = - Util.option_bind (Xml.member "DefaultCharacterSet" xml) CharacterSet.parse - ; supported_character_sets = - Util.of_option - [] + ("EventCategories.member", + (EventCategoriesList.to_query v.event_categories))); + Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (SourceType.to_query f))); + Util.option_map v.source_identifier + (fun f -> Query.Pair ("SourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.date (fun f -> ("date", (DateTime.to_json f))); + Some + ("event_categories", + (EventCategoriesList.to_json v.event_categories)); + Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.source_type + (fun f -> ("source_type", (SourceType.to_json f))); + Util.option_map v.source_identifier + (fun f -> ("source_identifier", (String.to_json f)))]) + let of_json j = + { + source_identifier = + (Util.option_map (Json.lookup j "source_identifier") String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") SourceType.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json); + event_categories = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories"))); + date = (Util.option_map (Json.lookup j "date") DateTime.of_json) + } + end +module Certificate = + struct + type t = + { + certificate_identifier: String.t option ; + certificate_type: String.t option ; + thumbprint: String.t option ; + valid_from: DateTime.t option ; + valid_till: DateTime.t option } + let make ?certificate_identifier ?certificate_type ?thumbprint + ?valid_from ?valid_till () = + { + certificate_identifier; + certificate_type; + thumbprint; + valid_from; + valid_till + } + let parse xml = + Some + { + certificate_identifier = + (Util.option_bind (Xml.member "CertificateIdentifier" xml) + String.parse); + certificate_type = + (Util.option_bind (Xml.member "CertificateType" xml) String.parse); + thumbprint = + (Util.option_bind (Xml.member "Thumbprint" xml) String.parse); + valid_from = + (Util.option_bind (Xml.member "ValidFrom" xml) DateTime.parse); + valid_till = + (Util.option_bind (Xml.member "ValidTill" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.valid_till + (fun f -> Query.Pair ("ValidTill", (DateTime.to_query f))); + Util.option_map v.valid_from + (fun f -> Query.Pair ("ValidFrom", (DateTime.to_query f))); + Util.option_map v.thumbprint + (fun f -> Query.Pair ("Thumbprint", (String.to_query f))); + Util.option_map v.certificate_type + (fun f -> Query.Pair ("CertificateType", (String.to_query f))); + Util.option_map v.certificate_identifier + (fun f -> + Query.Pair ("CertificateIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.valid_till + (fun f -> ("valid_till", (DateTime.to_json f))); + Util.option_map v.valid_from + (fun f -> ("valid_from", (DateTime.to_json f))); + Util.option_map v.thumbprint + (fun f -> ("thumbprint", (String.to_json f))); + Util.option_map v.certificate_type + (fun f -> ("certificate_type", (String.to_json f))); + Util.option_map v.certificate_identifier + (fun f -> ("certificate_identifier", (String.to_json f)))]) + let of_json j = + { + certificate_identifier = + (Util.option_map (Json.lookup j "certificate_identifier") + String.of_json); + certificate_type = + (Util.option_map (Json.lookup j "certificate_type") String.of_json); + thumbprint = + (Util.option_map (Json.lookup j "thumbprint") String.of_json); + valid_from = + (Util.option_map (Json.lookup j "valid_from") DateTime.of_json); + valid_till = + (Util.option_map (Json.lookup j "valid_till") DateTime.of_json) + } + end +module OptionGroup = + struct + type t = + { + option_group_name: String.t option ; + option_group_description: String.t option ; + engine_name: String.t option ; + major_engine_version: String.t option ; + options: OptionsList.t ; + allows_vpc_and_non_vpc_instance_memberships: Boolean.t option ; + vpc_id: String.t option } + let make ?option_group_name ?option_group_description ?engine_name + ?major_engine_version ?(options= []) + ?allows_vpc_and_non_vpc_instance_memberships ?vpc_id () = + { + option_group_name; + option_group_description; + engine_name; + major_engine_version; + options; + allows_vpc_and_non_vpc_instance_memberships; + vpc_id + } + let parse xml = + Some + { + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + option_group_description = + (Util.option_bind (Xml.member "OptionGroupDescription" xml) + String.parse); + engine_name = + (Util.option_bind (Xml.member "EngineName" xml) String.parse); + major_engine_version = + (Util.option_bind (Xml.member "MajorEngineVersion" xml) + String.parse); + options = + (Util.of_option [] + (Util.option_bind (Xml.member "Options" xml) OptionsList.parse)); + allows_vpc_and_non_vpc_instance_memberships = (Util.option_bind - (Xml.member "SupportedCharacterSets" xml) - SupportedCharacterSetsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "AllowsVpcAndNonVpcInstanceMemberships" xml) + Boolean.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.allows_vpc_and_non_vpc_instance_memberships + (fun f -> + Query.Pair + ("AllowsVpcAndNonVpcInstanceMemberships", + (Boolean.to_query f))); + Some + (Query.Pair ("Options.member", (OptionsList.to_query v.options))); + Util.option_map v.major_engine_version + (fun f -> Query.Pair ("MajorEngineVersion", (String.to_query f))); + Util.option_map v.engine_name + (fun f -> Query.Pair ("EngineName", (String.to_query f))); + Util.option_map v.option_group_description + (fun f -> + Query.Pair ("OptionGroupDescription", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.vpc_id + (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.allows_vpc_and_non_vpc_instance_memberships + (fun f -> + ("allows_vpc_and_non_vpc_instance_memberships", + (Boolean.to_json f))); + Some ("options", (OptionsList.to_json v.options)); + Util.option_map v.major_engine_version + (fun f -> ("major_engine_version", (String.to_json f))); + Util.option_map v.engine_name + (fun f -> ("engine_name", (String.to_json f))); + Util.option_map v.option_group_description + (fun f -> ("option_group_description", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f)))]) + let of_json j = + { + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + option_group_description = + (Util.option_map (Json.lookup j "option_group_description") + String.of_json); + engine_name = + (Util.option_map (Json.lookup j "engine_name") String.of_json); + major_engine_version = + (Util.option_map (Json.lookup j "major_engine_version") + String.of_json); + options = + (OptionsList.of_json (Util.of_option_exn (Json.lookup j "options"))); + allows_vpc_and_non_vpc_instance_memberships = + (Util.option_map + (Json.lookup j "allows_vpc_and_non_vpc_instance_memberships") + Boolean.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json) + } + end +module OrderableDBInstanceOption = + struct + type t = + { + engine: String.t option ; + engine_version: String.t option ; + d_b_instance_class: String.t option ; + license_model: String.t option ; + availability_zones: AvailabilityZoneList.t ; + multi_a_z_capable: Boolean.t option ; + read_replica_capable: Boolean.t option ; + vpc: Boolean.t option ; + supports_storage_encryption: Boolean.t option ; + storage_type: String.t option ; + supports_iops: Boolean.t option } + let make ?engine ?engine_version ?d_b_instance_class ?license_model + ?(availability_zones= []) ?multi_a_z_capable ?read_replica_capable + ?vpc ?supports_storage_encryption ?storage_type ?supports_iops () = + { + engine; + engine_version; + d_b_instance_class; + license_model; + availability_zones; + multi_a_z_capable; + read_replica_capable; + vpc; + supports_storage_encryption; + storage_type; + supports_iops + } + let parse xml = + Some + { + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZoneList.parse)); + multi_a_z_capable = + (Util.option_bind (Xml.member "MultiAZCapable" xml) Boolean.parse); + read_replica_capable = + (Util.option_bind (Xml.member "ReadReplicaCapable" xml) + Boolean.parse); + vpc = (Util.option_bind (Xml.member "Vpc" xml) Boolean.parse); + supports_storage_encryption = + (Util.option_bind (Xml.member "SupportsStorageEncryption" xml) + Boolean.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + supports_iops = + (Util.option_bind (Xml.member "SupportsIops" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.supports_iops + (fun f -> Query.Pair ("SupportsIops", (Boolean.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.supports_storage_encryption + (fun f -> + Query.Pair + ("SupportsStorageEncryption", (Boolean.to_query f))); + Util.option_map v.vpc + (fun f -> Query.Pair ("Vpc", (Boolean.to_query f))); + Util.option_map v.read_replica_capable + (fun f -> + Query.Pair ("ReadReplicaCapable", (Boolean.to_query f))); + Util.option_map v.multi_a_z_capable + (fun f -> Query.Pair ("MultiAZCapable", (Boolean.to_query f))); + Some (Query.Pair - ( "SupportedCharacterSets.member" - , SupportedCharacterSetsList.to_query v.supported_character_sets )) - ; Util.option_map v.default_character_set (fun f -> - Query.Pair ("DefaultCharacterSet", CharacterSet.to_query f)) - ; Util.option_map v.d_b_engine_version_description (fun f -> - Query.Pair ("DBEngineVersionDescription", String.to_query f)) - ; Util.option_map v.d_b_engine_description (fun f -> - Query.Pair ("DBEngineDescription", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - Query.Pair ("DBParameterGroupFamily", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "supported_character_sets" - , SupportedCharacterSetsList.to_json v.supported_character_sets ) - ; Util.option_map v.default_character_set (fun f -> - "default_character_set", CharacterSet.to_json f) - ; Util.option_map v.d_b_engine_version_description (fun f -> - "d_b_engine_version_description", String.to_json f) - ; Util.option_map v.d_b_engine_description (fun f -> - "d_b_engine_description", String.to_json f) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - "d_b_parameter_group_family", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ]) - - let of_json j = - { engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; d_b_parameter_group_family = - Util.option_map (Json.lookup j "d_b_parameter_group_family") String.of_json - ; d_b_engine_description = - Util.option_map (Json.lookup j "d_b_engine_description") String.of_json - ; d_b_engine_version_description = - Util.option_map (Json.lookup j "d_b_engine_version_description") String.of_json - ; default_character_set = - Util.option_map (Json.lookup j "default_character_set") CharacterSet.of_json - ; supported_character_sets = - SupportedCharacterSetsList.of_json - (Util.of_option_exn (Json.lookup j "supported_character_sets")) - } -end - -module DBSnapshot = struct - type t = - { d_b_snapshot_identifier : String.t option - ; d_b_instance_identifier : String.t option - ; snapshot_create_time : DateTime.t option - ; engine : String.t option - ; allocated_storage : Integer.t option - ; status : String.t option - ; port : Integer.t option - ; availability_zone : String.t option - ; vpc_id : String.t option - ; instance_create_time : DateTime.t option - ; master_username : String.t option - ; engine_version : String.t option - ; license_model : String.t option - ; snapshot_type : String.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; percent_progress : Integer.t option - ; source_region : String.t option - ; source_d_b_snapshot_identifier : String.t option - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; encrypted : Boolean.t option - ; kms_key_id : String.t option - } - - let make - ?d_b_snapshot_identifier - ?d_b_instance_identifier - ?snapshot_create_time - ?engine - ?allocated_storage - ?status - ?port - ?availability_zone - ?vpc_id - ?instance_create_time - ?master_username - ?engine_version - ?license_model - ?snapshot_type - ?iops - ?option_group_name - ?percent_progress - ?source_region - ?source_d_b_snapshot_identifier - ?storage_type - ?tde_credential_arn - ?encrypted - ?kms_key_id - () = - { d_b_snapshot_identifier - ; d_b_instance_identifier - ; snapshot_create_time - ; engine - ; allocated_storage - ; status - ; port - ; availability_zone - ; vpc_id - ; instance_create_time - ; master_username - ; engine_version - ; license_model - ; snapshot_type - ; iops - ; option_group_name - ; percent_progress - ; source_region - ; source_d_b_snapshot_identifier - ; storage_type - ; tde_credential_arn - ; encrypted - ; kms_key_id - } - - let parse xml = - Some - { d_b_snapshot_identifier = - Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) String.parse - ; d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; snapshot_create_time = - Util.option_bind (Xml.member "SnapshotCreateTime" xml) DateTime.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; instance_create_time = - Util.option_bind (Xml.member "InstanceCreateTime" xml) DateTime.parse - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; snapshot_type = Util.option_bind (Xml.member "SnapshotType" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; percent_progress = - Util.option_bind (Xml.member "PercentProgress" xml) Integer.parse - ; source_region = Util.option_bind (Xml.member "SourceRegion" xml) String.parse - ; source_d_b_snapshot_identifier = - Util.option_bind (Xml.member "SourceDBSnapshotIdentifier" xml) String.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; encrypted = Util.option_bind (Xml.member "Encrypted" xml) Boolean.parse - ; kms_key_id = Util.option_bind (Xml.member "KmsKeyId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Util.option_map v.encrypted (fun f -> - Query.Pair ("Encrypted", Boolean.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.source_d_b_snapshot_identifier (fun f -> - Query.Pair ("SourceDBSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.source_region (fun f -> - Query.Pair ("SourceRegion", String.to_query f)) - ; Util.option_map v.percent_progress (fun f -> - Query.Pair ("PercentProgress", Integer.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.snapshot_type (fun f -> - Query.Pair ("SnapshotType", String.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Util.option_map v.instance_create_time (fun f -> - Query.Pair ("InstanceCreateTime", DateTime.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.snapshot_create_time (fun f -> - Query.Pair ("SnapshotCreateTime", DateTime.to_query f)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ; Util.option_map v.d_b_snapshot_identifier (fun f -> - Query.Pair ("DBSnapshotIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Util.option_map v.encrypted (fun f -> "encrypted", Boolean.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.source_d_b_snapshot_identifier (fun f -> - "source_d_b_snapshot_identifier", String.to_json f) - ; Util.option_map v.source_region (fun f -> "source_region", String.to_json f) - ; Util.option_map v.percent_progress (fun f -> - "percent_progress", Integer.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.snapshot_type (fun f -> "snapshot_type", String.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Util.option_map v.instance_create_time (fun f -> - "instance_create_time", DateTime.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.snapshot_create_time (fun f -> - "snapshot_create_time", DateTime.to_json f) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ; Util.option_map v.d_b_snapshot_identifier (fun f -> - "d_b_snapshot_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_snapshot_identifier = - Util.option_map (Json.lookup j "d_b_snapshot_identifier") String.of_json - ; d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; snapshot_create_time = - Util.option_map (Json.lookup j "snapshot_create_time") DateTime.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; instance_create_time = - Util.option_map (Json.lookup j "instance_create_time") DateTime.of_json - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; snapshot_type = Util.option_map (Json.lookup j "snapshot_type") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; percent_progress = - Util.option_map (Json.lookup j "percent_progress") Integer.of_json - ; source_region = Util.option_map (Json.lookup j "source_region") String.of_json - ; source_d_b_snapshot_identifier = - Util.option_map (Json.lookup j "source_d_b_snapshot_identifier") String.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; encrypted = Util.option_map (Json.lookup j "encrypted") Boolean.of_json - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - } -end - -module EventCategoriesMap = struct - type t = - { source_type : String.t option - ; event_categories : EventCategoriesList.t - } - - let make ?source_type ?(event_categories = []) () = { source_type; event_categories } - - let parse xml = - Some - { source_type = Util.option_bind (Xml.member "SourceType" xml) String.parse - ; event_categories = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategories" xml) - EventCategoriesList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AvailabilityZones.member", + (AvailabilityZoneList.to_query v.availability_zones))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.supports_iops + (fun f -> ("supports_iops", (Boolean.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.supports_storage_encryption + (fun f -> ("supports_storage_encryption", (Boolean.to_json f))); + Util.option_map v.vpc (fun f -> ("vpc", (Boolean.to_json f))); + Util.option_map v.read_replica_capable + (fun f -> ("read_replica_capable", (Boolean.to_json f))); + Util.option_map v.multi_a_z_capable + (fun f -> ("multi_a_z_capable", (Boolean.to_json f))); + Some + ("availability_zones", + (AvailabilityZoneList.to_json v.availability_zones)); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f)))]) + let of_json j = + { + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + availability_zones = + (AvailabilityZoneList.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + multi_a_z_capable = + (Util.option_map (Json.lookup j "multi_a_z_capable") + Boolean.of_json); + read_replica_capable = + (Util.option_map (Json.lookup j "read_replica_capable") + Boolean.of_json); + vpc = (Util.option_map (Json.lookup j "vpc") Boolean.of_json); + supports_storage_encryption = + (Util.option_map (Json.lookup j "supports_storage_encryption") + Boolean.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + supports_iops = + (Util.option_map (Json.lookup j "supports_iops") Boolean.of_json) + } + end +module DBClusterSnapshot = + struct + type t = + { + availability_zones: AvailabilityZones.t ; + d_b_cluster_snapshot_identifier: String.t option ; + d_b_cluster_identifier: String.t option ; + snapshot_create_time: DateTime.t option ; + engine: String.t option ; + allocated_storage: Integer.t option ; + status: String.t option ; + port: Integer.t option ; + vpc_id: String.t option ; + cluster_create_time: DateTime.t option ; + master_username: String.t option ; + engine_version: String.t option ; + license_model: String.t option ; + snapshot_type: String.t option ; + percent_progress: Integer.t option } + let make ?(availability_zones= []) ?d_b_cluster_snapshot_identifier + ?d_b_cluster_identifier ?snapshot_create_time ?engine + ?allocated_storage ?status ?port ?vpc_id ?cluster_create_time + ?master_username ?engine_version ?license_model ?snapshot_type + ?percent_progress () = + { + availability_zones; + d_b_cluster_snapshot_identifier; + d_b_cluster_identifier; + snapshot_create_time; + engine; + allocated_storage; + status; + port; + vpc_id; + cluster_create_time; + master_username; + engine_version; + license_model; + snapshot_type; + percent_progress + } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + d_b_cluster_snapshot_identifier = + (Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) + String.parse); + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + snapshot_create_time = + (Util.option_bind (Xml.member "SnapshotCreateTime" xml) + DateTime.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + cluster_create_time = + (Util.option_bind (Xml.member "ClusterCreateTime" xml) + DateTime.parse); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + snapshot_type = + (Util.option_bind (Xml.member "SnapshotType" xml) String.parse); + percent_progress = + (Util.option_bind (Xml.member "PercentProgress" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.percent_progress + (fun f -> Query.Pair ("PercentProgress", (Integer.to_query f))); + Util.option_map v.snapshot_type + (fun f -> Query.Pair ("SnapshotType", (String.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Util.option_map v.cluster_create_time + (fun f -> + Query.Pair ("ClusterCreateTime", (DateTime.to_query f))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.snapshot_create_time + (fun f -> + Query.Pair ("SnapshotCreateTime", (DateTime.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f))); + Util.option_map v.d_b_cluster_snapshot_identifier + (fun f -> + Query.Pair + ("DBClusterSnapshotIdentifier", (String.to_query f))); + Some (Query.Pair - ("EventCategories.member", EventCategoriesList.to_query v.event_categories)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("event_categories", EventCategoriesList.to_json v.event_categories) - ; Util.option_map v.source_type (fun f -> "source_type", String.to_json f) - ]) - - let of_json j = - { source_type = Util.option_map (Json.lookup j "source_type") String.of_json - ; event_categories = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories")) - } -end - -module DBInstance = struct - type t = - { d_b_instance_identifier : String.t option - ; d_b_instance_class : String.t option - ; engine : String.t option - ; d_b_instance_status : String.t option - ; master_username : String.t option - ; d_b_name : String.t option - ; endpoint : Endpoint.t option - ; allocated_storage : Integer.t option - ; instance_create_time : DateTime.t option - ; preferred_backup_window : String.t option - ; backup_retention_period : Integer.t option - ; d_b_security_groups : DBSecurityGroupMembershipList.t - ; vpc_security_groups : VpcSecurityGroupMembershipList.t - ; d_b_parameter_groups : DBParameterGroupStatusList.t - ; availability_zone : String.t option - ; d_b_subnet_group : DBSubnetGroup.t option - ; preferred_maintenance_window : String.t option - ; pending_modified_values : PendingModifiedValues.t option - ; latest_restorable_time : DateTime.t option - ; multi_a_z : Boolean.t option - ; engine_version : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; read_replica_source_d_b_instance_identifier : String.t option - ; read_replica_d_b_instance_identifiers : ReadReplicaDBInstanceIdentifierList.t - ; license_model : String.t option - ; iops : Integer.t option - ; option_group_memberships : OptionGroupMembershipList.t - ; character_set_name : String.t option - ; secondary_availability_zone : String.t option - ; publicly_accessible : Boolean.t option - ; status_infos : DBInstanceStatusInfoList.t - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; db_instance_port : Integer.t option - ; d_b_cluster_identifier : String.t option - ; storage_encrypted : Boolean.t option - ; kms_key_id : String.t option - ; dbi_resource_id : String.t option - ; c_a_certificate_identifier : String.t option - ; domain_memberships : DomainMembershipList.t - ; copy_tags_to_snapshot : Boolean.t option - } - - let make - ?d_b_instance_identifier - ?d_b_instance_class - ?engine - ?d_b_instance_status - ?master_username - ?d_b_name - ?endpoint - ?allocated_storage - ?instance_create_time - ?preferred_backup_window - ?backup_retention_period - ?(d_b_security_groups = []) - ?(vpc_security_groups = []) - ?(d_b_parameter_groups = []) - ?availability_zone - ?d_b_subnet_group - ?preferred_maintenance_window - ?pending_modified_values - ?latest_restorable_time - ?multi_a_z - ?engine_version - ?auto_minor_version_upgrade - ?read_replica_source_d_b_instance_identifier - ?(read_replica_d_b_instance_identifiers = []) - ?license_model - ?iops - ?(option_group_memberships = []) - ?character_set_name - ?secondary_availability_zone - ?publicly_accessible - ?(status_infos = []) - ?storage_type - ?tde_credential_arn - ?db_instance_port - ?d_b_cluster_identifier - ?storage_encrypted - ?kms_key_id - ?dbi_resource_id - ?c_a_certificate_identifier - ?(domain_memberships = []) - ?copy_tags_to_snapshot - () = - { d_b_instance_identifier - ; d_b_instance_class - ; engine - ; d_b_instance_status - ; master_username - ; d_b_name - ; endpoint - ; allocated_storage - ; instance_create_time - ; preferred_backup_window - ; backup_retention_period - ; d_b_security_groups - ; vpc_security_groups - ; d_b_parameter_groups - ; availability_zone - ; d_b_subnet_group - ; preferred_maintenance_window - ; pending_modified_values - ; latest_restorable_time - ; multi_a_z - ; engine_version - ; auto_minor_version_upgrade - ; read_replica_source_d_b_instance_identifier - ; read_replica_d_b_instance_identifiers - ; license_model - ; iops - ; option_group_memberships - ; character_set_name - ; secondary_availability_zone - ; publicly_accessible - ; status_infos - ; storage_type - ; tde_credential_arn - ; db_instance_port - ; d_b_cluster_identifier - ; storage_encrypted - ; kms_key_id - ; dbi_resource_id - ; c_a_certificate_identifier - ; domain_memberships - ; copy_tags_to_snapshot - } - - let parse xml = - Some - { d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; d_b_instance_status = - Util.option_bind (Xml.member "DBInstanceStatus" xml) String.parse - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; d_b_name = Util.option_bind (Xml.member "DBName" xml) String.parse - ; endpoint = Util.option_bind (Xml.member "Endpoint" xml) Endpoint.parse - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; instance_create_time = - Util.option_bind (Xml.member "InstanceCreateTime" xml) DateTime.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; d_b_security_groups = - Util.of_option - [] + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.percent_progress + (fun f -> ("percent_progress", (Integer.to_json f))); + Util.option_map v.snapshot_type + (fun f -> ("snapshot_type", (String.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Util.option_map v.cluster_create_time + (fun f -> ("cluster_create_time", (DateTime.to_json f))); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.snapshot_create_time + (fun f -> ("snapshot_create_time", (DateTime.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f))); + Util.option_map v.d_b_cluster_snapshot_identifier + (fun f -> + ("d_b_cluster_snapshot_identifier", (String.to_json f))); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + d_b_cluster_snapshot_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_snapshot_identifier") + String.of_json); + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + snapshot_create_time = + (Util.option_map (Json.lookup j "snapshot_create_time") + DateTime.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + cluster_create_time = + (Util.option_map (Json.lookup j "cluster_create_time") + DateTime.of_json); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + snapshot_type = + (Util.option_map (Json.lookup j "snapshot_type") String.of_json); + percent_progress = + (Util.option_map (Json.lookup j "percent_progress") Integer.of_json) + } + end +module ReservedDBInstancesOffering = + struct + type t = + { + reserved_d_b_instances_offering_id: String.t option ; + d_b_instance_class: String.t option ; + duration: Integer.t option ; + fixed_price: Double.t option ; + usage_price: Double.t option ; + currency_code: String.t option ; + product_description: String.t option ; + offering_type: String.t option ; + multi_a_z: Boolean.t option ; + recurring_charges: RecurringChargeList.t } + let make ?reserved_d_b_instances_offering_id ?d_b_instance_class + ?duration ?fixed_price ?usage_price ?currency_code + ?product_description ?offering_type ?multi_a_z ?(recurring_charges= + []) () = + { + reserved_d_b_instances_offering_id; + d_b_instance_class; + duration; + fixed_price; + usage_price; + currency_code; + product_description; + offering_type; + multi_a_z; + recurring_charges + } + let parse xml = + Some + { + reserved_d_b_instances_offering_id = (Util.option_bind - (Xml.member "DBSecurityGroups" xml) - DBSecurityGroupMembershipList.parse) - ; vpc_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroups" xml) - VpcSecurityGroupMembershipList.parse) - ; d_b_parameter_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBParameterGroups" xml) - DBParameterGroupStatusList.parse) - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; d_b_subnet_group = - Util.option_bind (Xml.member "DBSubnetGroup" xml) DBSubnetGroup.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; pending_modified_values = - Util.option_bind - (Xml.member "PendingModifiedValues" xml) - PendingModifiedValues.parse - ; latest_restorable_time = - Util.option_bind (Xml.member "LatestRestorableTime" xml) DateTime.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; read_replica_source_d_b_instance_identifier = - Util.option_bind - (Xml.member "ReadReplicaSourceDBInstanceIdentifier" xml) - String.parse - ; read_replica_d_b_instance_identifiers = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReadReplicaDBInstanceIdentifiers" xml) - ReadReplicaDBInstanceIdentifierList.parse) - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_memberships = - Util.of_option - [] - (Util.option_bind - (Xml.member "OptionGroupMemberships" xml) - OptionGroupMembershipList.parse) - ; character_set_name = - Util.option_bind (Xml.member "CharacterSetName" xml) String.parse - ; secondary_availability_zone = - Util.option_bind (Xml.member "SecondaryAvailabilityZone" xml) String.parse - ; publicly_accessible = - Util.option_bind (Xml.member "PubliclyAccessible" xml) Boolean.parse - ; status_infos = - Util.of_option - [] - (Util.option_bind - (Xml.member "StatusInfos" xml) - DBInstanceStatusInfoList.parse) - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; db_instance_port = - Util.option_bind (Xml.member "DbInstancePort" xml) Integer.parse - ; d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; storage_encrypted = - Util.option_bind (Xml.member "StorageEncrypted" xml) Boolean.parse - ; kms_key_id = Util.option_bind (Xml.member "KmsKeyId" xml) String.parse - ; dbi_resource_id = Util.option_bind (Xml.member "DbiResourceId" xml) String.parse - ; c_a_certificate_identifier = - Util.option_bind (Xml.member "CACertificateIdentifier" xml) String.parse - ; domain_memberships = - Util.of_option - [] - (Util.option_bind - (Xml.member "DomainMemberships" xml) - DomainMembershipList.parse) - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Some + (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + fixed_price = + (Util.option_bind (Xml.member "FixedPrice" xml) Double.parse); + usage_price = + (Util.option_bind (Xml.member "UsagePrice" xml) Double.parse); + currency_code = + (Util.option_bind (Xml.member "CurrencyCode" xml) String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + recurring_charges = + (Util.of_option [] + (Util.option_bind (Xml.member "RecurringCharges" xml) + RecurringChargeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RecurringCharges.member", + (RecurringChargeList.to_query v.recurring_charges))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.currency_code + (fun f -> Query.Pair ("CurrencyCode", (String.to_query f))); + Util.option_map v.usage_price + (fun f -> Query.Pair ("UsagePrice", (Double.to_query f))); + Util.option_map v.fixed_price + (fun f -> Query.Pair ("FixedPrice", (Double.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + Query.Pair + ("ReservedDBInstancesOfferingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("recurring_charges", + (RecurringChargeList.to_json v.recurring_charges)); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.currency_code + (fun f -> ("currency_code", (String.to_json f))); + Util.option_map v.usage_price + (fun f -> ("usage_price", (Double.to_json f))); + Util.option_map v.fixed_price + (fun f -> ("fixed_price", (Double.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + ("reserved_d_b_instances_offering_id", (String.to_json f)))]) + let of_json j = + { + reserved_d_b_instances_offering_id = + (Util.option_map + (Json.lookup j "reserved_d_b_instances_offering_id") + String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + fixed_price = + (Util.option_map (Json.lookup j "fixed_price") Double.of_json); + usage_price = + (Util.option_map (Json.lookup j "usage_price") Double.of_json); + currency_code = + (Util.option_map (Json.lookup j "currency_code") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + recurring_charges = + (RecurringChargeList.of_json + (Util.of_option_exn (Json.lookup j "recurring_charges"))) + } + end +module DBCluster = + struct + type t = + { + allocated_storage: Integer.t option ; + availability_zones: AvailabilityZones.t ; + backup_retention_period: Integer.t option ; + character_set_name: String.t option ; + database_name: String.t option ; + d_b_cluster_identifier: String.t option ; + d_b_cluster_parameter_group: String.t option ; + d_b_subnet_group: String.t option ; + status: String.t option ; + percent_progress: String.t option ; + earliest_restorable_time: DateTime.t option ; + endpoint: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + latest_restorable_time: DateTime.t option ; + port: Integer.t option ; + master_username: String.t option ; + d_b_cluster_option_group_memberships: DBClusterOptionGroupMemberships.t ; + preferred_backup_window: String.t option ; + preferred_maintenance_window: String.t option ; + d_b_cluster_members: DBClusterMemberList.t ; + vpc_security_groups: VpcSecurityGroupMembershipList.t } + let make ?allocated_storage ?(availability_zones= []) + ?backup_retention_period ?character_set_name ?database_name + ?d_b_cluster_identifier ?d_b_cluster_parameter_group + ?d_b_subnet_group ?status ?percent_progress + ?earliest_restorable_time ?endpoint ?engine ?engine_version + ?latest_restorable_time ?port ?master_username + ?(d_b_cluster_option_group_memberships= []) ?preferred_backup_window + ?preferred_maintenance_window ?(d_b_cluster_members= []) + ?(vpc_security_groups= []) () = + { + allocated_storage; + availability_zones; + backup_retention_period; + character_set_name; + database_name; + d_b_cluster_identifier; + d_b_cluster_parameter_group; + d_b_subnet_group; + status; + percent_progress; + earliest_restorable_time; + endpoint; + engine; + engine_version; + latest_restorable_time; + port; + master_username; + d_b_cluster_option_group_memberships; + preferred_backup_window; + preferred_maintenance_window; + d_b_cluster_members; + vpc_security_groups + } + let parse xml = + Some + { + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + character_set_name = + (Util.option_bind (Xml.member "CharacterSetName" xml) + String.parse); + database_name = + (Util.option_bind (Xml.member "DatabaseName" xml) String.parse); + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + d_b_cluster_parameter_group = + (Util.option_bind (Xml.member "DBClusterParameterGroup" xml) + String.parse); + d_b_subnet_group = + (Util.option_bind (Xml.member "DBSubnetGroup" xml) String.parse); + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + percent_progress = + (Util.option_bind (Xml.member "PercentProgress" xml) String.parse); + earliest_restorable_time = + (Util.option_bind (Xml.member "EarliestRestorableTime" xml) + DateTime.parse); + endpoint = + (Util.option_bind (Xml.member "Endpoint" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + latest_restorable_time = + (Util.option_bind (Xml.member "LatestRestorableTime" xml) + DateTime.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + d_b_cluster_option_group_memberships = + (Util.of_option [] + (Util.option_bind + (Xml.member "DBClusterOptionGroupMemberships" xml) + DBClusterOptionGroupMemberships.parse)); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + d_b_cluster_members = + (Util.of_option [] + (Util.option_bind (Xml.member "DBClusterMembers" xml) + DBClusterMemberList.parse)); + vpc_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroups" xml) + VpcSecurityGroupMembershipList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VpcSecurityGroups.member", + (VpcSecurityGroupMembershipList.to_query + v.vpc_security_groups))); + Some (Query.Pair - ( "DomainMemberships.member" - , DomainMembershipList.to_query v.domain_memberships )) - ; Util.option_map v.c_a_certificate_identifier (fun f -> - Query.Pair ("CACertificateIdentifier", String.to_query f)) - ; Util.option_map v.dbi_resource_id (fun f -> - Query.Pair ("DbiResourceId", String.to_query f)) - ; Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Util.option_map v.storage_encrypted (fun f -> - Query.Pair ("StorageEncrypted", Boolean.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ; Util.option_map v.db_instance_port (fun f -> - Query.Pair ("DbInstancePort", Integer.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Some + ("DBClusterMembers.member", + (DBClusterMemberList.to_query v.d_b_cluster_members))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Some (Query.Pair - ("StatusInfos.member", DBInstanceStatusInfoList.to_query v.status_infos)) - ; Util.option_map v.publicly_accessible (fun f -> - Query.Pair ("PubliclyAccessible", Boolean.to_query f)) - ; Util.option_map v.secondary_availability_zone (fun f -> - Query.Pair ("SecondaryAvailabilityZone", String.to_query f)) - ; Util.option_map v.character_set_name (fun f -> - Query.Pair ("CharacterSetName", String.to_query f)) - ; Some + ("DBClusterOptionGroupMemberships.member", + (DBClusterOptionGroupMemberships.to_query + v.d_b_cluster_option_group_memberships))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.latest_restorable_time + (fun f -> + Query.Pair ("LatestRestorableTime", (DateTime.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.endpoint + (fun f -> Query.Pair ("Endpoint", (String.to_query f))); + Util.option_map v.earliest_restorable_time + (fun f -> + Query.Pair ("EarliestRestorableTime", (DateTime.to_query f))); + Util.option_map v.percent_progress + (fun f -> Query.Pair ("PercentProgress", (String.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f))); + Util.option_map v.d_b_subnet_group + (fun f -> Query.Pair ("DBSubnetGroup", (String.to_query f))); + Util.option_map v.d_b_cluster_parameter_group + (fun f -> + Query.Pair ("DBClusterParameterGroup", (String.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f))); + Util.option_map v.database_name + (fun f -> Query.Pair ("DatabaseName", (String.to_query f))); + Util.option_map v.character_set_name + (fun f -> Query.Pair ("CharacterSetName", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Some (Query.Pair - ( "OptionGroupMemberships.member" - , OptionGroupMembershipList.to_query v.option_group_memberships )) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("vpc_security_groups", + (VpcSecurityGroupMembershipList.to_json v.vpc_security_groups)); + Some + ("d_b_cluster_members", + (DBClusterMemberList.to_json v.d_b_cluster_members)); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Some + ("d_b_cluster_option_group_memberships", + (DBClusterOptionGroupMemberships.to_json + v.d_b_cluster_option_group_memberships)); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.latest_restorable_time + (fun f -> ("latest_restorable_time", (DateTime.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.endpoint + (fun f -> ("endpoint", (String.to_json f))); + Util.option_map v.earliest_restorable_time + (fun f -> ("earliest_restorable_time", (DateTime.to_json f))); + Util.option_map v.percent_progress + (fun f -> ("percent_progress", (String.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f))); + Util.option_map v.d_b_subnet_group + (fun f -> ("d_b_subnet_group", (String.to_json f))); + Util.option_map v.d_b_cluster_parameter_group + (fun f -> ("d_b_cluster_parameter_group", (String.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f))); + Util.option_map v.database_name + (fun f -> ("database_name", (String.to_json f))); + Util.option_map v.character_set_name + (fun f -> ("character_set_name", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones)); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f)))]) + let of_json j = + { + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + character_set_name = + (Util.option_map (Json.lookup j "character_set_name") + String.of_json); + database_name = + (Util.option_map (Json.lookup j "database_name") String.of_json); + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + d_b_cluster_parameter_group = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group") + String.of_json); + d_b_subnet_group = + (Util.option_map (Json.lookup j "d_b_subnet_group") String.of_json); + status = (Util.option_map (Json.lookup j "status") String.of_json); + percent_progress = + (Util.option_map (Json.lookup j "percent_progress") String.of_json); + earliest_restorable_time = + (Util.option_map (Json.lookup j "earliest_restorable_time") + DateTime.of_json); + endpoint = + (Util.option_map (Json.lookup j "endpoint") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + latest_restorable_time = + (Util.option_map (Json.lookup j "latest_restorable_time") + DateTime.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + d_b_cluster_option_group_memberships = + (DBClusterOptionGroupMemberships.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_option_group_memberships"))); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + d_b_cluster_members = + (DBClusterMemberList.of_json + (Util.of_option_exn (Json.lookup j "d_b_cluster_members"))); + vpc_security_groups = + (VpcSecurityGroupMembershipList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_groups"))) + } + end +module DBSecurityGroup = + struct + type t = + { + owner_id: String.t option ; + d_b_security_group_name: String.t option ; + d_b_security_group_description: String.t option ; + vpc_id: String.t option ; + e_c2_security_groups: EC2SecurityGroupList.t ; + i_p_ranges: IPRangeList.t } + let make ?owner_id ?d_b_security_group_name + ?d_b_security_group_description ?vpc_id ?(e_c2_security_groups= []) + ?(i_p_ranges= []) () = + { + owner_id; + d_b_security_group_name; + d_b_security_group_description; + vpc_id; + e_c2_security_groups; + i_p_ranges + } + let parse xml = + Some + { + owner_id = + (Util.option_bind (Xml.member "OwnerId" xml) String.parse); + d_b_security_group_name = + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse); + d_b_security_group_description = + (Util.option_bind (Xml.member "DBSecurityGroupDescription" xml) + String.parse); + vpc_id = (Util.option_bind (Xml.member "VpcId" xml) String.parse); + e_c2_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "EC2SecurityGroups" xml) + EC2SecurityGroupList.parse)); + i_p_ranges = + (Util.of_option [] + (Util.option_bind (Xml.member "IPRanges" xml) + IPRangeList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("IPRanges.member", (IPRangeList.to_query v.i_p_ranges))); + Some (Query.Pair - ( "ReadReplicaDBInstanceIdentifiers.member" - , ReadReplicaDBInstanceIdentifierList.to_query - v.read_replica_d_b_instance_identifiers )) - ; Util.option_map v.read_replica_source_d_b_instance_identifier (fun f -> - Query.Pair ("ReadReplicaSourceDBInstanceIdentifier", String.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.latest_restorable_time (fun f -> - Query.Pair ("LatestRestorableTime", DateTime.to_query f)) - ; Util.option_map v.pending_modified_values (fun f -> - Query.Pair ("PendingModifiedValues", PendingModifiedValues.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.d_b_subnet_group (fun f -> - Query.Pair ("DBSubnetGroup", DBSubnetGroup.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Some + ("EC2SecurityGroups.member", + (EC2SecurityGroupList.to_query v.e_c2_security_groups))); + Util.option_map v.vpc_id + (fun f -> Query.Pair ("VpcId", (String.to_query f))); + Util.option_map v.d_b_security_group_description + (fun f -> + Query.Pair + ("DBSecurityGroupDescription", (String.to_query f))); + Util.option_map v.d_b_security_group_name + (fun f -> + Query.Pair ("DBSecurityGroupName", (String.to_query f))); + Util.option_map v.owner_id + (fun f -> Query.Pair ("OwnerId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("i_p_ranges", (IPRangeList.to_json v.i_p_ranges)); + Some + ("e_c2_security_groups", + (EC2SecurityGroupList.to_json v.e_c2_security_groups)); + Util.option_map v.vpc_id (fun f -> ("vpc_id", (String.to_json f))); + Util.option_map v.d_b_security_group_description + (fun f -> ("d_b_security_group_description", (String.to_json f))); + Util.option_map v.d_b_security_group_name + (fun f -> ("d_b_security_group_name", (String.to_json f))); + Util.option_map v.owner_id + (fun f -> ("owner_id", (String.to_json f)))]) + let of_json j = + { + owner_id = + (Util.option_map (Json.lookup j "owner_id") String.of_json); + d_b_security_group_name = + (Util.option_map (Json.lookup j "d_b_security_group_name") + String.of_json); + d_b_security_group_description = + (Util.option_map (Json.lookup j "d_b_security_group_description") + String.of_json); + vpc_id = (Util.option_map (Json.lookup j "vpc_id") String.of_json); + e_c2_security_groups = + (EC2SecurityGroupList.of_json + (Util.of_option_exn (Json.lookup j "e_c2_security_groups"))); + i_p_ranges = + (IPRangeList.of_json + (Util.of_option_exn (Json.lookup j "i_p_ranges"))) + } + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module OptionGroupOptionsList = + struct + type t = OptionGroupOption.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionGroupOption.parse + (Xml.members "OptionGroupOption" xml)) + let to_query v = Query.to_query_list OptionGroupOption.to_query v + let to_json v = `List (List.map OptionGroupOption.to_json v) + let of_json j = Json.to_list OptionGroupOption.of_json j + end +module FilterList = + struct + type t = Filter.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Filter.parse (Xml.members "Filter" xml)) + let to_query v = Query.to_query_list Filter.to_query v + let to_json v = `List (List.map Filter.to_json v) + let of_json j = Json.to_list Filter.of_json j + end +module SubnetIdentifierList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "SubnetIdentifier" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module EngineDefaults = + struct + type t = + { + d_b_parameter_group_family: String.t option ; + marker: String.t option ; + parameters: ParametersList.t } + let make ?d_b_parameter_group_family ?marker ?(parameters= []) () = + { d_b_parameter_group_family; marker; parameters } + let parse xml = + Some + { + d_b_parameter_group_family = + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", + (ParametersList.to_query v.parameters))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> + Query.Pair ("DBParameterGroupFamily", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (ParametersList.to_json v.parameters)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.d_b_parameter_group_family + (fun f -> ("d_b_parameter_group_family", (String.to_json f)))]) + let of_json j = + { + d_b_parameter_group_family = + (Util.option_map (Json.lookup j "d_b_parameter_group_family") + String.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module EventSubscriptionsList = + struct + type t = EventSubscription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map EventSubscription.parse + (Xml.members "EventSubscription" xml)) + let to_query v = Query.to_query_list EventSubscription.to_query v + let to_json v = `List (List.map EventSubscription.to_json v) + let of_json j = Json.to_list EventSubscription.of_json j + end +module OptionConfigurationList = + struct + type t = OptionConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionConfiguration.parse + (Xml.members "OptionConfiguration" xml)) + let to_query v = Query.to_query_list OptionConfiguration.to_query v + let to_json v = `List (List.map OptionConfiguration.to_json v) + let of_json j = Json.to_list OptionConfiguration.of_json j + end +module OptionNamesList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReservedDBInstanceList = + struct + type t = ReservedDBInstance.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedDBInstance.parse + (Xml.members "ReservedDBInstance" xml)) + let to_query v = Query.to_query_list ReservedDBInstance.to_query v + let to_json v = `List (List.map ReservedDBInstance.to_json v) + let of_json j = Json.to_list ReservedDBInstance.of_json j + end +module PendingMaintenanceActions = + struct + type t = ResourcePendingMaintenanceActions.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ResourcePendingMaintenanceActions.parse + (Xml.members "ResourcePendingMaintenanceActions" xml)) + let to_query v = + Query.to_query_list ResourcePendingMaintenanceActions.to_query v + let to_json v = + `List (List.map ResourcePendingMaintenanceActions.to_json v) + let of_json j = Json.to_list ResourcePendingMaintenanceActions.of_json j + end +module DBSubnetGroups = + struct + type t = DBSubnetGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBSubnetGroup.parse (Xml.members "DBSubnetGroup" xml)) + let to_query v = Query.to_query_list DBSubnetGroup.to_query v + let to_json v = `List (List.map DBSubnetGroup.to_json v) + let of_json j = Json.to_list DBSubnetGroup.of_json j + end +module DBEngineVersionList = + struct + type t = DBEngineVersion.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBEngineVersion.parse (Xml.members "DBEngineVersion" xml)) + let to_query v = Query.to_query_list DBEngineVersion.to_query v + let to_json v = `List (List.map DBEngineVersion.to_json v) + let of_json j = Json.to_list DBEngineVersion.of_json j + end +module DBSnapshotList = + struct + type t = DBSnapshot.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBSnapshot.parse (Xml.members "DBSnapshot" xml)) + let to_query v = Query.to_query_list DBSnapshot.to_query v + let to_json v = `List (List.map DBSnapshot.to_json v) + let of_json j = Json.to_list DBSnapshot.of_json j + end +module EventCategoriesMapList = + struct + type t = EventCategoriesMap.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map EventCategoriesMap.parse + (Xml.members "EventCategoriesMap" xml)) + let to_query v = Query.to_query_list EventCategoriesMap.to_query v + let to_json v = `List (List.map EventCategoriesMap.to_json v) + let of_json j = Json.to_list EventCategoriesMap.of_json j + end +module DBInstanceList = + struct + type t = DBInstance.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBInstance.parse (Xml.members "DBInstance" xml)) + let to_query v = Query.to_query_list DBInstance.to_query v + let to_json v = `List (List.map DBInstance.to_json v) + let of_json j = Json.to_list DBInstance.of_json j + end +module AccountQuotaList = + struct + type t = AccountQuota.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AccountQuota.parse (Xml.members "AccountQuota" xml)) + let to_query v = Query.to_query_list AccountQuota.to_query v + let to_json v = `List (List.map AccountQuota.to_json v) + let of_json j = Json.to_list AccountQuota.of_json j + end +module DBClusterParameterGroupList = + struct + type t = DBClusterParameterGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBClusterParameterGroup.parse + (Xml.members "DBClusterParameterGroup" xml)) + let to_query v = Query.to_query_list DBClusterParameterGroup.to_query v + let to_json v = `List (List.map DBClusterParameterGroup.to_json v) + let of_json j = Json.to_list DBClusterParameterGroup.of_json j + end +module DescribeDBLogFilesList = + struct + type t = DescribeDBLogFilesDetails.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DescribeDBLogFilesDetails.parse + (Xml.members "DescribeDBLogFilesDetails" xml)) + let to_query v = Query.to_query_list DescribeDBLogFilesDetails.to_query v + let to_json v = `List (List.map DescribeDBLogFilesDetails.to_json v) + let of_json j = Json.to_list DescribeDBLogFilesDetails.of_json j + end +module DBParameterGroupList = + struct + type t = DBParameterGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBParameterGroup.parse (Xml.members "DBParameterGroup" xml)) + let to_query v = Query.to_query_list DBParameterGroup.to_query v + let to_json v = `List (List.map DBParameterGroup.to_json v) + let of_json j = Json.to_list DBParameterGroup.of_json j + end +module EventList = + struct + type t = Event.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Event.parse (Xml.members "Event" xml)) + let to_query v = Query.to_query_list Event.to_query v + let to_json v = `List (List.map Event.to_json v) + let of_json j = Json.to_list Event.of_json j + end +module CertificateList = + struct + type t = Certificate.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Certificate.parse (Xml.members "Certificate" xml)) + let to_query v = Query.to_query_list Certificate.to_query v + let to_json v = `List (List.map Certificate.to_json v) + let of_json j = Json.to_list Certificate.of_json j + end +module OptionGroupsList = + struct + type t = OptionGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OptionGroup.parse (Xml.members "OptionGroup" xml)) + let to_query v = Query.to_query_list OptionGroup.to_query v + let to_json v = `List (List.map OptionGroup.to_json v) + let of_json j = Json.to_list OptionGroup.of_json j + end +module OrderableDBInstanceOptionsList = + struct + type t = OrderableDBInstanceOption.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map OrderableDBInstanceOption.parse + (Xml.members "OrderableDBInstanceOption" xml)) + let to_query v = Query.to_query_list OrderableDBInstanceOption.to_query v + let to_json v = `List (List.map OrderableDBInstanceOption.to_json v) + let of_json j = Json.to_list OrderableDBInstanceOption.of_json j + end +module KeyList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DBClusterSnapshotList = + struct + type t = DBClusterSnapshot.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBClusterSnapshot.parse + (Xml.members "DBClusterSnapshot" xml)) + let to_query v = Query.to_query_list DBClusterSnapshot.to_query v + let to_json v = `List (List.map DBClusterSnapshot.to_json v) + let of_json j = Json.to_list DBClusterSnapshot.of_json j + end +module ReservedDBInstancesOfferingList = + struct + type t = ReservedDBInstancesOffering.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReservedDBInstancesOffering.parse + (Xml.members "ReservedDBInstancesOffering" xml)) + let to_query v = + Query.to_query_list ReservedDBInstancesOffering.to_query v + let to_json v = `List (List.map ReservedDBInstancesOffering.to_json v) + let of_json j = Json.to_list ReservedDBInstancesOffering.of_json j + end +module DBClusterList = + struct + type t = DBCluster.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBCluster.parse (Xml.members "DBCluster" xml)) + let to_query v = Query.to_query_list DBCluster.to_query v + let to_json v = `List (List.map DBCluster.to_json v) + let of_json j = Json.to_list DBCluster.of_json j + end +module DBSecurityGroups = + struct + type t = DBSecurityGroup.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DBSecurityGroup.parse (Xml.members "DBSecurityGroup" xml)) + let to_query v = Query.to_query_list DBSecurityGroup.to_query v + let to_json v = `List (List.map DBSecurityGroup.to_json v) + let of_json j = Json.to_list DBSecurityGroup.of_json j + end +module ModifyDBClusterResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module CopyOptionGroupMessage = + struct + type t = + { + source_option_group_identifier: String.t ; + target_option_group_identifier: String.t ; + target_option_group_description: String.t ; + tags: TagList.t } + let make ~source_option_group_identifier ~target_option_group_identifier + ~target_option_group_description ?(tags= []) () = + { + source_option_group_identifier; + target_option_group_identifier; + target_option_group_description; + tags + } + let parse xml = + Some + { + source_option_group_identifier = + (Xml.required "SourceOptionGroupIdentifier" + (Util.option_bind + (Xml.member "SourceOptionGroupIdentifier" xml) String.parse)); + target_option_group_identifier = + (Xml.required "TargetOptionGroupIdentifier" + (Util.option_bind + (Xml.member "TargetOptionGroupIdentifier" xml) String.parse)); + target_option_group_description = + (Xml.required "TargetOptionGroupDescription" + (Util.option_bind + (Xml.member "TargetOptionGroupDescription" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "DBParameterGroups.member" - , DBParameterGroupStatusList.to_query v.d_b_parameter_groups )) - ; Some + ("TargetOptionGroupDescription", + (String.to_query v.target_option_group_description))); + Some (Query.Pair - ( "VpcSecurityGroups.member" - , VpcSecurityGroupMembershipList.to_query v.vpc_security_groups )) - ; Some + ("TargetOptionGroupIdentifier", + (String.to_query v.target_option_group_identifier))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroupMembershipList.to_query v.d_b_security_groups )) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.instance_create_time (fun f -> - Query.Pair ("InstanceCreateTime", DateTime.to_query f)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Util.option_map v.endpoint (fun f -> - Query.Pair ("Endpoint", Endpoint.to_query f)) - ; Util.option_map v.d_b_name (fun f -> Query.Pair ("DBName", String.to_query f)) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Util.option_map v.d_b_instance_status (fun f -> - Query.Pair ("DBInstanceStatus", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Some ("domain_memberships", DomainMembershipList.to_json v.domain_memberships) - ; Util.option_map v.c_a_certificate_identifier (fun f -> - "c_a_certificate_identifier", String.to_json f) - ; Util.option_map v.dbi_resource_id (fun f -> - "dbi_resource_id", String.to_json f) - ; Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Util.option_map v.storage_encrypted (fun f -> - "storage_encrypted", Boolean.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ; Util.option_map v.db_instance_port (fun f -> - "db_instance_port", Integer.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Some ("status_infos", DBInstanceStatusInfoList.to_json v.status_infos) - ; Util.option_map v.publicly_accessible (fun f -> - "publicly_accessible", Boolean.to_json f) - ; Util.option_map v.secondary_availability_zone (fun f -> - "secondary_availability_zone", String.to_json f) - ; Util.option_map v.character_set_name (fun f -> - "character_set_name", String.to_json f) - ; Some - ( "option_group_memberships" - , OptionGroupMembershipList.to_json v.option_group_memberships ) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Some - ( "read_replica_d_b_instance_identifiers" - , ReadReplicaDBInstanceIdentifierList.to_json - v.read_replica_d_b_instance_identifiers ) - ; Util.option_map v.read_replica_source_d_b_instance_identifier (fun f -> - "read_replica_source_d_b_instance_identifier", String.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.latest_restorable_time (fun f -> - "latest_restorable_time", DateTime.to_json f) - ; Util.option_map v.pending_modified_values (fun f -> - "pending_modified_values", PendingModifiedValues.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.d_b_subnet_group (fun f -> - "d_b_subnet_group", DBSubnetGroup.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Some - ( "d_b_parameter_groups" - , DBParameterGroupStatusList.to_json v.d_b_parameter_groups ) - ; Some - ( "vpc_security_groups" - , VpcSecurityGroupMembershipList.to_json v.vpc_security_groups ) - ; Some - ( "d_b_security_groups" - , DBSecurityGroupMembershipList.to_json v.d_b_security_groups ) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.instance_create_time (fun f -> - "instance_create_time", DateTime.to_json f) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Util.option_map v.endpoint (fun f -> "endpoint", Endpoint.to_json f) - ; Util.option_map v.d_b_name (fun f -> "d_b_name", String.to_json f) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Util.option_map v.d_b_instance_status (fun f -> - "d_b_instance_status", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; d_b_instance_status = - Util.option_map (Json.lookup j "d_b_instance_status") String.of_json - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; d_b_name = Util.option_map (Json.lookup j "d_b_name") String.of_json - ; endpoint = Util.option_map (Json.lookup j "endpoint") Endpoint.of_json - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; instance_create_time = - Util.option_map (Json.lookup j "instance_create_time") DateTime.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; d_b_security_groups = - DBSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - ; vpc_security_groups = - VpcSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_groups")) - ; d_b_parameter_groups = - DBParameterGroupStatusList.of_json - (Util.of_option_exn (Json.lookup j "d_b_parameter_groups")) - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; d_b_subnet_group = - Util.option_map (Json.lookup j "d_b_subnet_group") DBSubnetGroup.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; pending_modified_values = - Util.option_map - (Json.lookup j "pending_modified_values") - PendingModifiedValues.of_json - ; latest_restorable_time = - Util.option_map (Json.lookup j "latest_restorable_time") DateTime.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; read_replica_source_d_b_instance_identifier = - Util.option_map - (Json.lookup j "read_replica_source_d_b_instance_identifier") - String.of_json - ; read_replica_d_b_instance_identifiers = - ReadReplicaDBInstanceIdentifierList.of_json - (Util.of_option_exn (Json.lookup j "read_replica_d_b_instance_identifiers")) - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_memberships = - OptionGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "option_group_memberships")) - ; character_set_name = - Util.option_map (Json.lookup j "character_set_name") String.of_json - ; secondary_availability_zone = - Util.option_map (Json.lookup j "secondary_availability_zone") String.of_json - ; publicly_accessible = - Util.option_map (Json.lookup j "publicly_accessible") Boolean.of_json - ; status_infos = - DBInstanceStatusInfoList.of_json - (Util.of_option_exn (Json.lookup j "status_infos")) - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; db_instance_port = - Util.option_map (Json.lookup j "db_instance_port") Integer.of_json - ; d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; storage_encrypted = - Util.option_map (Json.lookup j "storage_encrypted") Boolean.of_json - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - ; dbi_resource_id = Util.option_map (Json.lookup j "dbi_resource_id") String.of_json - ; c_a_certificate_identifier = - Util.option_map (Json.lookup j "c_a_certificate_identifier") String.of_json - ; domain_memberships = - DomainMembershipList.of_json - (Util.of_option_exn (Json.lookup j "domain_memberships")) - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - } -end - -module AccountQuota = struct - type t = - { account_quota_name : String.t option - ; used : Long.t option - ; max : Long.t option - } - - let make ?account_quota_name ?used ?max () = { account_quota_name; used; max } - - let parse xml = - Some - { account_quota_name = - Util.option_bind (Xml.member "AccountQuotaName" xml) String.parse - ; used = Util.option_bind (Xml.member "Used" xml) Long.parse - ; max = Util.option_bind (Xml.member "Max" xml) Long.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max (fun f -> Query.Pair ("Max", Long.to_query f)) - ; Util.option_map v.used (fun f -> Query.Pair ("Used", Long.to_query f)) - ; Util.option_map v.account_quota_name (fun f -> - Query.Pair ("AccountQuotaName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max (fun f -> "max", Long.to_json f) - ; Util.option_map v.used (fun f -> "used", Long.to_json f) - ; Util.option_map v.account_quota_name (fun f -> - "account_quota_name", String.to_json f) - ]) - - let of_json j = - { account_quota_name = - Util.option_map (Json.lookup j "account_quota_name") String.of_json - ; used = Util.option_map (Json.lookup j "used") Long.of_json - ; max = Util.option_map (Json.lookup j "max") Long.of_json - } -end - -module DBClusterParameterGroup = struct - type t = - { d_b_cluster_parameter_group_name : String.t option - ; d_b_parameter_group_family : String.t option - ; description : String.t option - } - - let make ?d_b_cluster_parameter_group_name ?d_b_parameter_group_family ?description () = - { d_b_cluster_parameter_group_name; d_b_parameter_group_family; description } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse - ; d_b_parameter_group_family = - Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - Query.Pair ("DBParameterGroupFamily", String.to_query f)) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - Query.Pair ("DBClusterParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - "d_b_parameter_group_family", String.to_json f) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - "d_b_cluster_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") String.of_json - ; d_b_parameter_group_family = - Util.option_map (Json.lookup j "d_b_parameter_group_family") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module DescribeDBLogFilesDetails = struct - type t = - { log_file_name : String.t option - ; last_written : Long.t option - ; size : Long.t option - } - - let make ?log_file_name ?last_written ?size () = { log_file_name; last_written; size } - - let parse xml = - Some - { log_file_name = Util.option_bind (Xml.member "LogFileName" xml) String.parse - ; last_written = Util.option_bind (Xml.member "LastWritten" xml) Long.parse - ; size = Util.option_bind (Xml.member "Size" xml) Long.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.size (fun f -> Query.Pair ("Size", Long.to_query f)) - ; Util.option_map v.last_written (fun f -> - Query.Pair ("LastWritten", Long.to_query f)) - ; Util.option_map v.log_file_name (fun f -> - Query.Pair ("LogFileName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.size (fun f -> "size", Long.to_json f) - ; Util.option_map v.last_written (fun f -> "last_written", Long.to_json f) - ; Util.option_map v.log_file_name (fun f -> "log_file_name", String.to_json f) - ]) - - let of_json j = - { log_file_name = Util.option_map (Json.lookup j "log_file_name") String.of_json - ; last_written = Util.option_map (Json.lookup j "last_written") Long.of_json - ; size = Util.option_map (Json.lookup j "size") Long.of_json - } -end - -module DBParameterGroup = struct - type t = - { d_b_parameter_group_name : String.t option - ; d_b_parameter_group_family : String.t option - ; description : String.t option - } - - let make ?d_b_parameter_group_name ?d_b_parameter_group_family ?description () = - { d_b_parameter_group_name; d_b_parameter_group_family; description } - - let parse xml = - Some - { d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - ; d_b_parameter_group_family = - Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse - ; description = Util.option_bind (Xml.member "Description" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> - Query.Pair ("Description", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - Query.Pair ("DBParameterGroupFamily", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.description (fun f -> "description", String.to_json f) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - "d_b_parameter_group_family", String.to_json f) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - ; d_b_parameter_group_family = - Util.option_map (Json.lookup j "d_b_parameter_group_family") String.of_json - ; description = Util.option_map (Json.lookup j "description") String.of_json - } -end - -module Event = struct - type t = - { source_identifier : String.t option - ; source_type : SourceType.t option - ; message : String.t option - ; event_categories : EventCategoriesList.t - ; date : DateTime.t option - } - - let make ?source_identifier ?source_type ?message ?(event_categories = []) ?date () = - { source_identifier; source_type; message; event_categories; date } - - let parse xml = - Some - { source_identifier = - Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) SourceType.parse - ; message = Util.option_bind (Xml.member "Message" xml) String.parse - ; event_categories = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategories" xml) - EventCategoriesList.parse) - ; date = Util.option_bind (Xml.member "Date" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.date (fun f -> Query.Pair ("Date", DateTime.to_query f)) - ; Some + ("SourceOptionGroupIdentifier", + (String.to_query v.source_option_group_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("target_option_group_description", + (String.to_json v.target_option_group_description)); + Some + ("target_option_group_identifier", + (String.to_json v.target_option_group_identifier)); + Some + ("source_option_group_identifier", + (String.to_json v.source_option_group_identifier))]) + let of_json j = + { + source_option_group_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_option_group_identifier"))); + target_option_group_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_option_group_identifier"))); + target_option_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_option_group_description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DeleteDBInstanceMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + skip_final_snapshot: Boolean.t option ; + final_d_b_snapshot_identifier: String.t option } + let make ~d_b_instance_identifier ?skip_final_snapshot + ?final_d_b_snapshot_identifier () = + { + d_b_instance_identifier; + skip_final_snapshot; + final_d_b_snapshot_identifier + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + skip_final_snapshot = + (Util.option_bind (Xml.member "SkipFinalSnapshot" xml) + Boolean.parse); + final_d_b_snapshot_identifier = + (Util.option_bind (Xml.member "FinalDBSnapshotIdentifier" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.final_d_b_snapshot_identifier + (fun f -> + Query.Pair + ("FinalDBSnapshotIdentifier", (String.to_query f))); + Util.option_map v.skip_final_snapshot + (fun f -> Query.Pair ("SkipFinalSnapshot", (Boolean.to_query f))); + Some (Query.Pair - ("EventCategories.member", EventCategoriesList.to_query v.event_categories)) - ; Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", SourceType.to_query f)) - ; Util.option_map v.source_identifier (fun f -> - Query.Pair ("SourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.date (fun f -> "date", DateTime.to_json f) - ; Some ("event_categories", EventCategoriesList.to_json v.event_categories) - ; Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.source_type (fun f -> "source_type", SourceType.to_json f) - ; Util.option_map v.source_identifier (fun f -> - "source_identifier", String.to_json f) - ]) - - let of_json j = - { source_identifier = - Util.option_map (Json.lookup j "source_identifier") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") SourceType.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - ; event_categories = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories")) - ; date = Util.option_map (Json.lookup j "date") DateTime.of_json - } -end - -module Certificate = struct - type t = - { certificate_identifier : String.t option - ; certificate_type : String.t option - ; thumbprint : String.t option - ; valid_from : DateTime.t option - ; valid_till : DateTime.t option - } - - let make - ?certificate_identifier - ?certificate_type - ?thumbprint - ?valid_from - ?valid_till - () = - { certificate_identifier; certificate_type; thumbprint; valid_from; valid_till } - - let parse xml = - Some - { certificate_identifier = - Util.option_bind (Xml.member "CertificateIdentifier" xml) String.parse - ; certificate_type = - Util.option_bind (Xml.member "CertificateType" xml) String.parse - ; thumbprint = Util.option_bind (Xml.member "Thumbprint" xml) String.parse - ; valid_from = Util.option_bind (Xml.member "ValidFrom" xml) DateTime.parse - ; valid_till = Util.option_bind (Xml.member "ValidTill" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.valid_till (fun f -> - Query.Pair ("ValidTill", DateTime.to_query f)) - ; Util.option_map v.valid_from (fun f -> - Query.Pair ("ValidFrom", DateTime.to_query f)) - ; Util.option_map v.thumbprint (fun f -> - Query.Pair ("Thumbprint", String.to_query f)) - ; Util.option_map v.certificate_type (fun f -> - Query.Pair ("CertificateType", String.to_query f)) - ; Util.option_map v.certificate_identifier (fun f -> - Query.Pair ("CertificateIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.valid_till (fun f -> "valid_till", DateTime.to_json f) - ; Util.option_map v.valid_from (fun f -> "valid_from", DateTime.to_json f) - ; Util.option_map v.thumbprint (fun f -> "thumbprint", String.to_json f) - ; Util.option_map v.certificate_type (fun f -> - "certificate_type", String.to_json f) - ; Util.option_map v.certificate_identifier (fun f -> - "certificate_identifier", String.to_json f) - ]) - - let of_json j = - { certificate_identifier = - Util.option_map (Json.lookup j "certificate_identifier") String.of_json - ; certificate_type = Util.option_map (Json.lookup j "certificate_type") String.of_json - ; thumbprint = Util.option_map (Json.lookup j "thumbprint") String.of_json - ; valid_from = Util.option_map (Json.lookup j "valid_from") DateTime.of_json - ; valid_till = Util.option_map (Json.lookup j "valid_till") DateTime.of_json - } -end - -module OptionGroup = struct - type t = - { option_group_name : String.t option - ; option_group_description : String.t option - ; engine_name : String.t option - ; major_engine_version : String.t option - ; options : OptionsList.t - ; allows_vpc_and_non_vpc_instance_memberships : Boolean.t option - ; vpc_id : String.t option - } - - let make - ?option_group_name - ?option_group_description - ?engine_name - ?major_engine_version - ?(options = []) - ?allows_vpc_and_non_vpc_instance_memberships - ?vpc_id - () = - { option_group_name - ; option_group_description - ; engine_name - ; major_engine_version - ; options - ; allows_vpc_and_non_vpc_instance_memberships - ; vpc_id - } - - let parse xml = - Some - { option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; option_group_description = - Util.option_bind (Xml.member "OptionGroupDescription" xml) String.parse - ; engine_name = Util.option_bind (Xml.member "EngineName" xml) String.parse - ; major_engine_version = - Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse - ; options = - Util.of_option - [] - (Util.option_bind (Xml.member "Options" xml) OptionsList.parse) - ; allows_vpc_and_non_vpc_instance_memberships = - Util.option_bind - (Xml.member "AllowsVpcAndNonVpcInstanceMemberships" xml) - Boolean.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.allows_vpc_and_non_vpc_instance_memberships (fun f -> - Query.Pair ("AllowsVpcAndNonVpcInstanceMemberships", Boolean.to_query f)) - ; Some (Query.Pair ("Options.member", OptionsList.to_query v.options)) - ; Util.option_map v.major_engine_version (fun f -> - Query.Pair ("MajorEngineVersion", String.to_query f)) - ; Util.option_map v.engine_name (fun f -> - Query.Pair ("EngineName", String.to_query f)) - ; Util.option_map v.option_group_description (fun f -> - Query.Pair ("OptionGroupDescription", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.allows_vpc_and_non_vpc_instance_memberships (fun f -> - "allows_vpc_and_non_vpc_instance_memberships", Boolean.to_json f) - ; Some ("options", OptionsList.to_json v.options) - ; Util.option_map v.major_engine_version (fun f -> - "major_engine_version", String.to_json f) - ; Util.option_map v.engine_name (fun f -> "engine_name", String.to_json f) - ; Util.option_map v.option_group_description (fun f -> - "option_group_description", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ]) - - let of_json j = - { option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; option_group_description = - Util.option_map (Json.lookup j "option_group_description") String.of_json - ; engine_name = Util.option_map (Json.lookup j "engine_name") String.of_json - ; major_engine_version = - Util.option_map (Json.lookup j "major_engine_version") String.of_json - ; options = OptionsList.of_json (Util.of_option_exn (Json.lookup j "options")) - ; allows_vpc_and_non_vpc_instance_memberships = - Util.option_map - (Json.lookup j "allows_vpc_and_non_vpc_instance_memberships") - Boolean.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - } -end - -module OrderableDBInstanceOption = struct - type t = - { engine : String.t option - ; engine_version : String.t option - ; d_b_instance_class : String.t option - ; license_model : String.t option - ; availability_zones : AvailabilityZoneList.t - ; multi_a_z_capable : Boolean.t option - ; read_replica_capable : Boolean.t option - ; vpc : Boolean.t option - ; supports_storage_encryption : Boolean.t option - ; storage_type : String.t option - ; supports_iops : Boolean.t option - } - - let make - ?engine - ?engine_version - ?d_b_instance_class - ?license_model - ?(availability_zones = []) - ?multi_a_z_capable - ?read_replica_capable - ?vpc - ?supports_storage_encryption - ?storage_type - ?supports_iops - () = - { engine - ; engine_version - ; d_b_instance_class - ; license_model - ; availability_zones - ; multi_a_z_capable - ; read_replica_capable - ; vpc - ; supports_storage_encryption - ; storage_type - ; supports_iops - } - - let parse xml = - Some - { engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZoneList.parse) - ; multi_a_z_capable = - Util.option_bind (Xml.member "MultiAZCapable" xml) Boolean.parse - ; read_replica_capable = - Util.option_bind (Xml.member "ReadReplicaCapable" xml) Boolean.parse - ; vpc = Util.option_bind (Xml.member "Vpc" xml) Boolean.parse - ; supports_storage_encryption = - Util.option_bind (Xml.member "SupportsStorageEncryption" xml) Boolean.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; supports_iops = Util.option_bind (Xml.member "SupportsIops" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.supports_iops (fun f -> - Query.Pair ("SupportsIops", Boolean.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.supports_storage_encryption (fun f -> - Query.Pair ("SupportsStorageEncryption", Boolean.to_query f)) - ; Util.option_map v.vpc (fun f -> Query.Pair ("Vpc", Boolean.to_query f)) - ; Util.option_map v.read_replica_capable (fun f -> - Query.Pair ("ReadReplicaCapable", Boolean.to_query f)) - ; Util.option_map v.multi_a_z_capable (fun f -> - Query.Pair ("MultiAZCapable", Boolean.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.final_d_b_snapshot_identifier + (fun f -> ("final_d_b_snapshot_identifier", (String.to_json f))); + Util.option_map v.skip_final_snapshot + (fun f -> ("skip_final_snapshot", (Boolean.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + skip_final_snapshot = + (Util.option_map (Json.lookup j "skip_final_snapshot") + Boolean.of_json); + final_d_b_snapshot_identifier = + (Util.option_map (Json.lookup j "final_d_b_snapshot_identifier") + String.of_json) + } + end +module PromoteReadReplicaMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + backup_retention_period: Integer.t option ; + preferred_backup_window: String.t option } + let make ~d_b_instance_identifier ?backup_retention_period + ?preferred_backup_window () = + { + d_b_instance_identifier; + backup_retention_period; + preferred_backup_window + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZoneList.to_query v.availability_zones )) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.supports_iops (fun f -> "supports_iops", Boolean.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.supports_storage_encryption (fun f -> - "supports_storage_encryption", Boolean.to_json f) - ; Util.option_map v.vpc (fun f -> "vpc", Boolean.to_json f) - ; Util.option_map v.read_replica_capable (fun f -> - "read_replica_capable", Boolean.to_json f) - ; Util.option_map v.multi_a_z_capable (fun f -> - "multi_a_z_capable", Boolean.to_json f) - ; Some ("availability_zones", AvailabilityZoneList.to_json v.availability_zones) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ]) - - let of_json j = - { engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; availability_zones = - AvailabilityZoneList.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; multi_a_z_capable = - Util.option_map (Json.lookup j "multi_a_z_capable") Boolean.of_json - ; read_replica_capable = - Util.option_map (Json.lookup j "read_replica_capable") Boolean.of_json - ; vpc = Util.option_map (Json.lookup j "vpc") Boolean.of_json - ; supports_storage_encryption = - Util.option_map (Json.lookup j "supports_storage_encryption") Boolean.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; supports_iops = Util.option_map (Json.lookup j "supports_iops") Boolean.of_json - } -end - -module DBClusterSnapshot = struct - type t = - { availability_zones : AvailabilityZones.t - ; d_b_cluster_snapshot_identifier : String.t option - ; d_b_cluster_identifier : String.t option - ; snapshot_create_time : DateTime.t option - ; engine : String.t option - ; allocated_storage : Integer.t option - ; status : String.t option - ; port : Integer.t option - ; vpc_id : String.t option - ; cluster_create_time : DateTime.t option - ; master_username : String.t option - ; engine_version : String.t option - ; license_model : String.t option - ; snapshot_type : String.t option - ; percent_progress : Integer.t option - } - - let make - ?(availability_zones = []) - ?d_b_cluster_snapshot_identifier - ?d_b_cluster_identifier - ?snapshot_create_time - ?engine - ?allocated_storage - ?status - ?port - ?vpc_id - ?cluster_create_time - ?master_username - ?engine_version - ?license_model - ?snapshot_type - ?percent_progress - () = - { availability_zones - ; d_b_cluster_snapshot_identifier - ; d_b_cluster_identifier - ; snapshot_create_time - ; engine - ; allocated_storage - ; status - ; port - ; vpc_id - ; cluster_create_time - ; master_username - ; engine_version - ; license_model - ; snapshot_type - ; percent_progress - } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; d_b_cluster_snapshot_identifier = - Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse - ; d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; snapshot_create_time = - Util.option_bind (Xml.member "SnapshotCreateTime" xml) DateTime.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; cluster_create_time = - Util.option_bind (Xml.member "ClusterCreateTime" xml) DateTime.parse - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; snapshot_type = Util.option_bind (Xml.member "SnapshotType" xml) String.parse - ; percent_progress = - Util.option_bind (Xml.member "PercentProgress" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.percent_progress (fun f -> - Query.Pair ("PercentProgress", Integer.to_query f)) - ; Util.option_map v.snapshot_type (fun f -> - Query.Pair ("SnapshotType", String.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Util.option_map v.cluster_create_time (fun f -> - Query.Pair ("ClusterCreateTime", DateTime.to_query f)) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.snapshot_create_time (fun f -> - Query.Pair ("SnapshotCreateTime", DateTime.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ; Util.option_map v.d_b_cluster_snapshot_identifier (fun f -> - Query.Pair ("DBClusterSnapshotIdentifier", String.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json) + } + end +module ModifyEventSubscriptionResult = + struct + type t = { + event_subscription: EventSubscription.t option } + let make ?event_subscription () = { event_subscription } + let parse xml = + Some + { + event_subscription = + (Util.option_bind (Xml.member "EventSubscription" xml) + EventSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> + Query.Pair + ("EventSubscription", (EventSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> ("event_subscription", (EventSubscription.to_json f)))]) + let of_json j = + { + event_subscription = + (Util.option_map (Json.lookup j "event_subscription") + EventSubscription.of_json) + } + end +module DBParameterGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module FailoverDBClusterResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module OptionGroupOptionsMessage = + struct + type t = + { + option_group_options: OptionGroupOptionsList.t ; + marker: String.t option } + let make ?(option_group_options= []) ?marker () = + { option_group_options; marker } + let parse xml = + Some + { + option_group_options = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionGroupOptions" xml) + OptionGroupOptionsList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.percent_progress (fun f -> - "percent_progress", Integer.to_json f) - ; Util.option_map v.snapshot_type (fun f -> "snapshot_type", String.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Util.option_map v.cluster_create_time (fun f -> - "cluster_create_time", DateTime.to_json f) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.snapshot_create_time (fun f -> - "snapshot_create_time", DateTime.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ; Util.option_map v.d_b_cluster_snapshot_identifier (fun f -> - "d_b_cluster_snapshot_identifier", String.to_json f) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ]) - - let of_json j = - { availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; d_b_cluster_snapshot_identifier = - Util.option_map (Json.lookup j "d_b_cluster_snapshot_identifier") String.of_json - ; d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; snapshot_create_time = - Util.option_map (Json.lookup j "snapshot_create_time") DateTime.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; cluster_create_time = - Util.option_map (Json.lookup j "cluster_create_time") DateTime.of_json - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; snapshot_type = Util.option_map (Json.lookup j "snapshot_type") String.of_json - ; percent_progress = - Util.option_map (Json.lookup j "percent_progress") Integer.of_json - } -end - -module ReservedDBInstancesOffering = struct - type t = - { reserved_d_b_instances_offering_id : String.t option - ; d_b_instance_class : String.t option - ; duration : Integer.t option - ; fixed_price : Double.t option - ; usage_price : Double.t option - ; currency_code : String.t option - ; product_description : String.t option - ; offering_type : String.t option - ; multi_a_z : Boolean.t option - ; recurring_charges : RecurringChargeList.t - } - - let make - ?reserved_d_b_instances_offering_id - ?d_b_instance_class - ?duration - ?fixed_price - ?usage_price - ?currency_code - ?product_description - ?offering_type - ?multi_a_z - ?(recurring_charges = []) - () = - { reserved_d_b_instances_offering_id - ; d_b_instance_class - ; duration - ; fixed_price - ; usage_price - ; currency_code - ; product_description - ; offering_type - ; multi_a_z - ; recurring_charges - } - - let parse xml = - Some - { reserved_d_b_instances_offering_id = - Util.option_bind (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; fixed_price = Util.option_bind (Xml.member "FixedPrice" xml) Double.parse - ; usage_price = Util.option_bind (Xml.member "UsagePrice" xml) Double.parse - ; currency_code = Util.option_bind (Xml.member "CurrencyCode" xml) String.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; recurring_charges = - Util.of_option - [] - (Util.option_bind - (Xml.member "RecurringCharges" xml) - RecurringChargeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("OptionGroupOptions.member", + (OptionGroupOptionsList.to_query v.option_group_options)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("option_group_options", + (OptionGroupOptionsList.to_json v.option_group_options))]) + let of_json j = + { + option_group_options = + (OptionGroupOptionsList.of_json + (Util.of_option_exn (Json.lookup j "option_group_options"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeDBLogFilesMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + filename_contains: String.t option ; + file_last_written: Long.t option ; + file_size: Long.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~d_b_instance_identifier ?filename_contains ?file_last_written + ?file_size ?(filters= []) ?max_records ?marker () = + { + d_b_instance_identifier; + filename_contains; + file_last_written; + file_size; + filters; + max_records; + marker + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + filename_contains = + (Util.option_bind (Xml.member "FilenameContains" xml) + String.parse); + file_last_written = + (Util.option_bind (Xml.member "FileLastWritten" xml) Long.parse); + file_size = + (Util.option_bind (Xml.member "FileSize" xml) Long.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.file_size + (fun f -> Query.Pair ("FileSize", (Long.to_query f))); + Util.option_map v.file_last_written + (fun f -> Query.Pair ("FileLastWritten", (Long.to_query f))); + Util.option_map v.filename_contains + (fun f -> Query.Pair ("FilenameContains", (String.to_query f))); + Some (Query.Pair - ( "RecurringCharges.member" - , RecurringChargeList.to_query v.recurring_charges )) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.currency_code (fun f -> - Query.Pair ("CurrencyCode", String.to_query f)) - ; Util.option_map v.usage_price (fun f -> - Query.Pair ("UsagePrice", Double.to_query f)) - ; Util.option_map v.fixed_price (fun f -> - Query.Pair ("FixedPrice", Double.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - Query.Pair ("ReservedDBInstancesOfferingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("recurring_charges", RecurringChargeList.to_json v.recurring_charges) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.currency_code (fun f -> "currency_code", String.to_json f) - ; Util.option_map v.usage_price (fun f -> "usage_price", Double.to_json f) - ; Util.option_map v.fixed_price (fun f -> "fixed_price", Double.to_json f) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - "reserved_d_b_instances_offering_id", String.to_json f) - ]) - - let of_json j = - { reserved_d_b_instances_offering_id = - Util.option_map - (Json.lookup j "reserved_d_b_instances_offering_id") - String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; fixed_price = Util.option_map (Json.lookup j "fixed_price") Double.of_json - ; usage_price = Util.option_map (Json.lookup j "usage_price") Double.of_json - ; currency_code = Util.option_map (Json.lookup j "currency_code") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; recurring_charges = - RecurringChargeList.of_json - (Util.of_option_exn (Json.lookup j "recurring_charges")) - } -end - -module DBCluster = struct - type t = - { allocated_storage : Integer.t option - ; availability_zones : AvailabilityZones.t - ; backup_retention_period : Integer.t option - ; character_set_name : String.t option - ; database_name : String.t option - ; d_b_cluster_identifier : String.t option - ; d_b_cluster_parameter_group : String.t option - ; d_b_subnet_group : String.t option - ; status : String.t option - ; percent_progress : String.t option - ; earliest_restorable_time : DateTime.t option - ; endpoint : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; latest_restorable_time : DateTime.t option - ; port : Integer.t option - ; master_username : String.t option - ; d_b_cluster_option_group_memberships : DBClusterOptionGroupMemberships.t - ; preferred_backup_window : String.t option - ; preferred_maintenance_window : String.t option - ; d_b_cluster_members : DBClusterMemberList.t - ; vpc_security_groups : VpcSecurityGroupMembershipList.t - } - - let make - ?allocated_storage - ?(availability_zones = []) - ?backup_retention_period - ?character_set_name - ?database_name - ?d_b_cluster_identifier - ?d_b_cluster_parameter_group - ?d_b_subnet_group - ?status - ?percent_progress - ?earliest_restorable_time - ?endpoint - ?engine - ?engine_version - ?latest_restorable_time - ?port - ?master_username - ?(d_b_cluster_option_group_memberships = []) - ?preferred_backup_window - ?preferred_maintenance_window - ?(d_b_cluster_members = []) - ?(vpc_security_groups = []) - () = - { allocated_storage - ; availability_zones - ; backup_retention_period - ; character_set_name - ; database_name - ; d_b_cluster_identifier - ; d_b_cluster_parameter_group - ; d_b_subnet_group - ; status - ; percent_progress - ; earliest_restorable_time - ; endpoint - ; engine - ; engine_version - ; latest_restorable_time - ; port - ; master_username - ; d_b_cluster_option_group_memberships - ; preferred_backup_window - ; preferred_maintenance_window - ; d_b_cluster_members - ; vpc_security_groups - } - - let parse xml = - Some - { allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; character_set_name = - Util.option_bind (Xml.member "CharacterSetName" xml) String.parse - ; database_name = Util.option_bind (Xml.member "DatabaseName" xml) String.parse - ; d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; d_b_cluster_parameter_group = - Util.option_bind (Xml.member "DBClusterParameterGroup" xml) String.parse - ; d_b_subnet_group = Util.option_bind (Xml.member "DBSubnetGroup" xml) String.parse - ; status = Util.option_bind (Xml.member "Status" xml) String.parse - ; percent_progress = - Util.option_bind (Xml.member "PercentProgress" xml) String.parse - ; earliest_restorable_time = - Util.option_bind (Xml.member "EarliestRestorableTime" xml) DateTime.parse - ; endpoint = Util.option_bind (Xml.member "Endpoint" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; latest_restorable_time = - Util.option_bind (Xml.member "LatestRestorableTime" xml) DateTime.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; d_b_cluster_option_group_memberships = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBClusterOptionGroupMemberships" xml) - DBClusterOptionGroupMemberships.parse) - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; d_b_cluster_members = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBClusterMembers" xml) - DBClusterMemberList.parse) - ; vpc_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroups" xml) - VpcSecurityGroupMembershipList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.file_size + (fun f -> ("file_size", (Long.to_json f))); + Util.option_map v.file_last_written + (fun f -> ("file_last_written", (Long.to_json f))); + Util.option_map v.filename_contains + (fun f -> ("filename_contains", (String.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + filename_contains = + (Util.option_map (Json.lookup j "filename_contains") String.of_json); + file_last_written = + (Util.option_map (Json.lookup j "file_last_written") Long.of_json); + file_size = + (Util.option_map (Json.lookup j "file_size") Long.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DeleteDBClusterResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module InvalidDBClusterSnapshotStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDBSecurityGroupsMessage = + struct + type t = + { + d_b_security_group_name: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_security_group_name ?(filters= []) ?max_records ?marker + () = { d_b_security_group_name; filters; max_records; marker } + let parse xml = + Some + { + d_b_security_group_name = + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_security_group_name + (fun f -> + Query.Pair ("DBSecurityGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_security_group_name + (fun f -> ("d_b_security_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_security_group_name = + (Util.option_map (Json.lookup j "d_b_security_group_name") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InsufficientStorageClusterCapacityFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AuthorizationNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBClusterQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBSnapshotResult = + struct + type t = { + d_b_snapshot: DBSnapshot.t option } + let make ?d_b_snapshot () = { d_b_snapshot } + let parse xml = + Some + { + d_b_snapshot = + (Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> Query.Pair ("DBSnapshot", (DBSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> ("d_b_snapshot", (DBSnapshot.to_json f)))]) + let of_json j = + { + d_b_snapshot = + (Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json) + } + end +module CreateDBSubnetGroupMessage = + struct + type t = + { + d_b_subnet_group_name: String.t ; + d_b_subnet_group_description: String.t ; + subnet_ids: SubnetIdentifierList.t ; + tags: TagList.t } + let make ~d_b_subnet_group_name ~d_b_subnet_group_description + ~subnet_ids ?(tags= []) () = + { d_b_subnet_group_name; d_b_subnet_group_description; subnet_ids; tags + } + let parse xml = + Some + { + d_b_subnet_group_name = + (Xml.required "DBSubnetGroupName" + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse)); + d_b_subnet_group_description = + (Xml.required "DBSubnetGroupDescription" + (Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) + String.parse)); + subnet_ids = + (Xml.required "SubnetIds" + (Util.option_bind (Xml.member "SubnetIds" xml) + SubnetIdentifierList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "VpcSecurityGroups.member" - , VpcSecurityGroupMembershipList.to_query v.vpc_security_groups )) - ; Some + ("SubnetIds.member", + (SubnetIdentifierList.to_query v.subnet_ids))); + Some (Query.Pair - ( "DBClusterMembers.member" - , DBClusterMemberList.to_query v.d_b_cluster_members )) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Some + ("DBSubnetGroupDescription", + (String.to_query v.d_b_subnet_group_description))); + Some (Query.Pair - ( "DBClusterOptionGroupMemberships.member" - , DBClusterOptionGroupMemberships.to_query - v.d_b_cluster_option_group_memberships )) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.latest_restorable_time (fun f -> - Query.Pair ("LatestRestorableTime", DateTime.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.endpoint (fun f -> - Query.Pair ("Endpoint", String.to_query f)) - ; Util.option_map v.earliest_restorable_time (fun f -> - Query.Pair ("EarliestRestorableTime", DateTime.to_query f)) - ; Util.option_map v.percent_progress (fun f -> - Query.Pair ("PercentProgress", String.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ; Util.option_map v.d_b_subnet_group (fun f -> - Query.Pair ("DBSubnetGroup", String.to_query f)) - ; Util.option_map v.d_b_cluster_parameter_group (fun f -> - Query.Pair ("DBClusterParameterGroup", String.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ; Util.option_map v.database_name (fun f -> - Query.Pair ("DatabaseName", String.to_query f)) - ; Util.option_map v.character_set_name (fun f -> - Query.Pair ("CharacterSetName", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Some + ("DBSubnetGroupName", + (String.to_query v.d_b_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("subnet_ids", (SubnetIdentifierList.to_json v.subnet_ids)); + Some + ("d_b_subnet_group_description", + (String.to_json v.d_b_subnet_group_description)); + Some + ("d_b_subnet_group_name", + (String.to_json v.d_b_subnet_group_name))]) + let of_json j = + { + d_b_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name"))); + d_b_subnet_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_subnet_group_description"))); + subnet_ids = + (SubnetIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "subnet_ids"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DeleteDBSnapshotMessage = + struct + type t = { + d_b_snapshot_identifier: String.t } + let make ~d_b_snapshot_identifier () = { d_b_snapshot_identifier } + let parse xml = + Some + { + d_b_snapshot_identifier = + (Xml.required "DBSnapshotIdentifier" + (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSnapshotIdentifier", + (String.to_query v.d_b_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_snapshot_identifier", + (String.to_json v.d_b_snapshot_identifier))]) + let of_json j = + { + d_b_snapshot_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier"))) + } + end +module CreateDBInstanceReadReplicaResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module DescribeDBSubnetGroupsMessage = + struct + type t = + { + d_b_subnet_group_name: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_subnet_group_name ?(filters= []) ?max_records ?marker + () = { d_b_subnet_group_name; filters; max_records; marker } + let parse xml = + Some + { + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ReservedDBInstancesOfferingNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBSubnetGroupMessage = + struct + type t = { + d_b_subnet_group_name: String.t } + let make ~d_b_subnet_group_name () = { d_b_subnet_group_name } + let parse xml = + Some + { + d_b_subnet_group_name = + (Xml.required "DBSubnetGroupName" + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSubnetGroupName", + (String.to_query v.d_b_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_subnet_group_name", + (String.to_json v.d_b_subnet_group_name))]) + let of_json j = + { + d_b_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name"))) + } + end +module AddSourceIdentifierToSubscriptionResult = + struct + type t = { + event_subscription: EventSubscription.t option } + let make ?event_subscription () = { event_subscription } + let parse xml = + Some + { + event_subscription = + (Util.option_bind (Xml.member "EventSubscription" xml) + EventSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> + Query.Pair + ("EventSubscription", (EventSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> ("event_subscription", (EventSubscription.to_json f)))]) + let of_json j = + { + event_subscription = + (Util.option_map (Json.lookup j "event_subscription") + EventSubscription.of_json) + } + end +module DescribeEventSubscriptionsMessage = + struct + type t = + { + subscription_name: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?subscription_name ?(filters= []) ?max_records ?marker () = + { subscription_name; filters; max_records; marker } + let parse xml = + Some + { + subscription_name = + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.subscription_name + (fun f -> Query.Pair ("SubscriptionName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.subscription_name + (fun f -> ("subscription_name", (String.to_json f)))]) + let of_json j = + { + subscription_name = + (Util.option_map (Json.lookup j "subscription_name") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeAccountAttributesMessage = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBInstanceNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module TagListMessage = + struct + type t = { + tag_list: TagList.t } + let make ?(tag_list= []) () = { tag_list } + let parse xml = + Some + { + tag_list = + (Util.of_option [] + (Util.option_bind (Xml.member "TagList" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("TagList.member", (TagList.to_query v.tag_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tag_list", (TagList.to_json v.tag_list))]) + let of_json j = + { + tag_list = + (TagList.of_json (Util.of_option_exn (Json.lookup j "tag_list"))) + } + end +module InvalidDBSubnetGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RebootDBInstanceMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + force_failover: Boolean.t option } + let make ~d_b_instance_identifier ?force_failover () = + { d_b_instance_identifier; force_failover } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + force_failover = + (Util.option_bind (Xml.member "ForceFailover" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.force_failover + (fun f -> Query.Pair ("ForceFailover", (Boolean.to_query f))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "vpc_security_groups" - , VpcSecurityGroupMembershipList.to_json v.vpc_security_groups ) - ; Some ("d_b_cluster_members", DBClusterMemberList.to_json v.d_b_cluster_members) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Some - ( "d_b_cluster_option_group_memberships" - , DBClusterOptionGroupMemberships.to_json - v.d_b_cluster_option_group_memberships ) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.latest_restorable_time (fun f -> - "latest_restorable_time", DateTime.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.endpoint (fun f -> "endpoint", String.to_json f) - ; Util.option_map v.earliest_restorable_time (fun f -> - "earliest_restorable_time", DateTime.to_json f) - ; Util.option_map v.percent_progress (fun f -> - "percent_progress", String.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ; Util.option_map v.d_b_subnet_group (fun f -> - "d_b_subnet_group", String.to_json f) - ; Util.option_map v.d_b_cluster_parameter_group (fun f -> - "d_b_cluster_parameter_group", String.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ; Util.option_map v.database_name (fun f -> "database_name", String.to_json f) - ; Util.option_map v.character_set_name (fun f -> - "character_set_name", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ]) - - let of_json j = - { allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; character_set_name = - Util.option_map (Json.lookup j "character_set_name") String.of_json - ; database_name = Util.option_map (Json.lookup j "database_name") String.of_json - ; d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; d_b_cluster_parameter_group = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group") String.of_json - ; d_b_subnet_group = Util.option_map (Json.lookup j "d_b_subnet_group") String.of_json - ; status = Util.option_map (Json.lookup j "status") String.of_json - ; percent_progress = Util.option_map (Json.lookup j "percent_progress") String.of_json - ; earliest_restorable_time = - Util.option_map (Json.lookup j "earliest_restorable_time") DateTime.of_json - ; endpoint = Util.option_map (Json.lookup j "endpoint") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; latest_restorable_time = - Util.option_map (Json.lookup j "latest_restorable_time") DateTime.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; d_b_cluster_option_group_memberships = - DBClusterOptionGroupMemberships.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_option_group_memberships")) - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; d_b_cluster_members = - DBClusterMemberList.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_members")) - ; vpc_security_groups = - VpcSecurityGroupMembershipList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_groups")) - } -end - -module DBSecurityGroup = struct - type t = - { owner_id : String.t option - ; d_b_security_group_name : String.t option - ; d_b_security_group_description : String.t option - ; vpc_id : String.t option - ; e_c2_security_groups : EC2SecurityGroupList.t - ; i_p_ranges : IPRangeList.t - } - - let make - ?owner_id - ?d_b_security_group_name - ?d_b_security_group_description - ?vpc_id - ?(e_c2_security_groups = []) - ?(i_p_ranges = []) - () = - { owner_id - ; d_b_security_group_name - ; d_b_security_group_description - ; vpc_id - ; e_c2_security_groups - ; i_p_ranges - } - - let parse xml = - Some - { owner_id = Util.option_bind (Xml.member "OwnerId" xml) String.parse - ; d_b_security_group_name = - Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse - ; d_b_security_group_description = - Util.option_bind (Xml.member "DBSecurityGroupDescription" xml) String.parse - ; vpc_id = Util.option_bind (Xml.member "VpcId" xml) String.parse - ; e_c2_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "EC2SecurityGroups" xml) - EC2SecurityGroupList.parse) - ; i_p_ranges = - Util.of_option - [] - (Util.option_bind (Xml.member "IPRanges" xml) IPRangeList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("IPRanges.member", IPRangeList.to_query v.i_p_ranges)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.force_failover + (fun f -> ("force_failover", (Boolean.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + force_failover = + (Util.option_map (Json.lookup j "force_failover") Boolean.of_json) + } + end +module AuthorizationAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBClusterSnapshotResult = + struct + type t = { + d_b_cluster_snapshot: DBClusterSnapshot.t option } + let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } + let parse xml = + Some + { + d_b_cluster_snapshot = + (Util.option_bind (Xml.member "DBClusterSnapshot" xml) + DBClusterSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + Query.Pair + ("DBClusterSnapshot", (DBClusterSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + ("d_b_cluster_snapshot", (DBClusterSnapshot.to_json f)))]) + let of_json j = + { + d_b_cluster_snapshot = + (Util.option_map (Json.lookup j "d_b_cluster_snapshot") + DBClusterSnapshot.of_json) + } + end +module DBSnapshotAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyDBClusterMessage = + struct + type t = + { + d_b_cluster_identifier: String.t option ; + new_d_b_cluster_identifier: String.t option ; + apply_immediately: Boolean.t option ; + backup_retention_period: Integer.t option ; + d_b_cluster_parameter_group_name: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + port: Integer.t option ; + master_user_password: String.t option ; + option_group_name: String.t option ; + preferred_backup_window: String.t option ; + preferred_maintenance_window: String.t option } + let make ?d_b_cluster_identifier ?new_d_b_cluster_identifier + ?apply_immediately ?backup_retention_period + ?d_b_cluster_parameter_group_name ?(vpc_security_group_ids= []) ?port + ?master_user_password ?option_group_name ?preferred_backup_window + ?preferred_maintenance_window () = + { + d_b_cluster_identifier; + new_d_b_cluster_identifier; + apply_immediately; + backup_retention_period; + d_b_cluster_parameter_group_name; + vpc_security_group_ids; + port; + master_user_password; + option_group_name; + preferred_backup_window; + preferred_maintenance_window + } + let parse xml = + Some + { + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + new_d_b_cluster_identifier = + (Util.option_bind (Xml.member "NewDBClusterIdentifier" xml) + String.parse); + apply_immediately = + (Util.option_bind (Xml.member "ApplyImmediately" xml) + Boolean.parse); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + d_b_cluster_parameter_group_name = + (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) + String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + master_user_password = + (Util.option_bind (Xml.member "MasterUserPassword" xml) + String.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.master_user_password + (fun f -> Query.Pair ("MasterUserPassword", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Some (Query.Pair - ( "EC2SecurityGroups.member" - , EC2SecurityGroupList.to_query v.e_c2_security_groups )) - ; Util.option_map v.vpc_id (fun f -> Query.Pair ("VpcId", String.to_query f)) - ; Util.option_map v.d_b_security_group_description (fun f -> - Query.Pair ("DBSecurityGroupDescription", String.to_query f)) - ; Util.option_map v.d_b_security_group_name (fun f -> - Query.Pair ("DBSecurityGroupName", String.to_query f)) - ; Util.option_map v.owner_id (fun f -> Query.Pair ("OwnerId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("i_p_ranges", IPRangeList.to_json v.i_p_ranges) - ; Some - ("e_c2_security_groups", EC2SecurityGroupList.to_json v.e_c2_security_groups) - ; Util.option_map v.vpc_id (fun f -> "vpc_id", String.to_json f) - ; Util.option_map v.d_b_security_group_description (fun f -> - "d_b_security_group_description", String.to_json f) - ; Util.option_map v.d_b_security_group_name (fun f -> - "d_b_security_group_name", String.to_json f) - ; Util.option_map v.owner_id (fun f -> "owner_id", String.to_json f) - ]) - - let of_json j = - { owner_id = Util.option_map (Json.lookup j "owner_id") String.of_json - ; d_b_security_group_name = - Util.option_map (Json.lookup j "d_b_security_group_name") String.of_json - ; d_b_security_group_description = - Util.option_map (Json.lookup j "d_b_security_group_description") String.of_json - ; vpc_id = Util.option_map (Json.lookup j "vpc_id") String.of_json - ; e_c2_security_groups = - EC2SecurityGroupList.of_json - (Util.of_option_exn (Json.lookup j "e_c2_security_groups")) - ; i_p_ranges = IPRangeList.of_json (Util.of_option_exn (Json.lookup j "i_p_ranges")) - } -end - -module TagList = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module OptionGroupOptionsList = struct - type t = OptionGroupOption.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map OptionGroupOption.parse (Xml.members "OptionGroupOption" xml)) - - let to_query v = Query.to_query_list OptionGroupOption.to_query v - - let to_json v = `List (List.map OptionGroupOption.to_json v) - - let of_json j = Json.to_list OptionGroupOption.of_json j -end - -module FilterList = struct - type t = Filter.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Filter.parse (Xml.members "Filter" xml)) - - let to_query v = Query.to_query_list Filter.to_query v - - let to_json v = `List (List.map Filter.to_json v) - - let of_json j = Json.to_list Filter.of_json j -end - -module SubnetIdentifierList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "SubnetIdentifier" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module EngineDefaults = struct - type t = - { d_b_parameter_group_family : String.t option - ; marker : String.t option - ; parameters : ParametersList.t - } - - let make ?d_b_parameter_group_family ?marker ?(parameters = []) () = - { d_b_parameter_group_family; marker; parameters } - - let parse xml = - Some - { d_b_parameter_group_family = - Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - Query.Pair ("DBParameterGroupFamily", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", ParametersList.to_json v.parameters) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - "d_b_parameter_group_family", String.to_json f) - ]) - - let of_json j = - { d_b_parameter_group_family = - Util.option_map (Json.lookup j "d_b_parameter_group_family") String.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module EventSubscriptionsList = struct - type t = EventSubscription.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map EventSubscription.parse (Xml.members "EventSubscription" xml)) - - let to_query v = Query.to_query_list EventSubscription.to_query v - - let to_json v = `List (List.map EventSubscription.to_json v) - - let of_json j = Json.to_list EventSubscription.of_json j -end - -module OptionConfigurationList = struct - type t = OptionConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map OptionConfiguration.parse (Xml.members "OptionConfiguration" xml)) - - let to_query v = Query.to_query_list OptionConfiguration.to_query v - - let to_json v = `List (List.map OptionConfiguration.to_json v) - - let of_json j = Json.to_list OptionConfiguration.of_json j -end - -module OptionNamesList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReservedDBInstanceList = struct - type t = ReservedDBInstance.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ReservedDBInstance.parse (Xml.members "ReservedDBInstance" xml)) - - let to_query v = Query.to_query_list ReservedDBInstance.to_query v - - let to_json v = `List (List.map ReservedDBInstance.to_json v) - - let of_json j = Json.to_list ReservedDBInstance.of_json j -end - -module PendingMaintenanceActions = struct - type t = ResourcePendingMaintenanceActions.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - ResourcePendingMaintenanceActions.parse - (Xml.members "ResourcePendingMaintenanceActions" xml)) - - let to_query v = Query.to_query_list ResourcePendingMaintenanceActions.to_query v - - let to_json v = `List (List.map ResourcePendingMaintenanceActions.to_json v) - - let of_json j = Json.to_list ResourcePendingMaintenanceActions.of_json j -end - -module DBSubnetGroups = struct - type t = DBSubnetGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBSubnetGroup.parse (Xml.members "DBSubnetGroup" xml)) - - let to_query v = Query.to_query_list DBSubnetGroup.to_query v - - let to_json v = `List (List.map DBSubnetGroup.to_json v) - - let of_json j = Json.to_list DBSubnetGroup.of_json j -end - -module DBEngineVersionList = struct - type t = DBEngineVersion.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBEngineVersion.parse (Xml.members "DBEngineVersion" xml)) - - let to_query v = Query.to_query_list DBEngineVersion.to_query v - - let to_json v = `List (List.map DBEngineVersion.to_json v) - - let of_json j = Json.to_list DBEngineVersion.of_json j -end - -module DBSnapshotList = struct - type t = DBSnapshot.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBSnapshot.parse (Xml.members "DBSnapshot" xml)) - - let to_query v = Query.to_query_list DBSnapshot.to_query v - - let to_json v = `List (List.map DBSnapshot.to_json v) - - let of_json j = Json.to_list DBSnapshot.of_json j -end - -module EventCategoriesMapList = struct - type t = EventCategoriesMap.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map EventCategoriesMap.parse (Xml.members "EventCategoriesMap" xml)) - - let to_query v = Query.to_query_list EventCategoriesMap.to_query v - - let to_json v = `List (List.map EventCategoriesMap.to_json v) - - let of_json j = Json.to_list EventCategoriesMap.of_json j -end - -module DBInstanceList = struct - type t = DBInstance.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBInstance.parse (Xml.members "DBInstance" xml)) - - let to_query v = Query.to_query_list DBInstance.to_query v - - let to_json v = `List (List.map DBInstance.to_json v) - - let of_json j = Json.to_list DBInstance.of_json j -end - -module AccountQuotaList = struct - type t = AccountQuota.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map AccountQuota.parse (Xml.members "AccountQuota" xml)) - - let to_query v = Query.to_query_list AccountQuota.to_query v - - let to_json v = `List (List.map AccountQuota.to_json v) - - let of_json j = Json.to_list AccountQuota.of_json j -end - -module DBClusterParameterGroupList = struct - type t = DBClusterParameterGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBClusterParameterGroup.parse (Xml.members "DBClusterParameterGroup" xml)) - - let to_query v = Query.to_query_list DBClusterParameterGroup.to_query v - - let to_json v = `List (List.map DBClusterParameterGroup.to_json v) - - let of_json j = Json.to_list DBClusterParameterGroup.of_json j -end - -module DescribeDBLogFilesList = struct - type t = DescribeDBLogFilesDetails.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - DescribeDBLogFilesDetails.parse - (Xml.members "DescribeDBLogFilesDetails" xml)) - - let to_query v = Query.to_query_list DescribeDBLogFilesDetails.to_query v - - let to_json v = `List (List.map DescribeDBLogFilesDetails.to_json v) - - let of_json j = Json.to_list DescribeDBLogFilesDetails.of_json j -end - -module DBParameterGroupList = struct - type t = DBParameterGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBParameterGroup.parse (Xml.members "DBParameterGroup" xml)) - - let to_query v = Query.to_query_list DBParameterGroup.to_query v - - let to_json v = `List (List.map DBParameterGroup.to_json v) - - let of_json j = Json.to_list DBParameterGroup.of_json j -end - -module EventList = struct - type t = Event.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Event.parse (Xml.members "Event" xml)) - - let to_query v = Query.to_query_list Event.to_query v - - let to_json v = `List (List.map Event.to_json v) - - let of_json j = Json.to_list Event.of_json j -end - -module CertificateList = struct - type t = Certificate.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map Certificate.parse (Xml.members "Certificate" xml)) - - let to_query v = Query.to_query_list Certificate.to_query v - - let to_json v = `List (List.map Certificate.to_json v) - - let of_json j = Json.to_list Certificate.of_json j -end - -module OptionGroupsList = struct - type t = OptionGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map OptionGroup.parse (Xml.members "OptionGroup" xml)) - - let to_query v = Query.to_query_list OptionGroup.to_query v - - let to_json v = `List (List.map OptionGroup.to_json v) - - let of_json j = Json.to_list OptionGroup.of_json j -end - -module OrderableDBInstanceOptionsList = struct - type t = OrderableDBInstanceOption.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - OrderableDBInstanceOption.parse - (Xml.members "OrderableDBInstanceOption" xml)) - - let to_query v = Query.to_query_list OrderableDBInstanceOption.to_query v - - let to_json v = `List (List.map OrderableDBInstanceOption.to_json v) - - let of_json j = Json.to_list OrderableDBInstanceOption.of_json j -end - -module KeyList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DBClusterSnapshotList = struct - type t = DBClusterSnapshot.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DBClusterSnapshot.parse (Xml.members "DBClusterSnapshot" xml)) - - let to_query v = Query.to_query_list DBClusterSnapshot.to_query v - - let to_json v = `List (List.map DBClusterSnapshot.to_json v) - - let of_json j = Json.to_list DBClusterSnapshot.of_json j -end - -module ReservedDBInstancesOfferingList = struct - type t = ReservedDBInstancesOffering.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - ReservedDBInstancesOffering.parse - (Xml.members "ReservedDBInstancesOffering" xml)) - - let to_query v = Query.to_query_list ReservedDBInstancesOffering.to_query v - - let to_json v = `List (List.map ReservedDBInstancesOffering.to_json v) - - let of_json j = Json.to_list ReservedDBInstancesOffering.of_json j -end - -module DBClusterList = struct - type t = DBCluster.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map DBCluster.parse (Xml.members "DBCluster" xml)) - - let to_query v = Query.to_query_list DBCluster.to_query v - - let to_json v = `List (List.map DBCluster.to_json v) - - let of_json j = Json.to_list DBCluster.of_json j -end - -module DBSecurityGroups = struct - type t = DBSecurityGroup.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DBSecurityGroup.parse (Xml.members "DBSecurityGroup" xml)) - - let to_query v = Query.to_query_list DBSecurityGroup.to_query v - - let to_json v = `List (List.map DBSecurityGroup.to_json v) - - let of_json j = Json.to_list DBSecurityGroup.of_json j -end - -module ModifyDBClusterResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module CopyOptionGroupMessage = struct - type t = - { source_option_group_identifier : String.t - ; target_option_group_identifier : String.t - ; target_option_group_description : String.t - ; tags : TagList.t - } - - let make - ~source_option_group_identifier - ~target_option_group_identifier - ~target_option_group_description - ?(tags = []) - () = - { source_option_group_identifier - ; target_option_group_identifier - ; target_option_group_description - ; tags - } - - let parse xml = - Some - { source_option_group_identifier = - Xml.required - "SourceOptionGroupIdentifier" - (Util.option_bind (Xml.member "SourceOptionGroupIdentifier" xml) String.parse) - ; target_option_group_identifier = - Xml.required - "TargetOptionGroupIdentifier" - (Util.option_bind (Xml.member "TargetOptionGroupIdentifier" xml) String.parse) - ; target_option_group_description = - Xml.required - "TargetOptionGroupDescription" - (Util.option_bind - (Xml.member "TargetOptionGroupDescription" xml) + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + Query.Pair + ("DBClusterParameterGroupName", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Util.option_map v.apply_immediately + (fun f -> Query.Pair ("ApplyImmediately", (Boolean.to_query f))); + Util.option_map v.new_d_b_cluster_identifier + (fun f -> + Query.Pair ("NewDBClusterIdentifier", (String.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.master_user_password + (fun f -> ("master_user_password", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + ("d_b_cluster_parameter_group_name", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Util.option_map v.apply_immediately + (fun f -> ("apply_immediately", (Boolean.to_json f))); + Util.option_map v.new_d_b_cluster_identifier + (fun f -> ("new_d_b_cluster_identifier", (String.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + new_d_b_cluster_identifier = + (Util.option_map (Json.lookup j "new_d_b_cluster_identifier") + String.of_json); + apply_immediately = + (Util.option_map (Json.lookup j "apply_immediately") + Boolean.of_json); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + d_b_cluster_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") + String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + master_user_password = + (Util.option_map (Json.lookup j "master_user_password") + String.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json) + } + end +module CreateDBInstanceResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module DBClusterParameterGroupNameMessage = + struct + type t = { + d_b_cluster_parameter_group_name: String.t option } + let make ?d_b_cluster_parameter_group_name () = + { d_b_cluster_parameter_group_name } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + Query.Pair + ("DBClusterParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + ("d_b_cluster_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") + String.of_json) + } + end +module DBClusterSnapshotAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBClusterSnapshotMessage = + struct + type t = { + d_b_cluster_snapshot_identifier: String.t } + let make ~d_b_cluster_snapshot_identifier () = + { d_b_cluster_snapshot_identifier } + let parse xml = + Some + { + d_b_cluster_snapshot_identifier = + (Xml.required "DBClusterSnapshotIdentifier" + (Util.option_bind + (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBClusterSnapshotIdentifier", + (String.to_query v.d_b_cluster_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_cluster_snapshot_identifier", + (String.to_json v.d_b_cluster_snapshot_identifier))]) + let of_json j = + { + d_b_cluster_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_snapshot_identifier"))) + } + end +module DBSubnetGroupDoesNotCoverEnoughAZs = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBClusterMessage = + struct + type t = + { + d_b_cluster_identifier: String.t option ; + skip_final_snapshot: Boolean.t option ; + final_d_b_snapshot_identifier: String.t option } + let make ?d_b_cluster_identifier ?skip_final_snapshot + ?final_d_b_snapshot_identifier () = + { + d_b_cluster_identifier; + skip_final_snapshot; + final_d_b_snapshot_identifier + } + let parse xml = + Some + { + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + skip_final_snapshot = + (Util.option_bind (Xml.member "SkipFinalSnapshot" xml) + Boolean.parse); + final_d_b_snapshot_identifier = + (Util.option_bind (Xml.member "FinalDBSnapshotIdentifier" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.final_d_b_snapshot_identifier + (fun f -> + Query.Pair + ("FinalDBSnapshotIdentifier", (String.to_query f))); + Util.option_map v.skip_final_snapshot + (fun f -> Query.Pair ("SkipFinalSnapshot", (Boolean.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.final_d_b_snapshot_identifier + (fun f -> ("final_d_b_snapshot_identifier", (String.to_json f))); + Util.option_map v.skip_final_snapshot + (fun f -> ("skip_final_snapshot", (Boolean.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + skip_final_snapshot = + (Util.option_map (Json.lookup j "skip_final_snapshot") + Boolean.of_json); + final_d_b_snapshot_identifier = + (Util.option_map (Json.lookup j "final_d_b_snapshot_identifier") + String.of_json) + } + end +module CreateDBClusterResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module DomainNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeEngineDefaultParametersResult = + struct + type t = { + engine_defaults: EngineDefaults.t } + let make ~engine_defaults () = { engine_defaults } + let parse xml = + Some + { + engine_defaults = + (Xml.required "EngineDefaults" + (Util.option_bind (Xml.member "EngineDefaults" xml) + EngineDefaults.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EngineDefaults", + (EngineDefaults.to_query v.engine_defaults)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("engine_defaults", (EngineDefaults.to_json v.engine_defaults))]) + let of_json j = + { + engine_defaults = + (EngineDefaults.of_json + (Util.of_option_exn (Json.lookup j "engine_defaults"))) + } + end +module InvalidDBSecurityGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module PointInTimeRestoreNotEnabledFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module EventSubscriptionsMessage = + struct + type t = + { + marker: String.t option ; + event_subscriptions_list: EventSubscriptionsList.t } + let make ?marker ?(event_subscriptions_list= []) () = + { marker; event_subscriptions_list } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + event_subscriptions_list = + (Util.of_option [] + (Util.option_bind (Xml.member "EventSubscriptionsList" xml) + EventSubscriptionsList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EventSubscriptionsList.member", + (EventSubscriptionsList.to_query + v.event_subscriptions_list))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("event_subscriptions_list", + (EventSubscriptionsList.to_json v.event_subscriptions_list)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + event_subscriptions_list = + (EventSubscriptionsList.of_json + (Util.of_option_exn (Json.lookup j "event_subscriptions_list"))) + } + end +module DescribeEngineDefaultClusterParametersMessage = + struct + type t = + { + d_b_parameter_group_family: String.t ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~d_b_parameter_group_family ?(filters= []) ?max_records + ?marker () = + { d_b_parameter_group_family; filters; max_records; marker } + let parse xml = + Some + { + d_b_parameter_group_family = + (Xml.required "DBParameterGroupFamily" + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Some + (Query.Pair + ("DBParameterGroupFamily", + (String.to_query v.d_b_parameter_group_family)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("d_b_parameter_group_family", + (String.to_json v.d_b_parameter_group_family))]) + let of_json j = + { + d_b_parameter_group_family = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module AddSourceIdentifierToSubscriptionMessage = + struct + type t = { + subscription_name: String.t ; + source_identifier: String.t } + let make ~subscription_name ~source_identifier () = + { subscription_name; source_identifier } + let parse xml = + Some + { + subscription_name = + (Xml.required "SubscriptionName" + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse)); + source_identifier = + (Xml.required "SourceIdentifier" + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SourceIdentifier", (String.to_query v.source_identifier))); + Some (Query.Pair - ( "TargetOptionGroupDescription" - , String.to_query v.target_option_group_description )) - ; Some + ("SubscriptionName", (String.to_query v.subscription_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("source_identifier", (String.to_json v.source_identifier)); + Some ("subscription_name", (String.to_json v.subscription_name))]) + let of_json j = + { + subscription_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "subscription_name"))); + source_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_identifier"))) + } + end +module DBClusterSnapshotNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSubnetQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module StorageTypeNotSupportedFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidSubnet = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyOptionGroupMessage = + struct + type t = + { + option_group_name: String.t ; + options_to_include: OptionConfigurationList.t ; + options_to_remove: OptionNamesList.t ; + apply_immediately: Boolean.t option } + let make ~option_group_name ?(options_to_include= []) + ?(options_to_remove= []) ?apply_immediately () = + { + option_group_name; + options_to_include; + options_to_remove; + apply_immediately + } + let parse xml = + Some + { + option_group_name = + (Xml.required "OptionGroupName" + (Util.option_bind (Xml.member "OptionGroupName" xml) + String.parse)); + options_to_include = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionsToInclude" xml) + OptionConfigurationList.parse)); + options_to_remove = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionsToRemove" xml) + OptionNamesList.parse)); + apply_immediately = + (Util.option_bind (Xml.member "ApplyImmediately" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.apply_immediately + (fun f -> Query.Pair ("ApplyImmediately", (Boolean.to_query f))); + Some (Query.Pair - ( "TargetOptionGroupIdentifier" - , String.to_query v.target_option_group_identifier )) - ; Some + ("OptionsToRemove.member", + (OptionNamesList.to_query v.options_to_remove))); + Some (Query.Pair - ( "SourceOptionGroupIdentifier" - , String.to_query v.source_option_group_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "target_option_group_description" - , String.to_json v.target_option_group_description ) - ; Some - ( "target_option_group_identifier" - , String.to_json v.target_option_group_identifier ) - ; Some - ( "source_option_group_identifier" - , String.to_json v.source_option_group_identifier ) - ]) - - let of_json j = - { source_option_group_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_option_group_identifier")) - ; target_option_group_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "target_option_group_identifier")) - ; target_option_group_description = - String.of_json - (Util.of_option_exn (Json.lookup j "target_option_group_description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DeleteDBInstanceMessage = struct - type t = - { d_b_instance_identifier : String.t - ; skip_final_snapshot : Boolean.t option - ; final_d_b_snapshot_identifier : String.t option - } - - let make ~d_b_instance_identifier ?skip_final_snapshot ?final_d_b_snapshot_identifier () - = - { d_b_instance_identifier; skip_final_snapshot; final_d_b_snapshot_identifier } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; skip_final_snapshot = - Util.option_bind (Xml.member "SkipFinalSnapshot" xml) Boolean.parse - ; final_d_b_snapshot_identifier = - Util.option_bind (Xml.member "FinalDBSnapshotIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.final_d_b_snapshot_identifier (fun f -> - Query.Pair ("FinalDBSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.skip_final_snapshot (fun f -> - Query.Pair ("SkipFinalSnapshot", Boolean.to_query f)) - ; Some + ("OptionsToInclude.member", + (OptionConfigurationList.to_query v.options_to_include))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.final_d_b_snapshot_identifier (fun f -> - "final_d_b_snapshot_identifier", String.to_json f) - ; Util.option_map v.skip_final_snapshot (fun f -> - "skip_final_snapshot", Boolean.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; skip_final_snapshot = - Util.option_map (Json.lookup j "skip_final_snapshot") Boolean.of_json - ; final_d_b_snapshot_identifier = - Util.option_map (Json.lookup j "final_d_b_snapshot_identifier") String.of_json - } -end - -module PromoteReadReplicaMessage = struct - type t = - { d_b_instance_identifier : String.t - ; backup_retention_period : Integer.t option - ; preferred_backup_window : String.t option - } - - let make ~d_b_instance_identifier ?backup_retention_period ?preferred_backup_window () = - { d_b_instance_identifier; backup_retention_period; preferred_backup_window } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Some + ("OptionGroupName", (String.to_query v.option_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.apply_immediately + (fun f -> ("apply_immediately", (Boolean.to_json f))); + Some + ("options_to_remove", + (OptionNamesList.to_json v.options_to_remove)); + Some + ("options_to_include", + (OptionConfigurationList.to_json v.options_to_include)); + Some ("option_group_name", (String.to_json v.option_group_name))]) + let of_json j = + { + option_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "option_group_name"))); + options_to_include = + (OptionConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "options_to_include"))); + options_to_remove = + (OptionNamesList.of_json + (Util.of_option_exn (Json.lookup j "options_to_remove"))); + apply_immediately = + (Util.option_map (Json.lookup j "apply_immediately") + Boolean.of_json) + } + end +module ReservedDBInstanceMessage = + struct + type t = + { + marker: String.t option ; + reserved_d_b_instances: ReservedDBInstanceList.t } + let make ?marker ?(reserved_d_b_instances= []) () = + { marker; reserved_d_b_instances } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + reserved_d_b_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "ReservedDBInstances" xml) + ReservedDBInstanceList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedDBInstances.member", + (ReservedDBInstanceList.to_query v.reserved_d_b_instances))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_d_b_instances", + (ReservedDBInstanceList.to_json v.reserved_d_b_instances)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + reserved_d_b_instances = + (ReservedDBInstanceList.of_json + (Util.of_option_exn (Json.lookup j "reserved_d_b_instances"))) + } + end +module DBParameterGroupDetails = + struct + type t = { + parameters: ParametersList.t ; + marker: String.t option } + let make ?(parameters= []) ?marker () = { parameters; marker } + let parse xml = + Some + { + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - } -end - -module ModifyEventSubscriptionResult = struct - type t = { event_subscription : EventSubscription.t option } - - let make ?event_subscription () = { event_subscription } - - let parse xml = - Some - { event_subscription = - Util.option_bind (Xml.member "EventSubscription" xml) EventSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - Query.Pair ("EventSubscription", EventSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - "event_subscription", EventSubscription.to_json f) - ]) - - let of_json j = - { event_subscription = - Util.option_map (Json.lookup j "event_subscription") EventSubscription.of_json - } -end - -module DBParameterGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module FailoverDBClusterResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module OptionGroupOptionsMessage = struct - type t = - { option_group_options : OptionGroupOptionsList.t - ; marker : String.t option - } - - let make ?(option_group_options = []) ?marker () = { option_group_options; marker } - - let parse xml = - Some - { option_group_options = - Util.of_option - [] + ("Parameters.member", (ParametersList.to_query v.parameters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("parameters", (ParametersList.to_json v.parameters))]) + let of_json j = + { + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module AddTagsToResourceMessage = + struct + type t = { + resource_name: String.t ; + tags: TagList.t } + let make ~resource_name ~tags () = { resource_name; tags } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)); + tags = + (Xml.required "Tags" + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ApplyPendingMaintenanceActionResult = + struct + type t = + { + resource_pending_maintenance_actions: + ResourcePendingMaintenanceActions.t option } + let make ?resource_pending_maintenance_actions () = + { resource_pending_maintenance_actions } + let parse xml = + Some + { + resource_pending_maintenance_actions = (Util.option_bind - (Xml.member "OptionGroupOptions" xml) - OptionGroupOptionsList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + (Xml.member "ResourcePendingMaintenanceActions" xml) + ResourcePendingMaintenanceActions.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.resource_pending_maintenance_actions + (fun f -> + Query.Pair + ("ResourcePendingMaintenanceActions", + (ResourcePendingMaintenanceActions.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.resource_pending_maintenance_actions + (fun f -> + ("resource_pending_maintenance_actions", + (ResourcePendingMaintenanceActions.to_json f)))]) + let of_json j = + { + resource_pending_maintenance_actions = + (Util.option_map + (Json.lookup j "resource_pending_maintenance_actions") + ResourcePendingMaintenanceActions.of_json) + } + end +module InvalidOptionGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyDBSubnetGroupResult = + struct + type t = { + d_b_subnet_group: DBSubnetGroup.t option } + let make ?d_b_subnet_group () = { d_b_subnet_group } + let parse xml = + Some + { + d_b_subnet_group = + (Util.option_bind (Xml.member "DBSubnetGroup" xml) + DBSubnetGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_subnet_group + (fun f -> + Query.Pair ("DBSubnetGroup", (DBSubnetGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_subnet_group + (fun f -> ("d_b_subnet_group", (DBSubnetGroup.to_json f)))]) + let of_json j = + { + d_b_subnet_group = + (Util.option_map (Json.lookup j "d_b_subnet_group") + DBSubnetGroup.of_json) + } + end +module InsufficientDomainCapacityFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SNSNoAuthorizationFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBClusterSnapshotResult = + struct + type t = { + d_b_cluster_snapshot: DBClusterSnapshot.t option } + let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } + let parse xml = + Some + { + d_b_cluster_snapshot = + (Util.option_bind (Xml.member "DBClusterSnapshot" xml) + DBClusterSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + Query.Pair + ("DBClusterSnapshot", (DBClusterSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + ("d_b_cluster_snapshot", (DBClusterSnapshot.to_json f)))]) + let of_json j = + { + d_b_cluster_snapshot = + (Util.option_map (Json.lookup j "d_b_cluster_snapshot") + DBClusterSnapshot.of_json) + } + end +module CreateOptionGroupMessage = + struct + type t = + { + option_group_name: String.t ; + engine_name: String.t ; + major_engine_version: String.t ; + option_group_description: String.t ; + tags: TagList.t } + let make ~option_group_name ~engine_name ~major_engine_version + ~option_group_description ?(tags= []) () = + { + option_group_name; + engine_name; + major_engine_version; + option_group_description; + tags + } + let parse xml = + Some + { + option_group_name = + (Xml.required "OptionGroupName" + (Util.option_bind (Xml.member "OptionGroupName" xml) + String.parse)); + engine_name = + (Xml.required "EngineName" + (Util.option_bind (Xml.member "EngineName" xml) String.parse)); + major_engine_version = + (Xml.required "MajorEngineVersion" + (Util.option_bind (Xml.member "MajorEngineVersion" xml) + String.parse)); + option_group_description = + (Xml.required "OptionGroupDescription" + (Util.option_bind (Xml.member "OptionGroupDescription" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "OptionGroupOptions.member" - , OptionGroupOptionsList.to_query v.option_group_options )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some - ( "option_group_options" - , OptionGroupOptionsList.to_json v.option_group_options ) - ]) - - let of_json j = - { option_group_options = - OptionGroupOptionsList.of_json - (Util.of_option_exn (Json.lookup j "option_group_options")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DescribeDBLogFilesMessage = struct - type t = - { d_b_instance_identifier : String.t - ; filename_contains : String.t option - ; file_last_written : Long.t option - ; file_size : Long.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ~d_b_instance_identifier - ?filename_contains - ?file_last_written - ?file_size - ?(filters = []) - ?max_records - ?marker - () = - { d_b_instance_identifier - ; filename_contains - ; file_last_written - ; file_size - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; filename_contains = - Util.option_bind (Xml.member "FilenameContains" xml) String.parse - ; file_last_written = Util.option_bind (Xml.member "FileLastWritten" xml) Long.parse - ; file_size = Util.option_bind (Xml.member "FileSize" xml) Long.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.file_size (fun f -> Query.Pair ("FileSize", Long.to_query f)) - ; Util.option_map v.file_last_written (fun f -> - Query.Pair ("FileLastWritten", Long.to_query f)) - ; Util.option_map v.filename_contains (fun f -> - Query.Pair ("FilenameContains", String.to_query f)) - ; Some + ("OptionGroupDescription", + (String.to_query v.option_group_description))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.file_size (fun f -> "file_size", Long.to_json f) - ; Util.option_map v.file_last_written (fun f -> - "file_last_written", Long.to_json f) - ; Util.option_map v.filename_contains (fun f -> - "filename_contains", String.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; filename_contains = - Util.option_map (Json.lookup j "filename_contains") String.of_json - ; file_last_written = Util.option_map (Json.lookup j "file_last_written") Long.of_json - ; file_size = Util.option_map (Json.lookup j "file_size") Long.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DeleteDBClusterResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module InvalidDBClusterSnapshotStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDBSecurityGroupsMessage = struct - type t = - { d_b_security_group_name : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_security_group_name ?(filters = []) ?max_records ?marker () = - { d_b_security_group_name; filters; max_records; marker } - - let parse xml = - Some - { d_b_security_group_name = - Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_security_group_name (fun f -> - Query.Pair ("DBSecurityGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_security_group_name (fun f -> - "d_b_security_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_security_group_name = - Util.option_map (Json.lookup j "d_b_security_group_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module InsufficientStorageClusterCapacityFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AuthorizationNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBClusterQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBSnapshotResult = struct - type t = { d_b_snapshot : DBSnapshot.t option } - - let make ?d_b_snapshot () = { d_b_snapshot } - - let parse xml = - Some - { d_b_snapshot = Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> - Query.Pair ("DBSnapshot", DBSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> "d_b_snapshot", DBSnapshot.to_json f) - ]) - - let of_json j = - { d_b_snapshot = Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json } -end - -module CreateDBSubnetGroupMessage = struct - type t = - { d_b_subnet_group_name : String.t - ; d_b_subnet_group_description : String.t - ; subnet_ids : SubnetIdentifierList.t - ; tags : TagList.t - } - - let make - ~d_b_subnet_group_name - ~d_b_subnet_group_description - ~subnet_ids - ?(tags = []) - () = - { d_b_subnet_group_name; d_b_subnet_group_description; subnet_ids; tags } - - let parse xml = - Some - { d_b_subnet_group_name = - Xml.required - "DBSubnetGroupName" - (Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse) - ; d_b_subnet_group_description = - Xml.required - "DBSubnetGroupDescription" - (Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) String.parse) - ; subnet_ids = - Xml.required - "SubnetIds" - (Util.option_bind (Xml.member "SubnetIds" xml) SubnetIdentifierList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some - (Query.Pair ("SubnetIds.member", SubnetIdentifierList.to_query v.subnet_ids)) - ; Some + ("MajorEngineVersion", + (String.to_query v.major_engine_version))); + Some (Query.Pair ("EngineName", (String.to_query v.engine_name))); + Some (Query.Pair - ( "DBSubnetGroupDescription" - , String.to_query v.d_b_subnet_group_description )) - ; Some - (Query.Pair ("DBSubnetGroupName", String.to_query v.d_b_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("subnet_ids", SubnetIdentifierList.to_json v.subnet_ids) - ; Some - ( "d_b_subnet_group_description" - , String.to_json v.d_b_subnet_group_description ) - ; Some ("d_b_subnet_group_name", String.to_json v.d_b_subnet_group_name) - ]) - - let of_json j = - { d_b_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name")) - ; d_b_subnet_group_description = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_subnet_group_description")) - ; subnet_ids = - SubnetIdentifierList.of_json (Util.of_option_exn (Json.lookup j "subnet_ids")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DeleteDBSnapshotMessage = struct - type t = { d_b_snapshot_identifier : String.t } - - let make ~d_b_snapshot_identifier () = { d_b_snapshot_identifier } - - let parse xml = - Some - { d_b_snapshot_identifier = - Xml.required - "DBSnapshotIdentifier" - (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("OptionGroupName", (String.to_query v.option_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("option_group_description", + (String.to_json v.option_group_description)); + Some + ("major_engine_version", + (String.to_json v.major_engine_version)); + Some ("engine_name", (String.to_json v.engine_name)); + Some ("option_group_name", (String.to_json v.option_group_name))]) + let of_json j = + { + option_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "option_group_name"))); + engine_name = + (String.of_json (Util.of_option_exn (Json.lookup j "engine_name"))); + major_engine_version = + (String.of_json + (Util.of_option_exn (Json.lookup j "major_engine_version"))); + option_group_description = + (String.of_json + (Util.of_option_exn (Json.lookup j "option_group_description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module InvalidVPCNetworkStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SubnetAlreadyInUse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ProvisionedIopsNotAvailableInAZFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module PendingMaintenanceActionsMessage = + struct + type t = + { + pending_maintenance_actions: PendingMaintenanceActions.t ; + marker: String.t option } + let make ?(pending_maintenance_actions= []) ?marker () = + { pending_maintenance_actions; marker } + let parse xml = + Some + { + pending_maintenance_actions = + (Util.of_option [] + (Util.option_bind (Xml.member "PendingMaintenanceActions" xml) + PendingMaintenanceActions.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("DBSnapshotIdentifier", String.to_query v.d_b_snapshot_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_snapshot_identifier", String.to_json v.d_b_snapshot_identifier) ]) - - let of_json j = - { d_b_snapshot_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier")) - } -end - -module CreateDBInstanceReadReplicaResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module DescribeDBSubnetGroupsMessage = struct - type t = - { d_b_subnet_group_name : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_subnet_group_name ?(filters = []) ?max_records ?marker () = - { d_b_subnet_group_name; filters; max_records; marker } - - let parse xml = - Some - { d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ReservedDBInstancesOfferingNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBSubnetGroupMessage = struct - type t = { d_b_subnet_group_name : String.t } - - let make ~d_b_subnet_group_name () = { d_b_subnet_group_name } - - let parse xml = - Some - { d_b_subnet_group_name = - Xml.required - "DBSubnetGroupName" - (Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DBSubnetGroupName", String.to_query v.d_b_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_subnet_group_name", String.to_json v.d_b_subnet_group_name) ]) - - let of_json j = - { d_b_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name")) - } -end - -module AddSourceIdentifierToSubscriptionResult = struct - type t = { event_subscription : EventSubscription.t option } - - let make ?event_subscription () = { event_subscription } - - let parse xml = - Some - { event_subscription = - Util.option_bind (Xml.member "EventSubscription" xml) EventSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - Query.Pair ("EventSubscription", EventSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - "event_subscription", EventSubscription.to_json f) - ]) - - let of_json j = - { event_subscription = - Util.option_map (Json.lookup j "event_subscription") EventSubscription.of_json - } -end - -module DescribeEventSubscriptionsMessage = struct - type t = - { subscription_name : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?subscription_name ?(filters = []) ?max_records ?marker () = - { subscription_name; filters; max_records; marker } - - let parse xml = - Some - { subscription_name = - Util.option_bind (Xml.member "SubscriptionName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.subscription_name (fun f -> - Query.Pair ("SubscriptionName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.subscription_name (fun f -> - "subscription_name", String.to_json f) - ]) - - let of_json j = - { subscription_name = - Util.option_map (Json.lookup j "subscription_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DescribeAccountAttributesMessage = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBInstanceNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module TagListMessage = struct - type t = { tag_list : TagList.t } - - let make ?(tag_list = []) () = { tag_list } - - let parse xml = - Some - { tag_list = - Util.of_option [] (Util.option_bind (Xml.member "TagList" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagList.member", TagList.to_query v.tag_list)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("tag_list", TagList.to_json v.tag_list) ]) - - let of_json j = - { tag_list = TagList.of_json (Util.of_option_exn (Json.lookup j "tag_list")) } -end - -module InvalidDBSubnetGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RebootDBInstanceMessage = struct - type t = - { d_b_instance_identifier : String.t - ; force_failover : Boolean.t option - } - - let make ~d_b_instance_identifier ?force_failover () = - { d_b_instance_identifier; force_failover } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; force_failover = Util.option_bind (Xml.member "ForceFailover" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.force_failover (fun f -> - Query.Pair ("ForceFailover", Boolean.to_query f)) - ; Some + ("PendingMaintenanceActions.member", + (PendingMaintenanceActions.to_query + v.pending_maintenance_actions)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("pending_maintenance_actions", + (PendingMaintenanceActions.to_json + v.pending_maintenance_actions))]) + let of_json j = + { + pending_maintenance_actions = + (PendingMaintenanceActions.of_json + (Util.of_option_exn + (Json.lookup j "pending_maintenance_actions"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module RestoreDBInstanceToPointInTimeMessage = + struct + type t = + { + source_d_b_instance_identifier: String.t ; + target_d_b_instance_identifier: String.t ; + restore_time: DateTime.t option ; + use_latest_restorable_time: Boolean.t option ; + d_b_instance_class: String.t option ; + port: Integer.t option ; + availability_zone: String.t option ; + d_b_subnet_group_name: String.t option ; + multi_a_z: Boolean.t option ; + publicly_accessible: Boolean.t option ; + auto_minor_version_upgrade: Boolean.t option ; + license_model: String.t option ; + d_b_name: String.t option ; + engine: String.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + copy_tags_to_snapshot: Boolean.t option ; + tags: TagList.t ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + tde_credential_password: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + d_b_security_groups: DBSecurityGroupNameList.t ; + domain: String.t option } + let make ~source_d_b_instance_identifier ~target_d_b_instance_identifier + ?restore_time ?use_latest_restorable_time ?d_b_instance_class ?port + ?availability_zone ?d_b_subnet_group_name ?multi_a_z + ?publicly_accessible ?auto_minor_version_upgrade ?license_model + ?d_b_name ?engine ?iops ?option_group_name ?copy_tags_to_snapshot + ?(tags= []) ?storage_type ?tde_credential_arn + ?tde_credential_password ?(vpc_security_group_ids= []) + ?(d_b_security_groups= []) ?domain () = + { + source_d_b_instance_identifier; + target_d_b_instance_identifier; + restore_time; + use_latest_restorable_time; + d_b_instance_class; + port; + availability_zone; + d_b_subnet_group_name; + multi_a_z; + publicly_accessible; + auto_minor_version_upgrade; + license_model; + d_b_name; + engine; + iops; + option_group_name; + copy_tags_to_snapshot; + tags; + storage_type; + tde_credential_arn; + tde_credential_password; + vpc_security_group_ids; + d_b_security_groups; + domain + } + let parse xml = + Some + { + source_d_b_instance_identifier = + (Xml.required "SourceDBInstanceIdentifier" + (Util.option_bind + (Xml.member "SourceDBInstanceIdentifier" xml) String.parse)); + target_d_b_instance_identifier = + (Xml.required "TargetDBInstanceIdentifier" + (Util.option_bind + (Xml.member "TargetDBInstanceIdentifier" xml) String.parse)); + restore_time = + (Util.option_bind (Xml.member "RestoreTime" xml) DateTime.parse); + use_latest_restorable_time = + (Util.option_bind (Xml.member "UseLatestRestorableTime" xml) + Boolean.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + publicly_accessible = + (Util.option_bind (Xml.member "PubliclyAccessible" xml) + Boolean.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + d_b_name = + (Util.option_bind (Xml.member "DBName" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + tde_credential_password = + (Util.option_bind (Xml.member "TdeCredentialPassword" xml) + String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroupNameList.parse)); + domain = (Util.option_bind (Xml.member "Domain" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (String.to_query f))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.force_failover (fun f -> "force_failover", Boolean.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; force_failover = Util.option_map (Json.lookup j "force_failover") Boolean.of_json - } -end - -module AuthorizationAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBClusterSnapshotResult = struct - type t = { d_b_cluster_snapshot : DBClusterSnapshot.t option } - - let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } - - let parse xml = - Some - { d_b_cluster_snapshot = - Util.option_bind (Xml.member "DBClusterSnapshot" xml) DBClusterSnapshot.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - Query.Pair ("DBClusterSnapshot", DBClusterSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - "d_b_cluster_snapshot", DBClusterSnapshot.to_json f) - ]) - - let of_json j = - { d_b_cluster_snapshot = - Util.option_map (Json.lookup j "d_b_cluster_snapshot") DBClusterSnapshot.of_json - } -end - -module DBSnapshotAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyDBClusterMessage = struct - type t = - { d_b_cluster_identifier : String.t option - ; new_d_b_cluster_identifier : String.t option - ; apply_immediately : Boolean.t option - ; backup_retention_period : Integer.t option - ; d_b_cluster_parameter_group_name : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; port : Integer.t option - ; master_user_password : String.t option - ; option_group_name : String.t option - ; preferred_backup_window : String.t option - ; preferred_maintenance_window : String.t option - } - - let make - ?d_b_cluster_identifier - ?new_d_b_cluster_identifier - ?apply_immediately - ?backup_retention_period - ?d_b_cluster_parameter_group_name - ?(vpc_security_group_ids = []) - ?port - ?master_user_password - ?option_group_name - ?preferred_backup_window - ?preferred_maintenance_window - () = - { d_b_cluster_identifier - ; new_d_b_cluster_identifier - ; apply_immediately - ; backup_retention_period - ; d_b_cluster_parameter_group_name - ; vpc_security_group_ids - ; port - ; master_user_password - ; option_group_name - ; preferred_backup_window - ; preferred_maintenance_window - } - - let parse xml = - Some - { d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; new_d_b_cluster_identifier = - Util.option_bind (Xml.member "NewDBClusterIdentifier" xml) String.parse - ; apply_immediately = - Util.option_bind (Xml.member "ApplyImmediately" xml) Boolean.parse - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; d_b_cluster_parameter_group_name = - Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; master_user_password = - Util.option_bind (Xml.member "MasterUserPassword" xml) String.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.master_user_password (fun f -> - Query.Pair ("MasterUserPassword", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Some + ("DBSecurityGroups.member", + (DBSecurityGroupNameList.to_query v.d_b_security_groups))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - Query.Pair ("DBClusterParameterGroupName", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Util.option_map v.apply_immediately (fun f -> - Query.Pair ("ApplyImmediately", Boolean.to_query f)) - ; Util.option_map v.new_d_b_cluster_identifier (fun f -> - Query.Pair ("NewDBClusterIdentifier", String.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.master_user_password (fun f -> - "master_user_password", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - "d_b_cluster_parameter_group_name", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Util.option_map v.apply_immediately (fun f -> - "apply_immediately", Boolean.to_json f) - ; Util.option_map v.new_d_b_cluster_identifier (fun f -> - "new_d_b_cluster_identifier", String.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; new_d_b_cluster_identifier = - Util.option_map (Json.lookup j "new_d_b_cluster_identifier") String.of_json - ; apply_immediately = - Util.option_map (Json.lookup j "apply_immediately") Boolean.of_json - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; d_b_cluster_parameter_group_name = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; master_user_password = - Util.option_map (Json.lookup j "master_user_password") String.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - } -end - -module CreateDBInstanceResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module DBClusterParameterGroupNameMessage = struct - type t = { d_b_cluster_parameter_group_name : String.t option } - - let make ?d_b_cluster_parameter_group_name () = { d_b_cluster_parameter_group_name } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - Query.Pair ("DBClusterParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - "d_b_cluster_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") String.of_json - } -end - -module DBClusterSnapshotAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBClusterSnapshotMessage = struct - type t = { d_b_cluster_snapshot_identifier : String.t } - - let make ~d_b_cluster_snapshot_identifier () = { d_b_cluster_snapshot_identifier } - - let parse xml = - Some - { d_b_cluster_snapshot_identifier = - Xml.required - "DBClusterSnapshotIdentifier" - (Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.tde_credential_password + (fun f -> + Query.Pair ("TdeCredentialPassword", (String.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.d_b_name + (fun f -> Query.Pair ("DBName", (String.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.publicly_accessible + (fun f -> + Query.Pair ("PubliclyAccessible", (Boolean.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.use_latest_restorable_time + (fun f -> + Query.Pair ("UseLatestRestorableTime", (Boolean.to_query f))); + Util.option_map v.restore_time + (fun f -> Query.Pair ("RestoreTime", (DateTime.to_query f))); + Some (Query.Pair - ( "DBClusterSnapshotIdentifier" - , String.to_query v.d_b_cluster_snapshot_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "d_b_cluster_snapshot_identifier" - , String.to_json v.d_b_cluster_snapshot_identifier ) - ]) - - let of_json j = - { d_b_cluster_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_snapshot_identifier")) - } -end - -module DBSubnetGroupDoesNotCoverEnoughAZs = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBClusterMessage = struct - type t = - { d_b_cluster_identifier : String.t option - ; skip_final_snapshot : Boolean.t option - ; final_d_b_snapshot_identifier : String.t option - } - - let make ?d_b_cluster_identifier ?skip_final_snapshot ?final_d_b_snapshot_identifier () - = - { d_b_cluster_identifier; skip_final_snapshot; final_d_b_snapshot_identifier } - - let parse xml = - Some - { d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; skip_final_snapshot = - Util.option_bind (Xml.member "SkipFinalSnapshot" xml) Boolean.parse - ; final_d_b_snapshot_identifier = - Util.option_bind (Xml.member "FinalDBSnapshotIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.final_d_b_snapshot_identifier (fun f -> - Query.Pair ("FinalDBSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.skip_final_snapshot (fun f -> - Query.Pair ("SkipFinalSnapshot", Boolean.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.final_d_b_snapshot_identifier (fun f -> - "final_d_b_snapshot_identifier", String.to_json f) - ; Util.option_map v.skip_final_snapshot (fun f -> - "skip_final_snapshot", Boolean.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; skip_final_snapshot = - Util.option_map (Json.lookup j "skip_final_snapshot") Boolean.of_json - ; final_d_b_snapshot_identifier = - Util.option_map (Json.lookup j "final_d_b_snapshot_identifier") String.of_json - } -end - -module CreateDBClusterResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module DomainNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeEngineDefaultParametersResult = struct - type t = { engine_defaults : EngineDefaults.t } - - let make ~engine_defaults () = { engine_defaults } - - let parse xml = - Some - { engine_defaults = - Xml.required - "EngineDefaults" - (Util.option_bind (Xml.member "EngineDefaults" xml) EngineDefaults.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("EngineDefaults", EngineDefaults.to_query v.engine_defaults)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("engine_defaults", EngineDefaults.to_json v.engine_defaults) ]) - - let of_json j = - { engine_defaults = - EngineDefaults.of_json (Util.of_option_exn (Json.lookup j "engine_defaults")) - } -end - -module InvalidDBSecurityGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module PointInTimeRestoreNotEnabledFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module EventSubscriptionsMessage = struct - type t = - { marker : String.t option - ; event_subscriptions_list : EventSubscriptionsList.t - } - - let make ?marker ?(event_subscriptions_list = []) () = - { marker; event_subscriptions_list } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; event_subscriptions_list = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventSubscriptionsList" xml) - EventSubscriptionsList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("TargetDBInstanceIdentifier", + (String.to_query v.target_d_b_instance_identifier))); + Some (Query.Pair - ( "EventSubscriptionsList.member" - , EventSubscriptionsList.to_query v.event_subscriptions_list )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "event_subscriptions_list" - , EventSubscriptionsList.to_json v.event_subscriptions_list ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; event_subscriptions_list = - EventSubscriptionsList.of_json - (Util.of_option_exn (Json.lookup j "event_subscriptions_list")) - } -end - -module DescribeEngineDefaultClusterParametersMessage = struct - type t = - { d_b_parameter_group_family : String.t - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~d_b_parameter_group_family ?(filters = []) ?max_records ?marker () = - { d_b_parameter_group_family; filters; max_records; marker } - - let parse xml = - Some - { d_b_parameter_group_family = - Xml.required - "DBParameterGroupFamily" - (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Some + ("SourceDBInstanceIdentifier", + (String.to_query v.source_d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.domain + (fun f -> ("domain", (String.to_json f))); + Some + ("d_b_security_groups", + (DBSecurityGroupNameList.to_json v.d_b_security_groups)); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.tde_credential_password + (fun f -> ("tde_credential_password", (String.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.d_b_name + (fun f -> ("d_b_name", (String.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.publicly_accessible + (fun f -> ("publicly_accessible", (Boolean.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.use_latest_restorable_time + (fun f -> ("use_latest_restorable_time", (Boolean.to_json f))); + Util.option_map v.restore_time + (fun f -> ("restore_time", (DateTime.to_json f))); + Some + ("target_d_b_instance_identifier", + (String.to_json v.target_d_b_instance_identifier)); + Some + ("source_d_b_instance_identifier", + (String.to_json v.source_d_b_instance_identifier))]) + let of_json j = + { + source_d_b_instance_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_instance_identifier"))); + target_d_b_instance_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_d_b_instance_identifier"))); + restore_time = + (Util.option_map (Json.lookup j "restore_time") DateTime.of_json); + use_latest_restorable_time = + (Util.option_map (Json.lookup j "use_latest_restorable_time") + Boolean.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + publicly_accessible = + (Util.option_map (Json.lookup j "publicly_accessible") + Boolean.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + d_b_name = + (Util.option_map (Json.lookup j "d_b_name") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + tde_credential_password = + (Util.option_map (Json.lookup j "tde_credential_password") + String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + d_b_security_groups = + (DBSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))); + domain = (Util.option_map (Json.lookup j "domain") String.of_json) + } + end +module ModifyDBParameterGroupMessage = + struct + type t = + { + d_b_parameter_group_name: String.t ; + parameters: ParametersList.t } + let make ~d_b_parameter_group_name ~parameters () = + { d_b_parameter_group_name; parameters } + let parse xml = + Some + { + d_b_parameter_group_name = + (Xml.required "DBParameterGroupName" + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse)); + parameters = + (Xml.required "Parameters" + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", + (ParametersList.to_query v.parameters))); + Some (Query.Pair - ("DBParameterGroupFamily", String.to_query v.d_b_parameter_group_family)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("d_b_parameter_group_family", String.to_json v.d_b_parameter_group_family) - ]) - - let of_json j = - { d_b_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module AddSourceIdentifierToSubscriptionMessage = struct - type t = - { subscription_name : String.t - ; source_identifier : String.t - } - - let make ~subscription_name ~source_identifier () = - { subscription_name; source_identifier } - - let parse xml = - Some - { subscription_name = - Xml.required - "SubscriptionName" - (Util.option_bind (Xml.member "SubscriptionName" xml) String.parse) - ; source_identifier = - Xml.required - "SourceIdentifier" - (Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SourceIdentifier", String.to_query v.source_identifier)) - ; Some (Query.Pair ("SubscriptionName", String.to_query v.subscription_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("source_identifier", String.to_json v.source_identifier) - ; Some ("subscription_name", String.to_json v.subscription_name) - ]) - - let of_json j = - { subscription_name = - String.of_json (Util.of_option_exn (Json.lookup j "subscription_name")) - ; source_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "source_identifier")) - } -end - -module DBClusterSnapshotNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSubnetQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module StorageTypeNotSupportedFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidSubnet = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyOptionGroupMessage = struct - type t = - { option_group_name : String.t - ; options_to_include : OptionConfigurationList.t - ; options_to_remove : OptionNamesList.t - ; apply_immediately : Boolean.t option - } - - let make - ~option_group_name - ?(options_to_include = []) - ?(options_to_remove = []) - ?apply_immediately - () = - { option_group_name; options_to_include; options_to_remove; apply_immediately } - - let parse xml = - Some - { option_group_name = - Xml.required - "OptionGroupName" - (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse) - ; options_to_include = - Util.of_option - [] - (Util.option_bind - (Xml.member "OptionsToInclude" xml) - OptionConfigurationList.parse) - ; options_to_remove = - Util.of_option - [] - (Util.option_bind (Xml.member "OptionsToRemove" xml) OptionNamesList.parse) - ; apply_immediately = - Util.option_bind (Xml.member "ApplyImmediately" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.apply_immediately (fun f -> - Query.Pair ("ApplyImmediately", Boolean.to_query f)) - ; Some + ("DBParameterGroupName", + (String.to_query v.d_b_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (ParametersList.to_json v.parameters)); + Some + ("d_b_parameter_group_name", + (String.to_json v.d_b_parameter_group_name))]) + let of_json j = + { + d_b_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name"))); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module SubscriptionCategoryNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSubnetGroupMessage = + struct + type t = { + marker: String.t option ; + d_b_subnet_groups: DBSubnetGroups.t } + let make ?marker ?(d_b_subnet_groups= []) () = + { marker; d_b_subnet_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_subnet_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSubnetGroups" xml) + DBSubnetGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSubnetGroups.member", + (DBSubnetGroups.to_query v.d_b_subnet_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_subnet_groups", + (DBSubnetGroups.to_json v.d_b_subnet_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_subnet_groups = + (DBSubnetGroups.of_json + (Util.of_option_exn (Json.lookup j "d_b_subnet_groups"))) + } + end +module ResourceNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBClusterSnapshotMessage = + struct + type t = + { + d_b_cluster_snapshot_identifier: String.t ; + d_b_cluster_identifier: String.t ; + tags: TagList.t } + let make ~d_b_cluster_snapshot_identifier ~d_b_cluster_identifier + ?(tags= []) () = + { d_b_cluster_snapshot_identifier; d_b_cluster_identifier; tags } + let parse xml = + Some + { + d_b_cluster_snapshot_identifier = + (Xml.required "DBClusterSnapshotIdentifier" + (Util.option_bind + (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse)); + d_b_cluster_identifier = + (Xml.required "DBClusterIdentifier" + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ("OptionsToRemove.member", OptionNamesList.to_query v.options_to_remove)) - ; Some + ("DBClusterIdentifier", + (String.to_query v.d_b_cluster_identifier))); + Some (Query.Pair - ( "OptionsToInclude.member" - , OptionConfigurationList.to_query v.options_to_include )) - ; Some (Query.Pair ("OptionGroupName", String.to_query v.option_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.apply_immediately (fun f -> - "apply_immediately", Boolean.to_json f) - ; Some ("options_to_remove", OptionNamesList.to_json v.options_to_remove) - ; Some - ("options_to_include", OptionConfigurationList.to_json v.options_to_include) - ; Some ("option_group_name", String.to_json v.option_group_name) - ]) - - let of_json j = - { option_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "option_group_name")) - ; options_to_include = - OptionConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "options_to_include")) - ; options_to_remove = - OptionNamesList.of_json (Util.of_option_exn (Json.lookup j "options_to_remove")) - ; apply_immediately = - Util.option_map (Json.lookup j "apply_immediately") Boolean.of_json - } -end - -module ReservedDBInstanceMessage = struct - type t = - { marker : String.t option - ; reserved_d_b_instances : ReservedDBInstanceList.t - } - - let make ?marker ?(reserved_d_b_instances = []) () = { marker; reserved_d_b_instances } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; reserved_d_b_instances = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedDBInstances" xml) - ReservedDBInstanceList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "ReservedDBInstances.member" - , ReservedDBInstanceList.to_query v.reserved_d_b_instances )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_d_b_instances" - , ReservedDBInstanceList.to_json v.reserved_d_b_instances ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; reserved_d_b_instances = - ReservedDBInstanceList.of_json - (Util.of_option_exn (Json.lookup j "reserved_d_b_instances")) - } -end - -module DBParameterGroupDetails = struct - type t = - { parameters : ParametersList.t - ; marker : String.t option - } - - let make ?(parameters = []) ?marker () = { parameters; marker } - - let parse xml = - Some - { parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("parameters", ParametersList.to_json v.parameters) - ]) - - let of_json j = - { parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module AddTagsToResourceMessage = struct - type t = - { resource_name : String.t - ; tags : TagList.t - } - - let make ~resource_name ~tags () = { resource_name; tags } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - ; tags = - Xml.required "Tags" (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("resource_name", String.to_json v.resource_name) - ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ApplyPendingMaintenanceActionResult = struct - type t = - { resource_pending_maintenance_actions : ResourcePendingMaintenanceActions.t option } - - let make ?resource_pending_maintenance_actions () = - { resource_pending_maintenance_actions } - - let parse xml = - Some - { resource_pending_maintenance_actions = - Util.option_bind - (Xml.member "ResourcePendingMaintenanceActions" xml) - ResourcePendingMaintenanceActions.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.resource_pending_maintenance_actions (fun f -> - Query.Pair - ( "ResourcePendingMaintenanceActions" - , ResourcePendingMaintenanceActions.to_query f )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.resource_pending_maintenance_actions (fun f -> - ( "resource_pending_maintenance_actions" - , ResourcePendingMaintenanceActions.to_json f )) - ]) - - let of_json j = - { resource_pending_maintenance_actions = - Util.option_map - (Json.lookup j "resource_pending_maintenance_actions") - ResourcePendingMaintenanceActions.of_json - } -end - -module InvalidOptionGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyDBSubnetGroupResult = struct - type t = { d_b_subnet_group : DBSubnetGroup.t option } - - let make ?d_b_subnet_group () = { d_b_subnet_group } - - let parse xml = - Some - { d_b_subnet_group = - Util.option_bind (Xml.member "DBSubnetGroup" xml) DBSubnetGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_subnet_group (fun f -> - Query.Pair ("DBSubnetGroup", DBSubnetGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_subnet_group (fun f -> - "d_b_subnet_group", DBSubnetGroup.to_json f) - ]) - - let of_json j = - { d_b_subnet_group = - Util.option_map (Json.lookup j "d_b_subnet_group") DBSubnetGroup.of_json - } -end - -module InsufficientDomainCapacityFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SNSNoAuthorizationFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBClusterSnapshotResult = struct - type t = { d_b_cluster_snapshot : DBClusterSnapshot.t option } - - let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } - - let parse xml = - Some - { d_b_cluster_snapshot = - Util.option_bind (Xml.member "DBClusterSnapshot" xml) DBClusterSnapshot.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - Query.Pair ("DBClusterSnapshot", DBClusterSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - "d_b_cluster_snapshot", DBClusterSnapshot.to_json f) - ]) - - let of_json j = - { d_b_cluster_snapshot = - Util.option_map (Json.lookup j "d_b_cluster_snapshot") DBClusterSnapshot.of_json - } -end - -module CreateOptionGroupMessage = struct - type t = - { option_group_name : String.t - ; engine_name : String.t - ; major_engine_version : String.t - ; option_group_description : String.t - ; tags : TagList.t - } - - let make - ~option_group_name - ~engine_name - ~major_engine_version - ~option_group_description - ?(tags = []) - () = - { option_group_name - ; engine_name - ; major_engine_version - ; option_group_description - ; tags - } - - let parse xml = - Some - { option_group_name = - Xml.required - "OptionGroupName" - (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse) - ; engine_name = - Xml.required - "EngineName" - (Util.option_bind (Xml.member "EngineName" xml) String.parse) - ; major_engine_version = - Xml.required - "MajorEngineVersion" - (Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse) - ; option_group_description = - Xml.required - "OptionGroupDescription" - (Util.option_bind (Xml.member "OptionGroupDescription" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some - (Query.Pair - ("OptionGroupDescription", String.to_query v.option_group_description)) - ; Some - (Query.Pair ("MajorEngineVersion", String.to_query v.major_engine_version)) - ; Some (Query.Pair ("EngineName", String.to_query v.engine_name)) - ; Some (Query.Pair ("OptionGroupName", String.to_query v.option_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("option_group_description", String.to_json v.option_group_description) - ; Some ("major_engine_version", String.to_json v.major_engine_version) - ; Some ("engine_name", String.to_json v.engine_name) - ; Some ("option_group_name", String.to_json v.option_group_name) - ]) - - let of_json j = - { option_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "option_group_name")) - ; engine_name = String.of_json (Util.of_option_exn (Json.lookup j "engine_name")) - ; major_engine_version = - String.of_json (Util.of_option_exn (Json.lookup j "major_engine_version")) - ; option_group_description = - String.of_json (Util.of_option_exn (Json.lookup j "option_group_description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module InvalidVPCNetworkStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SubnetAlreadyInUse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ProvisionedIopsNotAvailableInAZFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module PendingMaintenanceActionsMessage = struct - type t = - { pending_maintenance_actions : PendingMaintenanceActions.t - ; marker : String.t option - } - - let make ?(pending_maintenance_actions = []) ?marker () = - { pending_maintenance_actions; marker } - - let parse xml = - Some - { pending_maintenance_actions = - Util.of_option - [] - (Util.option_bind - (Xml.member "PendingMaintenanceActions" xml) - PendingMaintenanceActions.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + ("DBClusterSnapshotIdentifier", + (String.to_query v.d_b_cluster_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("d_b_cluster_identifier", + (String.to_json v.d_b_cluster_identifier)); + Some + ("d_b_cluster_snapshot_identifier", + (String.to_json v.d_b_cluster_snapshot_identifier))]) + let of_json j = + { + d_b_cluster_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_snapshot_identifier"))); + d_b_cluster_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ReservedDBInstanceQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBParameterGroupResult = + struct + type t = { + d_b_parameter_group: DBParameterGroup.t option } + let make ?d_b_parameter_group () = { d_b_parameter_group } + let parse xml = + Some + { + d_b_parameter_group = + (Util.option_bind (Xml.member "DBParameterGroup" xml) + DBParameterGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group + (fun f -> + Query.Pair + ("DBParameterGroup", (DBParameterGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group + (fun f -> ("d_b_parameter_group", (DBParameterGroup.to_json f)))]) + let of_json j = + { + d_b_parameter_group = + (Util.option_map (Json.lookup j "d_b_parameter_group") + DBParameterGroup.of_json) + } + end +module InvalidDBSnapshotStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidDBInstanceStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DownloadDBLogFilePortionMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + log_file_name: String.t ; + marker: String.t option ; + number_of_lines: Integer.t option } + let make ~d_b_instance_identifier ~log_file_name ?marker + ?number_of_lines () = + { d_b_instance_identifier; log_file_name; marker; number_of_lines } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + log_file_name = + (Xml.required "LogFileName" + (Util.option_bind (Xml.member "LogFileName" xml) String.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + number_of_lines = + (Util.option_bind (Xml.member "NumberOfLines" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.number_of_lines + (fun f -> Query.Pair ("NumberOfLines", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair ("LogFileName", (String.to_query v.log_file_name))); + Some (Query.Pair - ( "PendingMaintenanceActions.member" - , PendingMaintenanceActions.to_query v.pending_maintenance_actions )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some - ( "pending_maintenance_actions" - , PendingMaintenanceActions.to_json v.pending_maintenance_actions ) - ]) - - let of_json j = - { pending_maintenance_actions = - PendingMaintenanceActions.of_json - (Util.of_option_exn (Json.lookup j "pending_maintenance_actions")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module RestoreDBInstanceToPointInTimeMessage = struct - type t = - { source_d_b_instance_identifier : String.t - ; target_d_b_instance_identifier : String.t - ; restore_time : DateTime.t option - ; use_latest_restorable_time : Boolean.t option - ; d_b_instance_class : String.t option - ; port : Integer.t option - ; availability_zone : String.t option - ; d_b_subnet_group_name : String.t option - ; multi_a_z : Boolean.t option - ; publicly_accessible : Boolean.t option - ; auto_minor_version_upgrade : Boolean.t option - ; license_model : String.t option - ; d_b_name : String.t option - ; engine : String.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; copy_tags_to_snapshot : Boolean.t option - ; tags : TagList.t - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; tde_credential_password : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; d_b_security_groups : DBSecurityGroupNameList.t - ; domain : String.t option - } - - let make - ~source_d_b_instance_identifier - ~target_d_b_instance_identifier - ?restore_time - ?use_latest_restorable_time - ?d_b_instance_class - ?port - ?availability_zone - ?d_b_subnet_group_name - ?multi_a_z - ?publicly_accessible - ?auto_minor_version_upgrade - ?license_model - ?d_b_name - ?engine - ?iops - ?option_group_name - ?copy_tags_to_snapshot - ?(tags = []) - ?storage_type - ?tde_credential_arn - ?tde_credential_password - ?(vpc_security_group_ids = []) - ?(d_b_security_groups = []) - ?domain - () = - { source_d_b_instance_identifier - ; target_d_b_instance_identifier - ; restore_time - ; use_latest_restorable_time - ; d_b_instance_class - ; port - ; availability_zone - ; d_b_subnet_group_name - ; multi_a_z - ; publicly_accessible - ; auto_minor_version_upgrade - ; license_model - ; d_b_name - ; engine - ; iops - ; option_group_name - ; copy_tags_to_snapshot - ; tags - ; storage_type - ; tde_credential_arn - ; tde_credential_password - ; vpc_security_group_ids - ; d_b_security_groups - ; domain - } - - let parse xml = - Some - { source_d_b_instance_identifier = - Xml.required - "SourceDBInstanceIdentifier" - (Util.option_bind (Xml.member "SourceDBInstanceIdentifier" xml) String.parse) - ; target_d_b_instance_identifier = - Xml.required - "TargetDBInstanceIdentifier" - (Util.option_bind (Xml.member "TargetDBInstanceIdentifier" xml) String.parse) - ; restore_time = Util.option_bind (Xml.member "RestoreTime" xml) DateTime.parse - ; use_latest_restorable_time = - Util.option_bind (Xml.member "UseLatestRestorableTime" xml) Boolean.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; publicly_accessible = - Util.option_bind (Xml.member "PubliclyAccessible" xml) Boolean.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; d_b_name = Util.option_bind (Xml.member "DBName" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; tde_credential_password = - Util.option_bind (Xml.member "TdeCredentialPassword" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; d_b_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBSecurityGroups" xml) - DBSecurityGroupNameList.parse) - ; domain = Util.option_bind (Xml.member "Domain" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.domain (fun f -> Query.Pair ("Domain", String.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.number_of_lines + (fun f -> ("number_of_lines", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Some ("log_file_name", (String.to_json v.log_file_name)); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + log_file_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "log_file_name"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + number_of_lines = + (Util.option_map (Json.lookup j "number_of_lines") Integer.of_json) + } + end +module AuthorizeDBSecurityGroupIngressMessage = + struct + type t = + { + d_b_security_group_name: String.t ; + c_i_d_r_i_p: String.t option ; + e_c2_security_group_name: String.t option ; + e_c2_security_group_id: String.t option ; + e_c2_security_group_owner_id: String.t option } + let make ~d_b_security_group_name ?c_i_d_r_i_p + ?e_c2_security_group_name ?e_c2_security_group_id + ?e_c2_security_group_owner_id () = + { + d_b_security_group_name; + c_i_d_r_i_p; + e_c2_security_group_name; + e_c2_security_group_id; + e_c2_security_group_owner_id + } + let parse xml = + Some + { + d_b_security_group_name = + (Xml.required "DBSecurityGroupName" + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse)); + c_i_d_r_i_p = + (Util.option_bind (Xml.member "CIDRIP" xml) String.parse); + e_c2_security_group_name = + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse); + e_c2_security_group_id = + (Util.option_bind (Xml.member "EC2SecurityGroupId" xml) + String.parse); + e_c2_security_group_owner_id = + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> + Query.Pair ("EC2SecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.e_c2_security_group_id + (fun f -> Query.Pair ("EC2SecurityGroupId", (String.to_query f))); + Util.option_map v.e_c2_security_group_name + (fun f -> + Query.Pair ("EC2SecurityGroupName", (String.to_query f))); + Util.option_map v.c_i_d_r_i_p + (fun f -> Query.Pair ("CIDRIP", (String.to_query f))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroupNameList.to_query v.d_b_security_groups )) - ; Some + ("DBSecurityGroupName", + (String.to_query v.d_b_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> ("e_c2_security_group_owner_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_id + (fun f -> ("e_c2_security_group_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_name + (fun f -> ("e_c2_security_group_name", (String.to_json f))); + Util.option_map v.c_i_d_r_i_p + (fun f -> ("c_i_d_r_i_p", (String.to_json f))); + Some + ("d_b_security_group_name", + (String.to_json v.d_b_security_group_name))]) + let of_json j = + { + d_b_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_group_name"))); + c_i_d_r_i_p = + (Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json); + e_c2_security_group_name = + (Util.option_map (Json.lookup j "e_c2_security_group_name") + String.of_json); + e_c2_security_group_id = + (Util.option_map (Json.lookup j "e_c2_security_group_id") + String.of_json); + e_c2_security_group_owner_id = + (Util.option_map (Json.lookup j "e_c2_security_group_owner_id") + String.of_json) + } + end +module DBEngineVersionMessage = + struct + type t = + { + marker: String.t option ; + d_b_engine_versions: DBEngineVersionList.t } + let make ?marker ?(d_b_engine_versions= []) () = + { marker; d_b_engine_versions } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_engine_versions = + (Util.of_option [] + (Util.option_bind (Xml.member "DBEngineVersions" xml) + DBEngineVersionList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBEngineVersions.member", + (DBEngineVersionList.to_query v.d_b_engine_versions))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_engine_versions", + (DBEngineVersionList.to_json v.d_b_engine_versions)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_engine_versions = + (DBEngineVersionList.of_json + (Util.of_option_exn (Json.lookup j "d_b_engine_versions"))) + } + end +module CreateDBClusterParameterGroupResult = + struct + type t = { + d_b_cluster_parameter_group: DBClusterParameterGroup.t option } + let make ?d_b_cluster_parameter_group () = + { d_b_cluster_parameter_group } + let parse xml = + Some + { + d_b_cluster_parameter_group = + (Util.option_bind (Xml.member "DBClusterParameterGroup" xml) + DBClusterParameterGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group + (fun f -> + Query.Pair + ("DBClusterParameterGroup", + (DBClusterParameterGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_parameter_group + (fun f -> + ("d_b_cluster_parameter_group", + (DBClusterParameterGroup.to_json f)))]) + let of_json j = + { + d_b_cluster_parameter_group = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group") + DBClusterParameterGroup.of_json) + } + end +module DBClusterParameterGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSnapshotMessage = + struct + type t = { + marker: String.t option ; + d_b_snapshots: DBSnapshotList.t } + let make ?marker ?(d_b_snapshots= []) () = { marker; d_b_snapshots } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_snapshots = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSnapshots" xml) + DBSnapshotList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSnapshots.member", + (DBSnapshotList.to_query v.d_b_snapshots))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("d_b_snapshots", (DBSnapshotList.to_json v.d_b_snapshots)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_snapshots = + (DBSnapshotList.of_json + (Util.of_option_exn (Json.lookup j "d_b_snapshots"))) + } + end +module DownloadDBLogFilePortionDetails = + struct + type t = + { + log_file_data: String.t option ; + marker: String.t option ; + additional_data_pending: Boolean.t option } + let make ?log_file_data ?marker ?additional_data_pending () = + { log_file_data; marker; additional_data_pending } + let parse xml = + Some + { + log_file_data = + (Util.option_bind (Xml.member "LogFileData" xml) String.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + additional_data_pending = + (Util.option_bind (Xml.member "AdditionalDataPending" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.additional_data_pending + (fun f -> + Query.Pair ("AdditionalDataPending", (Boolean.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.log_file_data + (fun f -> Query.Pair ("LogFileData", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.additional_data_pending + (fun f -> ("additional_data_pending", (Boolean.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.log_file_data + (fun f -> ("log_file_data", (String.to_json f)))]) + let of_json j = + { + log_file_data = + (Util.option_map (Json.lookup j "log_file_data") String.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + additional_data_pending = + (Util.option_map (Json.lookup j "additional_data_pending") + Boolean.of_json) + } + end +module DBUpgradeDependencyFailureFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSecurityGroupNotSupportedFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RestoreDBClusterToPointInTimeMessage = + struct + type t = + { + d_b_cluster_identifier: String.t ; + source_d_b_cluster_identifier: String.t ; + restore_to_time: DateTime.t option ; + use_latest_restorable_time: Boolean.t option ; + port: Integer.t option ; + d_b_subnet_group_name: String.t option ; + option_group_name: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + tags: TagList.t } + let make ~d_b_cluster_identifier ~source_d_b_cluster_identifier + ?restore_to_time ?use_latest_restorable_time ?port + ?d_b_subnet_group_name ?option_group_name ?(vpc_security_group_ids= + []) ?(tags= []) () = + { + d_b_cluster_identifier; + source_d_b_cluster_identifier; + restore_to_time; + use_latest_restorable_time; + port; + d_b_subnet_group_name; + option_group_name; + vpc_security_group_ids; + tags + } + let parse xml = + Some + { + d_b_cluster_identifier = + (Xml.required "DBClusterIdentifier" + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse)); + source_d_b_cluster_identifier = + (Xml.required "SourceDBClusterIdentifier" + (Util.option_bind (Xml.member "SourceDBClusterIdentifier" xml) + String.parse)); + restore_to_time = + (Util.option_bind (Xml.member "RestoreToTime" xml) DateTime.parse); + use_latest_restorable_time = + (Util.option_bind (Xml.member "UseLatestRestorableTime" xml) + Boolean.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.tde_credential_password (fun f -> - Query.Pair ("TdeCredentialPassword", String.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.d_b_name (fun f -> Query.Pair ("DBName", String.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.publicly_accessible (fun f -> - Query.Pair ("PubliclyAccessible", Boolean.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.use_latest_restorable_time (fun f -> - Query.Pair ("UseLatestRestorableTime", Boolean.to_query f)) - ; Util.option_map v.restore_time (fun f -> - Query.Pair ("RestoreTime", DateTime.to_query f)) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.use_latest_restorable_time + (fun f -> + Query.Pair ("UseLatestRestorableTime", (Boolean.to_query f))); + Util.option_map v.restore_to_time + (fun f -> Query.Pair ("RestoreToTime", (DateTime.to_query f))); + Some (Query.Pair - ( "TargetDBInstanceIdentifier" - , String.to_query v.target_d_b_instance_identifier )) - ; Some + ("SourceDBClusterIdentifier", + (String.to_query v.source_d_b_cluster_identifier))); + Some (Query.Pair - ( "SourceDBInstanceIdentifier" - , String.to_query v.source_d_b_instance_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.domain (fun f -> "domain", String.to_json f) - ; Some - ("d_b_security_groups", DBSecurityGroupNameList.to_json v.d_b_security_groups) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.tde_credential_password (fun f -> - "tde_credential_password", String.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.d_b_name (fun f -> "d_b_name", String.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.publicly_accessible (fun f -> - "publicly_accessible", Boolean.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.use_latest_restorable_time (fun f -> - "use_latest_restorable_time", Boolean.to_json f) - ; Util.option_map v.restore_time (fun f -> "restore_time", DateTime.to_json f) - ; Some - ( "target_d_b_instance_identifier" - , String.to_json v.target_d_b_instance_identifier ) - ; Some - ( "source_d_b_instance_identifier" - , String.to_json v.source_d_b_instance_identifier ) - ]) - - let of_json j = - { source_d_b_instance_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_instance_identifier")) - ; target_d_b_instance_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "target_d_b_instance_identifier")) - ; restore_time = Util.option_map (Json.lookup j "restore_time") DateTime.of_json - ; use_latest_restorable_time = - Util.option_map (Json.lookup j "use_latest_restorable_time") Boolean.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; publicly_accessible = - Util.option_map (Json.lookup j "publicly_accessible") Boolean.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; d_b_name = Util.option_map (Json.lookup j "d_b_name") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; tde_credential_password = - Util.option_map (Json.lookup j "tde_credential_password") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; d_b_security_groups = - DBSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - ; domain = Util.option_map (Json.lookup j "domain") String.of_json - } -end - -module ModifyDBParameterGroupMessage = struct - type t = - { d_b_parameter_group_name : String.t - ; parameters : ParametersList.t - } - - let make ~d_b_parameter_group_name ~parameters () = - { d_b_parameter_group_name; parameters } - - let parse xml = - Some - { d_b_parameter_group_name = - Xml.required - "DBParameterGroupName" - (Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse) - ; parameters = - Xml.required - "Parameters" - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Some + ("DBClusterIdentifier", + (String.to_query v.d_b_cluster_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.use_latest_restorable_time + (fun f -> ("use_latest_restorable_time", (Boolean.to_json f))); + Util.option_map v.restore_to_time + (fun f -> ("restore_to_time", (DateTime.to_json f))); + Some + ("source_d_b_cluster_identifier", + (String.to_json v.source_d_b_cluster_identifier)); + Some + ("d_b_cluster_identifier", + (String.to_json v.d_b_cluster_identifier))]) + let of_json j = + { + d_b_cluster_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier"))); + source_d_b_cluster_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_cluster_identifier"))); + restore_to_time = + (Util.option_map (Json.lookup j "restore_to_time") DateTime.of_json); + use_latest_restorable_time = + (Util.option_map (Json.lookup j "use_latest_restorable_time") + Boolean.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CreateEventSubscriptionResult = + struct + type t = { + event_subscription: EventSubscription.t option } + let make ?event_subscription () = { event_subscription } + let parse xml = + Some + { + event_subscription = + (Util.option_bind (Xml.member "EventSubscription" xml) + EventSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> + Query.Pair + ("EventSubscription", (EventSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> ("event_subscription", (EventSubscription.to_json f)))]) + let of_json j = + { + event_subscription = + (Util.option_map (Json.lookup j "event_subscription") + EventSubscription.of_json) + } + end +module DBLogFileNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module EventCategoriesMessage = + struct + type t = { + event_categories_map_list: EventCategoriesMapList.t } + let make ?(event_categories_map_list= []) () = + { event_categories_map_list } + let parse xml = + Some + { + event_categories_map_list = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategoriesMapList" xml) + EventCategoriesMapList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EventCategoriesMapList.member", + (EventCategoriesMapList.to_query + v.event_categories_map_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("event_categories_map_list", + (EventCategoriesMapList.to_json v.event_categories_map_list))]) + let of_json j = + { + event_categories_map_list = + (EventCategoriesMapList.of_json + (Util.of_option_exn (Json.lookup j "event_categories_map_list"))) + } + end +module DescribeDBSnapshotsMessage = + struct + type t = + { + d_b_instance_identifier: String.t option ; + d_b_snapshot_identifier: String.t option ; + snapshot_type: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_instance_identifier ?d_b_snapshot_identifier + ?snapshot_type ?(filters= []) ?max_records ?marker () = + { + d_b_instance_identifier; + d_b_snapshot_identifier; + snapshot_type; + filters; + max_records; + marker + } + let parse xml = + Some + { + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + d_b_snapshot_identifier = + (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) + String.parse); + snapshot_type = + (Util.option_bind (Xml.member "SnapshotType" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.snapshot_type + (fun f -> Query.Pair ("SnapshotType", (String.to_query f))); + Util.option_map v.d_b_snapshot_identifier + (fun f -> + Query.Pair ("DBSnapshotIdentifier", (String.to_query f))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.snapshot_type + (fun f -> ("snapshot_type", (String.to_json f))); + Util.option_map v.d_b_snapshot_identifier + (fun f -> ("d_b_snapshot_identifier", (String.to_json f))); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + d_b_snapshot_identifier = + (Util.option_map (Json.lookup j "d_b_snapshot_identifier") + String.of_json); + snapshot_type = + (Util.option_map (Json.lookup j "snapshot_type") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module CopyDBClusterSnapshotResult = + struct + type t = { + d_b_cluster_snapshot: DBClusterSnapshot.t option } + let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } + let parse xml = + Some + { + d_b_cluster_snapshot = + (Util.option_bind (Xml.member "DBClusterSnapshot" xml) + DBClusterSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + Query.Pair + ("DBClusterSnapshot", (DBClusterSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_snapshot + (fun f -> + ("d_b_cluster_snapshot", (DBClusterSnapshot.to_json f)))]) + let of_json j = + { + d_b_cluster_snapshot = + (Util.option_map (Json.lookup j "d_b_cluster_snapshot") + DBClusterSnapshot.of_json) + } + end +module CreateEventSubscriptionMessage = + struct + type t = + { + subscription_name: String.t ; + sns_topic_arn: String.t ; + source_type: String.t option ; + event_categories: EventCategoriesList.t ; + source_ids: SourceIdsList.t ; + enabled: Boolean.t option ; + tags: TagList.t } + let make ~subscription_name ~sns_topic_arn ?source_type + ?(event_categories= []) ?(source_ids= []) ?enabled ?(tags= []) () = + { + subscription_name; + sns_topic_arn; + source_type; + event_categories; + source_ids; + enabled; + tags + } + let parse xml = + Some + { + subscription_name = + (Xml.required "SubscriptionName" + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse)); + sns_topic_arn = + (Xml.required "SnsTopicArn" + (Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse)); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) String.parse); + event_categories = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategories" xml) + EventCategoriesList.parse)); + source_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "SourceIds" xml) + SourceIdsList.parse)); + enabled = + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.enabled + (fun f -> Query.Pair ("Enabled", (Boolean.to_query f))); + Some (Query.Pair - ("DBParameterGroupName", String.to_query v.d_b_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", ParametersList.to_json v.parameters) - ; Some ("d_b_parameter_group_name", String.to_json v.d_b_parameter_group_name) - ]) - - let of_json j = - { d_b_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name")) - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module SubscriptionCategoryNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSubnetGroupMessage = struct - type t = - { marker : String.t option - ; d_b_subnet_groups : DBSubnetGroups.t - } - - let make ?marker ?(d_b_subnet_groups = []) () = { marker; d_b_subnet_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_subnet_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "DBSubnetGroups" xml) DBSubnetGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SourceIds.member", (SourceIdsList.to_query v.source_ids))); + Some (Query.Pair - ("DBSubnetGroups.member", DBSubnetGroups.to_query v.d_b_subnet_groups)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_subnet_groups", DBSubnetGroups.to_json v.d_b_subnet_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_subnet_groups = - DBSubnetGroups.of_json (Util.of_option_exn (Json.lookup j "d_b_subnet_groups")) - } -end - -module ResourceNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBClusterSnapshotMessage = struct - type t = - { d_b_cluster_snapshot_identifier : String.t - ; d_b_cluster_identifier : String.t - ; tags : TagList.t - } - - let make ~d_b_cluster_snapshot_identifier ~d_b_cluster_identifier ?(tags = []) () = - { d_b_cluster_snapshot_identifier; d_b_cluster_identifier; tags } - - let parse xml = - Some - { d_b_cluster_snapshot_identifier = - Xml.required - "DBClusterSnapshotIdentifier" - (Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse) - ; d_b_cluster_identifier = - Xml.required - "DBClusterIdentifier" - (Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some - (Query.Pair ("DBClusterIdentifier", String.to_query v.d_b_cluster_identifier)) - ; Some + ("EventCategories.member", + (EventCategoriesList.to_query v.event_categories))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (String.to_query f))); + Some + (Query.Pair ("SnsTopicArn", (String.to_query v.sns_topic_arn))); + Some (Query.Pair - ( "DBClusterSnapshotIdentifier" - , String.to_query v.d_b_cluster_snapshot_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("d_b_cluster_identifier", String.to_json v.d_b_cluster_identifier) - ; Some - ( "d_b_cluster_snapshot_identifier" - , String.to_json v.d_b_cluster_snapshot_identifier ) - ]) - - let of_json j = - { d_b_cluster_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_snapshot_identifier")) - ; d_b_cluster_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ReservedDBInstanceQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBParameterGroupResult = struct - type t = { d_b_parameter_group : DBParameterGroup.t option } - - let make ?d_b_parameter_group () = { d_b_parameter_group } - - let parse xml = - Some - { d_b_parameter_group = - Util.option_bind (Xml.member "DBParameterGroup" xml) DBParameterGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group (fun f -> - Query.Pair ("DBParameterGroup", DBParameterGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group (fun f -> - "d_b_parameter_group", DBParameterGroup.to_json f) - ]) - - let of_json j = - { d_b_parameter_group = - Util.option_map (Json.lookup j "d_b_parameter_group") DBParameterGroup.of_json - } -end - -module InvalidDBSnapshotStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidDBInstanceStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DownloadDBLogFilePortionMessage = struct - type t = - { d_b_instance_identifier : String.t - ; log_file_name : String.t - ; marker : String.t option - ; number_of_lines : Integer.t option - } - - let make ~d_b_instance_identifier ~log_file_name ?marker ?number_of_lines () = - { d_b_instance_identifier; log_file_name; marker; number_of_lines } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; log_file_name = - Xml.required - "LogFileName" - (Util.option_bind (Xml.member "LogFileName" xml) String.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; number_of_lines = Util.option_bind (Xml.member "NumberOfLines" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.number_of_lines (fun f -> - Query.Pair ("NumberOfLines", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("LogFileName", String.to_query v.log_file_name)) - ; Some + ("SubscriptionName", (String.to_query v.subscription_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.enabled + (fun f -> ("enabled", (Boolean.to_json f))); + Some ("source_ids", (SourceIdsList.to_json v.source_ids)); + Some + ("event_categories", + (EventCategoriesList.to_json v.event_categories)); + Util.option_map v.source_type + (fun f -> ("source_type", (String.to_json f))); + Some ("sns_topic_arn", (String.to_json v.sns_topic_arn)); + Some ("subscription_name", (String.to_json v.subscription_name))]) + let of_json j = + { + subscription_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "subscription_name"))); + sns_topic_arn = + (String.of_json + (Util.of_option_exn (Json.lookup j "sns_topic_arn"))); + source_type = + (Util.option_map (Json.lookup j "source_type") String.of_json); + event_categories = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories"))); + source_ids = + (SourceIdsList.of_json + (Util.of_option_exn (Json.lookup j "source_ids"))); + enabled = (Util.option_map (Json.lookup j "enabled") Boolean.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CopyDBClusterSnapshotMessage = + struct + type t = + { + source_d_b_cluster_snapshot_identifier: String.t ; + target_d_b_cluster_snapshot_identifier: String.t ; + tags: TagList.t } + let make ~source_d_b_cluster_snapshot_identifier + ~target_d_b_cluster_snapshot_identifier ?(tags= []) () = + { + source_d_b_cluster_snapshot_identifier; + target_d_b_cluster_snapshot_identifier; + tags + } + let parse xml = + Some + { + source_d_b_cluster_snapshot_identifier = + (Xml.required "SourceDBClusterSnapshotIdentifier" + (Util.option_bind + (Xml.member "SourceDBClusterSnapshotIdentifier" xml) + String.parse)); + target_d_b_cluster_snapshot_identifier = + (Xml.required "TargetDBClusterSnapshotIdentifier" + (Util.option_bind + (Xml.member "TargetDBClusterSnapshotIdentifier" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.number_of_lines (fun f -> - "number_of_lines", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("log_file_name", String.to_json v.log_file_name) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; log_file_name = String.of_json (Util.of_option_exn (Json.lookup j "log_file_name")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; number_of_lines = Util.option_map (Json.lookup j "number_of_lines") Integer.of_json - } -end - -module AuthorizeDBSecurityGroupIngressMessage = struct - type t = - { d_b_security_group_name : String.t - ; c_i_d_r_i_p : String.t option - ; e_c2_security_group_name : String.t option - ; e_c2_security_group_id : String.t option - ; e_c2_security_group_owner_id : String.t option - } - - let make - ~d_b_security_group_name - ?c_i_d_r_i_p - ?e_c2_security_group_name - ?e_c2_security_group_id - ?e_c2_security_group_owner_id - () = - { d_b_security_group_name - ; c_i_d_r_i_p - ; e_c2_security_group_name - ; e_c2_security_group_id - ; e_c2_security_group_owner_id - } - - let parse xml = - Some - { d_b_security_group_name = - Xml.required - "DBSecurityGroupName" - (Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse) - ; c_i_d_r_i_p = Util.option_bind (Xml.member "CIDRIP" xml) String.parse - ; e_c2_security_group_name = - Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse - ; e_c2_security_group_id = - Util.option_bind (Xml.member "EC2SecurityGroupId" xml) String.parse - ; e_c2_security_group_owner_id = - Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - Query.Pair ("EC2SecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_id (fun f -> - Query.Pair ("EC2SecurityGroupId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_name (fun f -> - Query.Pair ("EC2SecurityGroupName", String.to_query f)) - ; Util.option_map v.c_i_d_r_i_p (fun f -> - Query.Pair ("CIDRIP", String.to_query f)) - ; Some - (Query.Pair ("DBSecurityGroupName", String.to_query v.d_b_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - "e_c2_security_group_owner_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_id (fun f -> - "e_c2_security_group_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_name (fun f -> - "e_c2_security_group_name", String.to_json f) - ; Util.option_map v.c_i_d_r_i_p (fun f -> "c_i_d_r_i_p", String.to_json f) - ; Some ("d_b_security_group_name", String.to_json v.d_b_security_group_name) - ]) - - let of_json j = - { d_b_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_security_group_name")) - ; c_i_d_r_i_p = Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json - ; e_c2_security_group_name = - Util.option_map (Json.lookup j "e_c2_security_group_name") String.of_json - ; e_c2_security_group_id = - Util.option_map (Json.lookup j "e_c2_security_group_id") String.of_json - ; e_c2_security_group_owner_id = - Util.option_map (Json.lookup j "e_c2_security_group_owner_id") String.of_json - } -end - -module DBEngineVersionMessage = struct - type t = - { marker : String.t option - ; d_b_engine_versions : DBEngineVersionList.t - } - - let make ?marker ?(d_b_engine_versions = []) () = { marker; d_b_engine_versions } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_engine_versions = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBEngineVersions" xml) - DBEngineVersionList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("TargetDBClusterSnapshotIdentifier", + (String.to_query v.target_d_b_cluster_snapshot_identifier))); + Some (Query.Pair - ( "DBEngineVersions.member" - , DBEngineVersionList.to_query v.d_b_engine_versions )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_engine_versions", DBEngineVersionList.to_json v.d_b_engine_versions) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_engine_versions = - DBEngineVersionList.of_json - (Util.of_option_exn (Json.lookup j "d_b_engine_versions")) - } -end - -module CreateDBClusterParameterGroupResult = struct - type t = { d_b_cluster_parameter_group : DBClusterParameterGroup.t option } - - let make ?d_b_cluster_parameter_group () = { d_b_cluster_parameter_group } - - let parse xml = - Some - { d_b_cluster_parameter_group = - Util.option_bind - (Xml.member "DBClusterParameterGroup" xml) - DBClusterParameterGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group (fun f -> - Query.Pair ("DBClusterParameterGroup", DBClusterParameterGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_parameter_group (fun f -> - "d_b_cluster_parameter_group", DBClusterParameterGroup.to_json f) - ]) - - let of_json j = - { d_b_cluster_parameter_group = - Util.option_map - (Json.lookup j "d_b_cluster_parameter_group") - DBClusterParameterGroup.of_json - } -end - -module DBClusterParameterGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSnapshotMessage = struct - type t = - { marker : String.t option - ; d_b_snapshots : DBSnapshotList.t - } - - let make ?marker ?(d_b_snapshots = []) () = { marker; d_b_snapshots } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_snapshots = - Util.of_option - [] - (Util.option_bind (Xml.member "DBSnapshots" xml) DBSnapshotList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DBSnapshots.member", DBSnapshotList.to_query v.d_b_snapshots)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_snapshots", DBSnapshotList.to_json v.d_b_snapshots) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_snapshots = - DBSnapshotList.of_json (Util.of_option_exn (Json.lookup j "d_b_snapshots")) - } -end - -module DownloadDBLogFilePortionDetails = struct - type t = - { log_file_data : String.t option - ; marker : String.t option - ; additional_data_pending : Boolean.t option - } - - let make ?log_file_data ?marker ?additional_data_pending () = - { log_file_data; marker; additional_data_pending } - - let parse xml = - Some - { log_file_data = Util.option_bind (Xml.member "LogFileData" xml) String.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; additional_data_pending = - Util.option_bind (Xml.member "AdditionalDataPending" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.additional_data_pending (fun f -> - Query.Pair ("AdditionalDataPending", Boolean.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.log_file_data (fun f -> - Query.Pair ("LogFileData", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.additional_data_pending (fun f -> - "additional_data_pending", Boolean.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.log_file_data (fun f -> "log_file_data", String.to_json f) - ]) - - let of_json j = - { log_file_data = Util.option_map (Json.lookup j "log_file_data") String.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; additional_data_pending = - Util.option_map (Json.lookup j "additional_data_pending") Boolean.of_json - } -end - -module DBUpgradeDependencyFailureFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSecurityGroupNotSupportedFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RestoreDBClusterToPointInTimeMessage = struct - type t = - { d_b_cluster_identifier : String.t - ; source_d_b_cluster_identifier : String.t - ; restore_to_time : DateTime.t option - ; use_latest_restorable_time : Boolean.t option - ; port : Integer.t option - ; d_b_subnet_group_name : String.t option - ; option_group_name : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; tags : TagList.t - } - - let make - ~d_b_cluster_identifier - ~source_d_b_cluster_identifier - ?restore_to_time - ?use_latest_restorable_time - ?port - ?d_b_subnet_group_name - ?option_group_name - ?(vpc_security_group_ids = []) - ?(tags = []) + ("SourceDBClusterSnapshotIdentifier", + (String.to_query v.source_d_b_cluster_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("target_d_b_cluster_snapshot_identifier", + (String.to_json v.target_d_b_cluster_snapshot_identifier)); + Some + ("source_d_b_cluster_snapshot_identifier", + (String.to_json v.source_d_b_cluster_snapshot_identifier))]) + let of_json j = + { + source_d_b_cluster_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_cluster_snapshot_identifier"))); + target_d_b_cluster_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_d_b_cluster_snapshot_identifier"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DescribeDBClustersMessage = + struct + type t = + { + d_b_cluster_identifier: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_cluster_identifier ?(filters= []) ?max_records ?marker + () = { d_b_cluster_identifier; filters; max_records; marker } + let parse xml = + Some + { + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DBSecurityGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSubnetGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBParameterGroupMessage = + struct + type t = { + d_b_parameter_group_name: String.t } + let make ~d_b_parameter_group_name () = { d_b_parameter_group_name } + let parse xml = + Some + { + d_b_parameter_group_name = + (Xml.required "DBParameterGroupName" + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBParameterGroupName", + (String.to_query v.d_b_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_parameter_group_name", + (String.to_json v.d_b_parameter_group_name))]) + let of_json j = + { + d_b_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name"))) + } + end +module CreateDBClusterMessage = + struct + type t = + { + availability_zones: AvailabilityZones.t ; + backup_retention_period: Integer.t option ; + character_set_name: String.t option ; + database_name: String.t option ; + d_b_cluster_identifier: String.t option ; + d_b_cluster_parameter_group_name: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + d_b_subnet_group_name: String.t option ; + engine: String.t option ; + engine_version: String.t option ; + port: Integer.t option ; + master_username: String.t option ; + master_user_password: String.t option ; + option_group_name: String.t option ; + preferred_backup_window: String.t option ; + preferred_maintenance_window: String.t option ; + tags: TagList.t } + let make ?(availability_zones= []) ?backup_retention_period + ?character_set_name ?database_name ?d_b_cluster_identifier + ?d_b_cluster_parameter_group_name ?(vpc_security_group_ids= []) + ?d_b_subnet_group_name ?engine ?engine_version ?port + ?master_username ?master_user_password ?option_group_name + ?preferred_backup_window ?preferred_maintenance_window ?(tags= []) () = - { d_b_cluster_identifier - ; source_d_b_cluster_identifier - ; restore_to_time - ; use_latest_restorable_time - ; port - ; d_b_subnet_group_name - ; option_group_name - ; vpc_security_group_ids - ; tags - } - - let parse xml = - Some - { d_b_cluster_identifier = - Xml.required - "DBClusterIdentifier" - (Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse) - ; source_d_b_cluster_identifier = - Xml.required - "SourceDBClusterIdentifier" - (Util.option_bind (Xml.member "SourceDBClusterIdentifier" xml) String.parse) - ; restore_to_time = Util.option_bind (Xml.member "RestoreToTime" xml) DateTime.parse - ; use_latest_restorable_time = - Util.option_bind (Xml.member "UseLatestRestorableTime" xml) Boolean.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + { + availability_zones; + backup_retention_period; + character_set_name; + database_name; + d_b_cluster_identifier; + d_b_cluster_parameter_group_name; + vpc_security_group_ids; + d_b_subnet_group_name; + engine; + engine_version; + port; + master_username; + master_user_password; + option_group_name; + preferred_backup_window; + preferred_maintenance_window; + tags + } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + character_set_name = + (Util.option_bind (Xml.member "CharacterSetName" xml) + String.parse); + database_name = + (Util.option_bind (Xml.member "DatabaseName" xml) String.parse); + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + d_b_cluster_parameter_group_name = + (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) + String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + master_user_password = + (Util.option_bind (Xml.member "MasterUserPassword" xml) + String.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.master_user_password + (fun f -> Query.Pair ("MasterUserPassword", (String.to_query f))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.use_latest_restorable_time (fun f -> - Query.Pair ("UseLatestRestorableTime", Boolean.to_query f)) - ; Util.option_map v.restore_to_time (fun f -> - Query.Pair ("RestoreToTime", DateTime.to_query f)) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + Query.Pair + ("DBClusterParameterGroupName", (String.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f))); + Util.option_map v.database_name + (fun f -> Query.Pair ("DatabaseName", (String.to_query f))); + Util.option_map v.character_set_name + (fun f -> Query.Pair ("CharacterSetName", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Some (Query.Pair - ( "SourceDBClusterIdentifier" - , String.to_query v.source_d_b_cluster_identifier )) - ; Some - (Query.Pair ("DBClusterIdentifier", String.to_query v.d_b_cluster_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.use_latest_restorable_time (fun f -> - "use_latest_restorable_time", Boolean.to_json f) - ; Util.option_map v.restore_to_time (fun f -> - "restore_to_time", DateTime.to_json f) - ; Some - ( "source_d_b_cluster_identifier" - , String.to_json v.source_d_b_cluster_identifier ) - ; Some ("d_b_cluster_identifier", String.to_json v.d_b_cluster_identifier) - ]) - - let of_json j = - { d_b_cluster_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier")) - ; source_d_b_cluster_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_cluster_identifier")) - ; restore_to_time = Util.option_map (Json.lookup j "restore_to_time") DateTime.of_json - ; use_latest_restorable_time = - Util.option_map (Json.lookup j "use_latest_restorable_time") Boolean.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CreateEventSubscriptionResult = struct - type t = { event_subscription : EventSubscription.t option } - - let make ?event_subscription () = { event_subscription } - - let parse xml = - Some - { event_subscription = - Util.option_bind (Xml.member "EventSubscription" xml) EventSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - Query.Pair ("EventSubscription", EventSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - "event_subscription", EventSubscription.to_json f) - ]) - - let of_json j = - { event_subscription = - Util.option_map (Json.lookup j "event_subscription") EventSubscription.of_json - } -end - -module DBLogFileNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module EventCategoriesMessage = struct - type t = { event_categories_map_list : EventCategoriesMapList.t } - - let make ?(event_categories_map_list = []) () = { event_categories_map_list } - - let parse xml = - Some - { event_categories_map_list = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategoriesMapList" xml) - EventCategoriesMapList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.master_user_password + (fun f -> ("master_user_password", (String.to_json f))); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + ("d_b_cluster_parameter_group_name", (String.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f))); + Util.option_map v.database_name + (fun f -> ("database_name", (String.to_json f))); + Util.option_map v.character_set_name + (fun f -> ("character_set_name", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + character_set_name = + (Util.option_map (Json.lookup j "character_set_name") + String.of_json); + database_name = + (Util.option_map (Json.lookup j "database_name") String.of_json); + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + d_b_cluster_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") + String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + master_user_password = + (Util.option_map (Json.lookup j "master_user_password") + String.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module ModifyDBClusterParameterGroupMessage = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t ; + parameters: ParametersList.t } + let make ~d_b_cluster_parameter_group_name ~parameters () = + { d_b_cluster_parameter_group_name; parameters } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Xml.required "DBClusterParameterGroupName" + (Util.option_bind + (Xml.member "DBClusterParameterGroupName" xml) String.parse)); + parameters = + (Xml.required "Parameters" + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", + (ParametersList.to_query v.parameters))); + Some (Query.Pair - ( "EventCategoriesMapList.member" - , EventCategoriesMapList.to_query v.event_categories_map_list )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "event_categories_map_list" - , EventCategoriesMapList.to_json v.event_categories_map_list ) - ]) - - let of_json j = - { event_categories_map_list = - EventCategoriesMapList.of_json - (Util.of_option_exn (Json.lookup j "event_categories_map_list")) - } -end - -module DescribeDBSnapshotsMessage = struct - type t = - { d_b_instance_identifier : String.t option - ; d_b_snapshot_identifier : String.t option - ; snapshot_type : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?d_b_instance_identifier - ?d_b_snapshot_identifier - ?snapshot_type - ?(filters = []) - ?max_records - ?marker - () = - { d_b_instance_identifier - ; d_b_snapshot_identifier - ; snapshot_type - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; d_b_snapshot_identifier = - Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) String.parse - ; snapshot_type = Util.option_bind (Xml.member "SnapshotType" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.snapshot_type (fun f -> - Query.Pair ("SnapshotType", String.to_query f)) - ; Util.option_map v.d_b_snapshot_identifier (fun f -> - Query.Pair ("DBSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.snapshot_type (fun f -> "snapshot_type", String.to_json f) - ; Util.option_map v.d_b_snapshot_identifier (fun f -> - "d_b_snapshot_identifier", String.to_json f) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; d_b_snapshot_identifier = - Util.option_map (Json.lookup j "d_b_snapshot_identifier") String.of_json - ; snapshot_type = Util.option_map (Json.lookup j "snapshot_type") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module CopyDBClusterSnapshotResult = struct - type t = { d_b_cluster_snapshot : DBClusterSnapshot.t option } - - let make ?d_b_cluster_snapshot () = { d_b_cluster_snapshot } - - let parse xml = - Some - { d_b_cluster_snapshot = - Util.option_bind (Xml.member "DBClusterSnapshot" xml) DBClusterSnapshot.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - Query.Pair ("DBClusterSnapshot", DBClusterSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_snapshot (fun f -> - "d_b_cluster_snapshot", DBClusterSnapshot.to_json f) - ]) - - let of_json j = - { d_b_cluster_snapshot = - Util.option_map (Json.lookup j "d_b_cluster_snapshot") DBClusterSnapshot.of_json - } -end - -module CreateEventSubscriptionMessage = struct - type t = - { subscription_name : String.t - ; sns_topic_arn : String.t - ; source_type : String.t option - ; event_categories : EventCategoriesList.t - ; source_ids : SourceIdsList.t - ; enabled : Boolean.t option - ; tags : TagList.t - } - - let make - ~subscription_name - ~sns_topic_arn - ?source_type - ?(event_categories = []) - ?(source_ids = []) - ?enabled - ?(tags = []) - () = - { subscription_name - ; sns_topic_arn - ; source_type - ; event_categories - ; source_ids - ; enabled - ; tags - } - - let parse xml = - Some - { subscription_name = - Xml.required - "SubscriptionName" - (Util.option_bind (Xml.member "SubscriptionName" xml) String.parse) - ; sns_topic_arn = - Xml.required - "SnsTopicArn" - (Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse) - ; source_type = Util.option_bind (Xml.member "SourceType" xml) String.parse - ; event_categories = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategories" xml) - EventCategoriesList.parse) - ; source_ids = - Util.of_option - [] - (Util.option_bind (Xml.member "SourceIds" xml) SourceIdsList.parse) - ; enabled = Util.option_bind (Xml.member "Enabled" xml) Boolean.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.enabled (fun f -> Query.Pair ("Enabled", Boolean.to_query f)) - ; Some (Query.Pair ("SourceIds.member", SourceIdsList.to_query v.source_ids)) - ; Some - (Query.Pair - ("EventCategories.member", EventCategoriesList.to_query v.event_categories)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", String.to_query f)) - ; Some (Query.Pair ("SnsTopicArn", String.to_query v.sns_topic_arn)) - ; Some (Query.Pair ("SubscriptionName", String.to_query v.subscription_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.enabled (fun f -> "enabled", Boolean.to_json f) - ; Some ("source_ids", SourceIdsList.to_json v.source_ids) - ; Some ("event_categories", EventCategoriesList.to_json v.event_categories) - ; Util.option_map v.source_type (fun f -> "source_type", String.to_json f) - ; Some ("sns_topic_arn", String.to_json v.sns_topic_arn) - ; Some ("subscription_name", String.to_json v.subscription_name) - ]) - - let of_json j = - { subscription_name = - String.of_json (Util.of_option_exn (Json.lookup j "subscription_name")) - ; sns_topic_arn = String.of_json (Util.of_option_exn (Json.lookup j "sns_topic_arn")) - ; source_type = Util.option_map (Json.lookup j "source_type") String.of_json - ; event_categories = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories")) - ; source_ids = SourceIdsList.of_json (Util.of_option_exn (Json.lookup j "source_ids")) - ; enabled = Util.option_map (Json.lookup j "enabled") Boolean.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CopyDBClusterSnapshotMessage = struct - type t = - { source_d_b_cluster_snapshot_identifier : String.t - ; target_d_b_cluster_snapshot_identifier : String.t - ; tags : TagList.t - } - - let make - ~source_d_b_cluster_snapshot_identifier - ~target_d_b_cluster_snapshot_identifier - ?(tags = []) - () = - { source_d_b_cluster_snapshot_identifier - ; target_d_b_cluster_snapshot_identifier - ; tags - } - - let parse xml = - Some - { source_d_b_cluster_snapshot_identifier = - Xml.required - "SourceDBClusterSnapshotIdentifier" - (Util.option_bind - (Xml.member "SourceDBClusterSnapshotIdentifier" xml) - String.parse) - ; target_d_b_cluster_snapshot_identifier = - Xml.required - "TargetDBClusterSnapshotIdentifier" - (Util.option_bind - (Xml.member "TargetDBClusterSnapshotIdentifier" xml) - String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("DBClusterParameterGroupName", + (String.to_query v.d_b_cluster_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (ParametersList.to_json v.parameters)); + Some + ("d_b_cluster_parameter_group_name", + (String.to_json v.d_b_cluster_parameter_group_name))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_group_name"))); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module ModifyOptionGroupResult = + struct + type t = { + option_group: OptionGroup.t option } + let make ?option_group () = { option_group } + let parse xml = + Some + { + option_group = + (Util.option_bind (Xml.member "OptionGroup" xml) + OptionGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> Query.Pair ("OptionGroup", (OptionGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> ("option_group", (OptionGroup.to_json f)))]) + let of_json j = + { + option_group = + (Util.option_map (Json.lookup j "option_group") OptionGroup.of_json) + } + end +module InvalidDBSubnetGroupFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyDBInstanceMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + allocated_storage: Integer.t option ; + d_b_instance_class: String.t option ; + d_b_security_groups: DBSecurityGroupNameList.t ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + apply_immediately: Boolean.t option ; + master_user_password: String.t option ; + d_b_parameter_group_name: String.t option ; + backup_retention_period: Integer.t option ; + preferred_backup_window: String.t option ; + preferred_maintenance_window: String.t option ; + multi_a_z: Boolean.t option ; + engine_version: String.t option ; + allow_major_version_upgrade: Boolean.t option ; + auto_minor_version_upgrade: Boolean.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + new_d_b_instance_identifier: String.t option ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + tde_credential_password: String.t option ; + c_a_certificate_identifier: String.t option ; + domain: String.t option ; + copy_tags_to_snapshot: Boolean.t option } + let make ~d_b_instance_identifier ?allocated_storage + ?d_b_instance_class ?(d_b_security_groups= []) + ?(vpc_security_group_ids= []) ?apply_immediately + ?master_user_password ?d_b_parameter_group_name + ?backup_retention_period ?preferred_backup_window + ?preferred_maintenance_window ?multi_a_z ?engine_version + ?allow_major_version_upgrade ?auto_minor_version_upgrade ?iops + ?option_group_name ?new_d_b_instance_identifier ?storage_type + ?tde_credential_arn ?tde_credential_password + ?c_a_certificate_identifier ?domain ?copy_tags_to_snapshot () = + { + d_b_instance_identifier; + allocated_storage; + d_b_instance_class; + d_b_security_groups; + vpc_security_group_ids; + apply_immediately; + master_user_password; + d_b_parameter_group_name; + backup_retention_period; + preferred_backup_window; + preferred_maintenance_window; + multi_a_z; + engine_version; + allow_major_version_upgrade; + auto_minor_version_upgrade; + iops; + option_group_name; + new_d_b_instance_identifier; + storage_type; + tde_credential_arn; + tde_credential_password; + c_a_certificate_identifier; + domain; + copy_tags_to_snapshot + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroupNameList.parse)); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + apply_immediately = + (Util.option_bind (Xml.member "ApplyImmediately" xml) + Boolean.parse); + master_user_password = + (Util.option_bind (Xml.member "MasterUserPassword" xml) + String.parse); + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + allow_major_version_upgrade = + (Util.option_bind (Xml.member "AllowMajorVersionUpgrade" xml) + Boolean.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + new_d_b_instance_identifier = + (Util.option_bind (Xml.member "NewDBInstanceIdentifier" xml) + String.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + tde_credential_password = + (Util.option_bind (Xml.member "TdeCredentialPassword" xml) + String.parse); + c_a_certificate_identifier = + (Util.option_bind (Xml.member "CACertificateIdentifier" xml) + String.parse); + domain = (Util.option_bind (Xml.member "Domain" xml) String.parse); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (String.to_query f))); + Util.option_map v.c_a_certificate_identifier + (fun f -> + Query.Pair ("CACertificateIdentifier", (String.to_query f))); + Util.option_map v.tde_credential_password + (fun f -> + Query.Pair ("TdeCredentialPassword", (String.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.new_d_b_instance_identifier + (fun f -> + Query.Pair ("NewDBInstanceIdentifier", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.allow_major_version_upgrade + (fun f -> + Query.Pair ("AllowMajorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f))); + Util.option_map v.master_user_password + (fun f -> Query.Pair ("MasterUserPassword", (String.to_query f))); + Util.option_map v.apply_immediately + (fun f -> Query.Pair ("ApplyImmediately", (Boolean.to_query f))); + Some (Query.Pair - ( "TargetDBClusterSnapshotIdentifier" - , String.to_query v.target_d_b_cluster_snapshot_identifier )) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Some (Query.Pair - ( "SourceDBClusterSnapshotIdentifier" - , String.to_query v.source_d_b_cluster_snapshot_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "target_d_b_cluster_snapshot_identifier" - , String.to_json v.target_d_b_cluster_snapshot_identifier ) - ; Some - ( "source_d_b_cluster_snapshot_identifier" - , String.to_json v.source_d_b_cluster_snapshot_identifier ) - ]) - - let of_json j = - { source_d_b_cluster_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_cluster_snapshot_identifier")) - ; target_d_b_cluster_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "target_d_b_cluster_snapshot_identifier")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DescribeDBClustersMessage = struct - type t = - { d_b_cluster_identifier : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_cluster_identifier ?(filters = []) ?max_records ?marker () = - { d_b_cluster_identifier; filters; max_records; marker } - - let parse xml = - Some - { d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DBSecurityGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSubnetGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBParameterGroupMessage = struct - type t = { d_b_parameter_group_name : String.t } - - let make ~d_b_parameter_group_name () = { d_b_parameter_group_name } - - let parse xml = - Some - { d_b_parameter_group_name = - Xml.required - "DBParameterGroupName" - (Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBSecurityGroups.member", + (DBSecurityGroupNameList.to_query v.d_b_security_groups))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Some (Query.Pair - ("DBParameterGroupName", String.to_query v.d_b_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_parameter_group_name", String.to_json v.d_b_parameter_group_name) ]) - - let of_json j = - { d_b_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name")) - } -end - -module CreateDBClusterMessage = struct - type t = - { availability_zones : AvailabilityZones.t - ; backup_retention_period : Integer.t option - ; character_set_name : String.t option - ; database_name : String.t option - ; d_b_cluster_identifier : String.t option - ; d_b_cluster_parameter_group_name : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; d_b_subnet_group_name : String.t option - ; engine : String.t option - ; engine_version : String.t option - ; port : Integer.t option - ; master_username : String.t option - ; master_user_password : String.t option - ; option_group_name : String.t option - ; preferred_backup_window : String.t option - ; preferred_maintenance_window : String.t option - ; tags : TagList.t - } - - let make - ?(availability_zones = []) - ?backup_retention_period - ?character_set_name - ?database_name - ?d_b_cluster_identifier - ?d_b_cluster_parameter_group_name - ?(vpc_security_group_ids = []) - ?d_b_subnet_group_name - ?engine - ?engine_version - ?port - ?master_username - ?master_user_password - ?option_group_name - ?preferred_backup_window - ?preferred_maintenance_window - ?(tags = []) - () = - { availability_zones - ; backup_retention_period - ; character_set_name - ; database_name - ; d_b_cluster_identifier - ; d_b_cluster_parameter_group_name - ; vpc_security_group_ids - ; d_b_subnet_group_name - ; engine - ; engine_version - ; port - ; master_username - ; master_user_password - ; option_group_name - ; preferred_backup_window - ; preferred_maintenance_window - ; tags - } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Util.option_map v.domain (fun f -> ("domain", (String.to_json f))); + Util.option_map v.c_a_certificate_identifier + (fun f -> ("c_a_certificate_identifier", (String.to_json f))); + Util.option_map v.tde_credential_password + (fun f -> ("tde_credential_password", (String.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.new_d_b_instance_identifier + (fun f -> ("new_d_b_instance_identifier", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.allow_major_version_upgrade + (fun f -> ("allow_major_version_upgrade", (Boolean.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f))); + Util.option_map v.master_user_password + (fun f -> ("master_user_password", (String.to_json f))); + Util.option_map v.apply_immediately + (fun f -> ("apply_immediately", (Boolean.to_json f))); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Some + ("d_b_security_groups", + (DBSecurityGroupNameList.to_json v.d_b_security_groups)); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + d_b_security_groups = + (DBSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + apply_immediately = + (Util.option_map (Json.lookup j "apply_immediately") + Boolean.of_json); + master_user_password = + (Util.option_map (Json.lookup j "master_user_password") + String.of_json); + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + allow_major_version_upgrade = + (Util.option_map (Json.lookup j "allow_major_version_upgrade") + Boolean.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + new_d_b_instance_identifier = + (Util.option_map (Json.lookup j "new_d_b_instance_identifier") + String.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + tde_credential_password = + (Util.option_map (Json.lookup j "tde_credential_password") + String.of_json); + c_a_certificate_identifier = + (Util.option_map (Json.lookup j "c_a_certificate_identifier") + String.of_json); + domain = (Util.option_map (Json.lookup j "domain") String.of_json); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json) + } + end +module DescribeReservedDBInstancesOfferingsMessage = + struct + type t = + { + reserved_d_b_instances_offering_id: String.t option ; + d_b_instance_class: String.t option ; + duration: String.t option ; + product_description: String.t option ; + offering_type: String.t option ; + multi_a_z: Boolean.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?reserved_d_b_instances_offering_id ?d_b_instance_class + ?duration ?product_description ?offering_type ?multi_a_z ?(filters= + []) ?max_records ?marker () = + { + reserved_d_b_instances_offering_id; + d_b_instance_class; + duration; + product_description; + offering_type; + multi_a_z; + filters; + max_records; + marker + } + let parse xml = + Some + { + reserved_d_b_instances_offering_id = (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; character_set_name = - Util.option_bind (Xml.member "CharacterSetName" xml) String.parse - ; database_name = Util.option_bind (Xml.member "DatabaseName" xml) String.parse - ; d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; d_b_cluster_parameter_group_name = - Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; master_user_password = - Util.option_bind (Xml.member "MasterUserPassword" xml) String.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.master_user_password (fun f -> - Query.Pair ("MasterUserPassword", String.to_query f)) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Some + (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + Query.Pair + ("ReservedDBInstancesOfferingId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + ("reserved_d_b_instances_offering_id", (String.to_json f)))]) + let of_json j = + { + reserved_d_b_instances_offering_id = + (Util.option_map + (Json.lookup j "reserved_d_b_instances_offering_id") + String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module OptionGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ResetDBClusterParameterGroupMessage = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t ; + reset_all_parameters: Boolean.t option ; + parameters: ParametersList.t } + let make ~d_b_cluster_parameter_group_name ?reset_all_parameters + ?(parameters= []) () = + { d_b_cluster_parameter_group_name; reset_all_parameters; parameters } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Xml.required "DBClusterParameterGroupName" + (Util.option_bind + (Xml.member "DBClusterParameterGroupName" xml) String.parse)); + reset_all_parameters = + (Util.option_bind (Xml.member "ResetAllParameters" xml) + Boolean.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", + (ParametersList.to_query v.parameters))); + Util.option_map v.reset_all_parameters + (fun f -> + Query.Pair ("ResetAllParameters", (Boolean.to_query f))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - Query.Pair ("DBClusterParameterGroupName", String.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ; Util.option_map v.database_name (fun f -> - Query.Pair ("DatabaseName", String.to_query f)) - ; Util.option_map v.character_set_name (fun f -> - Query.Pair ("CharacterSetName", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Some + ("DBClusterParameterGroupName", + (String.to_query v.d_b_cluster_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (ParametersList.to_json v.parameters)); + Util.option_map v.reset_all_parameters + (fun f -> ("reset_all_parameters", (Boolean.to_json f))); + Some + ("d_b_cluster_parameter_group_name", + (String.to_json v.d_b_cluster_parameter_group_name))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_group_name"))); + reset_all_parameters = + (Util.option_map (Json.lookup j "reset_all_parameters") + Boolean.of_json); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module RestoreDBClusterFromSnapshotResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module RestoreDBInstanceFromDBSnapshotResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module RestoreDBClusterFromSnapshotMessage = + struct + type t = + { + availability_zones: AvailabilityZones.t ; + d_b_cluster_identifier: String.t ; + snapshot_identifier: String.t ; + engine: String.t ; + engine_version: String.t option ; + port: Integer.t option ; + d_b_subnet_group_name: String.t option ; + database_name: String.t option ; + option_group_name: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + tags: TagList.t } + let make ?(availability_zones= []) ~d_b_cluster_identifier + ~snapshot_identifier ~engine ?engine_version ?port + ?d_b_subnet_group_name ?database_name ?option_group_name + ?(vpc_security_group_ids= []) ?(tags= []) () = + { + availability_zones; + d_b_cluster_identifier; + snapshot_identifier; + engine; + engine_version; + port; + d_b_subnet_group_name; + database_name; + option_group_name; + vpc_security_group_ids; + tags + } + let parse xml = + Some + { + availability_zones = + (Util.of_option [] + (Util.option_bind (Xml.member "AvailabilityZones" xml) + AvailabilityZones.parse)); + d_b_cluster_identifier = + (Xml.required "DBClusterIdentifier" + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse)); + snapshot_identifier = + (Xml.required "SnapshotIdentifier" + (Util.option_bind (Xml.member "SnapshotIdentifier" xml) + String.parse)); + engine = + (Xml.required "Engine" + (Util.option_bind (Xml.member "Engine" xml) String.parse)); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + database_name = + (Util.option_bind (Xml.member "DatabaseName" xml) String.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.master_user_password (fun f -> - "master_user_password", String.to_json f) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - "d_b_cluster_parameter_group_name", String.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ; Util.option_map v.database_name (fun f -> "database_name", String.to_json f) - ; Util.option_map v.character_set_name (fun f -> - "character_set_name", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ]) - - let of_json j = - { availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; character_set_name = - Util.option_map (Json.lookup j "character_set_name") String.of_json - ; database_name = Util.option_map (Json.lookup j "database_name") String.of_json - ; d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; d_b_cluster_parameter_group_name = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; master_user_password = - Util.option_map (Json.lookup j "master_user_password") String.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module ModifyDBClusterParameterGroupMessage = struct - type t = - { d_b_cluster_parameter_group_name : String.t - ; parameters : ParametersList.t - } - - let make ~d_b_cluster_parameter_group_name ~parameters () = - { d_b_cluster_parameter_group_name; parameters } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Xml.required - "DBClusterParameterGroupName" - (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - ; parameters = - Xml.required - "Parameters" - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.database_name + (fun f -> Query.Pair ("DatabaseName", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Some (Query.Pair ("Engine", (String.to_query v.engine))); + Some (Query.Pair - ( "DBClusterParameterGroupName" - , String.to_query v.d_b_cluster_parameter_group_name )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", ParametersList.to_json v.parameters) - ; Some - ( "d_b_cluster_parameter_group_name" - , String.to_json v.d_b_cluster_parameter_group_name ) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_group_name")) - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module ModifyOptionGroupResult = struct - type t = { option_group : OptionGroup.t option } - - let make ?option_group () = { option_group } - - let parse xml = - Some - { option_group = Util.option_bind (Xml.member "OptionGroup" xml) OptionGroup.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> - Query.Pair ("OptionGroup", OptionGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> "option_group", OptionGroup.to_json f) - ]) - - let of_json j = - { option_group = Util.option_map (Json.lookup j "option_group") OptionGroup.of_json } -end - -module InvalidDBSubnetGroupFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyDBInstanceMessage = struct - type t = - { d_b_instance_identifier : String.t - ; allocated_storage : Integer.t option - ; d_b_instance_class : String.t option - ; d_b_security_groups : DBSecurityGroupNameList.t - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; apply_immediately : Boolean.t option - ; master_user_password : String.t option - ; d_b_parameter_group_name : String.t option - ; backup_retention_period : Integer.t option - ; preferred_backup_window : String.t option - ; preferred_maintenance_window : String.t option - ; multi_a_z : Boolean.t option - ; engine_version : String.t option - ; allow_major_version_upgrade : Boolean.t option - ; auto_minor_version_upgrade : Boolean.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; new_d_b_instance_identifier : String.t option - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; tde_credential_password : String.t option - ; c_a_certificate_identifier : String.t option - ; domain : String.t option - ; copy_tags_to_snapshot : Boolean.t option - } - - let make - ~d_b_instance_identifier - ?allocated_storage - ?d_b_instance_class - ?(d_b_security_groups = []) - ?(vpc_security_group_ids = []) - ?apply_immediately - ?master_user_password - ?d_b_parameter_group_name - ?backup_retention_period - ?preferred_backup_window - ?preferred_maintenance_window - ?multi_a_z - ?engine_version - ?allow_major_version_upgrade - ?auto_minor_version_upgrade - ?iops - ?option_group_name - ?new_d_b_instance_identifier - ?storage_type - ?tde_credential_arn - ?tde_credential_password - ?c_a_certificate_identifier - ?domain - ?copy_tags_to_snapshot - () = - { d_b_instance_identifier - ; allocated_storage - ; d_b_instance_class - ; d_b_security_groups - ; vpc_security_group_ids - ; apply_immediately - ; master_user_password - ; d_b_parameter_group_name - ; backup_retention_period - ; preferred_backup_window - ; preferred_maintenance_window - ; multi_a_z - ; engine_version - ; allow_major_version_upgrade - ; auto_minor_version_upgrade - ; iops - ; option_group_name - ; new_d_b_instance_identifier - ; storage_type - ; tde_credential_arn - ; tde_credential_password - ; c_a_certificate_identifier - ; domain - ; copy_tags_to_snapshot - } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; d_b_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBSecurityGroups" xml) - DBSecurityGroupNameList.parse) - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; apply_immediately = - Util.option_bind (Xml.member "ApplyImmediately" xml) Boolean.parse - ; master_user_password = - Util.option_bind (Xml.member "MasterUserPassword" xml) String.parse - ; d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; allow_major_version_upgrade = - Util.option_bind (Xml.member "AllowMajorVersionUpgrade" xml) Boolean.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; new_d_b_instance_identifier = - Util.option_bind (Xml.member "NewDBInstanceIdentifier" xml) String.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; tde_credential_password = - Util.option_bind (Xml.member "TdeCredentialPassword" xml) String.parse - ; c_a_certificate_identifier = - Util.option_bind (Xml.member "CACertificateIdentifier" xml) String.parse - ; domain = Util.option_bind (Xml.member "Domain" xml) String.parse - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Util.option_map v.domain (fun f -> Query.Pair ("Domain", String.to_query f)) - ; Util.option_map v.c_a_certificate_identifier (fun f -> - Query.Pair ("CACertificateIdentifier", String.to_query f)) - ; Util.option_map v.tde_credential_password (fun f -> - Query.Pair ("TdeCredentialPassword", String.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.new_d_b_instance_identifier (fun f -> - Query.Pair ("NewDBInstanceIdentifier", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.allow_major_version_upgrade (fun f -> - Query.Pair ("AllowMajorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ; Util.option_map v.master_user_password (fun f -> - Query.Pair ("MasterUserPassword", String.to_query f)) - ; Util.option_map v.apply_immediately (fun f -> - Query.Pair ("ApplyImmediately", Boolean.to_query f)) - ; Some + ("SnapshotIdentifier", + (String.to_query v.snapshot_identifier))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Some + ("DBClusterIdentifier", + (String.to_query v.d_b_cluster_identifier))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroupNameList.to_query v.d_b_security_groups )) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Some + ("AvailabilityZones.member", + (AvailabilityZones.to_query v.availability_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.database_name + (fun f -> ("database_name", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Some ("engine", (String.to_json v.engine)); + Some + ("snapshot_identifier", (String.to_json v.snapshot_identifier)); + Some + ("d_b_cluster_identifier", + (String.to_json v.d_b_cluster_identifier)); + Some + ("availability_zones", + (AvailabilityZones.to_json v.availability_zones))]) + let of_json j = + { + availability_zones = + (AvailabilityZones.of_json + (Util.of_option_exn (Json.lookup j "availability_zones"))); + d_b_cluster_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier"))); + snapshot_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "snapshot_identifier"))); + engine = + (String.of_json (Util.of_option_exn (Json.lookup j "engine"))); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + database_name = + (Util.option_map (Json.lookup j "database_name") String.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DBParameterGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDBInstancesMessage = + struct + type t = + { + d_b_instance_identifier: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_instance_identifier ?(filters= []) ?max_records ?marker + () = { d_b_instance_identifier; filters; max_records; marker } + let parse xml = + Some + { + d_b_instance_identifier = + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_instance_identifier + (fun f -> + Query.Pair ("DBInstanceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_instance_identifier + (fun f -> ("d_b_instance_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_instance_identifier = + (Util.option_map (Json.lookup j "d_b_instance_identifier") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ModifyDBInstanceResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module DescribeEngineDefaultClusterParametersResult = + struct + type t = { + engine_defaults: EngineDefaults.t option } + let make ?engine_defaults () = { engine_defaults } + let parse xml = + Some + { + engine_defaults = + (Util.option_bind (Xml.member "EngineDefaults" xml) + EngineDefaults.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.engine_defaults + (fun f -> + Query.Pair ("EngineDefaults", (EngineDefaults.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.engine_defaults + (fun f -> ("engine_defaults", (EngineDefaults.to_json f)))]) + let of_json j = + { + engine_defaults = + (Util.option_map (Json.lookup j "engine_defaults") + EngineDefaults.of_json) + } + end +module CreateDBSnapshotMessage = + struct + type t = + { + d_b_snapshot_identifier: String.t ; + d_b_instance_identifier: String.t ; + tags: TagList.t } + let make ~d_b_snapshot_identifier ~d_b_instance_identifier ?(tags= []) + () = { d_b_snapshot_identifier; d_b_instance_identifier; tags } + let parse xml = + Some + { + d_b_snapshot_identifier = + (Xml.required "DBSnapshotIdentifier" + (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) + String.parse)); + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Util.option_map v.domain (fun f -> "domain", String.to_json f) - ; Util.option_map v.c_a_certificate_identifier (fun f -> - "c_a_certificate_identifier", String.to_json f) - ; Util.option_map v.tde_credential_password (fun f -> - "tde_credential_password", String.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.new_d_b_instance_identifier (fun f -> - "new_d_b_instance_identifier", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.allow_major_version_upgrade (fun f -> - "allow_major_version_upgrade", Boolean.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ; Util.option_map v.master_user_password (fun f -> - "master_user_password", String.to_json f) - ; Util.option_map v.apply_immediately (fun f -> - "apply_immediately", Boolean.to_json f) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Some - ("d_b_security_groups", DBSecurityGroupNameList.to_json v.d_b_security_groups) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; d_b_security_groups = - DBSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; apply_immediately = - Util.option_map (Json.lookup j "apply_immediately") Boolean.of_json - ; master_user_password = - Util.option_map (Json.lookup j "master_user_password") String.of_json - ; d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; allow_major_version_upgrade = - Util.option_map (Json.lookup j "allow_major_version_upgrade") Boolean.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; new_d_b_instance_identifier = - Util.option_map (Json.lookup j "new_d_b_instance_identifier") String.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; tde_credential_password = - Util.option_map (Json.lookup j "tde_credential_password") String.of_json - ; c_a_certificate_identifier = - Util.option_map (Json.lookup j "c_a_certificate_identifier") String.of_json - ; domain = Util.option_map (Json.lookup j "domain") String.of_json - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - } -end - -module DescribeReservedDBInstancesOfferingsMessage = struct - type t = - { reserved_d_b_instances_offering_id : String.t option - ; d_b_instance_class : String.t option - ; duration : String.t option - ; product_description : String.t option - ; offering_type : String.t option - ; multi_a_z : Boolean.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?reserved_d_b_instances_offering_id - ?d_b_instance_class - ?duration - ?product_description - ?offering_type - ?multi_a_z - ?(filters = []) - ?max_records - ?marker - () = - { reserved_d_b_instances_offering_id - ; d_b_instance_class - ; duration - ; product_description - ; offering_type - ; multi_a_z - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { reserved_d_b_instances_offering_id = - Util.option_bind (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) String.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - Query.Pair ("ReservedDBInstancesOfferingId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.duration (fun f -> "duration", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - "reserved_d_b_instances_offering_id", String.to_json f) - ]) - - let of_json j = - { reserved_d_b_instances_offering_id = - Util.option_map - (Json.lookup j "reserved_d_b_instances_offering_id") - String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module OptionGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ResetDBClusterParameterGroupMessage = struct - type t = - { d_b_cluster_parameter_group_name : String.t - ; reset_all_parameters : Boolean.t option - ; parameters : ParametersList.t - } - - let make ~d_b_cluster_parameter_group_name ?reset_all_parameters ?(parameters = []) () = - { d_b_cluster_parameter_group_name; reset_all_parameters; parameters } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Xml.required - "DBClusterParameterGroupName" - (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - ; reset_all_parameters = - Util.option_bind (Xml.member "ResetAllParameters" xml) Boolean.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Util.option_map v.reset_all_parameters (fun f -> - Query.Pair ("ResetAllParameters", Boolean.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier))); + Some (Query.Pair - ( "DBClusterParameterGroupName" - , String.to_query v.d_b_cluster_parameter_group_name )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", ParametersList.to_json v.parameters) - ; Util.option_map v.reset_all_parameters (fun f -> - "reset_all_parameters", Boolean.to_json f) - ; Some - ( "d_b_cluster_parameter_group_name" - , String.to_json v.d_b_cluster_parameter_group_name ) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_group_name")) - ; reset_all_parameters = - Util.option_map (Json.lookup j "reset_all_parameters") Boolean.of_json - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module RestoreDBClusterFromSnapshotResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module RestoreDBInstanceFromDBSnapshotResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module RestoreDBClusterFromSnapshotMessage = struct - type t = - { availability_zones : AvailabilityZones.t - ; d_b_cluster_identifier : String.t - ; snapshot_identifier : String.t - ; engine : String.t - ; engine_version : String.t option - ; port : Integer.t option - ; d_b_subnet_group_name : String.t option - ; database_name : String.t option - ; option_group_name : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; tags : TagList.t - } - - let make - ?(availability_zones = []) - ~d_b_cluster_identifier - ~snapshot_identifier - ~engine - ?engine_version - ?port - ?d_b_subnet_group_name - ?database_name - ?option_group_name - ?(vpc_security_group_ids = []) - ?(tags = []) - () = - { availability_zones - ; d_b_cluster_identifier - ; snapshot_identifier - ; engine - ; engine_version - ; port - ; d_b_subnet_group_name - ; database_name - ; option_group_name - ; vpc_security_group_ids - ; tags - } - - let parse xml = - Some - { availability_zones = - Util.of_option - [] - (Util.option_bind - (Xml.member "AvailabilityZones" xml) - AvailabilityZones.parse) - ; d_b_cluster_identifier = - Xml.required - "DBClusterIdentifier" - (Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse) - ; snapshot_identifier = - Xml.required - "SnapshotIdentifier" - (Util.option_bind (Xml.member "SnapshotIdentifier" xml) String.parse) - ; engine = - Xml.required "Engine" (Util.option_bind (Xml.member "Engine" xml) String.parse) - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; database_name = Util.option_bind (Xml.member "DatabaseName" xml) String.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("DBSnapshotIdentifier", + (String.to_query v.d_b_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier)); + Some + ("d_b_snapshot_identifier", + (String.to_json v.d_b_snapshot_identifier))]) + let of_json j = + { + d_b_snapshot_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier"))); + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module CopyDBParameterGroupMessage = + struct + type t = + { + source_d_b_parameter_group_identifier: String.t ; + target_d_b_parameter_group_identifier: String.t ; + target_d_b_parameter_group_description: String.t ; + tags: TagList.t } + let make ~source_d_b_parameter_group_identifier + ~target_d_b_parameter_group_identifier + ~target_d_b_parameter_group_description ?(tags= []) () = + { + source_d_b_parameter_group_identifier; + target_d_b_parameter_group_identifier; + target_d_b_parameter_group_description; + tags + } + let parse xml = + Some + { + source_d_b_parameter_group_identifier = + (Xml.required "SourceDBParameterGroupIdentifier" + (Util.option_bind + (Xml.member "SourceDBParameterGroupIdentifier" xml) + String.parse)); + target_d_b_parameter_group_identifier = + (Xml.required "TargetDBParameterGroupIdentifier" + (Util.option_bind + (Xml.member "TargetDBParameterGroupIdentifier" xml) + String.parse)); + target_d_b_parameter_group_description = + (Xml.required "TargetDBParameterGroupDescription" + (Util.option_bind + (Xml.member "TargetDBParameterGroupDescription" xml) + String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.database_name (fun f -> - Query.Pair ("DatabaseName", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Some (Query.Pair ("Engine", String.to_query v.engine)) - ; Some (Query.Pair ("SnapshotIdentifier", String.to_query v.snapshot_identifier)) - ; Some - (Query.Pair ("DBClusterIdentifier", String.to_query v.d_b_cluster_identifier)) - ; Some + ("TargetDBParameterGroupDescription", + (String.to_query v.target_d_b_parameter_group_description))); + Some (Query.Pair - ( "AvailabilityZones.member" - , AvailabilityZones.to_query v.availability_zones )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.database_name (fun f -> "database_name", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Some ("engine", String.to_json v.engine) - ; Some ("snapshot_identifier", String.to_json v.snapshot_identifier) - ; Some ("d_b_cluster_identifier", String.to_json v.d_b_cluster_identifier) - ; Some ("availability_zones", AvailabilityZones.to_json v.availability_zones) - ]) - - let of_json j = - { availability_zones = - AvailabilityZones.of_json - (Util.of_option_exn (Json.lookup j "availability_zones")) - ; d_b_cluster_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_cluster_identifier")) - ; snapshot_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "snapshot_identifier")) - ; engine = String.of_json (Util.of_option_exn (Json.lookup j "engine")) - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; database_name = Util.option_map (Json.lookup j "database_name") String.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DBParameterGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDBInstancesMessage = struct - type t = - { d_b_instance_identifier : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_instance_identifier ?(filters = []) ?max_records ?marker () = - { d_b_instance_identifier; filters; max_records; marker } - - let parse xml = - Some - { d_b_instance_identifier = - Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_instance_identifier (fun f -> - Query.Pair ("DBInstanceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_instance_identifier (fun f -> - "d_b_instance_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_instance_identifier = - Util.option_map (Json.lookup j "d_b_instance_identifier") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ModifyDBInstanceResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module DescribeEngineDefaultClusterParametersResult = struct - type t = { engine_defaults : EngineDefaults.t option } - - let make ?engine_defaults () = { engine_defaults } - - let parse xml = - Some - { engine_defaults = - Util.option_bind (Xml.member "EngineDefaults" xml) EngineDefaults.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.engine_defaults (fun f -> - Query.Pair ("EngineDefaults", EngineDefaults.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.engine_defaults (fun f -> - "engine_defaults", EngineDefaults.to_json f) - ]) - - let of_json j = - { engine_defaults = - Util.option_map (Json.lookup j "engine_defaults") EngineDefaults.of_json - } -end - -module CreateDBSnapshotMessage = struct - type t = - { d_b_snapshot_identifier : String.t - ; d_b_instance_identifier : String.t - ; tags : TagList.t - } - - let make ~d_b_snapshot_identifier ~d_b_instance_identifier ?(tags = []) () = - { d_b_snapshot_identifier; d_b_instance_identifier; tags } - - let parse xml = - Some - { d_b_snapshot_identifier = - Xml.required - "DBSnapshotIdentifier" - (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) String.parse) - ; d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("TargetDBParameterGroupIdentifier", + (String.to_query v.target_d_b_parameter_group_identifier))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ; Some + ("SourceDBParameterGroupIdentifier", + (String.to_query v.source_d_b_parameter_group_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("target_d_b_parameter_group_description", + (String.to_json v.target_d_b_parameter_group_description)); + Some + ("target_d_b_parameter_group_identifier", + (String.to_json v.target_d_b_parameter_group_identifier)); + Some + ("source_d_b_parameter_group_identifier", + (String.to_json v.source_d_b_parameter_group_identifier))]) + let of_json j = + { + source_d_b_parameter_group_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_parameter_group_identifier"))); + target_d_b_parameter_group_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_d_b_parameter_group_identifier"))); + target_d_b_parameter_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_d_b_parameter_group_description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DeleteEventSubscriptionResult = + struct + type t = { + event_subscription: EventSubscription.t option } + let make ?event_subscription () = { event_subscription } + let parse xml = + Some + { + event_subscription = + (Util.option_bind (Xml.member "EventSubscription" xml) + EventSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> + Query.Pair + ("EventSubscription", (EventSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> ("event_subscription", (EventSubscription.to_json f)))]) + let of_json j = + { + event_subscription = + (Util.option_map (Json.lookup j "event_subscription") + EventSubscription.of_json) + } + end +module OptionGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidEventSubscriptionStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBInstanceMessage = + struct + type t = { + marker: String.t option ; + d_b_instances: DBInstanceList.t } + let make ?marker ?(d_b_instances= []) () = { marker; d_b_instances } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_instances = + (Util.of_option [] + (Util.option_bind (Xml.member "DBInstances" xml) + DBInstanceList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBInstances.member", + (DBInstanceList.to_query v.d_b_instances))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("d_b_instances", (DBInstanceList.to_json v.d_b_instances)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_instances = + (DBInstanceList.of_json + (Util.of_option_exn (Json.lookup j "d_b_instances"))) + } + end +module CopyDBSnapshotResult = + struct + type t = { + d_b_snapshot: DBSnapshot.t option } + let make ?d_b_snapshot () = { d_b_snapshot } + let parse xml = + Some + { + d_b_snapshot = + (Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> Query.Pair ("DBSnapshot", (DBSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> ("d_b_snapshot", (DBSnapshot.to_json f)))]) + let of_json j = + { + d_b_snapshot = + (Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json) + } + end +module InsufficientDBInstanceCapacityFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateOptionGroupResult = + struct + type t = { + option_group: OptionGroup.t option } + let make ?option_group () = { option_group } + let parse xml = + Some + { + option_group = + (Util.option_bind (Xml.member "OptionGroup" xml) + OptionGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> Query.Pair ("OptionGroup", (OptionGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> ("option_group", (OptionGroup.to_json f)))]) + let of_json j = + { + option_group = + (Util.option_map (Json.lookup j "option_group") OptionGroup.of_json) + } + end +module DescribeCertificatesMessage = + struct + type t = + { + certificate_identifier: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?certificate_identifier ?(filters= []) ?max_records ?marker + () = { certificate_identifier; filters; max_records; marker } + let parse xml = + Some + { + certificate_identifier = + (Util.option_bind (Xml.member "CertificateIdentifier" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.certificate_identifier + (fun f -> + Query.Pair ("CertificateIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.certificate_identifier + (fun f -> ("certificate_identifier", (String.to_json f)))]) + let of_json j = + { + certificate_identifier = + (Util.option_map (Json.lookup j "certificate_identifier") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DBSubnetGroupNotAllowedFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBSecurityGroupResult = + struct + type t = { + d_b_security_group: DBSecurityGroup.t option } + let make ?d_b_security_group () = { d_b_security_group } + let parse xml = + Some + { + d_b_security_group = + (Util.option_bind (Xml.member "DBSecurityGroup" xml) + DBSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> + Query.Pair ("DBSecurityGroup", (DBSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> ("d_b_security_group", (DBSecurityGroup.to_json f)))]) + let of_json j = + { + d_b_security_group = + (Util.option_map (Json.lookup j "d_b_security_group") + DBSecurityGroup.of_json) + } + end +module AccountAttributesMessage = + struct + type t = { + account_quotas: AccountQuotaList.t } + let make ?(account_quotas= []) () = { account_quotas } + let parse xml = + Some + { + account_quotas = + (Util.of_option [] + (Util.option_bind (Xml.member "AccountQuotas" xml) + AccountQuotaList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AccountQuotas.member", + (AccountQuotaList.to_query v.account_quotas)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("account_quotas", (AccountQuotaList.to_json v.account_quotas))]) + let of_json j = + { + account_quotas = + (AccountQuotaList.of_json + (Util.of_option_exn (Json.lookup j "account_quotas"))) + } + end +module DBSecurityGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RestoreDBClusterToPointInTimeResult = + struct + type t = { + d_b_cluster: DBCluster.t option } + let make ?d_b_cluster () = { d_b_cluster } + let parse xml = + Some + { + d_b_cluster = + (Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> Query.Pair ("DBCluster", (DBCluster.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster + (fun f -> ("d_b_cluster", (DBCluster.to_json f)))]) + let of_json j = + { + d_b_cluster = + (Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json) + } + end +module StorageQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidDBSubnetStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RebootDBInstanceResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module ResetDBParameterGroupMessage = + struct + type t = + { + d_b_parameter_group_name: String.t ; + reset_all_parameters: Boolean.t option ; + parameters: ParametersList.t } + let make ~d_b_parameter_group_name ?reset_all_parameters ?(parameters= + []) () = + { d_b_parameter_group_name; reset_all_parameters; parameters } + let parse xml = + Some + { + d_b_parameter_group_name = + (Xml.required "DBParameterGroupName" + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse)); + reset_all_parameters = + (Util.option_bind (Xml.member "ResetAllParameters" xml) + Boolean.parse); + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Parameters.member", + (ParametersList.to_query v.parameters))); + Util.option_map v.reset_all_parameters + (fun f -> + Query.Pair ("ResetAllParameters", (Boolean.to_query f))); + Some (Query.Pair - ("DBSnapshotIdentifier", String.to_query v.d_b_snapshot_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ; Some ("d_b_snapshot_identifier", String.to_json v.d_b_snapshot_identifier) - ]) - - let of_json j = - { d_b_snapshot_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier")) - ; d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module CopyDBParameterGroupMessage = struct - type t = - { source_d_b_parameter_group_identifier : String.t - ; target_d_b_parameter_group_identifier : String.t - ; target_d_b_parameter_group_description : String.t - ; tags : TagList.t - } - - let make - ~source_d_b_parameter_group_identifier - ~target_d_b_parameter_group_identifier - ~target_d_b_parameter_group_description - ?(tags = []) - () = - { source_d_b_parameter_group_identifier - ; target_d_b_parameter_group_identifier - ; target_d_b_parameter_group_description - ; tags - } - - let parse xml = - Some - { source_d_b_parameter_group_identifier = - Xml.required - "SourceDBParameterGroupIdentifier" - (Util.option_bind - (Xml.member "SourceDBParameterGroupIdentifier" xml) - String.parse) - ; target_d_b_parameter_group_identifier = - Xml.required - "TargetDBParameterGroupIdentifier" - (Util.option_bind - (Xml.member "TargetDBParameterGroupIdentifier" xml) + ("DBParameterGroupName", + (String.to_query v.d_b_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parameters", (ParametersList.to_json v.parameters)); + Util.option_map v.reset_all_parameters + (fun f -> ("reset_all_parameters", (Boolean.to_json f))); + Some + ("d_b_parameter_group_name", + (String.to_json v.d_b_parameter_group_name))]) + let of_json j = + { + d_b_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name"))); + reset_all_parameters = + (Util.option_map (Json.lookup j "reset_all_parameters") + Boolean.of_json); + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))) + } + end +module DescribeOptionGroupsMessage = + struct + type t = + { + option_group_name: String.t option ; + filters: FilterList.t ; + marker: String.t option ; + max_records: Integer.t option ; + engine_name: String.t option ; + major_engine_version: String.t option } + let make ?option_group_name ?(filters= []) ?marker ?max_records + ?engine_name ?major_engine_version () = + { + option_group_name; + filters; + marker; + max_records; + engine_name; + major_engine_version + } + let parse xml = + Some + { + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + engine_name = + (Util.option_bind (Xml.member "EngineName" xml) String.parse); + major_engine_version = + (Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse) - ; target_d_b_parameter_group_description = - Xml.required - "TargetDBParameterGroupDescription" - (Util.option_bind - (Xml.member "TargetDBParameterGroupDescription" xml) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.major_engine_version + (fun f -> + Query.Pair ("MajorEngineVersion", (String.to_query f))); + Util.option_map v.engine_name + (fun f -> Query.Pair ("EngineName", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.major_engine_version + (fun f -> ("major_engine_version", (String.to_json f))); + Util.option_map v.engine_name + (fun f -> ("engine_name", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f)))]) + let of_json j = + { + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + engine_name = + (Util.option_map (Json.lookup j "engine_name") String.of_json); + major_engine_version = + (Util.option_map (Json.lookup j "major_engine_version") + String.of_json) + } + end +module InvalidDBParameterGroupStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteEventSubscriptionMessage = + struct + type t = { + subscription_name: String.t } + let make ~subscription_name () = { subscription_name } + let parse xml = + Some + { + subscription_name = + (Xml.required "SubscriptionName" + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SubscriptionName", (String.to_query v.subscription_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subscription_name", (String.to_json v.subscription_name))]) + let of_json j = + { + subscription_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "subscription_name"))) + } + end +module DBParameterGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBSecurityGroupMessage = + struct + type t = { + d_b_security_group_name: String.t } + let make ~d_b_security_group_name () = { d_b_security_group_name } + let parse xml = + Some + { + d_b_security_group_name = + (Xml.required "DBSecurityGroupName" + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSecurityGroupName", + (String.to_query v.d_b_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_security_group_name", + (String.to_json v.d_b_security_group_name))]) + let of_json j = + { + d_b_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_group_name"))) + } + end +module DBInstanceAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module RevokeDBSecurityGroupIngressMessage = + struct + type t = + { + d_b_security_group_name: String.t ; + c_i_d_r_i_p: String.t option ; + e_c2_security_group_name: String.t option ; + e_c2_security_group_id: String.t option ; + e_c2_security_group_owner_id: String.t option } + let make ~d_b_security_group_name ?c_i_d_r_i_p + ?e_c2_security_group_name ?e_c2_security_group_id + ?e_c2_security_group_owner_id () = + { + d_b_security_group_name; + c_i_d_r_i_p; + e_c2_security_group_name; + e_c2_security_group_id; + e_c2_security_group_owner_id + } + let parse xml = + Some + { + d_b_security_group_name = + (Xml.required "DBSecurityGroupName" + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse)); + c_i_d_r_i_p = + (Util.option_bind (Xml.member "CIDRIP" xml) String.parse); + e_c2_security_group_name = + (Util.option_bind (Xml.member "EC2SecurityGroupName" xml) + String.parse); + e_c2_security_group_id = + (Util.option_bind (Xml.member "EC2SecurityGroupId" xml) + String.parse); + e_c2_security_group_owner_id = + (Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> + Query.Pair ("EC2SecurityGroupOwnerId", (String.to_query f))); + Util.option_map v.e_c2_security_group_id + (fun f -> Query.Pair ("EC2SecurityGroupId", (String.to_query f))); + Util.option_map v.e_c2_security_group_name + (fun f -> + Query.Pair ("EC2SecurityGroupName", (String.to_query f))); + Util.option_map v.c_i_d_r_i_p + (fun f -> Query.Pair ("CIDRIP", (String.to_query f))); + Some (Query.Pair - ( "TargetDBParameterGroupDescription" - , String.to_query v.target_d_b_parameter_group_description )) - ; Some + ("DBSecurityGroupName", + (String.to_query v.d_b_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.e_c2_security_group_owner_id + (fun f -> ("e_c2_security_group_owner_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_id + (fun f -> ("e_c2_security_group_id", (String.to_json f))); + Util.option_map v.e_c2_security_group_name + (fun f -> ("e_c2_security_group_name", (String.to_json f))); + Util.option_map v.c_i_d_r_i_p + (fun f -> ("c_i_d_r_i_p", (String.to_json f))); + Some + ("d_b_security_group_name", + (String.to_json v.d_b_security_group_name))]) + let of_json j = + { + d_b_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_group_name"))); + c_i_d_r_i_p = + (Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json); + e_c2_security_group_name = + (Util.option_map (Json.lookup j "e_c2_security_group_name") + String.of_json); + e_c2_security_group_id = + (Util.option_map (Json.lookup j "e_c2_security_group_id") + String.of_json); + e_c2_security_group_owner_id = + (Util.option_map (Json.lookup j "e_c2_security_group_owner_id") + String.of_json) + } + end +module SubscriptionNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBClusterParameterGroupsMessage = + struct + type t = + { + marker: String.t option ; + d_b_cluster_parameter_groups: DBClusterParameterGroupList.t } + let make ?marker ?(d_b_cluster_parameter_groups= []) () = + { marker; d_b_cluster_parameter_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_cluster_parameter_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBClusterParameterGroups" xml) + DBClusterParameterGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBClusterParameterGroups.member", + (DBClusterParameterGroupList.to_query + v.d_b_cluster_parameter_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_cluster_parameter_groups", + (DBClusterParameterGroupList.to_json + v.d_b_cluster_parameter_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_cluster_parameter_groups = + (DBClusterParameterGroupList.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_groups"))) + } + end +module ReservedDBInstanceAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CopyDBSnapshotMessage = + struct + type t = + { + source_d_b_snapshot_identifier: String.t ; + target_d_b_snapshot_identifier: String.t ; + tags: TagList.t ; + copy_tags: Boolean.t option } + let make ~source_d_b_snapshot_identifier ~target_d_b_snapshot_identifier + ?(tags= []) ?copy_tags () = + { + source_d_b_snapshot_identifier; + target_d_b_snapshot_identifier; + tags; + copy_tags + } + let parse xml = + Some + { + source_d_b_snapshot_identifier = + (Xml.required "SourceDBSnapshotIdentifier" + (Util.option_bind + (Xml.member "SourceDBSnapshotIdentifier" xml) String.parse)); + target_d_b_snapshot_identifier = + (Xml.required "TargetDBSnapshotIdentifier" + (Util.option_bind + (Xml.member "TargetDBSnapshotIdentifier" xml) String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + copy_tags = + (Util.option_bind (Xml.member "CopyTags" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags + (fun f -> Query.Pair ("CopyTags", (Boolean.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ( "TargetDBParameterGroupIdentifier" - , String.to_query v.target_d_b_parameter_group_identifier )) - ; Some + ("TargetDBSnapshotIdentifier", + (String.to_query v.target_d_b_snapshot_identifier))); + Some (Query.Pair - ( "SourceDBParameterGroupIdentifier" - , String.to_query v.source_d_b_parameter_group_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "target_d_b_parameter_group_description" - , String.to_json v.target_d_b_parameter_group_description ) - ; Some - ( "target_d_b_parameter_group_identifier" - , String.to_json v.target_d_b_parameter_group_identifier ) - ; Some - ( "source_d_b_parameter_group_identifier" - , String.to_json v.source_d_b_parameter_group_identifier ) - ]) - - let of_json j = - { source_d_b_parameter_group_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_parameter_group_identifier")) - ; target_d_b_parameter_group_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "target_d_b_parameter_group_identifier")) - ; target_d_b_parameter_group_description = - String.of_json - (Util.of_option_exn (Json.lookup j "target_d_b_parameter_group_description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DeleteEventSubscriptionResult = struct - type t = { event_subscription : EventSubscription.t option } - - let make ?event_subscription () = { event_subscription } - - let parse xml = - Some - { event_subscription = - Util.option_bind (Xml.member "EventSubscription" xml) EventSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - Query.Pair ("EventSubscription", EventSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - "event_subscription", EventSubscription.to_json f) - ]) - - let of_json j = - { event_subscription = - Util.option_map (Json.lookup j "event_subscription") EventSubscription.of_json - } -end - -module OptionGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidEventSubscriptionStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBInstanceMessage = struct - type t = - { marker : String.t option - ; d_b_instances : DBInstanceList.t - } - - let make ?marker ?(d_b_instances = []) () = { marker; d_b_instances } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_instances = - Util.of_option - [] - (Util.option_bind (Xml.member "DBInstances" xml) DBInstanceList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DBInstances.member", DBInstanceList.to_query v.d_b_instances)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_instances", DBInstanceList.to_json v.d_b_instances) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_instances = - DBInstanceList.of_json (Util.of_option_exn (Json.lookup j "d_b_instances")) - } -end - -module CopyDBSnapshotResult = struct - type t = { d_b_snapshot : DBSnapshot.t option } - - let make ?d_b_snapshot () = { d_b_snapshot } - - let parse xml = - Some - { d_b_snapshot = Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> - Query.Pair ("DBSnapshot", DBSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> "d_b_snapshot", DBSnapshot.to_json f) - ]) - - let of_json j = - { d_b_snapshot = Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json } -end - -module InsufficientDBInstanceCapacityFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateOptionGroupResult = struct - type t = { option_group : OptionGroup.t option } - - let make ?option_group () = { option_group } - - let parse xml = - Some - { option_group = Util.option_bind (Xml.member "OptionGroup" xml) OptionGroup.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> - Query.Pair ("OptionGroup", OptionGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> "option_group", OptionGroup.to_json f) - ]) - - let of_json j = - { option_group = Util.option_map (Json.lookup j "option_group") OptionGroup.of_json } -end - -module DescribeCertificatesMessage = struct - type t = - { certificate_identifier : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?certificate_identifier ?(filters = []) ?max_records ?marker () = - { certificate_identifier; filters; max_records; marker } - - let parse xml = - Some - { certificate_identifier = - Util.option_bind (Xml.member "CertificateIdentifier" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.certificate_identifier (fun f -> - Query.Pair ("CertificateIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.certificate_identifier (fun f -> - "certificate_identifier", String.to_json f) - ]) - - let of_json j = - { certificate_identifier = - Util.option_map (Json.lookup j "certificate_identifier") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DBSubnetGroupNotAllowedFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBSecurityGroupResult = struct - type t = { d_b_security_group : DBSecurityGroup.t option } - - let make ?d_b_security_group () = { d_b_security_group } - - let parse xml = - Some - { d_b_security_group = - Util.option_bind (Xml.member "DBSecurityGroup" xml) DBSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - Query.Pair ("DBSecurityGroup", DBSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - "d_b_security_group", DBSecurityGroup.to_json f) - ]) - - let of_json j = - { d_b_security_group = - Util.option_map (Json.lookup j "d_b_security_group") DBSecurityGroup.of_json - } -end - -module AccountAttributesMessage = struct - type t = { account_quotas : AccountQuotaList.t } - - let make ?(account_quotas = []) () = { account_quotas } - - let parse xml = - Some - { account_quotas = - Util.of_option - [] - (Util.option_bind (Xml.member "AccountQuotas" xml) AccountQuotaList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SourceDBSnapshotIdentifier", + (String.to_query v.source_d_b_snapshot_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags + (fun f -> ("copy_tags", (Boolean.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Some + ("target_d_b_snapshot_identifier", + (String.to_json v.target_d_b_snapshot_identifier)); + Some + ("source_d_b_snapshot_identifier", + (String.to_json v.source_d_b_snapshot_identifier))]) + let of_json j = + { + source_d_b_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_snapshot_identifier"))); + target_d_b_snapshot_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "target_d_b_snapshot_identifier"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + copy_tags = + (Util.option_map (Json.lookup j "copy_tags") Boolean.of_json) + } + end +module RevokeDBSecurityGroupIngressResult = + struct + type t = { + d_b_security_group: DBSecurityGroup.t option } + let make ?d_b_security_group () = { d_b_security_group } + let parse xml = + Some + { + d_b_security_group = + (Util.option_bind (Xml.member "DBSecurityGroup" xml) + DBSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> + Query.Pair ("DBSecurityGroup", (DBSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> ("d_b_security_group", (DBSecurityGroup.to_json f)))]) + let of_json j = + { + d_b_security_group = + (Util.option_map (Json.lookup j "d_b_security_group") + DBSecurityGroup.of_json) + } + end +module DescribeDBLogFilesResponse = + struct + type t = + { + describe_d_b_log_files: DescribeDBLogFilesList.t ; + marker: String.t option } + let make ?(describe_d_b_log_files= []) ?marker () = + { describe_d_b_log_files; marker } + let parse xml = + Some + { + describe_d_b_log_files = + (Util.of_option [] + (Util.option_bind (Xml.member "DescribeDBLogFiles" xml) + DescribeDBLogFilesList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("AccountQuotas.member", AccountQuotaList.to_query v.account_quotas)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("account_quotas", AccountQuotaList.to_json v.account_quotas) ]) - - let of_json j = - { account_quotas = - AccountQuotaList.of_json (Util.of_option_exn (Json.lookup j "account_quotas")) - } -end - -module DBSecurityGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RestoreDBClusterToPointInTimeResult = struct - type t = { d_b_cluster : DBCluster.t option } - - let make ?d_b_cluster () = { d_b_cluster } - - let parse xml = - Some { d_b_cluster = Util.option_bind (Xml.member "DBCluster" xml) DBCluster.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> - Query.Pair ("DBCluster", DBCluster.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster (fun f -> "d_b_cluster", DBCluster.to_json f) ]) - - let of_json j = - { d_b_cluster = Util.option_map (Json.lookup j "d_b_cluster") DBCluster.of_json } -end - -module StorageQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidDBSubnetStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RebootDBInstanceResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module ResetDBParameterGroupMessage = struct - type t = - { d_b_parameter_group_name : String.t - ; reset_all_parameters : Boolean.t option - ; parameters : ParametersList.t - } - - let make ~d_b_parameter_group_name ?reset_all_parameters ?(parameters = []) () = - { d_b_parameter_group_name; reset_all_parameters; parameters } - - let parse xml = - Some - { d_b_parameter_group_name = - Xml.required - "DBParameterGroupName" - (Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse) - ; reset_all_parameters = - Util.option_bind (Xml.member "ResetAllParameters" xml) Boolean.parse - ; parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ; Util.option_map v.reset_all_parameters (fun f -> - Query.Pair ("ResetAllParameters", Boolean.to_query f)) - ; Some + ("DescribeDBLogFiles.member", + (DescribeDBLogFilesList.to_query v.describe_d_b_log_files)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("describe_d_b_log_files", + (DescribeDBLogFilesList.to_json v.describe_d_b_log_files))]) + let of_json j = + { + describe_d_b_log_files = + (DescribeDBLogFilesList.of_json + (Util.of_option_exn (Json.lookup j "describe_d_b_log_files"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeEventsMessage = + struct + type t = + { + source_identifier: String.t option ; + source_type: SourceType.t option ; + start_time: DateTime.t option ; + end_time: DateTime.t option ; + duration: Integer.t option ; + event_categories: EventCategoriesList.t ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?source_identifier ?source_type ?start_time ?end_time + ?duration ?(event_categories= []) ?(filters= []) ?max_records + ?marker () = + { + source_identifier; + source_type; + start_time; + end_time; + duration; + event_categories; + filters; + max_records; + marker + } + let parse xml = + Some + { + source_identifier = + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) SourceType.parse); + start_time = + (Util.option_bind (Xml.member "StartTime" xml) DateTime.parse); + end_time = + (Util.option_bind (Xml.member "EndTime" xml) DateTime.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) Integer.parse); + event_categories = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategories" xml) + EventCategoriesList.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Some (Query.Pair - ("DBParameterGroupName", String.to_query v.d_b_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("parameters", ParametersList.to_json v.parameters) - ; Util.option_map v.reset_all_parameters (fun f -> - "reset_all_parameters", Boolean.to_json f) - ; Some ("d_b_parameter_group_name", String.to_json v.d_b_parameter_group_name) - ]) - - let of_json j = - { d_b_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name")) - ; reset_all_parameters = - Util.option_map (Json.lookup j "reset_all_parameters") Boolean.of_json - ; parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - } -end - -module DescribeOptionGroupsMessage = struct - type t = - { option_group_name : String.t option - ; filters : FilterList.t - ; marker : String.t option - ; max_records : Integer.t option - ; engine_name : String.t option - ; major_engine_version : String.t option - } - - let make - ?option_group_name - ?(filters = []) - ?marker - ?max_records - ?engine_name - ?major_engine_version - () = - { option_group_name; filters; marker; max_records; engine_name; major_engine_version } - - let parse xml = - Some - { option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; engine_name = Util.option_bind (Xml.member "EngineName" xml) String.parse - ; major_engine_version = - Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.major_engine_version (fun f -> - Query.Pair ("MajorEngineVersion", String.to_query f)) - ; Util.option_map v.engine_name (fun f -> - Query.Pair ("EngineName", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.major_engine_version (fun f -> - "major_engine_version", String.to_json f) - ; Util.option_map v.engine_name (fun f -> "engine_name", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ]) - - let of_json j = - { option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; engine_name = Util.option_map (Json.lookup j "engine_name") String.of_json - ; major_engine_version = - Util.option_map (Json.lookup j "major_engine_version") String.of_json - } -end - -module InvalidDBParameterGroupStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteEventSubscriptionMessage = struct - type t = { subscription_name : String.t } - - let make ~subscription_name () = { subscription_name } - - let parse xml = - Some - { subscription_name = - Xml.required - "SubscriptionName" - (Util.option_bind (Xml.member "SubscriptionName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SubscriptionName", String.to_query v.subscription_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subscription_name", String.to_json v.subscription_name) ]) - - let of_json j = - { subscription_name = - String.of_json (Util.of_option_exn (Json.lookup j "subscription_name")) - } -end - -module DBParameterGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBSecurityGroupMessage = struct - type t = { d_b_security_group_name : String.t } - - let make ~d_b_security_group_name () = { d_b_security_group_name } - - let parse xml = - Some - { d_b_security_group_name = - Xml.required - "DBSecurityGroupName" - (Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("DBSecurityGroupName", String.to_query v.d_b_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_security_group_name", String.to_json v.d_b_security_group_name) ]) - - let of_json j = - { d_b_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_security_group_name")) - } -end - -module DBInstanceAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module RevokeDBSecurityGroupIngressMessage = struct - type t = - { d_b_security_group_name : String.t - ; c_i_d_r_i_p : String.t option - ; e_c2_security_group_name : String.t option - ; e_c2_security_group_id : String.t option - ; e_c2_security_group_owner_id : String.t option - } - - let make - ~d_b_security_group_name - ?c_i_d_r_i_p - ?e_c2_security_group_name - ?e_c2_security_group_id - ?e_c2_security_group_owner_id - () = - { d_b_security_group_name - ; c_i_d_r_i_p - ; e_c2_security_group_name - ; e_c2_security_group_id - ; e_c2_security_group_owner_id - } - - let parse xml = - Some - { d_b_security_group_name = - Xml.required - "DBSecurityGroupName" - (Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse) - ; c_i_d_r_i_p = Util.option_bind (Xml.member "CIDRIP" xml) String.parse - ; e_c2_security_group_name = - Util.option_bind (Xml.member "EC2SecurityGroupName" xml) String.parse - ; e_c2_security_group_id = - Util.option_bind (Xml.member "EC2SecurityGroupId" xml) String.parse - ; e_c2_security_group_owner_id = - Util.option_bind (Xml.member "EC2SecurityGroupOwnerId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - Query.Pair ("EC2SecurityGroupOwnerId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_id (fun f -> - Query.Pair ("EC2SecurityGroupId", String.to_query f)) - ; Util.option_map v.e_c2_security_group_name (fun f -> - Query.Pair ("EC2SecurityGroupName", String.to_query f)) - ; Util.option_map v.c_i_d_r_i_p (fun f -> - Query.Pair ("CIDRIP", String.to_query f)) - ; Some - (Query.Pair ("DBSecurityGroupName", String.to_query v.d_b_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.e_c2_security_group_owner_id (fun f -> - "e_c2_security_group_owner_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_id (fun f -> - "e_c2_security_group_id", String.to_json f) - ; Util.option_map v.e_c2_security_group_name (fun f -> - "e_c2_security_group_name", String.to_json f) - ; Util.option_map v.c_i_d_r_i_p (fun f -> "c_i_d_r_i_p", String.to_json f) - ; Some ("d_b_security_group_name", String.to_json v.d_b_security_group_name) - ]) - - let of_json j = - { d_b_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_security_group_name")) - ; c_i_d_r_i_p = Util.option_map (Json.lookup j "c_i_d_r_i_p") String.of_json - ; e_c2_security_group_name = - Util.option_map (Json.lookup j "e_c2_security_group_name") String.of_json - ; e_c2_security_group_id = - Util.option_map (Json.lookup j "e_c2_security_group_id") String.of_json - ; e_c2_security_group_owner_id = - Util.option_map (Json.lookup j "e_c2_security_group_owner_id") String.of_json - } -end - -module SubscriptionNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBClusterParameterGroupsMessage = struct - type t = - { marker : String.t option - ; d_b_cluster_parameter_groups : DBClusterParameterGroupList.t - } - - let make ?marker ?(d_b_cluster_parameter_groups = []) () = - { marker; d_b_cluster_parameter_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_cluster_parameter_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBClusterParameterGroups" xml) - DBClusterParameterGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "DBClusterParameterGroups.member" - , DBClusterParameterGroupList.to_query v.d_b_cluster_parameter_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "d_b_cluster_parameter_groups" - , DBClusterParameterGroupList.to_json v.d_b_cluster_parameter_groups ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_cluster_parameter_groups = - DBClusterParameterGroupList.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_groups")) - } -end - -module ReservedDBInstanceAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CopyDBSnapshotMessage = struct - type t = - { source_d_b_snapshot_identifier : String.t - ; target_d_b_snapshot_identifier : String.t - ; tags : TagList.t - ; copy_tags : Boolean.t option - } - - let make - ~source_d_b_snapshot_identifier - ~target_d_b_snapshot_identifier - ?(tags = []) - ?copy_tags - () = - { source_d_b_snapshot_identifier; target_d_b_snapshot_identifier; tags; copy_tags } - - let parse xml = - Some - { source_d_b_snapshot_identifier = - Xml.required - "SourceDBSnapshotIdentifier" - (Util.option_bind (Xml.member "SourceDBSnapshotIdentifier" xml) String.parse) - ; target_d_b_snapshot_identifier = - Xml.required - "TargetDBSnapshotIdentifier" - (Util.option_bind (Xml.member "TargetDBSnapshotIdentifier" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; copy_tags = Util.option_bind (Xml.member "CopyTags" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags (fun f -> - Query.Pair ("CopyTags", Boolean.to_query f)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("EventCategories.member", + (EventCategoriesList.to_query v.event_categories))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (Integer.to_query f))); + Util.option_map v.end_time + (fun f -> Query.Pair ("EndTime", (DateTime.to_query f))); + Util.option_map v.start_time + (fun f -> Query.Pair ("StartTime", (DateTime.to_query f))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (SourceType.to_query f))); + Util.option_map v.source_identifier + (fun f -> Query.Pair ("SourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("event_categories", + (EventCategoriesList.to_json v.event_categories)); + Util.option_map v.duration + (fun f -> ("duration", (Integer.to_json f))); + Util.option_map v.end_time + (fun f -> ("end_time", (DateTime.to_json f))); + Util.option_map v.start_time + (fun f -> ("start_time", (DateTime.to_json f))); + Util.option_map v.source_type + (fun f -> ("source_type", (SourceType.to_json f))); + Util.option_map v.source_identifier + (fun f -> ("source_identifier", (String.to_json f)))]) + let of_json j = + { + source_identifier = + (Util.option_map (Json.lookup j "source_identifier") String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") SourceType.of_json); + start_time = + (Util.option_map (Json.lookup j "start_time") DateTime.of_json); + end_time = + (Util.option_map (Json.lookup j "end_time") DateTime.of_json); + duration = + (Util.option_map (Json.lookup j "duration") Integer.of_json); + event_categories = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InvalidDBClusterStateFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SNSTopicArnNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CertificateNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReservedDBInstanceNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module OptionGroupQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDBClusterParametersMessage = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t ; + source: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~d_b_cluster_parameter_group_name ?source ?(filters= []) + ?max_records ?marker () = + { + d_b_cluster_parameter_group_name; + source; + filters; + max_records; + marker + } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Xml.required "DBClusterParameterGroupName" + (Util.option_bind + (Xml.member "DBClusterParameterGroupName" xml) String.parse)); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Some (Query.Pair - ( "TargetDBSnapshotIdentifier" - , String.to_query v.target_d_b_snapshot_identifier )) - ; Some - (Query.Pair - ( "SourceDBSnapshotIdentifier" - , String.to_query v.source_d_b_snapshot_identifier )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags (fun f -> "copy_tags", Boolean.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Some - ( "target_d_b_snapshot_identifier" - , String.to_json v.target_d_b_snapshot_identifier ) - ; Some - ( "source_d_b_snapshot_identifier" - , String.to_json v.source_d_b_snapshot_identifier ) - ]) - - let of_json j = - { source_d_b_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_snapshot_identifier")) - ; target_d_b_snapshot_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "target_d_b_snapshot_identifier")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; copy_tags = Util.option_map (Json.lookup j "copy_tags") Boolean.of_json - } -end - -module RevokeDBSecurityGroupIngressResult = struct - type t = { d_b_security_group : DBSecurityGroup.t option } - - let make ?d_b_security_group () = { d_b_security_group } - - let parse xml = - Some - { d_b_security_group = - Util.option_bind (Xml.member "DBSecurityGroup" xml) DBSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - Query.Pair ("DBSecurityGroup", DBSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - "d_b_security_group", DBSecurityGroup.to_json f) - ]) - - let of_json j = - { d_b_security_group = - Util.option_map (Json.lookup j "d_b_security_group") DBSecurityGroup.of_json - } -end - -module DescribeDBLogFilesResponse = struct - type t = - { describe_d_b_log_files : DescribeDBLogFilesList.t - ; marker : String.t option - } - - let make ?(describe_d_b_log_files = []) ?marker () = { describe_d_b_log_files; marker } - - let parse xml = - Some - { describe_d_b_log_files = - Util.of_option - [] + ("DBClusterParameterGroupName", + (String.to_query v.d_b_cluster_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Some + ("d_b_cluster_parameter_group_name", + (String.to_json v.d_b_cluster_parameter_group_name))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_group_name"))); + source = (Util.option_map (Json.lookup j "source") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module SnapshotQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBClusterNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeReservedDBInstancesMessage = + struct + type t = + { + reserved_d_b_instance_id: String.t option ; + reserved_d_b_instances_offering_id: String.t option ; + d_b_instance_class: String.t option ; + duration: String.t option ; + product_description: String.t option ; + offering_type: String.t option ; + multi_a_z: Boolean.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?reserved_d_b_instance_id ?reserved_d_b_instances_offering_id + ?d_b_instance_class ?duration ?product_description ?offering_type + ?multi_a_z ?(filters= []) ?max_records ?marker () = + { + reserved_d_b_instance_id; + reserved_d_b_instances_offering_id; + d_b_instance_class; + duration; + product_description; + offering_type; + multi_a_z; + filters; + max_records; + marker + } + let parse xml = + Some + { + reserved_d_b_instance_id = + (Util.option_bind (Xml.member "ReservedDBInstanceId" xml) + String.parse); + reserved_d_b_instances_offering_id = (Util.option_bind - (Xml.member "DescribeDBLogFiles" xml) - DescribeDBLogFilesList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + duration = + (Util.option_bind (Xml.member "Duration" xml) String.parse); + product_description = + (Util.option_bind (Xml.member "ProductDescription" xml) + String.parse); + offering_type = + (Util.option_bind (Xml.member "OfferingType" xml) String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.offering_type + (fun f -> Query.Pair ("OfferingType", (String.to_query f))); + Util.option_map v.product_description + (fun f -> Query.Pair ("ProductDescription", (String.to_query f))); + Util.option_map v.duration + (fun f -> Query.Pair ("Duration", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + Query.Pair + ("ReservedDBInstancesOfferingId", (String.to_query f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> + Query.Pair ("ReservedDBInstanceId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.offering_type + (fun f -> ("offering_type", (String.to_json f))); + Util.option_map v.product_description + (fun f -> ("product_description", (String.to_json f))); + Util.option_map v.duration + (fun f -> ("duration", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.reserved_d_b_instances_offering_id + (fun f -> + ("reserved_d_b_instances_offering_id", (String.to_json f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> ("reserved_d_b_instance_id", (String.to_json f)))]) + let of_json j = + { + reserved_d_b_instance_id = + (Util.option_map (Json.lookup j "reserved_d_b_instance_id") + String.of_json); + reserved_d_b_instances_offering_id = + (Util.option_map + (Json.lookup j "reserved_d_b_instances_offering_id") + String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + duration = + (Util.option_map (Json.lookup j "duration") String.of_json); + product_description = + (Util.option_map (Json.lookup j "product_description") + String.of_json); + offering_type = + (Util.option_map (Json.lookup j "offering_type") String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribePendingMaintenanceActionsMessage = + struct + type t = + { + resource_identifier: String.t option ; + filters: FilterList.t ; + marker: String.t option ; + max_records: Integer.t option } + let make ?resource_identifier ?(filters= []) ?marker ?max_records () + = { resource_identifier; filters; marker; max_records } + let parse xml = + Some + { + resource_identifier = + (Util.option_bind (Xml.member "ResourceIdentifier" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.resource_identifier + (fun f -> Query.Pair ("ResourceIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.resource_identifier + (fun f -> ("resource_identifier", (String.to_json f)))]) + let of_json j = + { + resource_identifier = + (Util.option_map (Json.lookup j "resource_identifier") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json) + } + end +module DBClusterParameterGroupDetails = + struct + type t = { + parameters: ParametersList.t ; + marker: String.t option } + let make ?(parameters= []) ?marker () = { parameters; marker } + let parse xml = + Some + { + parameters = + (Util.of_option [] + (Util.option_bind (Xml.member "Parameters" xml) + ParametersList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ( "DescribeDBLogFiles.member" - , DescribeDBLogFilesList.to_query v.describe_d_b_log_files )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some - ( "describe_d_b_log_files" - , DescribeDBLogFilesList.to_json v.describe_d_b_log_files ) - ]) - - let of_json j = - { describe_d_b_log_files = - DescribeDBLogFilesList.of_json - (Util.of_option_exn (Json.lookup j "describe_d_b_log_files")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DescribeEventsMessage = struct - type t = - { source_identifier : String.t option - ; source_type : SourceType.t option - ; start_time : DateTime.t option - ; end_time : DateTime.t option - ; duration : Integer.t option - ; event_categories : EventCategoriesList.t - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?source_identifier - ?source_type - ?start_time - ?end_time - ?duration - ?(event_categories = []) - ?(filters = []) - ?max_records - ?marker - () = - { source_identifier - ; source_type - ; start_time - ; end_time - ; duration - ; event_categories - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { source_identifier = - Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) SourceType.parse - ; start_time = Util.option_bind (Xml.member "StartTime" xml) DateTime.parse - ; end_time = Util.option_bind (Xml.member "EndTime" xml) DateTime.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) Integer.parse - ; event_categories = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategories" xml) - EventCategoriesList.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Some + ("Parameters.member", (ParametersList.to_query v.parameters)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("parameters", (ParametersList.to_json v.parameters))]) + let of_json j = + { + parameters = + (ParametersList.of_json + (Util.of_option_exn (Json.lookup j "parameters"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DescribeDBClusterParameterGroupsMessage = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_cluster_parameter_group_name ?(filters= []) ?max_records + ?marker () = + { d_b_cluster_parameter_group_name; filters; max_records; marker } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + Query.Pair + ("DBClusterParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_cluster_parameter_group_name + (fun f -> + ("d_b_cluster_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module PromoteReadReplicaResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module CopyOptionGroupResult = + struct + type t = { + option_group: OptionGroup.t option } + let make ?option_group () = { option_group } + let parse xml = + Some + { + option_group = + (Util.option_bind (Xml.member "OptionGroup" xml) + OptionGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> Query.Pair ("OptionGroup", (OptionGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.option_group + (fun f -> ("option_group", (OptionGroup.to_json f)))]) + let of_json j = + { + option_group = + (Util.option_map (Json.lookup j "option_group") OptionGroup.of_json) + } + end +module CreateDBInstanceMessage = + struct + type t = + { + d_b_name: String.t option ; + d_b_instance_identifier: String.t ; + allocated_storage: Integer.t option ; + d_b_instance_class: String.t ; + engine: String.t ; + master_username: String.t option ; + master_user_password: String.t option ; + d_b_security_groups: DBSecurityGroupNameList.t ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + availability_zone: String.t option ; + d_b_subnet_group_name: String.t option ; + preferred_maintenance_window: String.t option ; + d_b_parameter_group_name: String.t option ; + backup_retention_period: Integer.t option ; + preferred_backup_window: String.t option ; + port: Integer.t option ; + multi_a_z: Boolean.t option ; + engine_version: String.t option ; + auto_minor_version_upgrade: Boolean.t option ; + license_model: String.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + character_set_name: String.t option ; + publicly_accessible: Boolean.t option ; + tags: TagList.t ; + d_b_cluster_identifier: String.t option ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + tde_credential_password: String.t option ; + storage_encrypted: Boolean.t option ; + kms_key_id: String.t option ; + domain: String.t option ; + copy_tags_to_snapshot: Boolean.t option } + let make ?d_b_name ~d_b_instance_identifier ?allocated_storage + ~d_b_instance_class ~engine ?master_username ?master_user_password + ?(d_b_security_groups= []) ?(vpc_security_group_ids= []) + ?availability_zone ?d_b_subnet_group_name + ?preferred_maintenance_window ?d_b_parameter_group_name + ?backup_retention_period ?preferred_backup_window ?port ?multi_a_z + ?engine_version ?auto_minor_version_upgrade ?license_model ?iops + ?option_group_name ?character_set_name ?publicly_accessible ?(tags= + []) ?d_b_cluster_identifier ?storage_type ?tde_credential_arn + ?tde_credential_password ?storage_encrypted ?kms_key_id ?domain + ?copy_tags_to_snapshot () = + { + d_b_name; + d_b_instance_identifier; + allocated_storage; + d_b_instance_class; + engine; + master_username; + master_user_password; + d_b_security_groups; + vpc_security_group_ids; + availability_zone; + d_b_subnet_group_name; + preferred_maintenance_window; + d_b_parameter_group_name; + backup_retention_period; + preferred_backup_window; + port; + multi_a_z; + engine_version; + auto_minor_version_upgrade; + license_model; + iops; + option_group_name; + character_set_name; + publicly_accessible; + tags; + d_b_cluster_identifier; + storage_type; + tde_credential_arn; + tde_credential_password; + storage_encrypted; + kms_key_id; + domain; + copy_tags_to_snapshot + } + let parse xml = + Some + { + d_b_name = + (Util.option_bind (Xml.member "DBName" xml) String.parse); + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + allocated_storage = + (Util.option_bind (Xml.member "AllocatedStorage" xml) + Integer.parse); + d_b_instance_class = + (Xml.required "DBInstanceClass" + (Util.option_bind (Xml.member "DBInstanceClass" xml) + String.parse)); + engine = + (Xml.required "Engine" + (Util.option_bind (Xml.member "Engine" xml) String.parse)); + master_username = + (Util.option_bind (Xml.member "MasterUsername" xml) String.parse); + master_user_password = + (Util.option_bind (Xml.member "MasterUserPassword" xml) + String.parse); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroupNameList.parse)); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + preferred_maintenance_window = + (Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) + String.parse); + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse); + backup_retention_period = + (Util.option_bind (Xml.member "BackupRetentionPeriod" xml) + Integer.parse); + preferred_backup_window = + (Util.option_bind (Xml.member "PreferredBackupWindow" xml) + String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + character_set_name = + (Util.option_bind (Xml.member "CharacterSetName" xml) + String.parse); + publicly_accessible = + (Util.option_bind (Xml.member "PubliclyAccessible" xml) + Boolean.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + tde_credential_password = + (Util.option_bind (Xml.member "TdeCredentialPassword" xml) + String.parse); + storage_encrypted = + (Util.option_bind (Xml.member "StorageEncrypted" xml) + Boolean.parse); + kms_key_id = + (Util.option_bind (Xml.member "KmsKeyId" xml) String.parse); + domain = (Util.option_bind (Xml.member "Domain" xml) String.parse); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (String.to_query f))); + Util.option_map v.kms_key_id + (fun f -> Query.Pair ("KmsKeyId", (String.to_query f))); + Util.option_map v.storage_encrypted + (fun f -> Query.Pair ("StorageEncrypted", (Boolean.to_query f))); + Util.option_map v.tde_credential_password + (fun f -> + Query.Pair ("TdeCredentialPassword", (String.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.publicly_accessible + (fun f -> + Query.Pair ("PubliclyAccessible", (Boolean.to_query f))); + Util.option_map v.character_set_name + (fun f -> Query.Pair ("CharacterSetName", (String.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.preferred_backup_window + (fun f -> + Query.Pair ("PreferredBackupWindow", (String.to_query f))); + Util.option_map v.backup_retention_period + (fun f -> + Query.Pair ("BackupRetentionPeriod", (Integer.to_query f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f))); + Util.option_map v.preferred_maintenance_window + (fun f -> + Query.Pair + ("PreferredMaintenanceWindow", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Some (Query.Pair - ("EventCategories.member", EventCategoriesList.to_query v.event_categories)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", Integer.to_query f)) - ; Util.option_map v.end_time (fun f -> - Query.Pair ("EndTime", DateTime.to_query f)) - ; Util.option_map v.start_time (fun f -> - Query.Pair ("StartTime", DateTime.to_query f)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", SourceType.to_query f)) - ; Util.option_map v.source_identifier (fun f -> - Query.Pair ("SourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("event_categories", EventCategoriesList.to_json v.event_categories) - ; Util.option_map v.duration (fun f -> "duration", Integer.to_json f) - ; Util.option_map v.end_time (fun f -> "end_time", DateTime.to_json f) - ; Util.option_map v.start_time (fun f -> "start_time", DateTime.to_json f) - ; Util.option_map v.source_type (fun f -> "source_type", SourceType.to_json f) - ; Util.option_map v.source_identifier (fun f -> - "source_identifier", String.to_json f) - ]) - - let of_json j = - { source_identifier = - Util.option_map (Json.lookup j "source_identifier") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") SourceType.of_json - ; start_time = Util.option_map (Json.lookup j "start_time") DateTime.of_json - ; end_time = Util.option_map (Json.lookup j "end_time") DateTime.of_json - ; duration = Util.option_map (Json.lookup j "duration") Integer.of_json - ; event_categories = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module InvalidDBClusterStateFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SNSTopicArnNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CertificateNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ReservedDBInstanceNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module OptionGroupQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDBClusterParametersMessage = struct - type t = - { d_b_cluster_parameter_group_name : String.t - ; source : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ~d_b_cluster_parameter_group_name - ?source - ?(filters = []) - ?max_records - ?marker - () = - { d_b_cluster_parameter_group_name; source; filters; max_records; marker } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Xml.required - "DBClusterParameterGroupName" - (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Some (Query.Pair - ( "DBClusterParameterGroupName" - , String.to_query v.d_b_cluster_parameter_group_name )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Some - ( "d_b_cluster_parameter_group_name" - , String.to_json v.d_b_cluster_parameter_group_name ) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_group_name")) - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module SnapshotQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBClusterNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeReservedDBInstancesMessage = struct - type t = - { reserved_d_b_instance_id : String.t option - ; reserved_d_b_instances_offering_id : String.t option - ; d_b_instance_class : String.t option - ; duration : String.t option - ; product_description : String.t option - ; offering_type : String.t option - ; multi_a_z : Boolean.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?reserved_d_b_instance_id - ?reserved_d_b_instances_offering_id - ?d_b_instance_class - ?duration - ?product_description - ?offering_type - ?multi_a_z - ?(filters = []) - ?max_records - ?marker - () = - { reserved_d_b_instance_id - ; reserved_d_b_instances_offering_id - ; d_b_instance_class - ; duration - ; product_description - ; offering_type - ; multi_a_z - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { reserved_d_b_instance_id = - Util.option_bind (Xml.member "ReservedDBInstanceId" xml) String.parse - ; reserved_d_b_instances_offering_id = - Util.option_bind (Xml.member "ReservedDBInstancesOfferingId" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; duration = Util.option_bind (Xml.member "Duration" xml) String.parse - ; product_description = - Util.option_bind (Xml.member "ProductDescription" xml) String.parse - ; offering_type = Util.option_bind (Xml.member "OfferingType" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.offering_type (fun f -> - Query.Pair ("OfferingType", String.to_query f)) - ; Util.option_map v.product_description (fun f -> - Query.Pair ("ProductDescription", String.to_query f)) - ; Util.option_map v.duration (fun f -> - Query.Pair ("Duration", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - Query.Pair ("ReservedDBInstancesOfferingId", String.to_query f)) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - Query.Pair ("ReservedDBInstanceId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.offering_type (fun f -> "offering_type", String.to_json f) - ; Util.option_map v.product_description (fun f -> - "product_description", String.to_json f) - ; Util.option_map v.duration (fun f -> "duration", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.reserved_d_b_instances_offering_id (fun f -> - "reserved_d_b_instances_offering_id", String.to_json f) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - "reserved_d_b_instance_id", String.to_json f) - ]) - - let of_json j = - { reserved_d_b_instance_id = - Util.option_map (Json.lookup j "reserved_d_b_instance_id") String.of_json - ; reserved_d_b_instances_offering_id = - Util.option_map - (Json.lookup j "reserved_d_b_instances_offering_id") - String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; duration = Util.option_map (Json.lookup j "duration") String.of_json - ; product_description = - Util.option_map (Json.lookup j "product_description") String.of_json - ; offering_type = Util.option_map (Json.lookup j "offering_type") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DescribePendingMaintenanceActionsMessage = struct - type t = - { resource_identifier : String.t option - ; filters : FilterList.t - ; marker : String.t option - ; max_records : Integer.t option - } - - let make ?resource_identifier ?(filters = []) ?marker ?max_records () = - { resource_identifier; filters; marker; max_records } - - let parse xml = - Some - { resource_identifier = - Util.option_bind (Xml.member "ResourceIdentifier" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.resource_identifier (fun f -> - Query.Pair ("ResourceIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.resource_identifier (fun f -> - "resource_identifier", String.to_json f) - ]) - - let of_json j = - { resource_identifier = - Util.option_map (Json.lookup j "resource_identifier") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - } -end - -module DBClusterParameterGroupDetails = struct - type t = - { parameters : ParametersList.t - ; marker : String.t option - } - - let make ?(parameters = []) ?marker () = { parameters; marker } - - let parse xml = - Some - { parameters = - Util.of_option - [] - (Util.option_bind (Xml.member "Parameters" xml) ParametersList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("Parameters.member", ParametersList.to_query v.parameters)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("parameters", ParametersList.to_json v.parameters) - ]) - - let of_json j = - { parameters = - ParametersList.of_json (Util.of_option_exn (Json.lookup j "parameters")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DescribeDBClusterParameterGroupsMessage = struct - type t = - { d_b_cluster_parameter_group_name : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_cluster_parameter_group_name ?(filters = []) ?max_records ?marker () = - { d_b_cluster_parameter_group_name; filters; max_records; marker } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - Query.Pair ("DBClusterParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_cluster_parameter_group_name (fun f -> - "d_b_cluster_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - Util.option_map (Json.lookup j "d_b_cluster_parameter_group_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module PromoteReadReplicaResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module CopyOptionGroupResult = struct - type t = { option_group : OptionGroup.t option } - - let make ?option_group () = { option_group } - - let parse xml = - Some - { option_group = Util.option_bind (Xml.member "OptionGroup" xml) OptionGroup.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> - Query.Pair ("OptionGroup", OptionGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.option_group (fun f -> "option_group", OptionGroup.to_json f) - ]) - - let of_json j = - { option_group = Util.option_map (Json.lookup j "option_group") OptionGroup.of_json } -end - -module CreateDBInstanceMessage = struct - type t = - { d_b_name : String.t option - ; d_b_instance_identifier : String.t - ; allocated_storage : Integer.t option - ; d_b_instance_class : String.t - ; engine : String.t - ; master_username : String.t option - ; master_user_password : String.t option - ; d_b_security_groups : DBSecurityGroupNameList.t - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; availability_zone : String.t option - ; d_b_subnet_group_name : String.t option - ; preferred_maintenance_window : String.t option - ; d_b_parameter_group_name : String.t option - ; backup_retention_period : Integer.t option - ; preferred_backup_window : String.t option - ; port : Integer.t option - ; multi_a_z : Boolean.t option - ; engine_version : String.t option - ; auto_minor_version_upgrade : Boolean.t option - ; license_model : String.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; character_set_name : String.t option - ; publicly_accessible : Boolean.t option - ; tags : TagList.t - ; d_b_cluster_identifier : String.t option - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; tde_credential_password : String.t option - ; storage_encrypted : Boolean.t option - ; kms_key_id : String.t option - ; domain : String.t option - ; copy_tags_to_snapshot : Boolean.t option - } - - let make - ?d_b_name - ~d_b_instance_identifier - ?allocated_storage - ~d_b_instance_class - ~engine - ?master_username - ?master_user_password - ?(d_b_security_groups = []) - ?(vpc_security_group_ids = []) - ?availability_zone - ?d_b_subnet_group_name - ?preferred_maintenance_window - ?d_b_parameter_group_name - ?backup_retention_period - ?preferred_backup_window - ?port - ?multi_a_z - ?engine_version - ?auto_minor_version_upgrade - ?license_model - ?iops - ?option_group_name - ?character_set_name - ?publicly_accessible - ?(tags = []) - ?d_b_cluster_identifier - ?storage_type - ?tde_credential_arn - ?tde_credential_password - ?storage_encrypted - ?kms_key_id - ?domain - ?copy_tags_to_snapshot - () = - { d_b_name - ; d_b_instance_identifier - ; allocated_storage - ; d_b_instance_class - ; engine - ; master_username - ; master_user_password - ; d_b_security_groups - ; vpc_security_group_ids - ; availability_zone - ; d_b_subnet_group_name - ; preferred_maintenance_window - ; d_b_parameter_group_name - ; backup_retention_period - ; preferred_backup_window - ; port - ; multi_a_z - ; engine_version - ; auto_minor_version_upgrade - ; license_model - ; iops - ; option_group_name - ; character_set_name - ; publicly_accessible - ; tags - ; d_b_cluster_identifier - ; storage_type - ; tde_credential_arn - ; tde_credential_password - ; storage_encrypted - ; kms_key_id - ; domain - ; copy_tags_to_snapshot - } - - let parse xml = - Some - { d_b_name = Util.option_bind (Xml.member "DBName" xml) String.parse - ; d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; allocated_storage = - Util.option_bind (Xml.member "AllocatedStorage" xml) Integer.parse - ; d_b_instance_class = - Xml.required - "DBInstanceClass" - (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse) - ; engine = - Xml.required "Engine" (Util.option_bind (Xml.member "Engine" xml) String.parse) - ; master_username = Util.option_bind (Xml.member "MasterUsername" xml) String.parse - ; master_user_password = - Util.option_bind (Xml.member "MasterUserPassword" xml) String.parse - ; d_b_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBSecurityGroups" xml) - DBSecurityGroupNameList.parse) - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; preferred_maintenance_window = - Util.option_bind (Xml.member "PreferredMaintenanceWindow" xml) String.parse - ; d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - ; backup_retention_period = - Util.option_bind (Xml.member "BackupRetentionPeriod" xml) Integer.parse - ; preferred_backup_window = - Util.option_bind (Xml.member "PreferredBackupWindow" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; character_set_name = - Util.option_bind (Xml.member "CharacterSetName" xml) String.parse - ; publicly_accessible = - Util.option_bind (Xml.member "PubliclyAccessible" xml) Boolean.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; tde_credential_password = - Util.option_bind (Xml.member "TdeCredentialPassword" xml) String.parse - ; storage_encrypted = - Util.option_bind (Xml.member "StorageEncrypted" xml) Boolean.parse - ; kms_key_id = Util.option_bind (Xml.member "KmsKeyId" xml) String.parse - ; domain = Util.option_bind (Xml.member "Domain" xml) String.parse - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Util.option_map v.domain (fun f -> Query.Pair ("Domain", String.to_query f)) - ; Util.option_map v.kms_key_id (fun f -> - Query.Pair ("KmsKeyId", String.to_query f)) - ; Util.option_map v.storage_encrypted (fun f -> - Query.Pair ("StorageEncrypted", Boolean.to_query f)) - ; Util.option_map v.tde_credential_password (fun f -> - Query.Pair ("TdeCredentialPassword", String.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.publicly_accessible (fun f -> - Query.Pair ("PubliclyAccessible", Boolean.to_query f)) - ; Util.option_map v.character_set_name (fun f -> - Query.Pair ("CharacterSetName", String.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.preferred_backup_window (fun f -> - Query.Pair ("PreferredBackupWindow", String.to_query f)) - ; Util.option_map v.backup_retention_period (fun f -> - Query.Pair ("BackupRetentionPeriod", Integer.to_query f)) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ; Util.option_map v.preferred_maintenance_window (fun f -> - Query.Pair ("PreferredMaintenanceWindow", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Some + ("DBSecurityGroups.member", + (DBSecurityGroupNameList.to_query v.d_b_security_groups))); + Util.option_map v.master_user_password + (fun f -> Query.Pair ("MasterUserPassword", (String.to_query f))); + Util.option_map v.master_username + (fun f -> Query.Pair ("MasterUsername", (String.to_query f))); + Some (Query.Pair ("Engine", (String.to_query v.engine))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Some + ("DBInstanceClass", (String.to_query v.d_b_instance_class))); + Util.option_map v.allocated_storage + (fun f -> Query.Pair ("AllocatedStorage", (Integer.to_query f))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroupNameList.to_query v.d_b_security_groups )) - ; Util.option_map v.master_user_password (fun f -> - Query.Pair ("MasterUserPassword", String.to_query f)) - ; Util.option_map v.master_username (fun f -> - Query.Pair ("MasterUsername", String.to_query f)) - ; Some (Query.Pair ("Engine", String.to_query v.engine)) - ; Some (Query.Pair ("DBInstanceClass", String.to_query v.d_b_instance_class)) - ; Util.option_map v.allocated_storage (fun f -> - Query.Pair ("AllocatedStorage", Integer.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier))); + Util.option_map v.d_b_name + (fun f -> Query.Pair ("DBName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Util.option_map v.domain (fun f -> ("domain", (String.to_json f))); + Util.option_map v.kms_key_id + (fun f -> ("kms_key_id", (String.to_json f))); + Util.option_map v.storage_encrypted + (fun f -> ("storage_encrypted", (Boolean.to_json f))); + Util.option_map v.tde_credential_password + (fun f -> ("tde_credential_password", (String.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.publicly_accessible + (fun f -> ("publicly_accessible", (Boolean.to_json f))); + Util.option_map v.character_set_name + (fun f -> ("character_set_name", (String.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.preferred_backup_window + (fun f -> ("preferred_backup_window", (String.to_json f))); + Util.option_map v.backup_retention_period + (fun f -> ("backup_retention_period", (Integer.to_json f))); + Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f))); + Util.option_map v.preferred_maintenance_window + (fun f -> ("preferred_maintenance_window", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Some + ("d_b_security_groups", + (DBSecurityGroupNameList.to_json v.d_b_security_groups)); + Util.option_map v.master_user_password + (fun f -> ("master_user_password", (String.to_json f))); + Util.option_map v.master_username + (fun f -> ("master_username", (String.to_json f))); + Some ("engine", (String.to_json v.engine)); + Some ("d_b_instance_class", (String.to_json v.d_b_instance_class)); + Util.option_map v.allocated_storage + (fun f -> ("allocated_storage", (Integer.to_json f))); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier)); + Util.option_map v.d_b_name + (fun f -> ("d_b_name", (String.to_json f)))]) + let of_json j = + { + d_b_name = + (Util.option_map (Json.lookup j "d_b_name") String.of_json); + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + allocated_storage = + (Util.option_map (Json.lookup j "allocated_storage") + Integer.of_json); + d_b_instance_class = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_class"))); + engine = + (String.of_json (Util.of_option_exn (Json.lookup j "engine"))); + master_username = + (Util.option_map (Json.lookup j "master_username") String.of_json); + master_user_password = + (Util.option_map (Json.lookup j "master_user_password") + String.of_json); + d_b_security_groups = + (DBSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + preferred_maintenance_window = + (Util.option_map (Json.lookup j "preferred_maintenance_window") + String.of_json); + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json); + backup_retention_period = + (Util.option_map (Json.lookup j "backup_retention_period") + Integer.of_json); + preferred_backup_window = + (Util.option_map (Json.lookup j "preferred_backup_window") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + character_set_name = + (Util.option_map (Json.lookup j "character_set_name") + String.of_json); + publicly_accessible = + (Util.option_map (Json.lookup j "publicly_accessible") + Boolean.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + tde_credential_password = + (Util.option_map (Json.lookup j "tde_credential_password") + String.of_json); + storage_encrypted = + (Util.option_map (Json.lookup j "storage_encrypted") + Boolean.of_json); + kms_key_id = + (Util.option_map (Json.lookup j "kms_key_id") String.of_json); + domain = (Util.option_map (Json.lookup j "domain") String.of_json); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json) + } + end +module RemoveSourceIdentifierFromSubscriptionResult = + struct + type t = { + event_subscription: EventSubscription.t option } + let make ?event_subscription () = { event_subscription } + let parse xml = + Some + { + event_subscription = + (Util.option_bind (Xml.member "EventSubscription" xml) + EventSubscription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> + Query.Pair + ("EventSubscription", (EventSubscription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.event_subscription + (fun f -> ("event_subscription", (EventSubscription.to_json f)))]) + let of_json j = + { + event_subscription = + (Util.option_map (Json.lookup j "event_subscription") + EventSubscription.of_json) + } + end +module RestoreDBInstanceFromDBSnapshotMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + d_b_snapshot_identifier: String.t ; + d_b_instance_class: String.t option ; + port: Integer.t option ; + availability_zone: String.t option ; + d_b_subnet_group_name: String.t option ; + multi_a_z: Boolean.t option ; + publicly_accessible: Boolean.t option ; + auto_minor_version_upgrade: Boolean.t option ; + license_model: String.t option ; + d_b_name: String.t option ; + engine: String.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + tags: TagList.t ; + storage_type: String.t option ; + tde_credential_arn: String.t option ; + tde_credential_password: String.t option ; + vpc_security_group_ids: VpcSecurityGroupIdList.t ; + d_b_security_groups: DBSecurityGroupNameList.t ; + domain: String.t option ; + copy_tags_to_snapshot: Boolean.t option } + let make ~d_b_instance_identifier ~d_b_snapshot_identifier + ?d_b_instance_class ?port ?availability_zone ?d_b_subnet_group_name + ?multi_a_z ?publicly_accessible ?auto_minor_version_upgrade + ?license_model ?d_b_name ?engine ?iops ?option_group_name ?(tags= + []) ?storage_type ?tde_credential_arn ?tde_credential_password + ?(vpc_security_group_ids= []) ?(d_b_security_groups= []) ?domain + ?copy_tags_to_snapshot () = + { + d_b_instance_identifier; + d_b_snapshot_identifier; + d_b_instance_class; + port; + availability_zone; + d_b_subnet_group_name; + multi_a_z; + publicly_accessible; + auto_minor_version_upgrade; + license_model; + d_b_name; + engine; + iops; + option_group_name; + tags; + storage_type; + tde_credential_arn; + tde_credential_password; + vpc_security_group_ids; + d_b_security_groups; + domain; + copy_tags_to_snapshot + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + d_b_snapshot_identifier = + (Xml.required "DBSnapshotIdentifier" + (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) + String.parse)); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + multi_a_z = + (Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse); + publicly_accessible = + (Util.option_bind (Xml.member "PubliclyAccessible" xml) + Boolean.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + d_b_name = + (Util.option_bind (Xml.member "DBName" xml) String.parse); + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + tde_credential_arn = + (Util.option_bind (Xml.member "TdeCredentialArn" xml) + String.parse); + tde_credential_password = + (Util.option_bind (Xml.member "TdeCredentialPassword" xml) + String.parse); + vpc_security_group_ids = + (Util.of_option [] + (Util.option_bind (Xml.member "VpcSecurityGroupIds" xml) + VpcSecurityGroupIdList.parse)); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroupNameList.parse)); + domain = (Util.option_bind (Xml.member "Domain" xml) String.parse); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Util.option_map v.domain + (fun f -> Query.Pair ("Domain", (String.to_query f))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ; Util.option_map v.d_b_name (fun f -> Query.Pair ("DBName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Util.option_map v.domain (fun f -> "domain", String.to_json f) - ; Util.option_map v.kms_key_id (fun f -> "kms_key_id", String.to_json f) - ; Util.option_map v.storage_encrypted (fun f -> - "storage_encrypted", Boolean.to_json f) - ; Util.option_map v.tde_credential_password (fun f -> - "tde_credential_password", String.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.publicly_accessible (fun f -> - "publicly_accessible", Boolean.to_json f) - ; Util.option_map v.character_set_name (fun f -> - "character_set_name", String.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.preferred_backup_window (fun f -> - "preferred_backup_window", String.to_json f) - ; Util.option_map v.backup_retention_period (fun f -> - "backup_retention_period", Integer.to_json f) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ; Util.option_map v.preferred_maintenance_window (fun f -> - "preferred_maintenance_window", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Some - ("d_b_security_groups", DBSecurityGroupNameList.to_json v.d_b_security_groups) - ; Util.option_map v.master_user_password (fun f -> - "master_user_password", String.to_json f) - ; Util.option_map v.master_username (fun f -> - "master_username", String.to_json f) - ; Some ("engine", String.to_json v.engine) - ; Some ("d_b_instance_class", String.to_json v.d_b_instance_class) - ; Util.option_map v.allocated_storage (fun f -> - "allocated_storage", Integer.to_json f) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ; Util.option_map v.d_b_name (fun f -> "d_b_name", String.to_json f) - ]) - - let of_json j = - { d_b_name = Util.option_map (Json.lookup j "d_b_name") String.of_json - ; d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; allocated_storage = - Util.option_map (Json.lookup j "allocated_storage") Integer.of_json - ; d_b_instance_class = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_class")) - ; engine = String.of_json (Util.of_option_exn (Json.lookup j "engine")) - ; master_username = Util.option_map (Json.lookup j "master_username") String.of_json - ; master_user_password = - Util.option_map (Json.lookup j "master_user_password") String.of_json - ; d_b_security_groups = - DBSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; preferred_maintenance_window = - Util.option_map (Json.lookup j "preferred_maintenance_window") String.of_json - ; d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - ; backup_retention_period = - Util.option_map (Json.lookup j "backup_retention_period") Integer.of_json - ; preferred_backup_window = - Util.option_map (Json.lookup j "preferred_backup_window") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; character_set_name = - Util.option_map (Json.lookup j "character_set_name") String.of_json - ; publicly_accessible = - Util.option_map (Json.lookup j "publicly_accessible") Boolean.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; tde_credential_password = - Util.option_map (Json.lookup j "tde_credential_password") String.of_json - ; storage_encrypted = - Util.option_map (Json.lookup j "storage_encrypted") Boolean.of_json - ; kms_key_id = Util.option_map (Json.lookup j "kms_key_id") String.of_json - ; domain = Util.option_map (Json.lookup j "domain") String.of_json - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - } -end - -module RemoveSourceIdentifierFromSubscriptionResult = struct - type t = { event_subscription : EventSubscription.t option } - - let make ?event_subscription () = { event_subscription } - - let parse xml = - Some - { event_subscription = - Util.option_bind (Xml.member "EventSubscription" xml) EventSubscription.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - Query.Pair ("EventSubscription", EventSubscription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.event_subscription (fun f -> - "event_subscription", EventSubscription.to_json f) - ]) - - let of_json j = - { event_subscription = - Util.option_map (Json.lookup j "event_subscription") EventSubscription.of_json - } -end - -module RestoreDBInstanceFromDBSnapshotMessage = struct - type t = - { d_b_instance_identifier : String.t - ; d_b_snapshot_identifier : String.t - ; d_b_instance_class : String.t option - ; port : Integer.t option - ; availability_zone : String.t option - ; d_b_subnet_group_name : String.t option - ; multi_a_z : Boolean.t option - ; publicly_accessible : Boolean.t option - ; auto_minor_version_upgrade : Boolean.t option - ; license_model : String.t option - ; d_b_name : String.t option - ; engine : String.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; tags : TagList.t - ; storage_type : String.t option - ; tde_credential_arn : String.t option - ; tde_credential_password : String.t option - ; vpc_security_group_ids : VpcSecurityGroupIdList.t - ; d_b_security_groups : DBSecurityGroupNameList.t - ; domain : String.t option - ; copy_tags_to_snapshot : Boolean.t option - } - - let make - ~d_b_instance_identifier - ~d_b_snapshot_identifier - ?d_b_instance_class - ?port - ?availability_zone - ?d_b_subnet_group_name - ?multi_a_z - ?publicly_accessible - ?auto_minor_version_upgrade - ?license_model - ?d_b_name - ?engine - ?iops - ?option_group_name - ?(tags = []) - ?storage_type - ?tde_credential_arn - ?tde_credential_password - ?(vpc_security_group_ids = []) - ?(d_b_security_groups = []) - ?domain - ?copy_tags_to_snapshot - () = - { d_b_instance_identifier - ; d_b_snapshot_identifier - ; d_b_instance_class - ; port - ; availability_zone - ; d_b_subnet_group_name - ; multi_a_z - ; publicly_accessible - ; auto_minor_version_upgrade - ; license_model - ; d_b_name - ; engine - ; iops - ; option_group_name - ; tags - ; storage_type - ; tde_credential_arn - ; tde_credential_password - ; vpc_security_group_ids - ; d_b_security_groups - ; domain - ; copy_tags_to_snapshot - } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; d_b_snapshot_identifier = - Xml.required - "DBSnapshotIdentifier" - (Util.option_bind (Xml.member "DBSnapshotIdentifier" xml) String.parse) - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; multi_a_z = Util.option_bind (Xml.member "MultiAZ" xml) Boolean.parse - ; publicly_accessible = - Util.option_bind (Xml.member "PubliclyAccessible" xml) Boolean.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; d_b_name = Util.option_bind (Xml.member "DBName" xml) String.parse - ; engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; tde_credential_arn = - Util.option_bind (Xml.member "TdeCredentialArn" xml) String.parse - ; tde_credential_password = - Util.option_bind (Xml.member "TdeCredentialPassword" xml) String.parse - ; vpc_security_group_ids = - Util.of_option - [] - (Util.option_bind - (Xml.member "VpcSecurityGroupIds" xml) - VpcSecurityGroupIdList.parse) - ; d_b_security_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBSecurityGroups" xml) - DBSecurityGroupNameList.parse) - ; domain = Util.option_bind (Xml.member "Domain" xml) String.parse - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Util.option_map v.domain (fun f -> Query.Pair ("Domain", String.to_query f)) - ; Some + ("DBSecurityGroups.member", + (DBSecurityGroupNameList.to_query v.d_b_security_groups))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroupNameList.to_query v.d_b_security_groups )) - ; Some + ("VpcSecurityGroupIds.member", + (VpcSecurityGroupIdList.to_query v.vpc_security_group_ids))); + Util.option_map v.tde_credential_password + (fun f -> + Query.Pair ("TdeCredentialPassword", (String.to_query f))); + Util.option_map v.tde_credential_arn + (fun f -> Query.Pair ("TdeCredentialArn", (String.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f))); + Util.option_map v.d_b_name + (fun f -> Query.Pair ("DBName", (String.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.publicly_accessible + (fun f -> + Query.Pair ("PubliclyAccessible", (Boolean.to_query f))); + Util.option_map v.multi_a_z + (fun f -> Query.Pair ("MultiAZ", (Boolean.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Some (Query.Pair - ( "VpcSecurityGroupIds.member" - , VpcSecurityGroupIdList.to_query v.vpc_security_group_ids )) - ; Util.option_map v.tde_credential_password (fun f -> - Query.Pair ("TdeCredentialPassword", String.to_query f)) - ; Util.option_map v.tde_credential_arn (fun f -> - Query.Pair ("TdeCredentialArn", String.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ; Util.option_map v.d_b_name (fun f -> Query.Pair ("DBName", String.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.publicly_accessible (fun f -> - Query.Pair ("PubliclyAccessible", Boolean.to_query f)) - ; Util.option_map v.multi_a_z (fun f -> - Query.Pair ("MultiAZ", Boolean.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Some + ("DBSnapshotIdentifier", + (String.to_query v.d_b_snapshot_identifier))); + Some (Query.Pair - ("DBSnapshotIdentifier", String.to_query v.d_b_snapshot_identifier)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Util.option_map v.domain (fun f -> ("domain", (String.to_json f))); + Some + ("d_b_security_groups", + (DBSecurityGroupNameList.to_json v.d_b_security_groups)); + Some + ("vpc_security_group_ids", + (VpcSecurityGroupIdList.to_json v.vpc_security_group_ids)); + Util.option_map v.tde_credential_password + (fun f -> ("tde_credential_password", (String.to_json f))); + Util.option_map v.tde_credential_arn + (fun f -> ("tde_credential_arn", (String.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f))); + Util.option_map v.d_b_name + (fun f -> ("d_b_name", (String.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.publicly_accessible + (fun f -> ("publicly_accessible", (Boolean.to_json f))); + Util.option_map v.multi_a_z + (fun f -> ("multi_a_z", (Boolean.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Some + ("d_b_snapshot_identifier", + (String.to_json v.d_b_snapshot_identifier)); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + d_b_snapshot_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier"))); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + multi_a_z = + (Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json); + publicly_accessible = + (Util.option_map (Json.lookup j "publicly_accessible") + Boolean.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + d_b_name = + (Util.option_map (Json.lookup j "d_b_name") String.of_json); + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + tde_credential_arn = + (Util.option_map (Json.lookup j "tde_credential_arn") + String.of_json); + tde_credential_password = + (Util.option_map (Json.lookup j "tde_credential_password") + String.of_json); + vpc_security_group_ids = + (VpcSecurityGroupIdList.of_json + (Util.of_option_exn (Json.lookup j "vpc_security_group_ids"))); + d_b_security_groups = + (DBSecurityGroupNameList.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))); + domain = (Util.option_map (Json.lookup j "domain") String.of_json); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json) + } + end +module DBSnapshotNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBSecurityGroupMessage = + struct + type t = + { + d_b_security_group_name: String.t ; + d_b_security_group_description: String.t ; + tags: TagList.t } + let make ~d_b_security_group_name ~d_b_security_group_description + ?(tags= []) () = + { d_b_security_group_name; d_b_security_group_description; tags } + let parse xml = + Some + { + d_b_security_group_name = + (Xml.required "DBSecurityGroupName" + (Util.option_bind (Xml.member "DBSecurityGroupName" xml) + String.parse)); + d_b_security_group_description = + (Xml.required "DBSecurityGroupDescription" + (Util.option_bind + (Xml.member "DBSecurityGroupDescription" xml) String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Util.option_map v.domain (fun f -> "domain", String.to_json f) - ; Some - ("d_b_security_groups", DBSecurityGroupNameList.to_json v.d_b_security_groups) - ; Some - ( "vpc_security_group_ids" - , VpcSecurityGroupIdList.to_json v.vpc_security_group_ids ) - ; Util.option_map v.tde_credential_password (fun f -> - "tde_credential_password", String.to_json f) - ; Util.option_map v.tde_credential_arn (fun f -> - "tde_credential_arn", String.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ; Util.option_map v.d_b_name (fun f -> "d_b_name", String.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.publicly_accessible (fun f -> - "publicly_accessible", Boolean.to_json f) - ; Util.option_map v.multi_a_z (fun f -> "multi_a_z", Boolean.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Some ("d_b_snapshot_identifier", String.to_json v.d_b_snapshot_identifier) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; d_b_snapshot_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_snapshot_identifier")) - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; multi_a_z = Util.option_map (Json.lookup j "multi_a_z") Boolean.of_json - ; publicly_accessible = - Util.option_map (Json.lookup j "publicly_accessible") Boolean.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; d_b_name = Util.option_map (Json.lookup j "d_b_name") String.of_json - ; engine = Util.option_map (Json.lookup j "engine") String.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; tde_credential_arn = - Util.option_map (Json.lookup j "tde_credential_arn") String.of_json - ; tde_credential_password = - Util.option_map (Json.lookup j "tde_credential_password") String.of_json - ; vpc_security_group_ids = - VpcSecurityGroupIdList.of_json - (Util.of_option_exn (Json.lookup j "vpc_security_group_ids")) - ; d_b_security_groups = - DBSecurityGroupNameList.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - ; domain = Util.option_map (Json.lookup j "domain") String.of_json - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - } -end - -module DBSnapshotNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBSecurityGroupMessage = struct - type t = - { d_b_security_group_name : String.t - ; d_b_security_group_description : String.t - ; tags : TagList.t - } - - let make ~d_b_security_group_name ~d_b_security_group_description ?(tags = []) () = - { d_b_security_group_name; d_b_security_group_description; tags } - - let parse xml = - Some - { d_b_security_group_name = - Xml.required - "DBSecurityGroupName" - (Util.option_bind (Xml.member "DBSecurityGroupName" xml) String.parse) - ; d_b_security_group_description = - Xml.required - "DBSecurityGroupDescription" - (Util.option_bind (Xml.member "DBSecurityGroupDescription" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some + ("DBSecurityGroupDescription", + (String.to_query v.d_b_security_group_description))); + Some (Query.Pair - ( "DBSecurityGroupDescription" - , String.to_query v.d_b_security_group_description )) - ; Some - (Query.Pair ("DBSecurityGroupName", String.to_query v.d_b_security_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some - ( "d_b_security_group_description" - , String.to_json v.d_b_security_group_description ) - ; Some ("d_b_security_group_name", String.to_json v.d_b_security_group_name) - ]) - - let of_json j = - { d_b_security_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_security_group_name")) - ; d_b_security_group_description = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_group_description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DBClusterAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidRestoreFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module FailoverDBClusterMessage = struct - type t = { d_b_cluster_identifier : String.t option } - - let make ?d_b_cluster_identifier () = { d_b_cluster_identifier } - - let parse xml = - Some - { d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - } -end - -module PurchaseReservedDBInstancesOfferingResult = struct - type t = { reserved_d_b_instance : ReservedDBInstance.t option } - - let make ?reserved_d_b_instance () = { reserved_d_b_instance } - - let parse xml = - Some - { reserved_d_b_instance = - Util.option_bind (Xml.member "ReservedDBInstance" xml) ReservedDBInstance.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.reserved_d_b_instance (fun f -> - Query.Pair ("ReservedDBInstance", ReservedDBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.reserved_d_b_instance (fun f -> - "reserved_d_b_instance", ReservedDBInstance.to_json f) - ]) - - let of_json j = - { reserved_d_b_instance = - Util.option_map (Json.lookup j "reserved_d_b_instance") ReservedDBInstance.of_json - } -end - -module RestoreDBInstanceToPointInTimeResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module ApplyPendingMaintenanceActionMessage = struct - type t = - { resource_identifier : String.t - ; apply_action : String.t - ; opt_in_type : String.t - } - - let make ~resource_identifier ~apply_action ~opt_in_type () = - { resource_identifier; apply_action; opt_in_type } - - let parse xml = - Some - { resource_identifier = - Xml.required - "ResourceIdentifier" - (Util.option_bind (Xml.member "ResourceIdentifier" xml) String.parse) - ; apply_action = - Xml.required - "ApplyAction" - (Util.option_bind (Xml.member "ApplyAction" xml) String.parse) - ; opt_in_type = - Xml.required - "OptInType" - (Util.option_bind (Xml.member "OptInType" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("OptInType", String.to_query v.opt_in_type)) - ; Some (Query.Pair ("ApplyAction", String.to_query v.apply_action)) - ; Some (Query.Pair ("ResourceIdentifier", String.to_query v.resource_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("opt_in_type", String.to_json v.opt_in_type) - ; Some ("apply_action", String.to_json v.apply_action) - ; Some ("resource_identifier", String.to_json v.resource_identifier) - ]) - - let of_json j = - { resource_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "resource_identifier")) - ; apply_action = String.of_json (Util.of_option_exn (Json.lookup j "apply_action")) - ; opt_in_type = String.of_json (Util.of_option_exn (Json.lookup j "opt_in_type")) - } -end - -module CreateDBClusterParameterGroupMessage = struct - type t = - { d_b_cluster_parameter_group_name : String.t - ; d_b_parameter_group_family : String.t - ; description : String.t - ; tags : TagList.t - } - - let make - ~d_b_cluster_parameter_group_name - ~d_b_parameter_group_family - ~description - ?(tags = []) - () = - { d_b_cluster_parameter_group_name; d_b_parameter_group_family; description; tags } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Xml.required - "DBClusterParameterGroupName" - (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - ; d_b_parameter_group_family = - Xml.required - "DBParameterGroupFamily" - (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse) - ; description = - Xml.required - "Description" - (Util.option_bind (Xml.member "Description" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some (Query.Pair ("Description", String.to_query v.description)) - ; Some + ("DBSecurityGroupName", + (String.to_query v.d_b_security_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some + ("d_b_security_group_description", + (String.to_json v.d_b_security_group_description)); + Some + ("d_b_security_group_name", + (String.to_json v.d_b_security_group_name))]) + let of_json j = + { + d_b_security_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_group_name"))); + d_b_security_group_description = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_security_group_description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DBClusterAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidRestoreFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module FailoverDBClusterMessage = + struct + type t = { + d_b_cluster_identifier: String.t option } + let make ?d_b_cluster_identifier () = { d_b_cluster_identifier } + let parse xml = + Some + { + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json) + } + end +module PurchaseReservedDBInstancesOfferingResult = + struct + type t = { + reserved_d_b_instance: ReservedDBInstance.t option } + let make ?reserved_d_b_instance () = { reserved_d_b_instance } + let parse xml = + Some + { + reserved_d_b_instance = + (Util.option_bind (Xml.member "ReservedDBInstance" xml) + ReservedDBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.reserved_d_b_instance + (fun f -> + Query.Pair + ("ReservedDBInstance", (ReservedDBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.reserved_d_b_instance + (fun f -> + ("reserved_d_b_instance", (ReservedDBInstance.to_json f)))]) + let of_json j = + { + reserved_d_b_instance = + (Util.option_map (Json.lookup j "reserved_d_b_instance") + ReservedDBInstance.of_json) + } + end +module RestoreDBInstanceToPointInTimeResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module ApplyPendingMaintenanceActionMessage = + struct + type t = + { + resource_identifier: String.t ; + apply_action: String.t ; + opt_in_type: String.t } + let make ~resource_identifier ~apply_action ~opt_in_type () = + { resource_identifier; apply_action; opt_in_type } + let parse xml = + Some + { + resource_identifier = + (Xml.required "ResourceIdentifier" + (Util.option_bind (Xml.member "ResourceIdentifier" xml) + String.parse)); + apply_action = + (Xml.required "ApplyAction" + (Util.option_bind (Xml.member "ApplyAction" xml) String.parse)); + opt_in_type = + (Xml.required "OptInType" + (Util.option_bind (Xml.member "OptInType" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("OptInType", (String.to_query v.opt_in_type))); + Some + (Query.Pair ("ApplyAction", (String.to_query v.apply_action))); + Some (Query.Pair - ("DBParameterGroupFamily", String.to_query v.d_b_parameter_group_family)) - ; Some + ("ResourceIdentifier", + (String.to_query v.resource_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("opt_in_type", (String.to_json v.opt_in_type)); + Some ("apply_action", (String.to_json v.apply_action)); + Some + ("resource_identifier", (String.to_json v.resource_identifier))]) + let of_json j = + { + resource_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_identifier"))); + apply_action = + (String.of_json (Util.of_option_exn (Json.lookup j "apply_action"))); + opt_in_type = + (String.of_json (Util.of_option_exn (Json.lookup j "opt_in_type"))) + } + end +module CreateDBClusterParameterGroupMessage = + struct + type t = + { + d_b_cluster_parameter_group_name: String.t ; + d_b_parameter_group_family: String.t ; + description: String.t ; + tags: TagList.t } + let make ~d_b_cluster_parameter_group_name ~d_b_parameter_group_family + ~description ?(tags= []) () = + { + d_b_cluster_parameter_group_name; + d_b_parameter_group_family; + description; + tags + } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Xml.required "DBClusterParameterGroupName" + (Util.option_bind + (Xml.member "DBClusterParameterGroupName" xml) String.parse)); + d_b_parameter_group_family = + (Xml.required "DBParameterGroupFamily" + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse)); + description = + (Xml.required "Description" + (Util.option_bind (Xml.member "Description" xml) String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair ("Description", (String.to_query v.description))); + Some (Query.Pair - ( "DBClusterParameterGroupName" - , String.to_query v.d_b_cluster_parameter_group_name )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("description", String.to_json v.description) - ; Some ("d_b_parameter_group_family", String.to_json v.d_b_parameter_group_family) - ; Some - ( "d_b_cluster_parameter_group_name" - , String.to_json v.d_b_cluster_parameter_group_name ) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_group_name")) - ; d_b_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DeleteOptionGroupMessage = struct - type t = { option_group_name : String.t } - - let make ~option_group_name () = { option_group_name } - - let parse xml = - Some - { option_group_name = - Xml.required - "OptionGroupName" - (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("OptionGroupName", String.to_query v.option_group_name)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("option_group_name", String.to_json v.option_group_name) ]) - - let of_json j = - { option_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "option_group_name")) - } -end - -module DescribeDBEngineVersionsMessage = struct - type t = - { engine : String.t option - ; engine_version : String.t option - ; d_b_parameter_group_family : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - ; default_only : Boolean.t option - ; list_supported_character_sets : Boolean.t option - } - - let make - ?engine - ?engine_version - ?d_b_parameter_group_family - ?(filters = []) - ?max_records - ?marker - ?default_only - ?list_supported_character_sets - () = - { engine - ; engine_version - ; d_b_parameter_group_family - ; filters - ; max_records - ; marker - ; default_only - ; list_supported_character_sets - } - - let parse xml = - Some - { engine = Util.option_bind (Xml.member "Engine" xml) String.parse - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; d_b_parameter_group_family = - Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; default_only = Util.option_bind (Xml.member "DefaultOnly" xml) Boolean.parse - ; list_supported_character_sets = - Util.option_bind (Xml.member "ListSupportedCharacterSets" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.list_supported_character_sets (fun f -> - Query.Pair ("ListSupportedCharacterSets", Boolean.to_query f)) - ; Util.option_map v.default_only (fun f -> - Query.Pair ("DefaultOnly", Boolean.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - Query.Pair ("DBParameterGroupFamily", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Util.option_map v.engine (fun f -> Query.Pair ("Engine", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.list_supported_character_sets (fun f -> - "list_supported_character_sets", Boolean.to_json f) - ; Util.option_map v.default_only (fun f -> "default_only", Boolean.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_parameter_group_family (fun f -> - "d_b_parameter_group_family", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Util.option_map v.engine (fun f -> "engine", String.to_json f) - ]) - - let of_json j = - { engine = Util.option_map (Json.lookup j "engine") String.of_json - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; d_b_parameter_group_family = - Util.option_map (Json.lookup j "d_b_parameter_group_family") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; default_only = Util.option_map (Json.lookup j "default_only") Boolean.of_json - ; list_supported_character_sets = - Util.option_map (Json.lookup j "list_supported_character_sets") Boolean.of_json - } -end - -module DBParameterGroupsMessage = struct - type t = - { marker : String.t option - ; d_b_parameter_groups : DBParameterGroupList.t - } - - let make ?marker ?(d_b_parameter_groups = []) () = { marker; d_b_parameter_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_parameter_groups = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBParameterGroups" xml) - DBParameterGroupList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBParameterGroupFamily", + (String.to_query v.d_b_parameter_group_family))); + Some (Query.Pair - ( "DBParameterGroups.member" - , DBParameterGroupList.to_query v.d_b_parameter_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ("d_b_parameter_groups", DBParameterGroupList.to_json v.d_b_parameter_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_parameter_groups = - DBParameterGroupList.of_json - (Util.of_option_exn (Json.lookup j "d_b_parameter_groups")) - } -end - -module CopyDBParameterGroupResult = struct - type t = { d_b_parameter_group : DBParameterGroup.t option } - - let make ?d_b_parameter_group () = { d_b_parameter_group } - - let parse xml = - Some - { d_b_parameter_group = - Util.option_bind (Xml.member "DBParameterGroup" xml) DBParameterGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group (fun f -> - Query.Pair ("DBParameterGroup", DBParameterGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group (fun f -> - "d_b_parameter_group", DBParameterGroup.to_json f) - ]) - - let of_json j = - { d_b_parameter_group = - Util.option_map (Json.lookup j "d_b_parameter_group") DBParameterGroup.of_json - } -end - -module DescribeOptionGroupOptionsMessage = struct - type t = - { engine_name : String.t - ; major_engine_version : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~engine_name ?major_engine_version ?(filters = []) ?max_records ?marker () = - { engine_name; major_engine_version; filters; max_records; marker } - - let parse xml = - Some - { engine_name = - Xml.required - "EngineName" - (Util.option_bind (Xml.member "EngineName" xml) String.parse) - ; major_engine_version = - Util.option_bind (Xml.member "MajorEngineVersion" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.major_engine_version (fun f -> - Query.Pair ("MajorEngineVersion", String.to_query f)) - ; Some (Query.Pair ("EngineName", String.to_query v.engine_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.major_engine_version (fun f -> - "major_engine_version", String.to_json f) - ; Some ("engine_name", String.to_json v.engine_name) - ]) - - let of_json j = - { engine_name = String.of_json (Util.of_option_exn (Json.lookup j "engine_name")) - ; major_engine_version = - Util.option_map (Json.lookup j "major_engine_version") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module EventsMessage = struct - type t = - { marker : String.t option - ; events : EventList.t - } - - let make ?marker ?(events = []) () = { marker; events } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; events = - Util.of_option [] (Util.option_bind (Xml.member "Events" xml) EventList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Events.member", EventList.to_query v.events)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("events", EventList.to_json v.events) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - } -end - -module SubscriptionAlreadyExistFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ModifyDBSubnetGroupMessage = struct - type t = - { d_b_subnet_group_name : String.t - ; d_b_subnet_group_description : String.t option - ; subnet_ids : SubnetIdentifierList.t - } - - let make ~d_b_subnet_group_name ?d_b_subnet_group_description ~subnet_ids () = - { d_b_subnet_group_name; d_b_subnet_group_description; subnet_ids } - - let parse xml = - Some - { d_b_subnet_group_name = - Xml.required - "DBSubnetGroupName" - (Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse) - ; d_b_subnet_group_description = - Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) String.parse - ; subnet_ids = - Xml.required - "SubnetIds" - (Util.option_bind (Xml.member "SubnetIds" xml) SubnetIdentifierList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("SubnetIds.member", SubnetIdentifierList.to_query v.subnet_ids)) - ; Util.option_map v.d_b_subnet_group_description (fun f -> - Query.Pair ("DBSubnetGroupDescription", String.to_query f)) - ; Some - (Query.Pair ("DBSubnetGroupName", String.to_query v.d_b_subnet_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("subnet_ids", SubnetIdentifierList.to_json v.subnet_ids) - ; Util.option_map v.d_b_subnet_group_description (fun f -> - "d_b_subnet_group_description", String.to_json f) - ; Some ("d_b_subnet_group_name", String.to_json v.d_b_subnet_group_name) - ]) - - let of_json j = - { d_b_subnet_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name")) - ; d_b_subnet_group_description = - Util.option_map (Json.lookup j "d_b_subnet_group_description") String.of_json - ; subnet_ids = - SubnetIdentifierList.of_json (Util.of_option_exn (Json.lookup j "subnet_ids")) - } -end - -module CertificateMessage = struct - type t = - { certificates : CertificateList.t - ; marker : String.t option - } - - let make ?(certificates = []) ?marker () = { certificates; marker } - - let parse xml = - Some - { certificates = - Util.of_option - [] - (Util.option_bind (Xml.member "Certificates" xml) CertificateList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some - (Query.Pair ("Certificates.member", CertificateList.to_query v.certificates)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("certificates", CertificateList.to_json v.certificates) - ]) - - let of_json j = - { certificates = - CertificateList.of_json (Util.of_option_exn (Json.lookup j "certificates")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module CreateDBInstanceReadReplicaMessage = struct - type t = - { d_b_instance_identifier : String.t - ; source_d_b_instance_identifier : String.t - ; d_b_instance_class : String.t option - ; availability_zone : String.t option - ; port : Integer.t option - ; auto_minor_version_upgrade : Boolean.t option - ; iops : Integer.t option - ; option_group_name : String.t option - ; publicly_accessible : Boolean.t option - ; tags : TagList.t - ; d_b_subnet_group_name : String.t option - ; storage_type : String.t option - ; copy_tags_to_snapshot : Boolean.t option - } - - let make - ~d_b_instance_identifier - ~source_d_b_instance_identifier - ?d_b_instance_class - ?availability_zone - ?port - ?auto_minor_version_upgrade - ?iops - ?option_group_name - ?publicly_accessible - ?(tags = []) - ?d_b_subnet_group_name - ?storage_type - ?copy_tags_to_snapshot - () = - { d_b_instance_identifier - ; source_d_b_instance_identifier - ; d_b_instance_class - ; availability_zone - ; port - ; auto_minor_version_upgrade - ; iops - ; option_group_name - ; publicly_accessible - ; tags - ; d_b_subnet_group_name - ; storage_type - ; copy_tags_to_snapshot - } - - let parse xml = - Some - { d_b_instance_identifier = - Xml.required - "DBInstanceIdentifier" - (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) String.parse) - ; source_d_b_instance_identifier = - Xml.required - "SourceDBInstanceIdentifier" - (Util.option_bind (Xml.member "SourceDBInstanceIdentifier" xml) String.parse) - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; availability_zone = - Util.option_bind (Xml.member "AvailabilityZone" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; auto_minor_version_upgrade = - Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) Boolean.parse - ; iops = Util.option_bind (Xml.member "Iops" xml) Integer.parse - ; option_group_name = - Util.option_bind (Xml.member "OptionGroupName" xml) String.parse - ; publicly_accessible = - Util.option_bind (Xml.member "PubliclyAccessible" xml) Boolean.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - ; d_b_subnet_group_name = - Util.option_bind (Xml.member "DBSubnetGroupName" xml) String.parse - ; storage_type = Util.option_bind (Xml.member "StorageType" xml) String.parse - ; copy_tags_to_snapshot = - Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - Query.Pair ("CopyTagsToSnapshot", Boolean.to_query f)) - ; Util.option_map v.storage_type (fun f -> - Query.Pair ("StorageType", String.to_query f)) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - Query.Pair ("DBSubnetGroupName", String.to_query f)) - ; Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.publicly_accessible (fun f -> - Query.Pair ("PubliclyAccessible", Boolean.to_query f)) - ; Util.option_map v.option_group_name (fun f -> - Query.Pair ("OptionGroupName", String.to_query f)) - ; Util.option_map v.iops (fun f -> Query.Pair ("Iops", Integer.to_query f)) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - Query.Pair ("AutoMinorVersionUpgrade", Boolean.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.availability_zone (fun f -> - Query.Pair ("AvailabilityZone", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Some + ("DBClusterParameterGroupName", + (String.to_query v.d_b_cluster_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("description", (String.to_json v.description)); + Some + ("d_b_parameter_group_family", + (String.to_json v.d_b_parameter_group_family)); + Some + ("d_b_cluster_parameter_group_name", + (String.to_json v.d_b_cluster_parameter_group_name))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_group_name"))); + d_b_parameter_group_family = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DeleteOptionGroupMessage = + struct + type t = { + option_group_name: String.t } + let make ~option_group_name () = { option_group_name } + let parse xml = + Some + { + option_group_name = + (Xml.required "OptionGroupName" + (Util.option_bind (Xml.member "OptionGroupName" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("OptionGroupName", (String.to_query v.option_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("option_group_name", (String.to_json v.option_group_name))]) + let of_json j = + { + option_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "option_group_name"))) + } + end +module DescribeDBEngineVersionsMessage = + struct + type t = + { + engine: String.t option ; + engine_version: String.t option ; + d_b_parameter_group_family: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option ; + default_only: Boolean.t option ; + list_supported_character_sets: Boolean.t option } + let make ?engine ?engine_version ?d_b_parameter_group_family + ?(filters= []) ?max_records ?marker ?default_only + ?list_supported_character_sets () = + { + engine; + engine_version; + d_b_parameter_group_family; + filters; + max_records; + marker; + default_only; + list_supported_character_sets + } + let parse xml = + Some + { + engine = (Util.option_bind (Xml.member "Engine" xml) String.parse); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + d_b_parameter_group_family = + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + default_only = + (Util.option_bind (Xml.member "DefaultOnly" xml) Boolean.parse); + list_supported_character_sets = + (Util.option_bind (Xml.member "ListSupportedCharacterSets" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.list_supported_character_sets + (fun f -> + Query.Pair + ("ListSupportedCharacterSets", (Boolean.to_query f))); + Util.option_map v.default_only + (fun f -> Query.Pair ("DefaultOnly", (Boolean.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_parameter_group_family + (fun f -> + Query.Pair ("DBParameterGroupFamily", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Util.option_map v.engine + (fun f -> Query.Pair ("Engine", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.list_supported_character_sets + (fun f -> + ("list_supported_character_sets", (Boolean.to_json f))); + Util.option_map v.default_only + (fun f -> ("default_only", (Boolean.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_parameter_group_family + (fun f -> ("d_b_parameter_group_family", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Util.option_map v.engine (fun f -> ("engine", (String.to_json f)))]) + let of_json j = + { + engine = (Util.option_map (Json.lookup j "engine") String.of_json); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + d_b_parameter_group_family = + (Util.option_map (Json.lookup j "d_b_parameter_group_family") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + default_only = + (Util.option_map (Json.lookup j "default_only") Boolean.of_json); + list_supported_character_sets = + (Util.option_map (Json.lookup j "list_supported_character_sets") + Boolean.of_json) + } + end +module DBParameterGroupsMessage = + struct + type t = + { + marker: String.t option ; + d_b_parameter_groups: DBParameterGroupList.t } + let make ?marker ?(d_b_parameter_groups= []) () = + { marker; d_b_parameter_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_parameter_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBParameterGroups" xml) + DBParameterGroupList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBParameterGroups.member", + (DBParameterGroupList.to_query v.d_b_parameter_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_parameter_groups", + (DBParameterGroupList.to_json v.d_b_parameter_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_parameter_groups = + (DBParameterGroupList.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_groups"))) + } + end +module CopyDBParameterGroupResult = + struct + type t = { + d_b_parameter_group: DBParameterGroup.t option } + let make ?d_b_parameter_group () = { d_b_parameter_group } + let parse xml = + Some + { + d_b_parameter_group = + (Util.option_bind (Xml.member "DBParameterGroup" xml) + DBParameterGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group + (fun f -> + Query.Pair + ("DBParameterGroup", (DBParameterGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group + (fun f -> ("d_b_parameter_group", (DBParameterGroup.to_json f)))]) + let of_json j = + { + d_b_parameter_group = + (Util.option_map (Json.lookup j "d_b_parameter_group") + DBParameterGroup.of_json) + } + end +module DescribeOptionGroupOptionsMessage = + struct + type t = + { + engine_name: String.t ; + major_engine_version: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~engine_name ?major_engine_version ?(filters= []) + ?max_records ?marker () = + { engine_name; major_engine_version; filters; max_records; marker } + let parse xml = + Some + { + engine_name = + (Xml.required "EngineName" + (Util.option_bind (Xml.member "EngineName" xml) String.parse)); + major_engine_version = + (Util.option_bind (Xml.member "MajorEngineVersion" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.major_engine_version + (fun f -> Query.Pair ("MajorEngineVersion", (String.to_query f))); + Some (Query.Pair ("EngineName", (String.to_query v.engine_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.major_engine_version + (fun f -> ("major_engine_version", (String.to_json f))); + Some ("engine_name", (String.to_json v.engine_name))]) + let of_json j = + { + engine_name = + (String.of_json (Util.of_option_exn (Json.lookup j "engine_name"))); + major_engine_version = + (Util.option_map (Json.lookup j "major_engine_version") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module EventsMessage = + struct + type t = { + marker: String.t option ; + events: EventList.t } + let make ?marker ?(events= []) () = { marker; events } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + events = + (Util.of_option [] + (Util.option_bind (Xml.member "Events" xml) EventList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Events.member", (EventList.to_query v.events))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("events", (EventList.to_json v.events)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))) + } + end +module SubscriptionAlreadyExistFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ModifyDBSubnetGroupMessage = + struct + type t = + { + d_b_subnet_group_name: String.t ; + d_b_subnet_group_description: String.t option ; + subnet_ids: SubnetIdentifierList.t } + let make ~d_b_subnet_group_name ?d_b_subnet_group_description + ~subnet_ids () = + { d_b_subnet_group_name; d_b_subnet_group_description; subnet_ids } + let parse xml = + Some + { + d_b_subnet_group_name = + (Xml.required "DBSubnetGroupName" + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse)); + d_b_subnet_group_description = + (Util.option_bind (Xml.member "DBSubnetGroupDescription" xml) + String.parse); + subnet_ids = + (Xml.required "SubnetIds" + (Util.option_bind (Xml.member "SubnetIds" xml) + SubnetIdentifierList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SubnetIds.member", + (SubnetIdentifierList.to_query v.subnet_ids))); + Util.option_map v.d_b_subnet_group_description + (fun f -> + Query.Pair ("DBSubnetGroupDescription", (String.to_query f))); + Some (Query.Pair - ( "SourceDBInstanceIdentifier" - , String.to_query v.source_d_b_instance_identifier )) - ; Some + ("DBSubnetGroupName", + (String.to_query v.d_b_subnet_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("subnet_ids", (SubnetIdentifierList.to_json v.subnet_ids)); + Util.option_map v.d_b_subnet_group_description + (fun f -> ("d_b_subnet_group_description", (String.to_json f))); + Some + ("d_b_subnet_group_name", + (String.to_json v.d_b_subnet_group_name))]) + let of_json j = + { + d_b_subnet_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_subnet_group_name"))); + d_b_subnet_group_description = + (Util.option_map (Json.lookup j "d_b_subnet_group_description") + String.of_json); + subnet_ids = + (SubnetIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "subnet_ids"))) + } + end +module CertificateMessage = + struct + type t = { + certificates: CertificateList.t ; + marker: String.t option } + let make ?(certificates= []) ?marker () = { certificates; marker } + let parse xml = + Some + { + certificates = + (Util.of_option [] + (Util.option_bind (Xml.member "Certificates" xml) + CertificateList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("DBInstanceIdentifier", String.to_query v.d_b_instance_identifier)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.copy_tags_to_snapshot (fun f -> - "copy_tags_to_snapshot", Boolean.to_json f) - ; Util.option_map v.storage_type (fun f -> "storage_type", String.to_json f) - ; Util.option_map v.d_b_subnet_group_name (fun f -> - "d_b_subnet_group_name", String.to_json f) - ; Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.publicly_accessible (fun f -> - "publicly_accessible", Boolean.to_json f) - ; Util.option_map v.option_group_name (fun f -> - "option_group_name", String.to_json f) - ; Util.option_map v.iops (fun f -> "iops", Integer.to_json f) - ; Util.option_map v.auto_minor_version_upgrade (fun f -> - "auto_minor_version_upgrade", Boolean.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.availability_zone (fun f -> - "availability_zone", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Some - ( "source_d_b_instance_identifier" - , String.to_json v.source_d_b_instance_identifier ) - ; Some ("d_b_instance_identifier", String.to_json v.d_b_instance_identifier) - ]) - - let of_json j = - { d_b_instance_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_instance_identifier")) - ; source_d_b_instance_identifier = - String.of_json - (Util.of_option_exn (Json.lookup j "source_d_b_instance_identifier")) - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; availability_zone = - Util.option_map (Json.lookup j "availability_zone") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; auto_minor_version_upgrade = - Util.option_map (Json.lookup j "auto_minor_version_upgrade") Boolean.of_json - ; iops = Util.option_map (Json.lookup j "iops") Integer.of_json - ; option_group_name = - Util.option_map (Json.lookup j "option_group_name") String.of_json - ; publicly_accessible = - Util.option_map (Json.lookup j "publicly_accessible") Boolean.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - ; d_b_subnet_group_name = - Util.option_map (Json.lookup j "d_b_subnet_group_name") String.of_json - ; storage_type = Util.option_map (Json.lookup j "storage_type") String.of_json - ; copy_tags_to_snapshot = - Util.option_map (Json.lookup j "copy_tags_to_snapshot") Boolean.of_json - } -end - -module AuthorizeDBSecurityGroupIngressResult = struct - type t = { d_b_security_group : DBSecurityGroup.t option } - - let make ?d_b_security_group () = { d_b_security_group } - - let parse xml = - Some - { d_b_security_group = - Util.option_bind (Xml.member "DBSecurityGroup" xml) DBSecurityGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - Query.Pair ("DBSecurityGroup", DBSecurityGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_security_group (fun f -> - "d_b_security_group", DBSecurityGroup.to_json f) - ]) - - let of_json j = - { d_b_security_group = - Util.option_map (Json.lookup j "d_b_security_group") DBSecurityGroup.of_json - } -end - -module SourceNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module OptionGroups = struct - type t = - { option_groups_list : OptionGroupsList.t - ; marker : String.t option - } - - let make ?(option_groups_list = []) ?marker () = { option_groups_list; marker } - - let parse xml = - Some - { option_groups_list = - Util.of_option - [] - (Util.option_bind (Xml.member "OptionGroupsList" xml) OptionGroupsList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + ("Certificates.member", + (CertificateList.to_query v.certificates)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some ("certificates", (CertificateList.to_json v.certificates))]) + let of_json j = + { + certificates = + (CertificateList.of_json + (Util.of_option_exn (Json.lookup j "certificates"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module CreateDBInstanceReadReplicaMessage = + struct + type t = + { + d_b_instance_identifier: String.t ; + source_d_b_instance_identifier: String.t ; + d_b_instance_class: String.t option ; + availability_zone: String.t option ; + port: Integer.t option ; + auto_minor_version_upgrade: Boolean.t option ; + iops: Integer.t option ; + option_group_name: String.t option ; + publicly_accessible: Boolean.t option ; + tags: TagList.t ; + d_b_subnet_group_name: String.t option ; + storage_type: String.t option ; + copy_tags_to_snapshot: Boolean.t option } + let make ~d_b_instance_identifier ~source_d_b_instance_identifier + ?d_b_instance_class ?availability_zone ?port + ?auto_minor_version_upgrade ?iops ?option_group_name + ?publicly_accessible ?(tags= []) ?d_b_subnet_group_name + ?storage_type ?copy_tags_to_snapshot () = + { + d_b_instance_identifier; + source_d_b_instance_identifier; + d_b_instance_class; + availability_zone; + port; + auto_minor_version_upgrade; + iops; + option_group_name; + publicly_accessible; + tags; + d_b_subnet_group_name; + storage_type; + copy_tags_to_snapshot + } + let parse xml = + Some + { + d_b_instance_identifier = + (Xml.required "DBInstanceIdentifier" + (Util.option_bind (Xml.member "DBInstanceIdentifier" xml) + String.parse)); + source_d_b_instance_identifier = + (Xml.required "SourceDBInstanceIdentifier" + (Util.option_bind + (Xml.member "SourceDBInstanceIdentifier" xml) String.parse)); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + availability_zone = + (Util.option_bind (Xml.member "AvailabilityZone" xml) + String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + auto_minor_version_upgrade = + (Util.option_bind (Xml.member "AutoMinorVersionUpgrade" xml) + Boolean.parse); + iops = (Util.option_bind (Xml.member "Iops" xml) Integer.parse); + option_group_name = + (Util.option_bind (Xml.member "OptionGroupName" xml) String.parse); + publicly_accessible = + (Util.option_bind (Xml.member "PubliclyAccessible" xml) + Boolean.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)); + d_b_subnet_group_name = + (Util.option_bind (Xml.member "DBSubnetGroupName" xml) + String.parse); + storage_type = + (Util.option_bind (Xml.member "StorageType" xml) String.parse); + copy_tags_to_snapshot = + (Util.option_bind (Xml.member "CopyTagsToSnapshot" xml) + Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> + Query.Pair ("CopyTagsToSnapshot", (Boolean.to_query f))); + Util.option_map v.storage_type + (fun f -> Query.Pair ("StorageType", (String.to_query f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> Query.Pair ("DBSubnetGroupName", (String.to_query f))); + Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.publicly_accessible + (fun f -> + Query.Pair ("PubliclyAccessible", (Boolean.to_query f))); + Util.option_map v.option_group_name + (fun f -> Query.Pair ("OptionGroupName", (String.to_query f))); + Util.option_map v.iops + (fun f -> Query.Pair ("Iops", (Integer.to_query f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> + Query.Pair ("AutoMinorVersionUpgrade", (Boolean.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.availability_zone + (fun f -> Query.Pair ("AvailabilityZone", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Some (Query.Pair - ("OptionGroupsList.member", OptionGroupsList.to_query v.option_groups_list)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("option_groups_list", OptionGroupsList.to_json v.option_groups_list) - ]) - - let of_json j = - { option_groups_list = - OptionGroupsList.of_json (Util.of_option_exn (Json.lookup j "option_groups_list")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DBSecurityGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBSnapshotResult = struct - type t = { d_b_snapshot : DBSnapshot.t option } - - let make ?d_b_snapshot () = { d_b_snapshot } - - let parse xml = - Some - { d_b_snapshot = Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> - Query.Pair ("DBSnapshot", DBSnapshot.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_snapshot (fun f -> "d_b_snapshot", DBSnapshot.to_json f) - ]) - - let of_json j = - { d_b_snapshot = Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json } -end - -module DescribeDBParameterGroupsMessage = struct - type t = - { d_b_parameter_group_name : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ?d_b_parameter_group_name ?(filters = []) ?max_records ?marker () = - { d_b_parameter_group_name; filters; max_records; marker } - - let parse xml = - Some - { d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module InsufficientDBClusterCapacityFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SNSInvalidTopicFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DBSubnetGroupAlreadyExistsFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDBClusterParameterGroupMessage = struct - type t = { d_b_cluster_parameter_group_name : String.t } - - let make ~d_b_cluster_parameter_group_name () = { d_b_cluster_parameter_group_name } - - let parse xml = - Some - { d_b_cluster_parameter_group_name = - Xml.required - "DBClusterParameterGroupName" - (Util.option_bind (Xml.member "DBClusterParameterGroupName" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("SourceDBInstanceIdentifier", + (String.to_query v.source_d_b_instance_identifier))); + Some (Query.Pair - ( "DBClusterParameterGroupName" - , String.to_query v.d_b_cluster_parameter_group_name )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "d_b_cluster_parameter_group_name" - , String.to_json v.d_b_cluster_parameter_group_name ) - ]) - - let of_json j = - { d_b_cluster_parameter_group_name = - String.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_parameter_group_name")) - } -end - -module OrderableDBInstanceOptionsMessage = struct - type t = - { orderable_d_b_instance_options : OrderableDBInstanceOptionsList.t - ; marker : String.t option - } - - let make ?(orderable_d_b_instance_options = []) ?marker () = - { orderable_d_b_instance_options; marker } - - let parse xml = - Some - { orderable_d_b_instance_options = - Util.of_option - [] - (Util.option_bind - (Xml.member "OrderableDBInstanceOptions" xml) - OrderableDBInstanceOptionsList.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some + ("DBInstanceIdentifier", + (String.to_query v.d_b_instance_identifier)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.copy_tags_to_snapshot + (fun f -> ("copy_tags_to_snapshot", (Boolean.to_json f))); + Util.option_map v.storage_type + (fun f -> ("storage_type", (String.to_json f))); + Util.option_map v.d_b_subnet_group_name + (fun f -> ("d_b_subnet_group_name", (String.to_json f))); + Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.publicly_accessible + (fun f -> ("publicly_accessible", (Boolean.to_json f))); + Util.option_map v.option_group_name + (fun f -> ("option_group_name", (String.to_json f))); + Util.option_map v.iops (fun f -> ("iops", (Integer.to_json f))); + Util.option_map v.auto_minor_version_upgrade + (fun f -> ("auto_minor_version_upgrade", (Boolean.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.availability_zone + (fun f -> ("availability_zone", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Some + ("source_d_b_instance_identifier", + (String.to_json v.source_d_b_instance_identifier)); + Some + ("d_b_instance_identifier", + (String.to_json v.d_b_instance_identifier))]) + let of_json j = + { + d_b_instance_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_instance_identifier"))); + source_d_b_instance_identifier = + (String.of_json + (Util.of_option_exn + (Json.lookup j "source_d_b_instance_identifier"))); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + availability_zone = + (Util.option_map (Json.lookup j "availability_zone") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + auto_minor_version_upgrade = + (Util.option_map (Json.lookup j "auto_minor_version_upgrade") + Boolean.of_json); + iops = (Util.option_map (Json.lookup j "iops") Integer.of_json); + option_group_name = + (Util.option_map (Json.lookup j "option_group_name") String.of_json); + publicly_accessible = + (Util.option_map (Json.lookup j "publicly_accessible") + Boolean.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))); + d_b_subnet_group_name = + (Util.option_map (Json.lookup j "d_b_subnet_group_name") + String.of_json); + storage_type = + (Util.option_map (Json.lookup j "storage_type") String.of_json); + copy_tags_to_snapshot = + (Util.option_map (Json.lookup j "copy_tags_to_snapshot") + Boolean.of_json) + } + end +module AuthorizeDBSecurityGroupIngressResult = + struct + type t = { + d_b_security_group: DBSecurityGroup.t option } + let make ?d_b_security_group () = { d_b_security_group } + let parse xml = + Some + { + d_b_security_group = + (Util.option_bind (Xml.member "DBSecurityGroup" xml) + DBSecurityGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> + Query.Pair ("DBSecurityGroup", (DBSecurityGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_security_group + (fun f -> ("d_b_security_group", (DBSecurityGroup.to_json f)))]) + let of_json j = + { + d_b_security_group = + (Util.option_map (Json.lookup j "d_b_security_group") + DBSecurityGroup.of_json) + } + end +module SourceNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module OptionGroups = + struct + type t = + { + option_groups_list: OptionGroupsList.t ; + marker: String.t option } + let make ?(option_groups_list= []) ?marker () = + { option_groups_list; marker } + let parse xml = + Some + { + option_groups_list = + (Util.of_option [] + (Util.option_bind (Xml.member "OptionGroupsList" xml) + OptionGroupsList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ( "OrderableDBInstanceOptions.member" - , OrderableDBInstanceOptionsList.to_query v.orderable_d_b_instance_options - )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some - ( "orderable_d_b_instance_options" - , OrderableDBInstanceOptionsList.to_json v.orderable_d_b_instance_options ) - ]) - - let of_json j = - { orderable_d_b_instance_options = - OrderableDBInstanceOptionsList.of_json - (Util.of_option_exn (Json.lookup j "orderable_d_b_instance_options")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DeleteDBInstanceResult = struct - type t = { d_b_instance : DBInstance.t option } - - let make ?d_b_instance () = { d_b_instance } - - let parse xml = - Some - { d_b_instance = Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> - Query.Pair ("DBInstance", DBInstance.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_instance (fun f -> "d_b_instance", DBInstance.to_json f) - ]) - - let of_json j = - { d_b_instance = Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json } -end - -module DescribeDBClusterSnapshotsMessage = struct - type t = - { d_b_cluster_identifier : String.t option - ; d_b_cluster_snapshot_identifier : String.t option - ; snapshot_type : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ?d_b_cluster_identifier - ?d_b_cluster_snapshot_identifier - ?snapshot_type - ?(filters = []) - ?max_records - ?marker - () = - { d_b_cluster_identifier - ; d_b_cluster_snapshot_identifier - ; snapshot_type - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { d_b_cluster_identifier = - Util.option_bind (Xml.member "DBClusterIdentifier" xml) String.parse - ; d_b_cluster_snapshot_identifier = - Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) String.parse - ; snapshot_type = Util.option_bind (Xml.member "SnapshotType" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.snapshot_type (fun f -> - Query.Pair ("SnapshotType", String.to_query f)) - ; Util.option_map v.d_b_cluster_snapshot_identifier (fun f -> - Query.Pair ("DBClusterSnapshotIdentifier", String.to_query f)) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - Query.Pair ("DBClusterIdentifier", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.snapshot_type (fun f -> "snapshot_type", String.to_json f) - ; Util.option_map v.d_b_cluster_snapshot_identifier (fun f -> - "d_b_cluster_snapshot_identifier", String.to_json f) - ; Util.option_map v.d_b_cluster_identifier (fun f -> - "d_b_cluster_identifier", String.to_json f) - ]) - - let of_json j = - { d_b_cluster_identifier = - Util.option_map (Json.lookup j "d_b_cluster_identifier") String.of_json - ; d_b_cluster_snapshot_identifier = - Util.option_map (Json.lookup j "d_b_cluster_snapshot_identifier") String.of_json - ; snapshot_type = Util.option_map (Json.lookup j "snapshot_type") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ModifyEventSubscriptionMessage = struct - type t = - { subscription_name : String.t - ; sns_topic_arn : String.t option - ; source_type : String.t option - ; event_categories : EventCategoriesList.t - ; enabled : Boolean.t option - } - - let make - ~subscription_name - ?sns_topic_arn - ?source_type - ?(event_categories = []) - ?enabled - () = - { subscription_name; sns_topic_arn; source_type; event_categories; enabled } - - let parse xml = - Some - { subscription_name = - Xml.required - "SubscriptionName" - (Util.option_bind (Xml.member "SubscriptionName" xml) String.parse) - ; sns_topic_arn = Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse - ; source_type = Util.option_bind (Xml.member "SourceType" xml) String.parse - ; event_categories = - Util.of_option - [] - (Util.option_bind - (Xml.member "EventCategories" xml) - EventCategoriesList.parse) - ; enabled = Util.option_bind (Xml.member "Enabled" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> Query.Pair ("Enabled", Boolean.to_query f)) - ; Some + ("OptionGroupsList.member", + (OptionGroupsList.to_query v.option_groups_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("option_groups_list", + (OptionGroupsList.to_json v.option_groups_list))]) + let of_json j = + { + option_groups_list = + (OptionGroupsList.of_json + (Util.of_option_exn (Json.lookup j "option_groups_list"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DBSecurityGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBSnapshotResult = + struct + type t = { + d_b_snapshot: DBSnapshot.t option } + let make ?d_b_snapshot () = { d_b_snapshot } + let parse xml = + Some + { + d_b_snapshot = + (Util.option_bind (Xml.member "DBSnapshot" xml) DBSnapshot.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> Query.Pair ("DBSnapshot", (DBSnapshot.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_snapshot + (fun f -> ("d_b_snapshot", (DBSnapshot.to_json f)))]) + let of_json j = + { + d_b_snapshot = + (Util.option_map (Json.lookup j "d_b_snapshot") DBSnapshot.of_json) + } + end +module DescribeDBParameterGroupsMessage = + struct + type t = + { + d_b_parameter_group_name: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_parameter_group_name ?(filters= []) ?max_records ?marker + () = { d_b_parameter_group_name; filters; max_records; marker } + let parse xml = + Some + { + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module InsufficientDBClusterCapacityFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SNSInvalidTopicFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DBSubnetGroupAlreadyExistsFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDBClusterParameterGroupMessage = + struct + type t = { + d_b_cluster_parameter_group_name: String.t } + let make ~d_b_cluster_parameter_group_name () = + { d_b_cluster_parameter_group_name } + let parse xml = + Some + { + d_b_cluster_parameter_group_name = + (Xml.required "DBClusterParameterGroupName" + (Util.option_bind + (Xml.member "DBClusterParameterGroupName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBClusterParameterGroupName", + (String.to_query v.d_b_cluster_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_cluster_parameter_group_name", + (String.to_json v.d_b_cluster_parameter_group_name))]) + let of_json j = + { + d_b_cluster_parameter_group_name = + (String.of_json + (Util.of_option_exn + (Json.lookup j "d_b_cluster_parameter_group_name"))) + } + end +module OrderableDBInstanceOptionsMessage = + struct + type t = + { + orderable_d_b_instance_options: OrderableDBInstanceOptionsList.t ; + marker: String.t option } + let make ?(orderable_d_b_instance_options= []) ?marker () = + { orderable_d_b_instance_options; marker } + let parse xml = + Some + { + orderable_d_b_instance_options = + (Util.of_option [] + (Util.option_bind + (Xml.member "OrderableDBInstanceOptions" xml) + OrderableDBInstanceOptionsList.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("EventCategories.member", EventCategoriesList.to_query v.event_categories)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", String.to_query f)) - ; Util.option_map v.sns_topic_arn (fun f -> - Query.Pair ("SnsTopicArn", String.to_query f)) - ; Some (Query.Pair ("SubscriptionName", String.to_query v.subscription_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.enabled (fun f -> "enabled", Boolean.to_json f) - ; Some ("event_categories", EventCategoriesList.to_json v.event_categories) - ; Util.option_map v.source_type (fun f -> "source_type", String.to_json f) - ; Util.option_map v.sns_topic_arn (fun f -> "sns_topic_arn", String.to_json f) - ; Some ("subscription_name", String.to_json v.subscription_name) - ]) - - let of_json j = - { subscription_name = - String.of_json (Util.of_option_exn (Json.lookup j "subscription_name")) - ; sns_topic_arn = Util.option_map (Json.lookup j "sns_topic_arn") String.of_json - ; source_type = Util.option_map (Json.lookup j "source_type") String.of_json - ; event_categories = - EventCategoriesList.of_json - (Util.of_option_exn (Json.lookup j "event_categories")) - ; enabled = Util.option_map (Json.lookup j "enabled") Boolean.of_json - } -end - -module RemoveTagsFromResourceMessage = struct - type t = - { resource_name : String.t - ; tag_keys : KeyList.t - } - - let make ~resource_name ~tag_keys () = { resource_name; tag_keys } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - ; tag_keys = - Xml.required - "TagKeys" - (Util.option_bind (Xml.member "TagKeys" xml) KeyList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagKeys.member", KeyList.to_query v.tag_keys)) - ; Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tag_keys", KeyList.to_json v.tag_keys) - ; Some ("resource_name", String.to_json v.resource_name) - ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - ; tag_keys = KeyList.of_json (Util.of_option_exn (Json.lookup j "tag_keys")) - } -end - -module PurchaseReservedDBInstancesOfferingMessage = struct - type t = - { reserved_d_b_instances_offering_id : String.t - ; reserved_d_b_instance_id : String.t option - ; d_b_instance_count : Integer.t option - ; tags : TagList.t - } - - let make - ~reserved_d_b_instances_offering_id - ?reserved_d_b_instance_id - ?d_b_instance_count - ?(tags = []) - () = - { reserved_d_b_instances_offering_id - ; reserved_d_b_instance_id - ; d_b_instance_count - ; tags - } - - let parse xml = - Some - { reserved_d_b_instances_offering_id = - Xml.required - "ReservedDBInstancesOfferingId" - (Util.option_bind - (Xml.member "ReservedDBInstancesOfferingId" xml) - String.parse) - ; reserved_d_b_instance_id = - Util.option_bind (Xml.member "ReservedDBInstanceId" xml) String.parse - ; d_b_instance_count = - Util.option_bind (Xml.member "DBInstanceCount" xml) Integer.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.d_b_instance_count (fun f -> - Query.Pair ("DBInstanceCount", Integer.to_query f)) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - Query.Pair ("ReservedDBInstanceId", String.to_query f)) - ; Some + ("OrderableDBInstanceOptions.member", + (OrderableDBInstanceOptionsList.to_query + v.orderable_d_b_instance_options)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Some + ("orderable_d_b_instance_options", + (OrderableDBInstanceOptionsList.to_json + v.orderable_d_b_instance_options))]) + let of_json j = + { + orderable_d_b_instance_options = + (OrderableDBInstanceOptionsList.of_json + (Util.of_option_exn + (Json.lookup j "orderable_d_b_instance_options"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DeleteDBInstanceResult = + struct + type t = { + d_b_instance: DBInstance.t option } + let make ?d_b_instance () = { d_b_instance } + let parse xml = + Some + { + d_b_instance = + (Util.option_bind (Xml.member "DBInstance" xml) DBInstance.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> Query.Pair ("DBInstance", (DBInstance.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_instance + (fun f -> ("d_b_instance", (DBInstance.to_json f)))]) + let of_json j = + { + d_b_instance = + (Util.option_map (Json.lookup j "d_b_instance") DBInstance.of_json) + } + end +module DescribeDBClusterSnapshotsMessage = + struct + type t = + { + d_b_cluster_identifier: String.t option ; + d_b_cluster_snapshot_identifier: String.t option ; + snapshot_type: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ?d_b_cluster_identifier ?d_b_cluster_snapshot_identifier + ?snapshot_type ?(filters= []) ?max_records ?marker () = + { + d_b_cluster_identifier; + d_b_cluster_snapshot_identifier; + snapshot_type; + filters; + max_records; + marker + } + let parse xml = + Some + { + d_b_cluster_identifier = + (Util.option_bind (Xml.member "DBClusterIdentifier" xml) + String.parse); + d_b_cluster_snapshot_identifier = + (Util.option_bind (Xml.member "DBClusterSnapshotIdentifier" xml) + String.parse); + snapshot_type = + (Util.option_bind (Xml.member "SnapshotType" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.snapshot_type + (fun f -> Query.Pair ("SnapshotType", (String.to_query f))); + Util.option_map v.d_b_cluster_snapshot_identifier + (fun f -> + Query.Pair + ("DBClusterSnapshotIdentifier", (String.to_query f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> + Query.Pair ("DBClusterIdentifier", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.snapshot_type + (fun f -> ("snapshot_type", (String.to_json f))); + Util.option_map v.d_b_cluster_snapshot_identifier + (fun f -> + ("d_b_cluster_snapshot_identifier", (String.to_json f))); + Util.option_map v.d_b_cluster_identifier + (fun f -> ("d_b_cluster_identifier", (String.to_json f)))]) + let of_json j = + { + d_b_cluster_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_identifier") + String.of_json); + d_b_cluster_snapshot_identifier = + (Util.option_map (Json.lookup j "d_b_cluster_snapshot_identifier") + String.of_json); + snapshot_type = + (Util.option_map (Json.lookup j "snapshot_type") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ModifyEventSubscriptionMessage = + struct + type t = + { + subscription_name: String.t ; + sns_topic_arn: String.t option ; + source_type: String.t option ; + event_categories: EventCategoriesList.t ; + enabled: Boolean.t option } + let make ~subscription_name ?sns_topic_arn ?source_type + ?(event_categories= []) ?enabled () = + { + subscription_name; + sns_topic_arn; + source_type; + event_categories; + enabled + } + let parse xml = + Some + { + subscription_name = + (Xml.required "SubscriptionName" + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse)); + sns_topic_arn = + (Util.option_bind (Xml.member "SnsTopicArn" xml) String.parse); + source_type = + (Util.option_bind (Xml.member "SourceType" xml) String.parse); + event_categories = + (Util.of_option [] + (Util.option_bind (Xml.member "EventCategories" xml) + EventCategoriesList.parse)); + enabled = + (Util.option_bind (Xml.member "Enabled" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> Query.Pair ("Enabled", (Boolean.to_query f))); + Some (Query.Pair - ( "ReservedDBInstancesOfferingId" - , String.to_query v.reserved_d_b_instances_offering_id )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.d_b_instance_count (fun f -> - "d_b_instance_count", Integer.to_json f) - ; Util.option_map v.reserved_d_b_instance_id (fun f -> - "reserved_d_b_instance_id", String.to_json f) - ; Some - ( "reserved_d_b_instances_offering_id" - , String.to_json v.reserved_d_b_instances_offering_id ) - ]) - - let of_json j = - { reserved_d_b_instances_offering_id = - String.of_json - (Util.of_option_exn (Json.lookup j "reserved_d_b_instances_offering_id")) - ; reserved_d_b_instance_id = - Util.option_map (Json.lookup j "reserved_d_b_instance_id") String.of_json - ; d_b_instance_count = - Util.option_map (Json.lookup j "d_b_instance_count") Integer.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module KMSKeyNotAccessibleFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeEventCategoriesMessage = struct - type t = - { source_type : String.t option - ; filters : FilterList.t - } - - let make ?source_type ?(filters = []) () = { source_type; filters } - - let parse xml = - Some - { source_type = Util.option_bind (Xml.member "SourceType" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.source_type (fun f -> - Query.Pair ("SourceType", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.source_type (fun f -> "source_type", String.to_json f) - ]) - - let of_json j = - { source_type = Util.option_map (Json.lookup j "source_type") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module CreateDBParameterGroupMessage = struct - type t = - { d_b_parameter_group_name : String.t - ; d_b_parameter_group_family : String.t - ; description : String.t - ; tags : TagList.t - } - - let make - ~d_b_parameter_group_name - ~d_b_parameter_group_family - ~description - ?(tags = []) - () = - { d_b_parameter_group_name; d_b_parameter_group_family; description; tags } - - let parse xml = - Some - { d_b_parameter_group_name = - Xml.required - "DBParameterGroupName" - (Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse) - ; d_b_parameter_group_family = - Xml.required - "DBParameterGroupFamily" - (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse) - ; description = - Xml.required - "Description" - (Util.option_bind (Xml.member "Description" xml) String.parse) - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Some (Query.Pair ("Description", String.to_query v.description)) - ; Some + ("EventCategories.member", + (EventCategoriesList.to_query v.event_categories))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (String.to_query f))); + Util.option_map v.sns_topic_arn + (fun f -> Query.Pair ("SnsTopicArn", (String.to_query f))); + Some (Query.Pair - ("DBParameterGroupFamily", String.to_query v.d_b_parameter_group_family)) - ; Some + ("SubscriptionName", (String.to_query v.subscription_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.enabled + (fun f -> ("enabled", (Boolean.to_json f))); + Some + ("event_categories", + (EventCategoriesList.to_json v.event_categories)); + Util.option_map v.source_type + (fun f -> ("source_type", (String.to_json f))); + Util.option_map v.sns_topic_arn + (fun f -> ("sns_topic_arn", (String.to_json f))); + Some ("subscription_name", (String.to_json v.subscription_name))]) + let of_json j = + { + subscription_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "subscription_name"))); + sns_topic_arn = + (Util.option_map (Json.lookup j "sns_topic_arn") String.of_json); + source_type = + (Util.option_map (Json.lookup j "source_type") String.of_json); + event_categories = + (EventCategoriesList.of_json + (Util.of_option_exn (Json.lookup j "event_categories"))); + enabled = (Util.option_map (Json.lookup j "enabled") Boolean.of_json) + } + end +module RemoveTagsFromResourceMessage = + struct + type t = { + resource_name: String.t ; + tag_keys: KeyList.t } + let make ~resource_name ~tag_keys () = { resource_name; tag_keys } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)); + tag_keys = + (Xml.required "TagKeys" + (Util.option_bind (Xml.member "TagKeys" xml) KeyList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("TagKeys.member", (KeyList.to_query v.tag_keys))); + Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tag_keys", (KeyList.to_json v.tag_keys)); + Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))); + tag_keys = + (KeyList.of_json (Util.of_option_exn (Json.lookup j "tag_keys"))) + } + end +module PurchaseReservedDBInstancesOfferingMessage = + struct + type t = + { + reserved_d_b_instances_offering_id: String.t ; + reserved_d_b_instance_id: String.t option ; + d_b_instance_count: Integer.t option ; + tags: TagList.t } + let make ~reserved_d_b_instances_offering_id ?reserved_d_b_instance_id + ?d_b_instance_count ?(tags= []) () = + { + reserved_d_b_instances_offering_id; + reserved_d_b_instance_id; + d_b_instance_count; + tags + } + let parse xml = + Some + { + reserved_d_b_instances_offering_id = + (Xml.required "ReservedDBInstancesOfferingId" + (Util.option_bind + (Xml.member "ReservedDBInstancesOfferingId" xml) + String.parse)); + reserved_d_b_instance_id = + (Util.option_bind (Xml.member "ReservedDBInstanceId" xml) + String.parse); + d_b_instance_count = + (Util.option_bind (Xml.member "DBInstanceCount" xml) + Integer.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.d_b_instance_count + (fun f -> Query.Pair ("DBInstanceCount", (Integer.to_query f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> + Query.Pair ("ReservedDBInstanceId", (String.to_query f))); + Some (Query.Pair - ("DBParameterGroupName", String.to_query v.d_b_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Some ("description", String.to_json v.description) - ; Some ("d_b_parameter_group_family", String.to_json v.d_b_parameter_group_family) - ; Some ("d_b_parameter_group_name", String.to_json v.d_b_parameter_group_name) - ]) - - let of_json j = - { d_b_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name")) - ; d_b_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family")) - ; description = String.of_json (Util.of_option_exn (Json.lookup j "description")) - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module AuthorizationQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDBParametersMessage = struct - type t = - { d_b_parameter_group_name : String.t - ; source : String.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~d_b_parameter_group_name ?source ?(filters = []) ?max_records ?marker () = - { d_b_parameter_group_name; source; filters; max_records; marker } - - let parse xml = - Some - { d_b_parameter_group_name = - Xml.required - "DBParameterGroupName" - (Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse) - ; source = Util.option_bind (Xml.member "Source" xml) String.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.source (fun f -> Query.Pair ("Source", String.to_query f)) - ; Some + ("ReservedDBInstancesOfferingId", + (String.to_query v.reserved_d_b_instances_offering_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.d_b_instance_count + (fun f -> ("d_b_instance_count", (Integer.to_json f))); + Util.option_map v.reserved_d_b_instance_id + (fun f -> ("reserved_d_b_instance_id", (String.to_json f))); + Some + ("reserved_d_b_instances_offering_id", + (String.to_json v.reserved_d_b_instances_offering_id))]) + let of_json j = + { + reserved_d_b_instances_offering_id = + (String.of_json + (Util.of_option_exn + (Json.lookup j "reserved_d_b_instances_offering_id"))); + reserved_d_b_instance_id = + (Util.option_map (Json.lookup j "reserved_d_b_instance_id") + String.of_json); + d_b_instance_count = + (Util.option_map (Json.lookup j "d_b_instance_count") + Integer.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module KMSKeyNotAccessibleFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeEventCategoriesMessage = + struct + type t = { + source_type: String.t option ; + filters: FilterList.t } + let make ?source_type ?(filters= []) () = { source_type; filters } + let parse xml = + Some + { + source_type = + (Util.option_bind (Xml.member "SourceType" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.source_type + (fun f -> Query.Pair ("SourceType", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.source_type + (fun f -> ("source_type", (String.to_json f)))]) + let of_json j = + { + source_type = + (Util.option_map (Json.lookup j "source_type") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module CreateDBParameterGroupMessage = + struct + type t = + { + d_b_parameter_group_name: String.t ; + d_b_parameter_group_family: String.t ; + description: String.t ; + tags: TagList.t } + let make ~d_b_parameter_group_name ~d_b_parameter_group_family + ~description ?(tags= []) () = + { + d_b_parameter_group_name; + d_b_parameter_group_family; + description; + tags + } + let parse xml = + Some + { + d_b_parameter_group_name = + (Xml.required "DBParameterGroupName" + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse)); + d_b_parameter_group_family = + (Xml.required "DBParameterGroupFamily" + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse)); + description = + (Xml.required "Description" + (Util.option_bind (Xml.member "Description" xml) String.parse)); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Some (Query.Pair ("Description", (String.to_query v.description))); + Some (Query.Pair - ("DBParameterGroupName", String.to_query v.d_b_parameter_group_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.source (fun f -> "source", String.to_json f) - ; Some ("d_b_parameter_group_name", String.to_json v.d_b_parameter_group_name) - ]) - - let of_json j = - { d_b_parameter_group_name = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name")) - ; source = Util.option_map (Json.lookup j "source") String.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DBParameterGroupNameMessage = struct - type t = { d_b_parameter_group_name : String.t option } - - let make ?d_b_parameter_group_name () = { d_b_parameter_group_name } - - let parse xml = - Some - { d_b_parameter_group_name = - Util.option_bind (Xml.member "DBParameterGroupName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group_name (fun f -> - Query.Pair ("DBParameterGroupName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_parameter_group_name (fun f -> - "d_b_parameter_group_name", String.to_json f) - ]) - - let of_json j = - { d_b_parameter_group_name = - Util.option_map (Json.lookup j "d_b_parameter_group_name") String.of_json - } -end - -module DBSubnetGroupNotFoundFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeOrderableDBInstanceOptionsMessage = struct - type t = - { engine : String.t - ; engine_version : String.t option - ; d_b_instance_class : String.t option - ; license_model : String.t option - ; vpc : Boolean.t option - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make - ~engine - ?engine_version - ?d_b_instance_class - ?license_model - ?vpc - ?(filters = []) - ?max_records - ?marker - () = - { engine - ; engine_version - ; d_b_instance_class - ; license_model - ; vpc - ; filters - ; max_records - ; marker - } - - let parse xml = - Some - { engine = - Xml.required "Engine" (Util.option_bind (Xml.member "Engine" xml) String.parse) - ; engine_version = Util.option_bind (Xml.member "EngineVersion" xml) String.parse - ; d_b_instance_class = - Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse - ; license_model = Util.option_bind (Xml.member "LicenseModel" xml) String.parse - ; vpc = Util.option_bind (Xml.member "Vpc" xml) Boolean.parse - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Util.option_map v.vpc (fun f -> Query.Pair ("Vpc", Boolean.to_query f)) - ; Util.option_map v.license_model (fun f -> - Query.Pair ("LicenseModel", String.to_query f)) - ; Util.option_map v.d_b_instance_class (fun f -> - Query.Pair ("DBInstanceClass", String.to_query f)) - ; Util.option_map v.engine_version (fun f -> - Query.Pair ("EngineVersion", String.to_query f)) - ; Some (Query.Pair ("Engine", String.to_query v.engine)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Util.option_map v.vpc (fun f -> "vpc", Boolean.to_json f) - ; Util.option_map v.license_model (fun f -> "license_model", String.to_json f) - ; Util.option_map v.d_b_instance_class (fun f -> - "d_b_instance_class", String.to_json f) - ; Util.option_map v.engine_version (fun f -> "engine_version", String.to_json f) - ; Some ("engine", String.to_json v.engine) - ]) - - let of_json j = - { engine = String.of_json (Util.of_option_exn (Json.lookup j "engine")) - ; engine_version = Util.option_map (Json.lookup j "engine_version") String.of_json - ; d_b_instance_class = - Util.option_map (Json.lookup j "d_b_instance_class") String.of_json - ; license_model = Util.option_map (Json.lookup j "license_model") String.of_json - ; vpc = Util.option_map (Json.lookup j "vpc") Boolean.of_json - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module DBClusterSnapshotMessage = struct - type t = - { marker : String.t option - ; d_b_cluster_snapshots : DBClusterSnapshotList.t - } - - let make ?marker ?(d_b_cluster_snapshots = []) () = { marker; d_b_cluster_snapshots } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_cluster_snapshots = - Util.of_option - [] - (Util.option_bind - (Xml.member "DBClusterSnapshots" xml) - DBClusterSnapshotList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBParameterGroupFamily", + (String.to_query v.d_b_parameter_group_family))); + Some (Query.Pair - ( "DBClusterSnapshots.member" - , DBClusterSnapshotList.to_query v.d_b_cluster_snapshots )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "d_b_cluster_snapshots" - , DBClusterSnapshotList.to_json v.d_b_cluster_snapshots ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_cluster_snapshots = - DBClusterSnapshotList.of_json - (Util.of_option_exn (Json.lookup j "d_b_cluster_snapshots")) - } -end - -module EventSubscriptionQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListTagsForResourceMessage = struct - type t = - { resource_name : String.t - ; filters : FilterList.t - } - - let make ~resource_name ?(filters = []) () = { resource_name; filters } - - let parse xml = - Some - { resource_name = - Xml.required - "ResourceName" - (Util.option_bind (Xml.member "ResourceName" xml) String.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Some (Query.Pair ("ResourceName", String.to_query v.resource_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filters", FilterList.to_json v.filters) - ; Some ("resource_name", String.to_json v.resource_name) - ]) - - let of_json j = - { resource_name = String.of_json (Util.of_option_exn (Json.lookup j "resource_name")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - } -end - -module DescribeEngineDefaultParametersMessage = struct - type t = - { d_b_parameter_group_family : String.t - ; filters : FilterList.t - ; max_records : Integer.t option - ; marker : String.t option - } - - let make ~d_b_parameter_group_family ?(filters = []) ?max_records ?marker () = - { d_b_parameter_group_family; filters; max_records; marker } - - let parse xml = - Some - { d_b_parameter_group_family = - Xml.required - "DBParameterGroupFamily" - (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) String.parse) - ; filters = - Util.of_option [] (Util.option_bind (Xml.member "Filters" xml) FilterList.parse) - ; max_records = Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.max_records (fun f -> - Query.Pair ("MaxRecords", Integer.to_query f)) - ; Some (Query.Pair ("Filters.member", FilterList.to_query v.filters)) - ; Some + ("DBParameterGroupName", + (String.to_query v.d_b_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Some ("description", (String.to_json v.description)); + Some + ("d_b_parameter_group_family", + (String.to_json v.d_b_parameter_group_family)); + Some + ("d_b_parameter_group_name", + (String.to_json v.d_b_parameter_group_name))]) + let of_json j = + { + d_b_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name"))); + d_b_parameter_group_family = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family"))); + description = + (String.of_json (Util.of_option_exn (Json.lookup j "description"))); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module AuthorizationQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDBParametersMessage = + struct + type t = + { + d_b_parameter_group_name: String.t ; + source: String.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~d_b_parameter_group_name ?source ?(filters= []) ?max_records + ?marker () = + { d_b_parameter_group_name; source; filters; max_records; marker } + let parse xml = + Some + { + d_b_parameter_group_name = + (Xml.required "DBParameterGroupName" + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse)); + source = (Util.option_bind (Xml.member "Source" xml) String.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.source + (fun f -> Query.Pair ("Source", (String.to_query f))); + Some (Query.Pair - ("DBParameterGroupFamily", String.to_query v.d_b_parameter_group_family)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.max_records (fun f -> "max_records", Integer.to_json f) - ; Some ("filters", FilterList.to_json v.filters) - ; Some ("d_b_parameter_group_family", String.to_json v.d_b_parameter_group_family) - ]) - - let of_json j = - { d_b_parameter_group_family = - String.of_json (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family")) - ; filters = FilterList.of_json (Util.of_option_exn (Json.lookup j "filters")) - ; max_records = Util.option_map (Json.lookup j "max_records") Integer.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - } -end - -module ReservedDBInstancesOfferingMessage = struct - type t = - { marker : String.t option - ; reserved_d_b_instances_offerings : ReservedDBInstancesOfferingList.t - } - - let make ?marker ?(reserved_d_b_instances_offerings = []) () = - { marker; reserved_d_b_instances_offerings } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; reserved_d_b_instances_offerings = - Util.of_option - [] - (Util.option_bind - (Xml.member "ReservedDBInstancesOfferings" xml) - ReservedDBInstancesOfferingList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBParameterGroupName", + (String.to_query v.d_b_parameter_group_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.source (fun f -> ("source", (String.to_json f))); + Some + ("d_b_parameter_group_name", + (String.to_json v.d_b_parameter_group_name))]) + let of_json j = + { + d_b_parameter_group_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_name"))); + source = (Util.option_map (Json.lookup j "source") String.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DBParameterGroupNameMessage = + struct + type t = { + d_b_parameter_group_name: String.t option } + let make ?d_b_parameter_group_name () = { d_b_parameter_group_name } + let parse xml = + Some + { + d_b_parameter_group_name = + (Util.option_bind (Xml.member "DBParameterGroupName" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group_name + (fun f -> + Query.Pair ("DBParameterGroupName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_parameter_group_name + (fun f -> ("d_b_parameter_group_name", (String.to_json f)))]) + let of_json j = + { + d_b_parameter_group_name = + (Util.option_map (Json.lookup j "d_b_parameter_group_name") + String.of_json) + } + end +module DBSubnetGroupNotFoundFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeOrderableDBInstanceOptionsMessage = + struct + type t = + { + engine: String.t ; + engine_version: String.t option ; + d_b_instance_class: String.t option ; + license_model: String.t option ; + vpc: Boolean.t option ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~engine ?engine_version ?d_b_instance_class ?license_model + ?vpc ?(filters= []) ?max_records ?marker () = + { + engine; + engine_version; + d_b_instance_class; + license_model; + vpc; + filters; + max_records; + marker + } + let parse xml = + Some + { + engine = + (Xml.required "Engine" + (Util.option_bind (Xml.member "Engine" xml) String.parse)); + engine_version = + (Util.option_bind (Xml.member "EngineVersion" xml) String.parse); + d_b_instance_class = + (Util.option_bind (Xml.member "DBInstanceClass" xml) String.parse); + license_model = + (Util.option_bind (Xml.member "LicenseModel" xml) String.parse); + vpc = (Util.option_bind (Xml.member "Vpc" xml) Boolean.parse); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Util.option_map v.vpc + (fun f -> Query.Pair ("Vpc", (Boolean.to_query f))); + Util.option_map v.license_model + (fun f -> Query.Pair ("LicenseModel", (String.to_query f))); + Util.option_map v.d_b_instance_class + (fun f -> Query.Pair ("DBInstanceClass", (String.to_query f))); + Util.option_map v.engine_version + (fun f -> Query.Pair ("EngineVersion", (String.to_query f))); + Some (Query.Pair ("Engine", (String.to_query v.engine)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Util.option_map v.vpc (fun f -> ("vpc", (Boolean.to_json f))); + Util.option_map v.license_model + (fun f -> ("license_model", (String.to_json f))); + Util.option_map v.d_b_instance_class + (fun f -> ("d_b_instance_class", (String.to_json f))); + Util.option_map v.engine_version + (fun f -> ("engine_version", (String.to_json f))); + Some ("engine", (String.to_json v.engine))]) + let of_json j = + { + engine = + (String.of_json (Util.of_option_exn (Json.lookup j "engine"))); + engine_version = + (Util.option_map (Json.lookup j "engine_version") String.of_json); + d_b_instance_class = + (Util.option_map (Json.lookup j "d_b_instance_class") + String.of_json); + license_model = + (Util.option_map (Json.lookup j "license_model") String.of_json); + vpc = (Util.option_map (Json.lookup j "vpc") Boolean.of_json); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module DBClusterSnapshotMessage = + struct + type t = + { + marker: String.t option ; + d_b_cluster_snapshots: DBClusterSnapshotList.t } + let make ?marker ?(d_b_cluster_snapshots= []) () = + { marker; d_b_cluster_snapshots } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_cluster_snapshots = + (Util.of_option [] + (Util.option_bind (Xml.member "DBClusterSnapshots" xml) + DBClusterSnapshotList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBClusterSnapshots.member", + (DBClusterSnapshotList.to_query v.d_b_cluster_snapshots))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_cluster_snapshots", + (DBClusterSnapshotList.to_json v.d_b_cluster_snapshots)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_cluster_snapshots = + (DBClusterSnapshotList.of_json + (Util.of_option_exn (Json.lookup j "d_b_cluster_snapshots"))) + } + end +module EventSubscriptionQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListTagsForResourceMessage = + struct + type t = { + resource_name: String.t ; + filters: FilterList.t } + let make ~resource_name ?(filters= []) () = { resource_name; filters } + let parse xml = + Some + { + resource_name = + (Xml.required "ResourceName" + (Util.option_bind (Xml.member "ResourceName" xml) String.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Some + (Query.Pair ("ResourceName", (String.to_query v.resource_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filters", (FilterList.to_json v.filters)); + Some ("resource_name", (String.to_json v.resource_name))]) + let of_json j = + { + resource_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "resource_name"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))) + } + end +module DescribeEngineDefaultParametersMessage = + struct + type t = + { + d_b_parameter_group_family: String.t ; + filters: FilterList.t ; + max_records: Integer.t option ; + marker: String.t option } + let make ~d_b_parameter_group_family ?(filters= []) ?max_records + ?marker () = + { d_b_parameter_group_family; filters; max_records; marker } + let parse xml = + Some + { + d_b_parameter_group_family = + (Xml.required "DBParameterGroupFamily" + (Util.option_bind (Xml.member "DBParameterGroupFamily" xml) + String.parse)); + filters = + (Util.of_option [] + (Util.option_bind (Xml.member "Filters" xml) FilterList.parse)); + max_records = + (Util.option_bind (Xml.member "MaxRecords" xml) Integer.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.max_records + (fun f -> Query.Pair ("MaxRecords", (Integer.to_query f))); + Some + (Query.Pair ("Filters.member", (FilterList.to_query v.filters))); + Some (Query.Pair - ( "ReservedDBInstancesOfferings.member" - , ReservedDBInstancesOfferingList.to_query - v.reserved_d_b_instances_offerings )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "reserved_d_b_instances_offerings" - , ReservedDBInstancesOfferingList.to_json v.reserved_d_b_instances_offerings - ) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; reserved_d_b_instances_offerings = - ReservedDBInstancesOfferingList.of_json - (Util.of_option_exn (Json.lookup j "reserved_d_b_instances_offerings")) - } -end - -module DBClusterMessage = struct - type t = - { marker : String.t option - ; d_b_clusters : DBClusterList.t - } - - let make ?marker ?(d_b_clusters = []) () = { marker; d_b_clusters } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_clusters = - Util.of_option - [] - (Util.option_bind (Xml.member "DBClusters" xml) DBClusterList.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DBClusters.member", DBClusterList.to_query v.d_b_clusters)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_clusters", DBClusterList.to_json v.d_b_clusters) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_clusters = - DBClusterList.of_json (Util.of_option_exn (Json.lookup j "d_b_clusters")) - } -end - -module InstanceQuotaExceededFault = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateDBSubnetGroupResult = struct - type t = { d_b_subnet_group : DBSubnetGroup.t option } - - let make ?d_b_subnet_group () = { d_b_subnet_group } - - let parse xml = - Some - { d_b_subnet_group = - Util.option_bind (Xml.member "DBSubnetGroup" xml) DBSubnetGroup.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.d_b_subnet_group (fun f -> - Query.Pair ("DBSubnetGroup", DBSubnetGroup.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.d_b_subnet_group (fun f -> - "d_b_subnet_group", DBSubnetGroup.to_json f) - ]) - - let of_json j = - { d_b_subnet_group = - Util.option_map (Json.lookup j "d_b_subnet_group") DBSubnetGroup.of_json - } -end - -module RemoveSourceIdentifierFromSubscriptionMessage = struct - type t = - { subscription_name : String.t - ; source_identifier : String.t - } - - let make ~subscription_name ~source_identifier () = - { subscription_name; source_identifier } - - let parse xml = - Some - { subscription_name = - Xml.required - "SubscriptionName" - (Util.option_bind (Xml.member "SubscriptionName" xml) String.parse) - ; source_identifier = - Xml.required - "SourceIdentifier" - (Util.option_bind (Xml.member "SourceIdentifier" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("SourceIdentifier", String.to_query v.source_identifier)) - ; Some (Query.Pair ("SubscriptionName", String.to_query v.subscription_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("source_identifier", String.to_json v.source_identifier) - ; Some ("subscription_name", String.to_json v.subscription_name) - ]) - - let of_json j = - { subscription_name = - String.of_json (Util.of_option_exn (Json.lookup j "subscription_name")) - ; source_identifier = - String.of_json (Util.of_option_exn (Json.lookup j "source_identifier")) - } -end - -module DBSecurityGroupMessage = struct - type t = - { marker : String.t option - ; d_b_security_groups : DBSecurityGroups.t - } - - let make ?marker ?(d_b_security_groups = []) () = { marker; d_b_security_groups } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; d_b_security_groups = - Util.of_option - [] - (Util.option_bind (Xml.member "DBSecurityGroups" xml) DBSecurityGroups.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DBParameterGroupFamily", + (String.to_query v.d_b_parameter_group_family)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.marker + (fun f -> ("marker", (String.to_json f))); + Util.option_map v.max_records + (fun f -> ("max_records", (Integer.to_json f))); + Some ("filters", (FilterList.to_json v.filters)); + Some + ("d_b_parameter_group_family", + (String.to_json v.d_b_parameter_group_family))]) + let of_json j = + { + d_b_parameter_group_family = + (String.of_json + (Util.of_option_exn (Json.lookup j "d_b_parameter_group_family"))); + filters = + (FilterList.of_json (Util.of_option_exn (Json.lookup j "filters"))); + max_records = + (Util.option_map (Json.lookup j "max_records") Integer.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json) + } + end +module ReservedDBInstancesOfferingMessage = + struct + type t = + { + marker: String.t option ; + reserved_d_b_instances_offerings: ReservedDBInstancesOfferingList.t } + let make ?marker ?(reserved_d_b_instances_offerings= []) () = + { marker; reserved_d_b_instances_offerings } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + reserved_d_b_instances_offerings = + (Util.of_option [] + (Util.option_bind + (Xml.member "ReservedDBInstancesOfferings" xml) + ReservedDBInstancesOfferingList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReservedDBInstancesOfferings.member", + (ReservedDBInstancesOfferingList.to_query + v.reserved_d_b_instances_offerings))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("reserved_d_b_instances_offerings", + (ReservedDBInstancesOfferingList.to_json + v.reserved_d_b_instances_offerings)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + reserved_d_b_instances_offerings = + (ReservedDBInstancesOfferingList.of_json + (Util.of_option_exn + (Json.lookup j "reserved_d_b_instances_offerings"))) + } + end +module DBClusterMessage = + struct + type t = { + marker: String.t option ; + d_b_clusters: DBClusterList.t } + let make ?marker ?(d_b_clusters= []) () = { marker; d_b_clusters } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_clusters = + (Util.of_option [] + (Util.option_bind (Xml.member "DBClusters" xml) + DBClusterList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBClusters.member", + (DBClusterList.to_query v.d_b_clusters))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("d_b_clusters", (DBClusterList.to_json v.d_b_clusters)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_clusters = + (DBClusterList.of_json + (Util.of_option_exn (Json.lookup j "d_b_clusters"))) + } + end +module InstanceQuotaExceededFault = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateDBSubnetGroupResult = + struct + type t = { + d_b_subnet_group: DBSubnetGroup.t option } + let make ?d_b_subnet_group () = { d_b_subnet_group } + let parse xml = + Some + { + d_b_subnet_group = + (Util.option_bind (Xml.member "DBSubnetGroup" xml) + DBSubnetGroup.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.d_b_subnet_group + (fun f -> + Query.Pair ("DBSubnetGroup", (DBSubnetGroup.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.d_b_subnet_group + (fun f -> ("d_b_subnet_group", (DBSubnetGroup.to_json f)))]) + let of_json j = + { + d_b_subnet_group = + (Util.option_map (Json.lookup j "d_b_subnet_group") + DBSubnetGroup.of_json) + } + end +module RemoveSourceIdentifierFromSubscriptionMessage = + struct + type t = { + subscription_name: String.t ; + source_identifier: String.t } + let make ~subscription_name ~source_identifier () = + { subscription_name; source_identifier } + let parse xml = + Some + { + subscription_name = + (Xml.required "SubscriptionName" + (Util.option_bind (Xml.member "SubscriptionName" xml) + String.parse)); + source_identifier = + (Xml.required "SourceIdentifier" + (Util.option_bind (Xml.member "SourceIdentifier" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("SourceIdentifier", (String.to_query v.source_identifier))); + Some (Query.Pair - ( "DBSecurityGroups.member" - , DBSecurityGroups.to_query v.d_b_security_groups )) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("d_b_security_groups", DBSecurityGroups.to_json v.d_b_security_groups) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; d_b_security_groups = - DBSecurityGroups.of_json - (Util.of_option_exn (Json.lookup j "d_b_security_groups")) - } -end + ("SubscriptionName", (String.to_query v.subscription_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("source_identifier", (String.to_json v.source_identifier)); + Some ("subscription_name", (String.to_json v.subscription_name))]) + let of_json j = + { + subscription_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "subscription_name"))); + source_identifier = + (String.of_json + (Util.of_option_exn (Json.lookup j "source_identifier"))) + } + end +module DBSecurityGroupMessage = + struct + type t = + { + marker: String.t option ; + d_b_security_groups: DBSecurityGroups.t } + let make ?marker ?(d_b_security_groups= []) () = + { marker; d_b_security_groups } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + d_b_security_groups = + (Util.of_option [] + (Util.option_bind (Xml.member "DBSecurityGroups" xml) + DBSecurityGroups.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DBSecurityGroups.member", + (DBSecurityGroups.to_query v.d_b_security_groups))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("d_b_security_groups", + (DBSecurityGroups.to_json v.d_b_security_groups)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + d_b_security_groups = + (DBSecurityGroups.of_json + (Util.of_option_exn (Json.lookup j "d_b_security_groups"))) + } + end \ No newline at end of file diff --git a/libraries/rds/lib_test/dune b/libraries/rds/lib_test/dune index 83d01337c..85928f5a4 100644 --- a/libraries/rds/lib_test/dune +++ b/libraries/rds/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_rds_test) - (libraries aws aws_rds aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_rds aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/rds/lib_test/test_async.ml b/libraries/rds/lib_test/test_async.ml index f4a17d08f..afb2a3d6a 100644 --- a/libraries/rds/lib_test/test_async.ml +++ b/libraries/rds/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_rds_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/rds/lib_test/test_lwt.ml b/libraries/rds/lib_test/test_lwt.ml index 2351e4491..0f036a527 100644 --- a/libraries/rds/lib_test/test_lwt.ml +++ b/libraries/rds/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_rds_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/route53/lib/associateVPCWithHostedZone.ml b/libraries/route53/lib/associateVPCWithHostedZone.ml index 061b00d1c..913174920 100644 --- a/libraries/route53/lib/associateVPCWithHostedZone.ml +++ b/libraries/route53/lib/associateVPCWithHostedZone.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = AssociateVPCWithHostedZoneRequest.t - type output = AssociateVPCWithHostedZoneResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "AssociateVPCWithHostedZone" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["AssociateVPCWithHostedZone"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AssociateVPCWithHostedZoneRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AssociateVPCWithHostedZoneRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp AssociateVPCWithHostedZoneResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed AssociateVPCWithHostedZoneResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AssociateVPCWithHostedZoneResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssociateVPCWithHostedZoneResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssociateVPCWithHostedZoneResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/associateVPCWithHostedZone.mli b/libraries/route53/lib/associateVPCWithHostedZone.mli index e760193ea..91777e0f3 100644 --- a/libraries/route53/lib/associateVPCWithHostedZone.mli +++ b/libraries/route53/lib/associateVPCWithHostedZone.mli @@ -1,10 +1,7 @@ open Types - type input = AssociateVPCWithHostedZoneRequest.t - type output = AssociateVPCWithHostedZoneResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/changeResourceRecordSets.ml b/libraries/route53/lib/changeResourceRecordSets.ml index a821ff3c1..870fec619 100644 --- a/libraries/route53/lib/changeResourceRecordSets.ml +++ b/libraries/route53/lib/changeResourceRecordSets.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ChangeResourceRecordSetsRequest.t - type output = ChangeResourceRecordSetsResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ChangeResourceRecordSets" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["ChangeResourceRecordSets"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ChangeResourceRecordSetsRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ChangeResourceRecordSetsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ChangeResourceRecordSetsResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ChangeResourceRecordSetsResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ChangeResourceRecordSetsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ChangeResourceRecordSetsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ChangeResourceRecordSetsResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/changeResourceRecordSets.mli b/libraries/route53/lib/changeResourceRecordSets.mli index 620cb9e43..695997cdf 100644 --- a/libraries/route53/lib/changeResourceRecordSets.mli +++ b/libraries/route53/lib/changeResourceRecordSets.mli @@ -1,10 +1,7 @@ open Types - type input = ChangeResourceRecordSetsRequest.t - type output = ChangeResourceRecordSetsResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/changeTagsForResource.ml b/libraries/route53/lib/changeTagsForResource.ml index 29b6473b3..f3b60a351 100644 --- a/libraries/route53/lib/changeTagsForResource.ml +++ b/libraries/route53/lib/changeTagsForResource.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = ChangeTagsForResourceRequest.t - type output = unit - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ChangeTagsForResource" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ChangeTagsForResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ChangeTagsForResourceRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ChangeTagsForResourceRequest.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 \ No newline at end of file diff --git a/libraries/route53/lib/changeTagsForResource.mli b/libraries/route53/lib/changeTagsForResource.mli index f98d8cd19..ba69457ab 100644 --- a/libraries/route53/lib/changeTagsForResource.mli +++ b/libraries/route53/lib/changeTagsForResource.mli @@ -1,10 +1,7 @@ open Types - type input = ChangeTagsForResourceRequest.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 \ No newline at end of file diff --git a/libraries/route53/lib/createHealthCheck.ml b/libraries/route53/lib/createHealthCheck.ml index 0b8ccac3a..74e14e952 100644 --- a/libraries/route53/lib/createHealthCheck.ml +++ b/libraries/route53/lib/createHealthCheck.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = CreateHealthCheckRequest.t - type output = CreateHealthCheckResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "CreateHealthCheck" ] ] + [("Version", ["2013-04-01"]); ("Action", ["CreateHealthCheck"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateHealthCheckRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateHealthCheckRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateHealthCheckResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateHealthCheckResponse.parse) + Util.or_error (Util.option_bind resp CreateHealthCheckResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateHealthCheckResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateHealthCheckResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateHealthCheckResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateHealthCheckResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/createHealthCheck.mli b/libraries/route53/lib/createHealthCheck.mli index 6fbe79a9e..9fe4dc609 100644 --- a/libraries/route53/lib/createHealthCheck.mli +++ b/libraries/route53/lib/createHealthCheck.mli @@ -1,10 +1,7 @@ open Types - type input = CreateHealthCheckRequest.t - type output = CreateHealthCheckResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/createHostedZone.ml b/libraries/route53/lib/createHostedZone.ml index 9aa33fb51..bcfb866f6 100644 --- a/libraries/route53/lib/createHostedZone.ml +++ b/libraries/route53/lib/createHostedZone.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = CreateHostedZoneRequest.t - type output = CreateHostedZoneResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "CreateHostedZone" ] ] + [("Version", ["2013-04-01"]); ("Action", ["CreateHostedZone"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateHostedZoneRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateHostedZoneRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateHostedZoneResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateHostedZoneResponse.parse) + Util.or_error (Util.option_bind resp CreateHostedZoneResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateHostedZoneResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateHostedZoneResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateHostedZoneResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateHostedZoneResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/createHostedZone.mli b/libraries/route53/lib/createHostedZone.mli index 9750e0db6..96eaaf5da 100644 --- a/libraries/route53/lib/createHostedZone.mli +++ b/libraries/route53/lib/createHostedZone.mli @@ -1,10 +1,7 @@ open Types - type input = CreateHostedZoneRequest.t - type output = CreateHostedZoneResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/createReusableDelegationSet.ml b/libraries/route53/lib/createReusableDelegationSet.ml index 9ebfb1c8b..c602fd9e6 100644 --- a/libraries/route53/lib/createReusableDelegationSet.ml +++ b/libraries/route53/lib/createReusableDelegationSet.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = CreateReusableDelegationSetRequest.t - type output = CreateReusableDelegationSetResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "CreateReusableDelegationSet" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["CreateReusableDelegationSet"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateReusableDelegationSetRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (CreateReusableDelegationSetRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp CreateReusableDelegationSetResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed CreateReusableDelegationSetResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateReusableDelegationSetResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateReusableDelegationSetResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateReusableDelegationSetResponse - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/createReusableDelegationSet.mli b/libraries/route53/lib/createReusableDelegationSet.mli index 23f7e07aa..061897f62 100644 --- a/libraries/route53/lib/createReusableDelegationSet.mli +++ b/libraries/route53/lib/createReusableDelegationSet.mli @@ -1,10 +1,7 @@ open Types - type input = CreateReusableDelegationSetRequest.t - type output = CreateReusableDelegationSetResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteHealthCheck.ml b/libraries/route53/lib/deleteHealthCheck.ml index af6bbe9e3..f6abd5f30 100644 --- a/libraries/route53/lib/deleteHealthCheck.ml +++ b/libraries/route53/lib/deleteHealthCheck.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteHealthCheckRequest.t - type output = unit - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "DeleteHealthCheck" ] ] + [("Version", ["2013-04-01"]); ("Action", ["DeleteHealthCheck"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteHealthCheckRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteHealthCheckRequest.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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteHealthCheck.mli b/libraries/route53/lib/deleteHealthCheck.mli index 1858647b6..3ba10db03 100644 --- a/libraries/route53/lib/deleteHealthCheck.mli +++ b/libraries/route53/lib/deleteHealthCheck.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteHealthCheckRequest.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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteHostedZone.ml b/libraries/route53/lib/deleteHostedZone.ml index 91c9bc263..ac4880c9c 100644 --- a/libraries/route53/lib/deleteHostedZone.ml +++ b/libraries/route53/lib/deleteHostedZone.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = DeleteHostedZoneRequest.t - type output = DeleteHostedZoneResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "DeleteHostedZone" ] ] + [("Version", ["2013-04-01"]); ("Action", ["DeleteHostedZone"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteHostedZoneRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteHostedZoneRequest.to_query req))))) in + (`DELETE, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DeleteHostedZoneResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DeleteHostedZoneResponse.parse) + Util.or_error (Util.option_bind resp DeleteHostedZoneResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteHostedZoneResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteHostedZoneResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteHostedZoneResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteHostedZoneResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteHostedZone.mli b/libraries/route53/lib/deleteHostedZone.mli index d3fe0b9a6..dce2707f3 100644 --- a/libraries/route53/lib/deleteHostedZone.mli +++ b/libraries/route53/lib/deleteHostedZone.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteHostedZoneRequest.t - type output = DeleteHostedZoneResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteReusableDelegationSet.ml b/libraries/route53/lib/deleteReusableDelegationSet.ml index 6ebe297aa..b8b2f215f 100644 --- a/libraries/route53/lib/deleteReusableDelegationSet.ml +++ b/libraries/route53/lib/deleteReusableDelegationSet.ml @@ -1,37 +1,32 @@ open Types open Aws - type input = DeleteReusableDelegationSetRequest.t - type output = unit - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "DeleteReusableDelegationSet" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["DeleteReusableDelegationSet"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteReusableDelegationSetRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render + (DeleteReusableDelegationSetRequest.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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/deleteReusableDelegationSet.mli b/libraries/route53/lib/deleteReusableDelegationSet.mli index 1180ea519..f175cc107 100644 --- a/libraries/route53/lib/deleteReusableDelegationSet.mli +++ b/libraries/route53/lib/deleteReusableDelegationSet.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteReusableDelegationSetRequest.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 \ No newline at end of file diff --git a/libraries/route53/lib/disassociateVPCFromHostedZone.ml b/libraries/route53/lib/disassociateVPCFromHostedZone.ml index 425dbdbb0..83718682c 100644 --- a/libraries/route53/lib/disassociateVPCFromHostedZone.ml +++ b/libraries/route53/lib/disassociateVPCFromHostedZone.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = DisassociateVPCFromHostedZoneRequest.t - type output = DisassociateVPCFromHostedZoneResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "DisassociateVPCFromHostedZone" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["DisassociateVPCFromHostedZone"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DisassociateVPCFromHostedZoneRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (DisassociateVPCFromHostedZoneRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp DisassociateVPCFromHostedZoneResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DisassociateVPCFromHostedZoneResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DisassociateVPCFromHostedZoneResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DisassociateVPCFromHostedZoneResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DisassociateVPCFromHostedZoneResponse - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/disassociateVPCFromHostedZone.mli b/libraries/route53/lib/disassociateVPCFromHostedZone.mli index 4869bcc9d..eb1d5c759 100644 --- a/libraries/route53/lib/disassociateVPCFromHostedZone.mli +++ b/libraries/route53/lib/disassociateVPCFromHostedZone.mli @@ -1,10 +1,7 @@ open Types - type input = DisassociateVPCFromHostedZoneRequest.t - type output = DisassociateVPCFromHostedZoneResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/dune b/libraries/route53/lib/dune index d95ccb058..78ed25312 100644 --- a/libraries/route53/lib/dune +++ b/libraries/route53/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_route53) + (name aws_route53) (public_name aws-route53) (synopsis "aws-Amazon Route 53") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/route53/lib/errors_internal.ml b/libraries/route53/lib/errors_internal.ml index 07171d748..1953e88ac 100644 --- a/libraries/route53/lib/errors_internal.ml +++ b/libraries/route53/lib/errors_internal.ml @@ -1,92 +1,89 @@ type t = - | AuthFailure - | Blocked - | ConflictingDomainExists - | DelegationSetAlreadyCreated - | DelegationSetAlreadyReusable - | DelegationSetInUse - | DelegationSetNotAvailable - | DelegationSetNotReusable - | DryRunOperation - | HealthCheckAlreadyExists - | HealthCheckInUse - | HealthCheckVersionMismatch - | HostedZoneAlreadyExists - | HostedZoneNotEmpty - | HostedZoneNotFound - | IdempotentParameterMismatch - | IncompatibleVersion - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidArgument - | InvalidChangeBatch - | InvalidClientTokenId - | InvalidDomainName - | InvalidInput - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | InvalidVPCId - | LastVPCAssociation - | LimitsExceeded - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | NoSuchChange - | NoSuchDelegationSet - | NoSuchGeoLocation - | NoSuchHealthCheck - | NoSuchHostedZone - | OptInRequired - | PendingVerification - | PriorRequestNotComplete - | PublicZoneVPCAssociation - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | ThrottlingException - | TooManyHealthChecks - | TooManyHostedZones - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | VPCAssociationNotFound - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | ConflictingDomainExists + | DelegationSetAlreadyCreated + | DelegationSetAlreadyReusable + | DelegationSetInUse + | DelegationSetNotAvailable + | DelegationSetNotReusable + | DryRunOperation + | HealthCheckAlreadyExists + | HealthCheckInUse + | HealthCheckVersionMismatch + | HostedZoneAlreadyExists + | HostedZoneNotEmpty + | HostedZoneNotFound + | IdempotentParameterMismatch + | IncompatibleVersion + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidArgument + | InvalidChangeBatch + | InvalidClientTokenId + | InvalidDomainName + | InvalidInput + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | InvalidVPCId + | LastVPCAssociation + | LimitsExceeded + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | NoSuchChange + | NoSuchDelegationSet + | NoSuchGeoLocation + | NoSuchHealthCheck + | NoSuchHostedZone + | OptInRequired + | PendingVerification + | PriorRequestNotComplete + | PublicZoneVPCAssociation + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | ThrottlingException + | TooManyHealthChecks + | TooManyHostedZones + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | VPCAssociationNotFound + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -147,7 +144,6 @@ let to_http_code e = | VPCAssociationNotFound -> Some 404 | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -208,7 +204,6 @@ let to_string e = | VPCAssociationNotFound -> "VPCAssociationNotFound" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -269,4 +264,4 @@ let of_string e = | "VPCAssociationNotFound" -> Some VPCAssociationNotFound | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/route53/lib/getChange.ml b/libraries/route53/lib/getChange.ml index efaeafcc2..9e8eae0ea 100644 --- a/libraries/route53/lib/getChange.ml +++ b/libraries/route53/lib/getChange.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = GetChangeRequest.t - type output = GetChangeResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetChange" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2013-04-01"]); ("Action", ["GetChange"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetChangeRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetChangeRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetChangeResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetChangeResponse.parse) + Util.or_error (Util.option_bind resp GetChangeResponse.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetChangeResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetChangeResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetChangeResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetChangeResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getChange.mli b/libraries/route53/lib/getChange.mli index 287242580..5b8ea4dd4 100644 --- a/libraries/route53/lib/getChange.mli +++ b/libraries/route53/lib/getChange.mli @@ -1,10 +1,7 @@ open Types - type input = GetChangeRequest.t - type output = GetChangeResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getCheckerIpRanges.ml b/libraries/route53/lib/getCheckerIpRanges.ml index 10a0af632..fc93af22c 100644 --- a/libraries/route53/lib/getCheckerIpRanges.ml +++ b/libraries/route53/lib/getCheckerIpRanges.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = unit - type output = GetCheckerIpRangesResponse.t - type error = Errors_internal.t - let service = "route53" - 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))) - [ "Version", [ "2013-04-01" ]; "Action", [ "GetCheckerIpRanges" ] ] - in - `GET, uri, [] - + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + [("Version", ["2013-04-01"]); ("Action", ["GetCheckerIpRanges"])] in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetCheckerIpRangesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetCheckerIpRangesResponse.parse) + Util.or_error (Util.option_bind resp GetCheckerIpRangesResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetCheckerIpRangesResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetCheckerIpRangesResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetCheckerIpRangesResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetCheckerIpRangesResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getCheckerIpRanges.mli b/libraries/route53/lib/getCheckerIpRanges.mli index 70548c00b..5cc253d2c 100644 --- a/libraries/route53/lib/getCheckerIpRanges.mli +++ b/libraries/route53/lib/getCheckerIpRanges.mli @@ -1,10 +1,7 @@ open Types - type input = unit - type output = GetCheckerIpRangesResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getGeoLocation.ml b/libraries/route53/lib/getGeoLocation.ml index 409dbf989..78005a1c7 100644 --- a/libraries/route53/lib/getGeoLocation.ml +++ b/libraries/route53/lib/getGeoLocation.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetGeoLocationRequest.t - type output = GetGeoLocationResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetGeoLocation" ] ] + [("Version", ["2013-04-01"]); ("Action", ["GetGeoLocation"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetGeoLocationRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetGeoLocationRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetGeoLocationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetGeoLocationResponse.parse) + Util.or_error (Util.option_bind resp GetGeoLocationResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetGeoLocationResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetGeoLocationResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetGeoLocationResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetGeoLocationResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getGeoLocation.mli b/libraries/route53/lib/getGeoLocation.mli index 047c92da6..ffdcd83ba 100644 --- a/libraries/route53/lib/getGeoLocation.mli +++ b/libraries/route53/lib/getGeoLocation.mli @@ -1,10 +1,7 @@ open Types - type input = GetGeoLocationRequest.t - type output = GetGeoLocationResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheck.ml b/libraries/route53/lib/getHealthCheck.ml index f9aa87ea8..08590e971 100644 --- a/libraries/route53/lib/getHealthCheck.ml +++ b/libraries/route53/lib/getHealthCheck.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetHealthCheckRequest.t - type output = GetHealthCheckResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetHealthCheck" ] ] + [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheck"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetHealthCheckRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetHealthCheckRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetHealthCheckResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetHealthCheckResponse.parse) + Util.or_error (Util.option_bind resp GetHealthCheckResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetHealthCheckResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetHealthCheckResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHealthCheckResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHealthCheckResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheck.mli b/libraries/route53/lib/getHealthCheck.mli index 4b6036e03..14d53eee6 100644 --- a/libraries/route53/lib/getHealthCheck.mli +++ b/libraries/route53/lib/getHealthCheck.mli @@ -1,10 +1,7 @@ open Types - type input = GetHealthCheckRequest.t - type output = GetHealthCheckResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckCount.ml b/libraries/route53/lib/getHealthCheckCount.ml index 35a395e49..da5e366a3 100644 --- a/libraries/route53/lib/getHealthCheckCount.ml +++ b/libraries/route53/lib/getHealthCheckCount.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = unit - type output = GetHealthCheckCountResponse.t - type error = Errors_internal.t - let service = "route53" - 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))) - [ "Version", [ "2013-04-01" ]; "Action", [ "GetHealthCheckCount" ] ] - in - `GET, uri, [] - + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheckCount"])] in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetHealthCheckCountResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetHealthCheckCountResponse.parse) + Util.or_error (Util.option_bind resp GetHealthCheckCountResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetHealthCheckCountResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetHealthCheckCountResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHealthCheckCountResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHealthCheckCountResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckCount.mli b/libraries/route53/lib/getHealthCheckCount.mli index e8c0ab004..65c0c7a75 100644 --- a/libraries/route53/lib/getHealthCheckCount.mli +++ b/libraries/route53/lib/getHealthCheckCount.mli @@ -1,10 +1,7 @@ open Types - type input = unit - type output = GetHealthCheckCountResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckLastFailureReason.ml b/libraries/route53/lib/getHealthCheckLastFailureReason.ml index 718bf6191..7d4a646f9 100644 --- a/libraries/route53/lib/getHealthCheckLastFailureReason.ml +++ b/libraries/route53/lib/getHealthCheckLastFailureReason.ml @@ -1,26 +1,22 @@ open Types open Aws - type input = GetHealthCheckLastFailureReasonRequest.t - type output = GetHealthCheckLastFailureReasonResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetHealthCheckLastFailureReason" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["GetHealthCheckLastFailureReason"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetHealthCheckLastFailureReasonRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render + (GetHealthCheckLastFailureReasonRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,35 +25,37 @@ let of_http body = Util.or_error (Util.option_bind resp GetHealthCheckLastFailureReasonResponse.parse) (let open Error in - BadResponse - { body - ; message = - "Could not find well formed GetHealthCheckLastFailureReasonResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetHealthCheckLastFailureReasonResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHealthCheckLastFailureReasonResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHealthCheckLastFailureReasonResponse - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckLastFailureReason.mli b/libraries/route53/lib/getHealthCheckLastFailureReason.mli index 15562513f..1b20e6412 100644 --- a/libraries/route53/lib/getHealthCheckLastFailureReason.mli +++ b/libraries/route53/lib/getHealthCheckLastFailureReason.mli @@ -1,10 +1,7 @@ open Types - type input = GetHealthCheckLastFailureReasonRequest.t - type output = GetHealthCheckLastFailureReasonResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckStatus.ml b/libraries/route53/lib/getHealthCheckStatus.ml index 822816009..e8070e778 100644 --- a/libraries/route53/lib/getHealthCheckStatus.ml +++ b/libraries/route53/lib/getHealthCheckStatus.ml @@ -1,26 +1,20 @@ open Types open Aws - type input = GetHealthCheckStatusRequest.t - type output = GetHealthCheckStatusResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetHealthCheckStatus" ] ] + [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheckStatus"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetHealthCheckStatusRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (GetHealthCheckStatusRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +23,37 @@ let of_http body = Util.or_error (Util.option_bind resp GetHealthCheckStatusResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetHealthCheckStatusResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetHealthCheckStatusResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHealthCheckStatusResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHealthCheckStatusResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHealthCheckStatus.mli b/libraries/route53/lib/getHealthCheckStatus.mli index 48b320d07..6ccc5be5f 100644 --- a/libraries/route53/lib/getHealthCheckStatus.mli +++ b/libraries/route53/lib/getHealthCheckStatus.mli @@ -1,10 +1,7 @@ open Types - type input = GetHealthCheckStatusRequest.t - type output = GetHealthCheckStatusResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHostedZone.ml b/libraries/route53/lib/getHostedZone.ml index e6d5c3b9b..bce3336ff 100644 --- a/libraries/route53/lib/getHostedZone.ml +++ b/libraries/route53/lib/getHostedZone.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = GetHostedZoneRequest.t - type output = GetHostedZoneResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetHostedZone" ] ] + [("Version", ["2013-04-01"]); ("Action", ["GetHostedZone"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetHostedZoneRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetHostedZoneRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetHostedZoneResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetHostedZoneResponse.parse) + Util.or_error (Util.option_bind resp GetHostedZoneResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetHostedZoneResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetHostedZoneResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHostedZoneResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHostedZoneResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHostedZone.mli b/libraries/route53/lib/getHostedZone.mli index c1682fd3e..f5728e43e 100644 --- a/libraries/route53/lib/getHostedZone.mli +++ b/libraries/route53/lib/getHostedZone.mli @@ -1,10 +1,7 @@ open Types - type input = GetHostedZoneRequest.t - type output = GetHostedZoneResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getHostedZoneCount.ml b/libraries/route53/lib/getHostedZoneCount.ml index 25392e186..4bed171e5 100644 --- a/libraries/route53/lib/getHostedZoneCount.ml +++ b/libraries/route53/lib/getHostedZoneCount.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = unit - type output = GetHostedZoneCountResponse.t - type error = Errors_internal.t - let service = "route53" - 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))) - [ "Version", [ "2013-04-01" ]; "Action", [ "GetHostedZoneCount" ] ] - in - `GET, uri, [] - + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + [("Version", ["2013-04-01"]); ("Action", ["GetHostedZoneCount"])] in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetHostedZoneCountResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetHostedZoneCountResponse.parse) + Util.or_error (Util.option_bind resp GetHostedZoneCountResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetHostedZoneCountResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetHostedZoneCountResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetHostedZoneCountResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetHostedZoneCountResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getHostedZoneCount.mli b/libraries/route53/lib/getHostedZoneCount.mli index 8f7f78304..697e7e23b 100644 --- a/libraries/route53/lib/getHostedZoneCount.mli +++ b/libraries/route53/lib/getHostedZoneCount.mli @@ -1,10 +1,7 @@ open Types - type input = unit - type output = GetHostedZoneCountResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/getReusableDelegationSet.ml b/libraries/route53/lib/getReusableDelegationSet.ml index 09042ce71..769a91178 100644 --- a/libraries/route53/lib/getReusableDelegationSet.ml +++ b/libraries/route53/lib/getReusableDelegationSet.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = GetReusableDelegationSetRequest.t - type output = GetReusableDelegationSetResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "GetReusableDelegationSet" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["GetReusableDelegationSet"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetReusableDelegationSetRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (GetReusableDelegationSetRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp GetReusableDelegationSetResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed GetReusableDelegationSetResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetReusableDelegationSetResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetReusableDelegationSetResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetReusableDelegationSetResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/getReusableDelegationSet.mli b/libraries/route53/lib/getReusableDelegationSet.mli index 46ffb298d..db6413b69 100644 --- a/libraries/route53/lib/getReusableDelegationSet.mli +++ b/libraries/route53/lib/getReusableDelegationSet.mli @@ -1,10 +1,7 @@ open Types - type input = GetReusableDelegationSetRequest.t - type output = GetReusableDelegationSetResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listGeoLocations.ml b/libraries/route53/lib/listGeoLocations.ml index 375585d3b..6e1721c91 100644 --- a/libraries/route53/lib/listGeoLocations.ml +++ b/libraries/route53/lib/listGeoLocations.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListGeoLocationsRequest.t - type output = ListGeoLocationsResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListGeoLocations" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListGeoLocations"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListGeoLocationsRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListGeoLocationsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListGeoLocationsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListGeoLocationsResponse.parse) + Util.or_error (Util.option_bind resp ListGeoLocationsResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListGeoLocationsResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListGeoLocationsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListGeoLocationsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListGeoLocationsResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listGeoLocations.mli b/libraries/route53/lib/listGeoLocations.mli index a52e25bb4..58cb6a687 100644 --- a/libraries/route53/lib/listGeoLocations.mli +++ b/libraries/route53/lib/listGeoLocations.mli @@ -1,10 +1,7 @@ open Types - type input = ListGeoLocationsRequest.t - type output = ListGeoLocationsResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listHealthChecks.ml b/libraries/route53/lib/listHealthChecks.ml index 8b81d4f95..70e058176 100644 --- a/libraries/route53/lib/listHealthChecks.ml +++ b/libraries/route53/lib/listHealthChecks.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListHealthChecksRequest.t - type output = ListHealthChecksResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListHealthChecks" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListHealthChecks"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListHealthChecksRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListHealthChecksRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListHealthChecksResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListHealthChecksResponse.parse) + Util.or_error (Util.option_bind resp ListHealthChecksResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListHealthChecksResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListHealthChecksResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListHealthChecksResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListHealthChecksResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listHealthChecks.mli b/libraries/route53/lib/listHealthChecks.mli index 3a2b6958a..f68b3bf08 100644 --- a/libraries/route53/lib/listHealthChecks.mli +++ b/libraries/route53/lib/listHealthChecks.mli @@ -1,10 +1,7 @@ open Types - type input = ListHealthChecksRequest.t - type output = ListHealthChecksResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listHostedZones.ml b/libraries/route53/lib/listHostedZones.ml index 573dda8de..7ffad6cec 100644 --- a/libraries/route53/lib/listHostedZones.ml +++ b/libraries/route53/lib/listHostedZones.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListHostedZonesRequest.t - type output = ListHostedZonesResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListHostedZones" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListHostedZones"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListHostedZonesRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListHostedZonesRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListHostedZonesResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListHostedZonesResponse.parse) + Util.or_error (Util.option_bind resp ListHostedZonesResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListHostedZonesResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListHostedZonesResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListHostedZonesResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListHostedZonesResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listHostedZones.mli b/libraries/route53/lib/listHostedZones.mli index bba602614..5b994c5d2 100644 --- a/libraries/route53/lib/listHostedZones.mli +++ b/libraries/route53/lib/listHostedZones.mli @@ -1,10 +1,7 @@ open Types - type input = ListHostedZonesRequest.t - type output = ListHostedZonesResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listHostedZonesByName.ml b/libraries/route53/lib/listHostedZonesByName.ml index 9f118ae89..4043664cb 100644 --- a/libraries/route53/lib/listHostedZonesByName.ml +++ b/libraries/route53/lib/listHostedZonesByName.ml @@ -1,26 +1,20 @@ open Types open Aws - type input = ListHostedZonesByNameRequest.t - type output = ListHostedZonesByNameResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListHostedZonesByName" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListHostedZonesByName"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListHostedZonesByNameRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (ListHostedZonesByNameRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +23,37 @@ let of_http body = Util.or_error (Util.option_bind resp ListHostedZonesByNameResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListHostedZonesByNameResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListHostedZonesByNameResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListHostedZonesByNameResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListHostedZonesByNameResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listHostedZonesByName.mli b/libraries/route53/lib/listHostedZonesByName.mli index c48b58219..8d7362dcd 100644 --- a/libraries/route53/lib/listHostedZonesByName.mli +++ b/libraries/route53/lib/listHostedZonesByName.mli @@ -1,10 +1,7 @@ open Types - type input = ListHostedZonesByNameRequest.t - type output = ListHostedZonesByNameResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listResourceRecordSets.ml b/libraries/route53/lib/listResourceRecordSets.ml index 7f181d853..c7b7b7372 100644 --- a/libraries/route53/lib/listResourceRecordSets.ml +++ b/libraries/route53/lib/listResourceRecordSets.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ListResourceRecordSetsRequest.t - type output = ListResourceRecordSetsResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListResourceRecordSets" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["ListResourceRecordSets"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListResourceRecordSetsRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (ListResourceRecordSetsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ListResourceRecordSetsResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListResourceRecordSetsResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListResourceRecordSetsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListResourceRecordSetsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListResourceRecordSetsResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listResourceRecordSets.mli b/libraries/route53/lib/listResourceRecordSets.mli index c355241aa..2913be47a 100644 --- a/libraries/route53/lib/listResourceRecordSets.mli +++ b/libraries/route53/lib/listResourceRecordSets.mli @@ -1,10 +1,7 @@ open Types - type input = ListResourceRecordSetsRequest.t - type output = ListResourceRecordSetsResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listReusableDelegationSets.ml b/libraries/route53/lib/listReusableDelegationSets.ml index 6d57fdd83..b605d47de 100644 --- a/libraries/route53/lib/listReusableDelegationSets.ml +++ b/libraries/route53/lib/listReusableDelegationSets.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = ListReusableDelegationSetsRequest.t - type output = ListReusableDelegationSetsResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListReusableDelegationSets" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["ListReusableDelegationSets"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListReusableDelegationSetsRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (ListReusableDelegationSetsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp ListReusableDelegationSetsResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ListReusableDelegationSetsResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListReusableDelegationSetsResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListReusableDelegationSetsResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListReusableDelegationSetsResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listReusableDelegationSets.mli b/libraries/route53/lib/listReusableDelegationSets.mli index 26c491c60..56b5ab846 100644 --- a/libraries/route53/lib/listReusableDelegationSets.mli +++ b/libraries/route53/lib/listReusableDelegationSets.mli @@ -1,10 +1,7 @@ open Types - type input = ListReusableDelegationSetsRequest.t - type output = ListReusableDelegationSetsResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listTagsForResource.ml b/libraries/route53/lib/listTagsForResource.ml index 5c7c863bf..08d09bd93 100644 --- a/libraries/route53/lib/listTagsForResource.ml +++ b/libraries/route53/lib/listTagsForResource.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = ListTagsForResourceRequest.t - type output = ListTagsForResourceResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListTagsForResource" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListTagsForResourceRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (ListTagsForResourceRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListTagsForResourceResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListTagsForResourceResponse.parse) + Util.or_error (Util.option_bind resp ListTagsForResourceResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListTagsForResourceResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListTagsForResourceResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListTagsForResourceResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListTagsForResourceResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listTagsForResource.mli b/libraries/route53/lib/listTagsForResource.mli index 80aaa0293..a4519077e 100644 --- a/libraries/route53/lib/listTagsForResource.mli +++ b/libraries/route53/lib/listTagsForResource.mli @@ -1,10 +1,7 @@ open Types - type input = ListTagsForResourceRequest.t - type output = ListTagsForResourceResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/listTagsForResources.ml b/libraries/route53/lib/listTagsForResources.ml index d3835183d..a0bd87620 100644 --- a/libraries/route53/lib/listTagsForResources.ml +++ b/libraries/route53/lib/listTagsForResources.ml @@ -1,26 +1,20 @@ open Types open Aws - type input = ListTagsForResourcesRequest.t - type output = ListTagsForResourcesResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "ListTagsForResources" ] ] + [("Version", ["2013-04-01"]); ("Action", ["ListTagsForResources"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListTagsForResourcesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ListTagsForResourcesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +23,37 @@ let of_http body = Util.or_error (Util.option_bind resp ListTagsForResourcesResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListTagsForResourcesResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListTagsForResourcesResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListTagsForResourcesResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListTagsForResourcesResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/listTagsForResources.mli b/libraries/route53/lib/listTagsForResources.mli index 1cbeedd88..04f3cb7c7 100644 --- a/libraries/route53/lib/listTagsForResources.mli +++ b/libraries/route53/lib/listTagsForResources.mli @@ -1,10 +1,7 @@ open Types - type input = ListTagsForResourcesRequest.t - type output = ListTagsForResourcesResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/types.ml b/libraries/route53/lib/types.ml index ffebaf26a..1c12304eb 100644 --- a/libraries/route53/lib/types.ml +++ b/libraries/route53/lib/types.ml @@ -1,4508 +1,4609 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module ResourceRecord = struct - type t = { value : String.t } - - let make ~value () = { value } - - let parse xml = - Some - { value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) +module ResourceRecord = + struct + type t = { + value: String.t } + let make ~value () = { value } + let parse xml = + Some + { + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (String.to_query v.value)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("value", (String.to_json v.value))]) + let of_json j = + { value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Value", String.to_query v.value)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("value", String.to_json v.value) ]) - - let of_json j = { value = String.of_json (Util.of_option_exn (Json.lookup j "value")) } -end - -module AliasTarget = struct - type t = - { hosted_zone_id : String.t - ; d_n_s_name : String.t - ; evaluate_target_health : Boolean.t - } - - let make ~hosted_zone_id ~d_n_s_name ~evaluate_target_health () = - { hosted_zone_id; d_n_s_name; evaluate_target_health } - - let parse xml = - Some - { hosted_zone_id = - Xml.required - "HostedZoneId" - (Util.option_bind (Xml.member "HostedZoneId" xml) String.parse) - ; d_n_s_name = - Xml.required - "DNSName" - (Util.option_bind (Xml.member "DNSName" xml) String.parse) - ; evaluate_target_health = - Xml.required - "EvaluateTargetHealth" - (Util.option_bind (Xml.member "EvaluateTargetHealth" xml) Boolean.parse) + end +module AliasTarget = + struct + type t = + { + hosted_zone_id: String.t ; + d_n_s_name: String.t ; + evaluate_target_health: Boolean.t } + let make ~hosted_zone_id ~d_n_s_name ~evaluate_target_health () = + { hosted_zone_id; d_n_s_name; evaluate_target_health } + let parse xml = + Some + { + hosted_zone_id = + (Xml.required "HostedZoneId" + (Util.option_bind (Xml.member "HostedZoneId" xml) String.parse)); + d_n_s_name = + (Xml.required "DNSName" + (Util.option_bind (Xml.member "DNSName" xml) String.parse)); + evaluate_target_health = + (Xml.required "EvaluateTargetHealth" + (Util.option_bind (Xml.member "EvaluateTargetHealth" xml) + Boolean.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EvaluateTargetHealth", + (Boolean.to_query v.evaluate_target_health))); + Some (Query.Pair ("DNSName", (String.to_query v.d_n_s_name))); + Some + (Query.Pair ("HostedZoneId", (String.to_query v.hosted_zone_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("evaluate_target_health", + (Boolean.to_json v.evaluate_target_health)); + Some ("d_n_s_name", (String.to_json v.d_n_s_name)); + Some ("hosted_zone_id", (String.to_json v.hosted_zone_id))]) + let of_json j = + { + hosted_zone_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_id"))); + d_n_s_name = + (String.of_json (Util.of_option_exn (Json.lookup j "d_n_s_name"))); + evaluate_target_health = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "evaluate_target_health"))) + } + end +module GeoLocation = + struct + type t = + { + continent_code: String.t option ; + country_code: String.t option ; + subdivision_code: String.t option } + let make ?continent_code ?country_code ?subdivision_code () = + { continent_code; country_code; subdivision_code } + let parse xml = + Some + { + continent_code = + (Util.option_bind (Xml.member "ContinentCode" xml) String.parse); + country_code = + (Util.option_bind (Xml.member "CountryCode" xml) String.parse); + subdivision_code = + (Util.option_bind (Xml.member "SubdivisionCode" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subdivision_code + (fun f -> Query.Pair ("SubdivisionCode", (String.to_query f))); + Util.option_map v.country_code + (fun f -> Query.Pair ("CountryCode", (String.to_query f))); + Util.option_map v.continent_code + (fun f -> Query.Pair ("ContinentCode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subdivision_code + (fun f -> ("subdivision_code", (String.to_json f))); + Util.option_map v.country_code + (fun f -> ("country_code", (String.to_json f))); + Util.option_map v.continent_code + (fun f -> ("continent_code", (String.to_json f)))]) + let of_json j = + { + continent_code = + (Util.option_map (Json.lookup j "continent_code") String.of_json); + country_code = + (Util.option_map (Json.lookup j "country_code") String.of_json); + subdivision_code = + (Util.option_map (Json.lookup j "subdivision_code") String.of_json) + } + end +module RRType = + struct + type t = + | SOA + | A + | TXT + | NS + | CNAME + | MX + | PTR + | SRV + | SPF + | AAAA + let str_to_t = + [("AAAA", AAAA); + ("SPF", SPF); + ("SRV", SRV); + ("PTR", PTR); + ("MX", MX); + ("CNAME", CNAME); + ("NS", NS); + ("TXT", TXT); + ("A", A); + ("SOA", SOA)] + let t_to_str = + [(AAAA, "AAAA"); + (SPF, "SPF"); + (SRV, "SRV"); + (PTR, "PTR"); + (MX, "MX"); + (CNAME, "CNAME"); + (NS, "NS"); + (TXT, "TXT"); + (A, "A"); + (SOA, "SOA")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ResourceRecordSetFailover = + struct + type t = + | PRIMARY + | SECONDARY + let str_to_t = [("SECONDARY", SECONDARY); ("PRIMARY", PRIMARY)] + let t_to_str = [(SECONDARY, "SECONDARY"); (PRIMARY, "PRIMARY")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ResourceRecordSetRegion = + struct + type t = + | Us_east_1 + | Us_west_1 + | Us_west_2 + | Eu_west_1 + | Eu_central_1 + | Ap_southeast_1 + | Ap_southeast_2 + | Ap_northeast_1 + | Sa_east_1 + | Cn_north_1 + let str_to_t = + [("cn-north-1", Cn_north_1); + ("sa-east-1", Sa_east_1); + ("ap-northeast-1", Ap_northeast_1); + ("ap-southeast-2", Ap_southeast_2); + ("ap-southeast-1", Ap_southeast_1); + ("eu-central-1", Eu_central_1); + ("eu-west-1", Eu_west_1); + ("us-west-2", Us_west_2); + ("us-west-1", Us_west_1); + ("us-east-1", Us_east_1)] + let t_to_str = + [(Cn_north_1, "cn-north-1"); + (Sa_east_1, "sa-east-1"); + (Ap_northeast_1, "ap-northeast-1"); + (Ap_southeast_2, "ap-southeast-2"); + (Ap_southeast_1, "ap-southeast-1"); + (Eu_central_1, "eu-central-1"); + (Eu_west_1, "eu-west-1"); + (Us_west_2, "us-west-2"); + (Us_west_1, "us-west-1"); + (Us_east_1, "us-east-1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ResourceRecords = + struct + type t = ResourceRecord.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ResourceRecord.parse (Xml.members "ResourceRecord" xml)) + let to_query v = Query.to_query_list ResourceRecord.to_query v + let to_json v = `List (List.map ResourceRecord.to_json v) + let of_json j = Json.to_list ResourceRecord.of_json j + end +module HealthCheckType = + struct + type t = + | HTTP + | HTTPS + | HTTP_STR_MATCH + | HTTPS_STR_MATCH + | TCP + let str_to_t = + [("TCP", TCP); + ("HTTPS_STR_MATCH", HTTPS_STR_MATCH); + ("HTTP_STR_MATCH", HTTP_STR_MATCH); + ("HTTPS", HTTPS); + ("HTTP", HTTP)] + let t_to_str = + [(TCP, "TCP"); + (HTTPS_STR_MATCH, "HTTPS_STR_MATCH"); + (HTTP_STR_MATCH, "HTTP_STR_MATCH"); + (HTTPS, "HTTPS"); + (HTTP, "HTTP")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Tag = + struct + type t = { + key: String.t option ; + value: String.t option } + let make ?key ?value () = { key; value } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module ChangeAction = + struct + type t = + | CREATE + | DELETE + | UPSERT + let str_to_t = + [("UPSERT", UPSERT); ("DELETE", DELETE); ("CREATE", CREATE)] + let t_to_str = + [(UPSERT, "UPSERT"); (DELETE, "DELETE"); (CREATE, "CREATE")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ResourceRecordSet = + struct + type t = + { + name: String.t ; + type_: RRType.t ; + set_identifier: String.t option ; + weight: Long.t option ; + region: ResourceRecordSetRegion.t option ; + geo_location: GeoLocation.t option ; + failover: ResourceRecordSetFailover.t option ; + t_t_l: Long.t option ; + resource_records: ResourceRecords.t ; + alias_target: AliasTarget.t option ; + health_check_id: String.t option } + let make ~name ~type_ ?set_identifier ?weight ?region ?geo_location + ?failover ?t_t_l ?(resource_records= []) ?alias_target + ?health_check_id () = + { + name; + type_; + set_identifier; + weight; + region; + geo_location; + failover; + t_t_l; + resource_records; + alias_target; + health_check_id } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + type_ = + (Xml.required "Type" + (Util.option_bind (Xml.member "Type" xml) RRType.parse)); + set_identifier = + (Util.option_bind (Xml.member "SetIdentifier" xml) String.parse); + weight = (Util.option_bind (Xml.member "Weight" xml) Long.parse); + region = + (Util.option_bind (Xml.member "Region" xml) + ResourceRecordSetRegion.parse); + geo_location = + (Util.option_bind (Xml.member "GeoLocation" xml) + GeoLocation.parse); + failover = + (Util.option_bind (Xml.member "Failover" xml) + ResourceRecordSetFailover.parse); + t_t_l = (Util.option_bind (Xml.member "TTL" xml) Long.parse); + resource_records = + (Util.of_option [] + (Util.option_bind (Xml.member "ResourceRecords" xml) + ResourceRecords.parse)); + alias_target = + (Util.option_bind (Xml.member "AliasTarget" xml) + AliasTarget.parse); + health_check_id = + (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.health_check_id + (fun f -> Query.Pair ("HealthCheckId", (String.to_query f))); + Util.option_map v.alias_target + (fun f -> Query.Pair ("AliasTarget", (AliasTarget.to_query f))); + Some (Query.Pair - ("EvaluateTargetHealth", Boolean.to_query v.evaluate_target_health)) - ; Some (Query.Pair ("DNSName", String.to_query v.d_n_s_name)) - ; Some (Query.Pair ("HostedZoneId", String.to_query v.hosted_zone_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("evaluate_target_health", Boolean.to_json v.evaluate_target_health) - ; Some ("d_n_s_name", String.to_json v.d_n_s_name) - ; Some ("hosted_zone_id", String.to_json v.hosted_zone_id) - ]) - - let of_json j = - { hosted_zone_id = - String.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_id")) - ; d_n_s_name = String.of_json (Util.of_option_exn (Json.lookup j "d_n_s_name")) - ; evaluate_target_health = - Boolean.of_json (Util.of_option_exn (Json.lookup j "evaluate_target_health")) - } -end - -module GeoLocation = struct - type t = - { continent_code : String.t option - ; country_code : String.t option - ; subdivision_code : String.t option - } - - let make ?continent_code ?country_code ?subdivision_code () = - { continent_code; country_code; subdivision_code } - - let parse xml = - Some - { continent_code = Util.option_bind (Xml.member "ContinentCode" xml) String.parse - ; country_code = Util.option_bind (Xml.member "CountryCode" xml) String.parse - ; subdivision_code = - Util.option_bind (Xml.member "SubdivisionCode" xml) String.parse + ("ResourceRecords.member", + (ResourceRecords.to_query v.resource_records))); + Util.option_map v.t_t_l + (fun f -> Query.Pair ("TTL", (Long.to_query f))); + Util.option_map v.failover + (fun f -> + Query.Pair + ("Failover", (ResourceRecordSetFailover.to_query f))); + Util.option_map v.geo_location + (fun f -> Query.Pair ("GeoLocation", (GeoLocation.to_query f))); + Util.option_map v.region + (fun f -> + Query.Pair ("Region", (ResourceRecordSetRegion.to_query f))); + Util.option_map v.weight + (fun f -> Query.Pair ("Weight", (Long.to_query f))); + Util.option_map v.set_identifier + (fun f -> Query.Pair ("SetIdentifier", (String.to_query f))); + Some (Query.Pair ("Type", (RRType.to_query v.type_))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.health_check_id + (fun f -> ("health_check_id", (String.to_json f))); + Util.option_map v.alias_target + (fun f -> ("alias_target", (AliasTarget.to_json f))); + Some + ("resource_records", + (ResourceRecords.to_json v.resource_records)); + Util.option_map v.t_t_l (fun f -> ("t_t_l", (Long.to_json f))); + Util.option_map v.failover + (fun f -> ("failover", (ResourceRecordSetFailover.to_json f))); + Util.option_map v.geo_location + (fun f -> ("geo_location", (GeoLocation.to_json f))); + Util.option_map v.region + (fun f -> ("region", (ResourceRecordSetRegion.to_json f))); + Util.option_map v.weight (fun f -> ("weight", (Long.to_json f))); + Util.option_map v.set_identifier + (fun f -> ("set_identifier", (String.to_json f))); + Some ("type_", (RRType.to_json v.type_)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + type_ = (RRType.of_json (Util.of_option_exn (Json.lookup j "type_"))); + set_identifier = + (Util.option_map (Json.lookup j "set_identifier") String.of_json); + weight = (Util.option_map (Json.lookup j "weight") Long.of_json); + region = + (Util.option_map (Json.lookup j "region") + ResourceRecordSetRegion.of_json); + geo_location = + (Util.option_map (Json.lookup j "geo_location") GeoLocation.of_json); + failover = + (Util.option_map (Json.lookup j "failover") + ResourceRecordSetFailover.of_json); + t_t_l = (Util.option_map (Json.lookup j "t_t_l") Long.of_json); + resource_records = + (ResourceRecords.of_json + (Util.of_option_exn (Json.lookup j "resource_records"))); + alias_target = + (Util.option_map (Json.lookup j "alias_target") AliasTarget.of_json); + health_check_id = + (Util.option_map (Json.lookup j "health_check_id") String.of_json) + } + end +module HostedZoneConfig = + struct + type t = { + comment: String.t option ; + private_zone: Boolean.t option } + let make ?comment ?private_zone () = { comment; private_zone } + let parse xml = + Some + { + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse); + private_zone = + (Util.option_bind (Xml.member "PrivateZone" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.private_zone + (fun f -> Query.Pair ("PrivateZone", (Boolean.to_query f))); + Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.private_zone + (fun f -> ("private_zone", (Boolean.to_json f))); + Util.option_map v.comment + (fun f -> ("comment", (String.to_json f)))]) + let of_json j = + { + comment = (Util.option_map (Json.lookup j "comment") String.of_json); + private_zone = + (Util.option_map (Json.lookup j "private_zone") Boolean.of_json) + } + end +module StatusReport = + struct + type t = { + status: String.t option ; + checked_time: DateTime.t option } + let make ?status ?checked_time () = { status; checked_time } + let parse xml = + Some + { + status = (Util.option_bind (Xml.member "Status" xml) String.parse); + checked_time = + (Util.option_bind (Xml.member "CheckedTime" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.checked_time + (fun f -> Query.Pair ("CheckedTime", (DateTime.to_query f))); + Util.option_map v.status + (fun f -> Query.Pair ("Status", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.checked_time + (fun f -> ("checked_time", (DateTime.to_json f))); + Util.option_map v.status (fun f -> ("status", (String.to_json f)))]) + let of_json j = + { + status = (Util.option_map (Json.lookup j "status") String.of_json); + checked_time = + (Util.option_map (Json.lookup j "checked_time") DateTime.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subdivision_code (fun f -> - Query.Pair ("SubdivisionCode", String.to_query f)) - ; Util.option_map v.country_code (fun f -> - Query.Pair ("CountryCode", String.to_query f)) - ; Util.option_map v.continent_code (fun f -> - Query.Pair ("ContinentCode", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subdivision_code (fun f -> - "subdivision_code", String.to_json f) - ; Util.option_map v.country_code (fun f -> "country_code", String.to_json f) - ; Util.option_map v.continent_code (fun f -> "continent_code", String.to_json f) - ]) - - let of_json j = - { continent_code = Util.option_map (Json.lookup j "continent_code") String.of_json - ; country_code = Util.option_map (Json.lookup j "country_code") String.of_json - ; subdivision_code = Util.option_map (Json.lookup j "subdivision_code") String.of_json - } -end - -module RRType = struct - type t = - | SOA - | A - | TXT - | NS - | CNAME - | MX - | PTR - | SRV - | SPF - | AAAA - - let str_to_t = - [ "AAAA", AAAA - ; "SPF", SPF - ; "SRV", SRV - ; "PTR", PTR - ; "MX", MX - ; "CNAME", CNAME - ; "NS", NS - ; "TXT", TXT - ; "A", A - ; "SOA", SOA - ] - - let t_to_str = - [ AAAA, "AAAA" - ; SPF, "SPF" - ; SRV, "SRV" - ; PTR, "PTR" - ; MX, "MX" - ; CNAME, "CNAME" - ; NS, "NS" - ; TXT, "TXT" - ; A, "A" - ; SOA, "SOA" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ResourceRecordSetFailover = struct - type t = - | PRIMARY - | SECONDARY - - let str_to_t = [ "SECONDARY", SECONDARY; "PRIMARY", PRIMARY ] - - let t_to_str = [ SECONDARY, "SECONDARY"; PRIMARY, "PRIMARY" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ResourceRecordSetRegion = struct - type t = - | Us_east_1 - | Us_west_1 - | Us_west_2 - | Eu_west_1 - | Eu_central_1 - | Ap_southeast_1 - | Ap_southeast_2 - | Ap_northeast_1 - | Sa_east_1 - | Cn_north_1 - - let str_to_t = - [ "cn-north-1", Cn_north_1 - ; "sa-east-1", Sa_east_1 - ; "ap-northeast-1", Ap_northeast_1 - ; "ap-southeast-2", Ap_southeast_2 - ; "ap-southeast-1", Ap_southeast_1 - ; "eu-central-1", Eu_central_1 - ; "eu-west-1", Eu_west_1 - ; "us-west-2", Us_west_2 - ; "us-west-1", Us_west_1 - ; "us-east-1", Us_east_1 - ] - - let t_to_str = - [ Cn_north_1, "cn-north-1" - ; Sa_east_1, "sa-east-1" - ; Ap_northeast_1, "ap-northeast-1" - ; Ap_southeast_2, "ap-southeast-2" - ; Ap_southeast_1, "ap-southeast-1" - ; Eu_central_1, "eu-central-1" - ; Eu_west_1, "eu-west-1" - ; Us_west_2, "us-west-2" - ; Us_west_1, "us-west-1" - ; Us_east_1, "us-east-1" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ResourceRecords = struct - type t = ResourceRecord.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ResourceRecord.parse (Xml.members "ResourceRecord" xml)) - - let to_query v = Query.to_query_list ResourceRecord.to_query v - - let to_json v = `List (List.map ResourceRecord.to_json v) - - let of_json j = Json.to_list ResourceRecord.of_json j -end - -module HealthCheckType = struct - type t = - | HTTP - | HTTPS - | HTTP_STR_MATCH - | HTTPS_STR_MATCH - | TCP - - let str_to_t = - [ "TCP", TCP - ; "HTTPS_STR_MATCH", HTTPS_STR_MATCH - ; "HTTP_STR_MATCH", HTTP_STR_MATCH - ; "HTTPS", HTTPS - ; "HTTP", HTTP - ] - - let t_to_str = - [ TCP, "TCP" - ; HTTPS_STR_MATCH, "HTTPS_STR_MATCH" - ; HTTP_STR_MATCH, "HTTP_STR_MATCH" - ; HTTPS, "HTTPS" - ; HTTP, "HTTP" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Tag = struct - type t = - { key : String.t option - ; value : String.t option - } - - let make ?key ?value () = { key; value } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse + end +module HealthCheckConfig = + struct + type t = + { + i_p_address: String.t option ; + port: Integer.t option ; + type_: HealthCheckType.t ; + resource_path: String.t option ; + fully_qualified_domain_name: String.t option ; + search_string: String.t option ; + request_interval: Integer.t option ; + failure_threshold: Integer.t option } + let make ?i_p_address ?port ~type_ ?resource_path + ?fully_qualified_domain_name ?search_string ?request_interval + ?failure_threshold () = + { + i_p_address; + port; + type_; + resource_path; + fully_qualified_domain_name; + search_string; + request_interval; + failure_threshold } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module ChangeAction = struct - type t = - | CREATE - | DELETE - | UPSERT - - let str_to_t = [ "UPSERT", UPSERT; "DELETE", DELETE; "CREATE", CREATE ] - - let t_to_str = [ UPSERT, "UPSERT"; DELETE, "DELETE"; CREATE, "CREATE" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ResourceRecordSet = struct - type t = - { name : String.t - ; type_ : RRType.t - ; set_identifier : String.t option - ; weight : Long.t option - ; region : ResourceRecordSetRegion.t option - ; geo_location : GeoLocation.t option - ; failover : ResourceRecordSetFailover.t option - ; t_t_l : Long.t option - ; resource_records : ResourceRecords.t - ; alias_target : AliasTarget.t option - ; health_check_id : String.t option - } - - let make - ~name - ~type_ - ?set_identifier - ?weight - ?region - ?geo_location - ?failover - ?t_t_l - ?(resource_records = []) - ?alias_target - ?health_check_id - () = - { name - ; type_ - ; set_identifier - ; weight - ; region - ; geo_location - ; failover - ; t_t_l - ; resource_records - ; alias_target - ; health_check_id - } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; type_ = - Xml.required "Type" (Util.option_bind (Xml.member "Type" xml) RRType.parse) - ; set_identifier = Util.option_bind (Xml.member "SetIdentifier" xml) String.parse - ; weight = Util.option_bind (Xml.member "Weight" xml) Long.parse - ; region = Util.option_bind (Xml.member "Region" xml) ResourceRecordSetRegion.parse - ; geo_location = Util.option_bind (Xml.member "GeoLocation" xml) GeoLocation.parse - ; failover = - Util.option_bind (Xml.member "Failover" xml) ResourceRecordSetFailover.parse - ; t_t_l = Util.option_bind (Xml.member "TTL" xml) Long.parse - ; resource_records = - Util.of_option - [] - (Util.option_bind (Xml.member "ResourceRecords" xml) ResourceRecords.parse) - ; alias_target = Util.option_bind (Xml.member "AliasTarget" xml) AliasTarget.parse - ; health_check_id = Util.option_bind (Xml.member "HealthCheckId" xml) String.parse + let parse xml = + Some + { + i_p_address = + (Util.option_bind (Xml.member "IPAddress" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + type_ = + (Xml.required "Type" + (Util.option_bind (Xml.member "Type" xml) + HealthCheckType.parse)); + resource_path = + (Util.option_bind (Xml.member "ResourcePath" xml) String.parse); + fully_qualified_domain_name = + (Util.option_bind (Xml.member "FullyQualifiedDomainName" xml) + String.parse); + search_string = + (Util.option_bind (Xml.member "SearchString" xml) String.parse); + request_interval = + (Util.option_bind (Xml.member "RequestInterval" xml) + Integer.parse); + failure_threshold = + (Util.option_bind (Xml.member "FailureThreshold" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.failure_threshold + (fun f -> Query.Pair ("FailureThreshold", (Integer.to_query f))); + Util.option_map v.request_interval + (fun f -> Query.Pair ("RequestInterval", (Integer.to_query f))); + Util.option_map v.search_string + (fun f -> Query.Pair ("SearchString", (String.to_query f))); + Util.option_map v.fully_qualified_domain_name + (fun f -> + Query.Pair ("FullyQualifiedDomainName", (String.to_query f))); + Util.option_map v.resource_path + (fun f -> Query.Pair ("ResourcePath", (String.to_query f))); + Some (Query.Pair ("Type", (HealthCheckType.to_query v.type_))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.i_p_address + (fun f -> Query.Pair ("IPAddress", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.failure_threshold + (fun f -> ("failure_threshold", (Integer.to_json f))); + Util.option_map v.request_interval + (fun f -> ("request_interval", (Integer.to_json f))); + Util.option_map v.search_string + (fun f -> ("search_string", (String.to_json f))); + Util.option_map v.fully_qualified_domain_name + (fun f -> ("fully_qualified_domain_name", (String.to_json f))); + Util.option_map v.resource_path + (fun f -> ("resource_path", (String.to_json f))); + Some ("type_", (HealthCheckType.to_json v.type_)); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.i_p_address + (fun f -> ("i_p_address", (String.to_json f)))]) + let of_json j = + { + i_p_address = + (Util.option_map (Json.lookup j "i_p_address") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + type_ = + (HealthCheckType.of_json + (Util.of_option_exn (Json.lookup j "type_"))); + resource_path = + (Util.option_map (Json.lookup j "resource_path") String.of_json); + fully_qualified_domain_name = + (Util.option_map (Json.lookup j "fully_qualified_domain_name") + String.of_json); + search_string = + (Util.option_map (Json.lookup j "search_string") String.of_json); + request_interval = + (Util.option_map (Json.lookup j "request_interval") Integer.of_json); + failure_threshold = + (Util.option_map (Json.lookup j "failure_threshold") + Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.health_check_id (fun f -> - Query.Pair ("HealthCheckId", String.to_query f)) - ; Util.option_map v.alias_target (fun f -> - Query.Pair ("AliasTarget", AliasTarget.to_query f)) - ; Some + end +module TagList = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module TagResourceType = + struct + type t = + | Healthcheck + | Hostedzone + let str_to_t = [("hostedzone", Hostedzone); ("healthcheck", Healthcheck)] + let t_to_str = [(Hostedzone, "hostedzone"); (Healthcheck, "healthcheck")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DelegationSetNameServers = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "NameServer" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module Change = + struct + type t = + { + action: ChangeAction.t ; + resource_record_set: ResourceRecordSet.t } + let make ~action ~resource_record_set () = + { action; resource_record_set } + let parse xml = + Some + { + action = + (Xml.required "Action" + (Util.option_bind (Xml.member "Action" xml) ChangeAction.parse)); + resource_record_set = + (Xml.required "ResourceRecordSet" + (Util.option_bind (Xml.member "ResourceRecordSet" xml) + ResourceRecordSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ResourceRecordSet", + (ResourceRecordSet.to_query v.resource_record_set))); + Some (Query.Pair ("Action", (ChangeAction.to_query v.action)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("resource_record_set", + (ResourceRecordSet.to_json v.resource_record_set)); + Some ("action", (ChangeAction.to_json v.action))]) + let of_json j = + { + action = + (ChangeAction.of_json (Util.of_option_exn (Json.lookup j "action"))); + resource_record_set = + (ResourceRecordSet.of_json + (Util.of_option_exn (Json.lookup j "resource_record_set"))) + } + end +module VPCRegion = + struct + type t = + | Us_east_1 + | Us_west_1 + | Us_west_2 + | Eu_west_1 + | Eu_central_1 + | Ap_southeast_1 + | Ap_southeast_2 + | Ap_northeast_1 + | Sa_east_1 + | Cn_north_1 + let str_to_t = + [("cn-north-1", Cn_north_1); + ("sa-east-1", Sa_east_1); + ("ap-northeast-1", Ap_northeast_1); + ("ap-southeast-2", Ap_southeast_2); + ("ap-southeast-1", Ap_southeast_1); + ("eu-central-1", Eu_central_1); + ("eu-west-1", Eu_west_1); + ("us-west-2", Us_west_2); + ("us-west-1", Us_west_1); + ("us-east-1", Us_east_1)] + let t_to_str = + [(Cn_north_1, "cn-north-1"); + (Sa_east_1, "sa-east-1"); + (Ap_northeast_1, "ap-northeast-1"); + (Ap_southeast_2, "ap-southeast-2"); + (Ap_southeast_1, "ap-southeast-1"); + (Eu_central_1, "eu-central-1"); + (Eu_west_1, "eu-west-1"); + (Us_west_2, "us-west-2"); + (Us_west_1, "us-west-1"); + (Us_east_1, "us-east-1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module HostedZone = + struct + type t = + { + id: String.t ; + name: String.t ; + caller_reference: String.t ; + config: HostedZoneConfig.t option ; + resource_record_set_count: Long.t option } + let make ~id ~name ~caller_reference ?config + ?resource_record_set_count () = + { id; name; caller_reference; config; resource_record_set_count } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + caller_reference = + (Xml.required "CallerReference" + (Util.option_bind (Xml.member "CallerReference" xml) + String.parse)); + config = + (Util.option_bind (Xml.member "Config" xml) + HostedZoneConfig.parse); + resource_record_set_count = + (Util.option_bind (Xml.member "ResourceRecordSetCount" xml) + Long.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.resource_record_set_count + (fun f -> + Query.Pair ("ResourceRecordSetCount", (Long.to_query f))); + Util.option_map v.config + (fun f -> Query.Pair ("Config", (HostedZoneConfig.to_query f))); + Some (Query.Pair - ("ResourceRecords.member", ResourceRecords.to_query v.resource_records)) - ; Util.option_map v.t_t_l (fun f -> Query.Pair ("TTL", Long.to_query f)) - ; Util.option_map v.failover (fun f -> - Query.Pair ("Failover", ResourceRecordSetFailover.to_query f)) - ; Util.option_map v.geo_location (fun f -> - Query.Pair ("GeoLocation", GeoLocation.to_query f)) - ; Util.option_map v.region (fun f -> - Query.Pair ("Region", ResourceRecordSetRegion.to_query f)) - ; Util.option_map v.weight (fun f -> Query.Pair ("Weight", Long.to_query f)) - ; Util.option_map v.set_identifier (fun f -> - Query.Pair ("SetIdentifier", String.to_query f)) - ; Some (Query.Pair ("Type", RRType.to_query v.type_)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.health_check_id (fun f -> - "health_check_id", String.to_json f) - ; Util.option_map v.alias_target (fun f -> "alias_target", AliasTarget.to_json f) - ; Some ("resource_records", ResourceRecords.to_json v.resource_records) - ; Util.option_map v.t_t_l (fun f -> "t_t_l", Long.to_json f) - ; Util.option_map v.failover (fun f -> - "failover", ResourceRecordSetFailover.to_json f) - ; Util.option_map v.geo_location (fun f -> "geo_location", GeoLocation.to_json f) - ; Util.option_map v.region (fun f -> "region", ResourceRecordSetRegion.to_json f) - ; Util.option_map v.weight (fun f -> "weight", Long.to_json f) - ; Util.option_map v.set_identifier (fun f -> "set_identifier", String.to_json f) - ; Some ("type_", RRType.to_json v.type_) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; type_ = RRType.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; set_identifier = Util.option_map (Json.lookup j "set_identifier") String.of_json - ; weight = Util.option_map (Json.lookup j "weight") Long.of_json - ; region = Util.option_map (Json.lookup j "region") ResourceRecordSetRegion.of_json - ; geo_location = Util.option_map (Json.lookup j "geo_location") GeoLocation.of_json - ; failover = - Util.option_map (Json.lookup j "failover") ResourceRecordSetFailover.of_json - ; t_t_l = Util.option_map (Json.lookup j "t_t_l") Long.of_json - ; resource_records = - ResourceRecords.of_json (Util.of_option_exn (Json.lookup j "resource_records")) - ; alias_target = Util.option_map (Json.lookup j "alias_target") AliasTarget.of_json - ; health_check_id = Util.option_map (Json.lookup j "health_check_id") String.of_json - } -end - -module HostedZoneConfig = struct - type t = - { comment : String.t option - ; private_zone : Boolean.t option - } - - let make ?comment ?private_zone () = { comment; private_zone } - - let parse xml = - Some - { comment = Util.option_bind (Xml.member "Comment" xml) String.parse - ; private_zone = Util.option_bind (Xml.member "PrivateZone" xml) Boolean.parse + ("CallerReference", (String.to_query v.caller_reference))); + Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.resource_record_set_count + (fun f -> ("resource_record_set_count", (Long.to_json f))); + Util.option_map v.config + (fun f -> ("config", (HostedZoneConfig.to_json f))); + Some ("caller_reference", (String.to_json v.caller_reference)); + Some ("name", (String.to_json v.name)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + caller_reference = + (String.of_json + (Util.of_option_exn (Json.lookup j "caller_reference"))); + config = + (Util.option_map (Json.lookup j "config") HostedZoneConfig.of_json); + resource_record_set_count = + (Util.option_map (Json.lookup j "resource_record_set_count") + Long.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.private_zone (fun f -> - Query.Pair ("PrivateZone", Boolean.to_query f)) - ; Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.private_zone (fun f -> "private_zone", Boolean.to_json f) - ; Util.option_map v.comment (fun f -> "comment", String.to_json f) - ]) - - let of_json j = - { comment = Util.option_map (Json.lookup j "comment") String.of_json - ; private_zone = Util.option_map (Json.lookup j "private_zone") Boolean.of_json - } -end - -module StatusReport = struct - type t = - { status : String.t option - ; checked_time : DateTime.t option - } - - let make ?status ?checked_time () = { status; checked_time } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "Status" xml) String.parse - ; checked_time = Util.option_bind (Xml.member "CheckedTime" xml) DateTime.parse + end +module ChangeStatus = + struct + type t = + | PENDING + | INSYNC + let str_to_t = [("INSYNC", INSYNC); ("PENDING", PENDING)] + let t_to_str = [(INSYNC, "INSYNC"); (PENDING, "PENDING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module HealthCheckObservation = + struct + type t = + { + i_p_address: String.t option ; + status_report: StatusReport.t option } + let make ?i_p_address ?status_report () = + { i_p_address; status_report } + let parse xml = + Some + { + i_p_address = + (Util.option_bind (Xml.member "IPAddress" xml) String.parse); + status_report = + (Util.option_bind (Xml.member "StatusReport" xml) + StatusReport.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status_report + (fun f -> + Query.Pair ("StatusReport", (StatusReport.to_query f))); + Util.option_map v.i_p_address + (fun f -> Query.Pair ("IPAddress", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status_report + (fun f -> ("status_report", (StatusReport.to_json f))); + Util.option_map v.i_p_address + (fun f -> ("i_p_address", (String.to_json f)))]) + let of_json j = + { + i_p_address = + (Util.option_map (Json.lookup j "i_p_address") String.of_json); + status_report = + (Util.option_map (Json.lookup j "status_report") + StatusReport.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.checked_time (fun f -> - Query.Pair ("CheckedTime", DateTime.to_query f)) - ; Util.option_map v.status (fun f -> Query.Pair ("Status", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.checked_time (fun f -> "checked_time", DateTime.to_json f) - ; Util.option_map v.status (fun f -> "status", String.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") String.of_json - ; checked_time = Util.option_map (Json.lookup j "checked_time") DateTime.of_json - } -end - -module HealthCheckConfig = struct - type t = - { i_p_address : String.t option - ; port : Integer.t option - ; type_ : HealthCheckType.t - ; resource_path : String.t option - ; fully_qualified_domain_name : String.t option - ; search_string : String.t option - ; request_interval : Integer.t option - ; failure_threshold : Integer.t option - } - - let make - ?i_p_address - ?port - ~type_ - ?resource_path - ?fully_qualified_domain_name - ?search_string - ?request_interval - ?failure_threshold - () = - { i_p_address - ; port - ; type_ - ; resource_path - ; fully_qualified_domain_name - ; search_string - ; request_interval - ; failure_threshold - } - - let parse xml = - Some - { i_p_address = Util.option_bind (Xml.member "IPAddress" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; type_ = - Xml.required - "Type" - (Util.option_bind (Xml.member "Type" xml) HealthCheckType.parse) - ; resource_path = Util.option_bind (Xml.member "ResourcePath" xml) String.parse - ; fully_qualified_domain_name = - Util.option_bind (Xml.member "FullyQualifiedDomainName" xml) String.parse - ; search_string = Util.option_bind (Xml.member "SearchString" xml) String.parse - ; request_interval = - Util.option_bind (Xml.member "RequestInterval" xml) Integer.parse - ; failure_threshold = - Util.option_bind (Xml.member "FailureThreshold" xml) Integer.parse + end +module GeoLocationDetails = + struct + type t = + { + continent_code: String.t option ; + continent_name: String.t option ; + country_code: String.t option ; + country_name: String.t option ; + subdivision_code: String.t option ; + subdivision_name: String.t option } + let make ?continent_code ?continent_name ?country_code ?country_name + ?subdivision_code ?subdivision_name () = + { + continent_code; + continent_name; + country_code; + country_name; + subdivision_code; + subdivision_name } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.failure_threshold (fun f -> - Query.Pair ("FailureThreshold", Integer.to_query f)) - ; Util.option_map v.request_interval (fun f -> - Query.Pair ("RequestInterval", Integer.to_query f)) - ; Util.option_map v.search_string (fun f -> - Query.Pair ("SearchString", String.to_query f)) - ; Util.option_map v.fully_qualified_domain_name (fun f -> - Query.Pair ("FullyQualifiedDomainName", String.to_query f)) - ; Util.option_map v.resource_path (fun f -> - Query.Pair ("ResourcePath", String.to_query f)) - ; Some (Query.Pair ("Type", HealthCheckType.to_query v.type_)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.i_p_address (fun f -> - Query.Pair ("IPAddress", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.failure_threshold (fun f -> - "failure_threshold", Integer.to_json f) - ; Util.option_map v.request_interval (fun f -> - "request_interval", Integer.to_json f) - ; Util.option_map v.search_string (fun f -> "search_string", String.to_json f) - ; Util.option_map v.fully_qualified_domain_name (fun f -> - "fully_qualified_domain_name", String.to_json f) - ; Util.option_map v.resource_path (fun f -> "resource_path", String.to_json f) - ; Some ("type_", HealthCheckType.to_json v.type_) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.i_p_address (fun f -> "i_p_address", String.to_json f) - ]) - - let of_json j = - { i_p_address = Util.option_map (Json.lookup j "i_p_address") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; type_ = HealthCheckType.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; resource_path = Util.option_map (Json.lookup j "resource_path") String.of_json - ; fully_qualified_domain_name = - Util.option_map (Json.lookup j "fully_qualified_domain_name") String.of_json - ; search_string = Util.option_map (Json.lookup j "search_string") String.of_json - ; request_interval = - Util.option_map (Json.lookup j "request_interval") Integer.of_json - ; failure_threshold = - Util.option_map (Json.lookup j "failure_threshold") Integer.of_json - } -end - -module TagList = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module TagResourceType = struct - type t = - | Healthcheck - | Hostedzone - - let str_to_t = [ "hostedzone", Hostedzone; "healthcheck", Healthcheck ] - - let t_to_str = [ Hostedzone, "hostedzone"; Healthcheck, "healthcheck" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DelegationSetNameServers = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "NameServer" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module Change = struct - type t = - { action : ChangeAction.t - ; resource_record_set : ResourceRecordSet.t - } - - let make ~action ~resource_record_set () = { action; resource_record_set } - - let parse xml = - Some - { action = - Xml.required - "Action" - (Util.option_bind (Xml.member "Action" xml) ChangeAction.parse) - ; resource_record_set = - Xml.required - "ResourceRecordSet" - (Util.option_bind - (Xml.member "ResourceRecordSet" xml) - ResourceRecordSet.parse) + let parse xml = + Some + { + continent_code = + (Util.option_bind (Xml.member "ContinentCode" xml) String.parse); + continent_name = + (Util.option_bind (Xml.member "ContinentName" xml) String.parse); + country_code = + (Util.option_bind (Xml.member "CountryCode" xml) String.parse); + country_name = + (Util.option_bind (Xml.member "CountryName" xml) String.parse); + subdivision_code = + (Util.option_bind (Xml.member "SubdivisionCode" xml) String.parse); + subdivision_name = + (Util.option_bind (Xml.member "SubdivisionName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subdivision_name + (fun f -> Query.Pair ("SubdivisionName", (String.to_query f))); + Util.option_map v.subdivision_code + (fun f -> Query.Pair ("SubdivisionCode", (String.to_query f))); + Util.option_map v.country_name + (fun f -> Query.Pair ("CountryName", (String.to_query f))); + Util.option_map v.country_code + (fun f -> Query.Pair ("CountryCode", (String.to_query f))); + Util.option_map v.continent_name + (fun f -> Query.Pair ("ContinentName", (String.to_query f))); + Util.option_map v.continent_code + (fun f -> Query.Pair ("ContinentCode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subdivision_name + (fun f -> ("subdivision_name", (String.to_json f))); + Util.option_map v.subdivision_code + (fun f -> ("subdivision_code", (String.to_json f))); + Util.option_map v.country_name + (fun f -> ("country_name", (String.to_json f))); + Util.option_map v.country_code + (fun f -> ("country_code", (String.to_json f))); + Util.option_map v.continent_name + (fun f -> ("continent_name", (String.to_json f))); + Util.option_map v.continent_code + (fun f -> ("continent_code", (String.to_json f)))]) + let of_json j = + { + continent_code = + (Util.option_map (Json.lookup j "continent_code") String.of_json); + continent_name = + (Util.option_map (Json.lookup j "continent_name") String.of_json); + country_code = + (Util.option_map (Json.lookup j "country_code") String.of_json); + country_name = + (Util.option_map (Json.lookup j "country_name") String.of_json); + subdivision_code = + (Util.option_map (Json.lookup j "subdivision_code") String.of_json); + subdivision_name = + (Util.option_map (Json.lookup j "subdivision_name") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module HealthCheck = + struct + type t = + { + id: String.t ; + caller_reference: String.t ; + health_check_config: HealthCheckConfig.t ; + health_check_version: Long.t } + let make ~id ~caller_reference ~health_check_config + ~health_check_version () = + { id; caller_reference; health_check_config; health_check_version } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + caller_reference = + (Xml.required "CallerReference" + (Util.option_bind (Xml.member "CallerReference" xml) + String.parse)); + health_check_config = + (Xml.required "HealthCheckConfig" + (Util.option_bind (Xml.member "HealthCheckConfig" xml) + HealthCheckConfig.parse)); + health_check_version = + (Xml.required "HealthCheckVersion" + (Util.option_bind (Xml.member "HealthCheckVersion" xml) + Long.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckVersion", + (Long.to_query v.health_check_version))); + Some + (Query.Pair + ("HealthCheckConfig", + (HealthCheckConfig.to_query v.health_check_config))); + Some (Query.Pair - ("ResourceRecordSet", ResourceRecordSet.to_query v.resource_record_set)) - ; Some (Query.Pair ("Action", ChangeAction.to_query v.action)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("resource_record_set", ResourceRecordSet.to_json v.resource_record_set) - ; Some ("action", ChangeAction.to_json v.action) - ]) - - let of_json j = - { action = ChangeAction.of_json (Util.of_option_exn (Json.lookup j "action")) - ; resource_record_set = - ResourceRecordSet.of_json - (Util.of_option_exn (Json.lookup j "resource_record_set")) - } -end - -module VPCRegion = struct - type t = - | Us_east_1 - | Us_west_1 - | Us_west_2 - | Eu_west_1 - | Eu_central_1 - | Ap_southeast_1 - | Ap_southeast_2 - | Ap_northeast_1 - | Sa_east_1 - | Cn_north_1 - - let str_to_t = - [ "cn-north-1", Cn_north_1 - ; "sa-east-1", Sa_east_1 - ; "ap-northeast-1", Ap_northeast_1 - ; "ap-southeast-2", Ap_southeast_2 - ; "ap-southeast-1", Ap_southeast_1 - ; "eu-central-1", Eu_central_1 - ; "eu-west-1", Eu_west_1 - ; "us-west-2", Us_west_2 - ; "us-west-1", Us_west_1 - ; "us-east-1", Us_east_1 - ] - - let t_to_str = - [ Cn_north_1, "cn-north-1" - ; Sa_east_1, "sa-east-1" - ; Ap_northeast_1, "ap-northeast-1" - ; Ap_southeast_2, "ap-southeast-2" - ; Ap_southeast_1, "ap-southeast-1" - ; Eu_central_1, "eu-central-1" - ; Eu_west_1, "eu-west-1" - ; Us_west_2, "us-west-2" - ; Us_west_1, "us-west-1" - ; Us_east_1, "us-east-1" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module HostedZone = struct - type t = - { id : String.t - ; name : String.t - ; caller_reference : String.t - ; config : HostedZoneConfig.t option - ; resource_record_set_count : Long.t option - } - - let make ~id ~name ~caller_reference ?config ?resource_record_set_count () = - { id; name; caller_reference; config; resource_record_set_count } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; caller_reference = - Xml.required - "CallerReference" - (Util.option_bind (Xml.member "CallerReference" xml) String.parse) - ; config = Util.option_bind (Xml.member "Config" xml) HostedZoneConfig.parse - ; resource_record_set_count = - Util.option_bind (Xml.member "ResourceRecordSetCount" xml) Long.parse + ("CallerReference", (String.to_query v.caller_reference))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("health_check_version", (Long.to_json v.health_check_version)); + Some + ("health_check_config", + (HealthCheckConfig.to_json v.health_check_config)); + Some ("caller_reference", (String.to_json v.caller_reference)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + caller_reference = + (String.of_json + (Util.of_option_exn (Json.lookup j "caller_reference"))); + health_check_config = + (HealthCheckConfig.of_json + (Util.of_option_exn (Json.lookup j "health_check_config"))); + health_check_version = + (Long.of_json + (Util.of_option_exn (Json.lookup j "health_check_version"))) + } + end +module ResourceTagSet = + struct + type t = + { + resource_type: TagResourceType.t option ; + resource_id: String.t option ; + tags: TagList.t } + let make ?resource_type ?resource_id ?(tags= []) () = + { resource_type; resource_id; tags } + let parse xml = + Some + { + resource_type = + (Util.option_bind (Xml.member "ResourceType" xml) + TagResourceType.parse); + resource_id = + (Util.option_bind (Xml.member "ResourceId" xml) String.parse); + tags = + (Util.of_option [] + (Util.option_bind (Xml.member "Tags" xml) TagList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tags.member", (TagList.to_query v.tags))); + Util.option_map v.resource_id + (fun f -> Query.Pair ("ResourceId", (String.to_query f))); + Util.option_map v.resource_type + (fun f -> + Query.Pair ("ResourceType", (TagResourceType.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tags", (TagList.to_json v.tags)); + Util.option_map v.resource_id + (fun f -> ("resource_id", (String.to_json f))); + Util.option_map v.resource_type + (fun f -> ("resource_type", (TagResourceType.to_json f)))]) + let of_json j = + { + resource_type = + (Util.option_map (Json.lookup j "resource_type") + TagResourceType.of_json); + resource_id = + (Util.option_map (Json.lookup j "resource_id") String.of_json); + tags = (TagList.of_json (Util.of_option_exn (Json.lookup j "tags"))) + } + end +module DelegationSet = + struct + type t = + { + id: String.t option ; + caller_reference: String.t option ; + name_servers: DelegationSetNameServers.t } + let make ?id ?caller_reference ~name_servers () = + { id; caller_reference; name_servers } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + caller_reference = + (Util.option_bind (Xml.member "CallerReference" xml) String.parse); + name_servers = + (Xml.required "NameServers" + (Util.option_bind (Xml.member "NameServers" xml) + DelegationSetNameServers.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NameServers.member", + (DelegationSetNameServers.to_query v.name_servers))); + Util.option_map v.caller_reference + (fun f -> Query.Pair ("CallerReference", (String.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("name_servers", + (DelegationSetNameServers.to_json v.name_servers)); + Util.option_map v.caller_reference + (fun f -> ("caller_reference", (String.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + caller_reference = + (Util.option_map (Json.lookup j "caller_reference") String.of_json); + name_servers = + (DelegationSetNameServers.of_json + (Util.of_option_exn (Json.lookup j "name_servers"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.resource_record_set_count (fun f -> - Query.Pair ("ResourceRecordSetCount", Long.to_query f)) - ; Util.option_map v.config (fun f -> - Query.Pair ("Config", HostedZoneConfig.to_query f)) - ; Some (Query.Pair ("CallerReference", String.to_query v.caller_reference)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.resource_record_set_count (fun f -> - "resource_record_set_count", Long.to_json f) - ; Util.option_map v.config (fun f -> "config", HostedZoneConfig.to_json f) - ; Some ("caller_reference", String.to_json v.caller_reference) - ; Some ("name", String.to_json v.name) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; caller_reference = - String.of_json (Util.of_option_exn (Json.lookup j "caller_reference")) - ; config = Util.option_map (Json.lookup j "config") HostedZoneConfig.of_json - ; resource_record_set_count = - Util.option_map (Json.lookup j "resource_record_set_count") Long.of_json - } -end - -module ChangeStatus = struct - type t = - | PENDING - | INSYNC - - let str_to_t = [ "INSYNC", INSYNC; "PENDING", PENDING ] - - let t_to_str = [ INSYNC, "INSYNC"; PENDING, "PENDING" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module HealthCheckObservation = struct - type t = - { i_p_address : String.t option - ; status_report : StatusReport.t option - } - - let make ?i_p_address ?status_report () = { i_p_address; status_report } - - let parse xml = - Some - { i_p_address = Util.option_bind (Xml.member "IPAddress" xml) String.parse - ; status_report = - Util.option_bind (Xml.member "StatusReport" xml) StatusReport.parse + end +module Changes = + struct + type t = Change.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Change.parse (Xml.members "Change" xml)) + let to_query v = Query.to_query_list Change.to_query v + let to_json v = `List (List.map Change.to_json v) + let of_json j = Json.to_list Change.of_json j + end +module VPC = + struct + type t = { + v_p_c_region: VPCRegion.t option ; + v_p_c_id: String.t option } + let make ?v_p_c_region ?v_p_c_id () = { v_p_c_region; v_p_c_id } + let parse xml = + Some + { + v_p_c_region = + (Util.option_bind (Xml.member "VPCRegion" xml) VPCRegion.parse); + v_p_c_id = (Util.option_bind (Xml.member "VPCId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.v_p_c_id + (fun f -> Query.Pair ("VPCId", (String.to_query f))); + Util.option_map v.v_p_c_region + (fun f -> Query.Pair ("VPCRegion", (VPCRegion.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.v_p_c_id + (fun f -> ("v_p_c_id", (String.to_json f))); + Util.option_map v.v_p_c_region + (fun f -> ("v_p_c_region", (VPCRegion.to_json f)))]) + let of_json j = + { + v_p_c_region = + (Util.option_map (Json.lookup j "v_p_c_region") VPCRegion.of_json); + v_p_c_id = + (Util.option_map (Json.lookup j "v_p_c_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status_report (fun f -> - Query.Pair ("StatusReport", StatusReport.to_query f)) - ; Util.option_map v.i_p_address (fun f -> - Query.Pair ("IPAddress", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status_report (fun f -> - "status_report", StatusReport.to_json f) - ; Util.option_map v.i_p_address (fun f -> "i_p_address", String.to_json f) - ]) - - let of_json j = - { i_p_address = Util.option_map (Json.lookup j "i_p_address") String.of_json - ; status_report = Util.option_map (Json.lookup j "status_report") StatusReport.of_json - } -end - -module GeoLocationDetails = struct - type t = - { continent_code : String.t option - ; continent_name : String.t option - ; country_code : String.t option - ; country_name : String.t option - ; subdivision_code : String.t option - ; subdivision_name : String.t option - } - - let make - ?continent_code - ?continent_name - ?country_code - ?country_name - ?subdivision_code - ?subdivision_name - () = - { continent_code - ; continent_name - ; country_code - ; country_name - ; subdivision_code - ; subdivision_name - } - - let parse xml = - Some - { continent_code = Util.option_bind (Xml.member "ContinentCode" xml) String.parse - ; continent_name = Util.option_bind (Xml.member "ContinentName" xml) String.parse - ; country_code = Util.option_bind (Xml.member "CountryCode" xml) String.parse - ; country_name = Util.option_bind (Xml.member "CountryName" xml) String.parse - ; subdivision_code = - Util.option_bind (Xml.member "SubdivisionCode" xml) String.parse - ; subdivision_name = - Util.option_bind (Xml.member "SubdivisionName" xml) String.parse + end +module HostedZones = + struct + type t = HostedZone.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map HostedZone.parse (Xml.members "HostedZone" xml)) + let to_query v = Query.to_query_list HostedZone.to_query v + let to_json v = `List (List.map HostedZone.to_json v) + let of_json j = Json.to_list HostedZone.of_json j + end +module ChangeInfo = + struct + type t = + { + id: String.t ; + status: ChangeStatus.t ; + submitted_at: DateTime.t ; + comment: String.t option } + let make ~id ~status ~submitted_at ?comment () = + { id; status; submitted_at; comment } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + status = + (Xml.required "Status" + (Util.option_bind (Xml.member "Status" xml) ChangeStatus.parse)); + submitted_at = + (Xml.required "SubmittedAt" + (Util.option_bind (Xml.member "SubmittedAt" xml) + DateTime.parse)); + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f))); + Some + (Query.Pair ("SubmittedAt", (DateTime.to_query v.submitted_at))); + Some (Query.Pair ("Status", (ChangeStatus.to_query v.status))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> ("comment", (String.to_json f))); + Some ("submitted_at", (DateTime.to_json v.submitted_at)); + Some ("status", (ChangeStatus.to_json v.status)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + status = + (ChangeStatus.of_json (Util.of_option_exn (Json.lookup j "status"))); + submitted_at = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "submitted_at"))); + comment = (Util.option_map (Json.lookup j "comment") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subdivision_name (fun f -> - Query.Pair ("SubdivisionName", String.to_query f)) - ; Util.option_map v.subdivision_code (fun f -> - Query.Pair ("SubdivisionCode", String.to_query f)) - ; Util.option_map v.country_name (fun f -> - Query.Pair ("CountryName", String.to_query f)) - ; Util.option_map v.country_code (fun f -> - Query.Pair ("CountryCode", String.to_query f)) - ; Util.option_map v.continent_name (fun f -> - Query.Pair ("ContinentName", String.to_query f)) - ; Util.option_map v.continent_code (fun f -> - Query.Pair ("ContinentCode", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subdivision_name (fun f -> - "subdivision_name", String.to_json f) - ; Util.option_map v.subdivision_code (fun f -> - "subdivision_code", String.to_json f) - ; Util.option_map v.country_name (fun f -> "country_name", String.to_json f) - ; Util.option_map v.country_code (fun f -> "country_code", String.to_json f) - ; Util.option_map v.continent_name (fun f -> "continent_name", String.to_json f) - ; Util.option_map v.continent_code (fun f -> "continent_code", String.to_json f) - ]) - - let of_json j = - { continent_code = Util.option_map (Json.lookup j "continent_code") String.of_json - ; continent_name = Util.option_map (Json.lookup j "continent_name") String.of_json - ; country_code = Util.option_map (Json.lookup j "country_code") String.of_json - ; country_name = Util.option_map (Json.lookup j "country_name") String.of_json - ; subdivision_code = Util.option_map (Json.lookup j "subdivision_code") String.of_json - ; subdivision_name = Util.option_map (Json.lookup j "subdivision_name") String.of_json - } -end - -module HealthCheck = struct - type t = - { id : String.t - ; caller_reference : String.t - ; health_check_config : HealthCheckConfig.t - ; health_check_version : Long.t - } - - let make ~id ~caller_reference ~health_check_config ~health_check_version () = - { id; caller_reference; health_check_config; health_check_version } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; caller_reference = - Xml.required - "CallerReference" - (Util.option_bind (Xml.member "CallerReference" xml) String.parse) - ; health_check_config = - Xml.required - "HealthCheckConfig" - (Util.option_bind - (Xml.member "HealthCheckConfig" xml) - HealthCheckConfig.parse) - ; health_check_version = - Xml.required - "HealthCheckVersion" - (Util.option_bind (Xml.member "HealthCheckVersion" xml) Long.parse) + end +module HealthCheckObservations = + struct + type t = HealthCheckObservation.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map HealthCheckObservation.parse + (Xml.members "HealthCheckObservation" xml)) + let to_query v = Query.to_query_list HealthCheckObservation.to_query v + let to_json v = `List (List.map HealthCheckObservation.to_json v) + let of_json j = Json.to_list HealthCheckObservation.of_json j + end +module CheckerIpRanges = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ErrorMessages = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "Message" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module TagResourceIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ResourceId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module GeoLocationDetailsList = + struct + type t = GeoLocationDetails.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map GeoLocationDetails.parse + (Xml.members "GeoLocationDetails" xml)) + let to_query v = Query.to_query_list GeoLocationDetails.to_query v + let to_json v = `List (List.map GeoLocationDetails.to_json v) + let of_json j = Json.to_list GeoLocationDetails.of_json j + end +module HealthChecks = + struct + type t = HealthCheck.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map HealthCheck.parse (Xml.members "HealthCheck" xml)) + let to_query v = Query.to_query_list HealthCheck.to_query v + let to_json v = `List (List.map HealthCheck.to_json v) + let of_json j = Json.to_list HealthCheck.of_json j + end +module TagKeyList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "Key" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ResourceTagSetList = + struct + type t = ResourceTagSet.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ResourceTagSet.parse (Xml.members "ResourceTagSet" xml)) + let to_query v = Query.to_query_list ResourceTagSet.to_query v + let to_json v = `List (List.map ResourceTagSet.to_json v) + let of_json j = Json.to_list ResourceTagSet.of_json j + end +module ResourceRecordSets = + struct + type t = ResourceRecordSet.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ResourceRecordSet.parse + (Xml.members "ResourceRecordSet" xml)) + let to_query v = Query.to_query_list ResourceRecordSet.to_query v + let to_json v = `List (List.map ResourceRecordSet.to_json v) + let of_json j = Json.to_list ResourceRecordSet.of_json j + end +module DelegationSets = + struct + type t = DelegationSet.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DelegationSet.parse (Xml.members "DelegationSet" xml)) + let to_query v = Query.to_query_list DelegationSet.to_query v + let to_json v = `List (List.map DelegationSet.to_json v) + let of_json j = Json.to_list DelegationSet.of_json j + end +module ChangeBatch = + struct + type t = { + comment: String.t option ; + changes: Changes.t } + let make ?comment ~changes () = { comment; changes } + let parse xml = + Some + { + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse); + changes = + (Xml.required "Changes" + (Util.option_bind (Xml.member "Changes" xml) Changes.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Changes.member", (Changes.to_query v.changes))); + Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("changes", (Changes.to_json v.changes)); + Util.option_map v.comment + (fun f -> ("comment", (String.to_json f)))]) + let of_json j = + { + comment = (Util.option_map (Json.lookup j "comment") String.of_json); + changes = + (Changes.of_json (Util.of_option_exn (Json.lookup j "changes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckVersion", Long.to_query v.health_check_version)) - ; Some + end +module VPCs = + struct + type t = VPC.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map VPC.parse (Xml.members "VPC" xml)) + let to_query v = Query.to_query_list VPC.to_query v + let to_json v = `List (List.map VPC.to_json v) + let of_json j = Json.to_list VPC.of_json j + end +module ListHostedZonesByNameResponse = + struct + type t = + { + hosted_zones: HostedZones.t ; + d_n_s_name: String.t option ; + hosted_zone_id: String.t option ; + is_truncated: Boolean.t ; + next_d_n_s_name: String.t option ; + next_hosted_zone_id: String.t option ; + max_items: String.t } + let make ~hosted_zones ?d_n_s_name ?hosted_zone_id ~is_truncated + ?next_d_n_s_name ?next_hosted_zone_id ~max_items () = + { + hosted_zones; + d_n_s_name; + hosted_zone_id; + is_truncated; + next_d_n_s_name; + next_hosted_zone_id; + max_items + } + let parse xml = + Some + { + hosted_zones = + (Xml.required "HostedZones" + (Util.option_bind (Xml.member "HostedZones" xml) + HostedZones.parse)); + d_n_s_name = + (Util.option_bind (Xml.member "DNSName" xml) String.parse); + hosted_zone_id = + (Util.option_bind (Xml.member "HostedZoneId" xml) String.parse); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_d_n_s_name = + (Util.option_bind (Xml.member "NextDNSName" xml) String.parse); + next_hosted_zone_id = + (Util.option_bind (Xml.member "NextHostedZoneId" xml) + String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_hosted_zone_id + (fun f -> Query.Pair ("NextHostedZoneId", (String.to_query f))); + Util.option_map v.next_d_n_s_name + (fun f -> Query.Pair ("NextDNSName", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Util.option_map v.hosted_zone_id + (fun f -> Query.Pair ("HostedZoneId", (String.to_query f))); + Util.option_map v.d_n_s_name + (fun f -> Query.Pair ("DNSName", (String.to_query f))); + Some (Query.Pair - ("HealthCheckConfig", HealthCheckConfig.to_query v.health_check_config)) - ; Some (Query.Pair ("CallerReference", String.to_query v.caller_reference)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_version", Long.to_json v.health_check_version) - ; Some ("health_check_config", HealthCheckConfig.to_json v.health_check_config) - ; Some ("caller_reference", String.to_json v.caller_reference) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; caller_reference = - String.of_json (Util.of_option_exn (Json.lookup j "caller_reference")) - ; health_check_config = - HealthCheckConfig.of_json - (Util.of_option_exn (Json.lookup j "health_check_config")) - ; health_check_version = - Long.of_json (Util.of_option_exn (Json.lookup j "health_check_version")) - } -end - -module ResourceTagSet = struct - type t = - { resource_type : TagResourceType.t option - ; resource_id : String.t option - ; tags : TagList.t - } - - let make ?resource_type ?resource_id ?(tags = []) () = - { resource_type; resource_id; tags } - - let parse xml = - Some - { resource_type = - Util.option_bind (Xml.member "ResourceType" xml) TagResourceType.parse - ; resource_id = Util.option_bind (Xml.member "ResourceId" xml) String.parse - ; tags = Util.of_option [] (Util.option_bind (Xml.member "Tags" xml) TagList.parse) + ("HostedZones.member", (HostedZones.to_query v.hosted_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_hosted_zone_id + (fun f -> ("next_hosted_zone_id", (String.to_json f))); + Util.option_map v.next_d_n_s_name + (fun f -> ("next_d_n_s_name", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Util.option_map v.hosted_zone_id + (fun f -> ("hosted_zone_id", (String.to_json f))); + Util.option_map v.d_n_s_name + (fun f -> ("d_n_s_name", (String.to_json f))); + Some ("hosted_zones", (HostedZones.to_json v.hosted_zones))]) + let of_json j = + { + hosted_zones = + (HostedZones.of_json + (Util.of_option_exn (Json.lookup j "hosted_zones"))); + d_n_s_name = + (Util.option_map (Json.lookup j "d_n_s_name") String.of_json); + hosted_zone_id = + (Util.option_map (Json.lookup j "hosted_zone_id") String.of_json); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_d_n_s_name = + (Util.option_map (Json.lookup j "next_d_n_s_name") String.of_json); + next_hosted_zone_id = + (Util.option_map (Json.lookup j "next_hosted_zone_id") + String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) + } + end +module DeleteReusableDelegationSetResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module HostedZoneNotFound = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ListHealthChecksRequest = + struct + type t = { + marker: String.t option ; + max_items: String.t option } + let make ?marker ?max_items () = { marker; max_items } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "marker" xml) String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tags.member", TagList.to_query v.tags)) - ; Util.option_map v.resource_id (fun f -> - Query.Pair ("ResourceId", String.to_query f)) - ; Util.option_map v.resource_type (fun f -> - Query.Pair ("ResourceType", TagResourceType.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tags", TagList.to_json v.tags) - ; Util.option_map v.resource_id (fun f -> "resource_id", String.to_json f) - ; Util.option_map v.resource_type (fun f -> - "resource_type", TagResourceType.to_json f) - ]) - - let of_json j = - { resource_type = - Util.option_map (Json.lookup j "resource_type") TagResourceType.of_json - ; resource_id = Util.option_map (Json.lookup j "resource_id") String.of_json - ; tags = TagList.of_json (Util.of_option_exn (Json.lookup j "tags")) - } -end - -module DelegationSet = struct - type t = - { id : String.t option - ; caller_reference : String.t option - ; name_servers : DelegationSetNameServers.t - } - - let make ?id ?caller_reference ~name_servers () = { id; caller_reference; name_servers } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; caller_reference = - Util.option_bind (Xml.member "CallerReference" xml) String.parse - ; name_servers = - Xml.required - "NameServers" - (Util.option_bind - (Xml.member "NameServers" xml) - DelegationSetNameServers.parse) + end +module AssociateVPCWithHostedZoneResponse = + struct + type t = { + change_info: ChangeInfo.t } + let make ~change_info () = { change_info } + let parse xml = + Some + { + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_info", (ChangeInfo.to_json v.change_info))]) + let of_json j = + { + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module DelegationSetAlreadyReusable = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetChangeRequest = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module GetGeoLocationResponse = + struct + type t = { + geo_location_details: GeoLocationDetails.t } + let make ~geo_location_details () = { geo_location_details } + let parse xml = + Some + { + geo_location_details = + (Xml.required "GeoLocationDetails" + (Util.option_bind (Xml.member "GeoLocationDetails" xml) + GeoLocationDetails.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("GeoLocationDetails", + (GeoLocationDetails.to_query v.geo_location_details)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("geo_location_details", + (GeoLocationDetails.to_json v.geo_location_details))]) + let of_json j = + { + geo_location_details = + (GeoLocationDetails.of_json + (Util.of_option_exn (Json.lookup j "geo_location_details"))) + } + end +module GetHealthCheckLastFailureReasonResponse = + struct + type t = { + health_check_observations: HealthCheckObservations.t } + let make ~health_check_observations () = { health_check_observations } + let parse xml = + Some + { + health_check_observations = + (Xml.required "HealthCheckObservations" + (Util.option_bind (Xml.member "HealthCheckObservations" xml) + HealthCheckObservations.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckObservations.member", + (HealthCheckObservations.to_query + v.health_check_observations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("health_check_observations", + (HealthCheckObservations.to_json v.health_check_observations))]) + let of_json j = + { + health_check_observations = + (HealthCheckObservations.of_json + (Util.of_option_exn (Json.lookup j "health_check_observations"))) + } + end +module GetHostedZoneRequest = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module DelegationSetAlreadyCreated = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ListReusableDelegationSetsRequest = + struct + type t = { + marker: String.t option ; + max_items: String.t option } + let make ?marker ?max_items () = { marker; max_items } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "marker" xml) String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json) + } + end +module InvalidArgument = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module CreateHostedZoneResponse = + struct + type t = + { + hosted_zone: HostedZone.t ; + change_info: ChangeInfo.t ; + delegation_set: DelegationSet.t ; + v_p_c: VPC.t option ; + location: String.t } + let make ~hosted_zone ~change_info ~delegation_set ?v_p_c ~location + () = { hosted_zone; change_info; delegation_set; v_p_c; location } + let parse xml = + Some + { + hosted_zone = + (Xml.required "HostedZone" + (Util.option_bind (Xml.member "HostedZone" xml) + HostedZone.parse)); + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)); + delegation_set = + (Xml.required "DelegationSet" + (Util.option_bind (Xml.member "DelegationSet" xml) + DelegationSet.parse)); + v_p_c = (Util.option_bind (Xml.member "VPC" xml) VPC.parse); + location = + (Xml.required "Location" + (Util.option_bind (Xml.member "Location" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Location", (String.to_query v.location))); + Util.option_map v.v_p_c + (fun f -> Query.Pair ("VPC", (VPC.to_query f))); + Some (Query.Pair - ("NameServers.member", DelegationSetNameServers.to_query v.name_servers)) - ; Util.option_map v.caller_reference (fun f -> - Query.Pair ("CallerReference", String.to_query f)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("name_servers", DelegationSetNameServers.to_json v.name_servers) - ; Util.option_map v.caller_reference (fun f -> - "caller_reference", String.to_json f) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; caller_reference = Util.option_map (Json.lookup j "caller_reference") String.of_json - ; name_servers = - DelegationSetNameServers.of_json - (Util.of_option_exn (Json.lookup j "name_servers")) - } -end - -module Changes = struct - type t = Change.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Change.parse (Xml.members "Change" xml)) - - let to_query v = Query.to_query_list Change.to_query v - - let to_json v = `List (List.map Change.to_json v) - - let of_json j = Json.to_list Change.of_json j -end - -module VPC = struct - type t = - { v_p_c_region : VPCRegion.t option - ; v_p_c_id : String.t option - } - - let make ?v_p_c_region ?v_p_c_id () = { v_p_c_region; v_p_c_id } - - let parse xml = - Some - { v_p_c_region = Util.option_bind (Xml.member "VPCRegion" xml) VPCRegion.parse - ; v_p_c_id = Util.option_bind (Xml.member "VPCId" xml) String.parse + ("DelegationSet", (DelegationSet.to_query v.delegation_set))); + Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info))); + Some + (Query.Pair ("HostedZone", (HostedZone.to_query v.hosted_zone)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("location", (String.to_json v.location)); + Util.option_map v.v_p_c (fun f -> ("v_p_c", (VPC.to_json f))); + Some ("delegation_set", (DelegationSet.to_json v.delegation_set)); + Some ("change_info", (ChangeInfo.to_json v.change_info)); + Some ("hosted_zone", (HostedZone.to_json v.hosted_zone))]) + let of_json j = + { + hosted_zone = + (HostedZone.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone"))); + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))); + delegation_set = + (DelegationSet.of_json + (Util.of_option_exn (Json.lookup j "delegation_set"))); + v_p_c = (Util.option_map (Json.lookup j "v_p_c") VPC.of_json); + location = + (String.of_json (Util.of_option_exn (Json.lookup j "location"))) + } + end +module GetHealthCheckStatusResponse = + struct + type t = { + health_check_observations: HealthCheckObservations.t } + let make ~health_check_observations () = { health_check_observations } + let parse xml = + Some + { + health_check_observations = + (Xml.required "HealthCheckObservations" + (Util.option_bind (Xml.member "HealthCheckObservations" xml) + HealthCheckObservations.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckObservations.member", + (HealthCheckObservations.to_query + v.health_check_observations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("health_check_observations", + (HealthCheckObservations.to_json v.health_check_observations))]) + let of_json j = + { + health_check_observations = + (HealthCheckObservations.of_json + (Util.of_option_exn (Json.lookup j "health_check_observations"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.v_p_c_id (fun f -> Query.Pair ("VPCId", String.to_query f)) - ; Util.option_map v.v_p_c_region (fun f -> - Query.Pair ("VPCRegion", VPCRegion.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.v_p_c_id (fun f -> "v_p_c_id", String.to_json f) - ; Util.option_map v.v_p_c_region (fun f -> "v_p_c_region", VPCRegion.to_json f) - ]) - - let of_json j = - { v_p_c_region = Util.option_map (Json.lookup j "v_p_c_region") VPCRegion.of_json - ; v_p_c_id = Util.option_map (Json.lookup j "v_p_c_id") String.of_json - } -end - -module HostedZones = struct - type t = HostedZone.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map HostedZone.parse (Xml.members "HostedZone" xml)) - - let to_query v = Query.to_query_list HostedZone.to_query v - - let to_json v = `List (List.map HostedZone.to_json v) - - let of_json j = Json.to_list HostedZone.of_json j -end - -module ChangeInfo = struct - type t = - { id : String.t - ; status : ChangeStatus.t - ; submitted_at : DateTime.t - ; comment : String.t option - } - - let make ~id ~status ~submitted_at ?comment () = { id; status; submitted_at; comment } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; status = - Xml.required - "Status" - (Util.option_bind (Xml.member "Status" xml) ChangeStatus.parse) - ; submitted_at = - Xml.required - "SubmittedAt" - (Util.option_bind (Xml.member "SubmittedAt" xml) DateTime.parse) - ; comment = Util.option_bind (Xml.member "Comment" xml) String.parse + end +module GetCheckerIpRangesResponse = + struct + type t = { + checker_ip_ranges: CheckerIpRanges.t } + let make ~checker_ip_ranges () = { checker_ip_ranges } + let parse xml = + Some + { + checker_ip_ranges = + (Xml.required "CheckerIpRanges" + (Util.option_bind (Xml.member "CheckerIpRanges" xml) + CheckerIpRanges.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CheckerIpRanges.member", + (CheckerIpRanges.to_query v.checker_ip_ranges)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("checker_ip_ranges", + (CheckerIpRanges.to_json v.checker_ip_ranges))]) + let of_json j = + { + checker_ip_ranges = + (CheckerIpRanges.of_json + (Util.of_option_exn (Json.lookup j "checker_ip_ranges"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ; Some (Query.Pair ("SubmittedAt", DateTime.to_query v.submitted_at)) - ; Some (Query.Pair ("Status", ChangeStatus.to_query v.status)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> "comment", String.to_json f) - ; Some ("submitted_at", DateTime.to_json v.submitted_at) - ; Some ("status", ChangeStatus.to_json v.status) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; status = ChangeStatus.of_json (Util.of_option_exn (Json.lookup j "status")) - ; submitted_at = DateTime.of_json (Util.of_option_exn (Json.lookup j "submitted_at")) - ; comment = Util.option_map (Json.lookup j "comment") String.of_json - } -end - -module HealthCheckObservations = struct - type t = HealthCheckObservation.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map HealthCheckObservation.parse (Xml.members "HealthCheckObservation" xml)) - - let to_query v = Query.to_query_list HealthCheckObservation.to_query v - - let to_json v = `List (List.map HealthCheckObservation.to_json v) - - let of_json j = Json.to_list HealthCheckObservation.of_json j -end - -module CheckerIpRanges = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ErrorMessages = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "Message" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module TagResourceIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ResourceId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module GeoLocationDetailsList = struct - type t = GeoLocationDetails.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map GeoLocationDetails.parse (Xml.members "GeoLocationDetails" xml)) - - let to_query v = Query.to_query_list GeoLocationDetails.to_query v - - let to_json v = `List (List.map GeoLocationDetails.to_json v) - - let of_json j = Json.to_list GeoLocationDetails.of_json j -end - -module HealthChecks = struct - type t = HealthCheck.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map HealthCheck.parse (Xml.members "HealthCheck" xml)) - - let to_query v = Query.to_query_list HealthCheck.to_query v - - let to_json v = `List (List.map HealthCheck.to_json v) - - let of_json j = Json.to_list HealthCheck.of_json j -end - -module TagKeyList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "Key" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ResourceTagSetList = struct - type t = ResourceTagSet.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ResourceTagSet.parse (Xml.members "ResourceTagSet" xml)) - - let to_query v = Query.to_query_list ResourceTagSet.to_query v - - let to_json v = `List (List.map ResourceTagSet.to_json v) - - let of_json j = Json.to_list ResourceTagSet.of_json j -end - -module ResourceRecordSets = struct - type t = ResourceRecordSet.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map ResourceRecordSet.parse (Xml.members "ResourceRecordSet" xml)) - - let to_query v = Query.to_query_list ResourceRecordSet.to_query v - - let to_json v = `List (List.map ResourceRecordSet.to_json v) - - let of_json j = Json.to_list ResourceRecordSet.of_json j -end - -module DelegationSets = struct - type t = DelegationSet.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DelegationSet.parse (Xml.members "DelegationSet" xml)) - - let to_query v = Query.to_query_list DelegationSet.to_query v - - let to_json v = `List (List.map DelegationSet.to_json v) - - let of_json j = Json.to_list DelegationSet.of_json j -end - -module ChangeBatch = struct - type t = - { comment : String.t option - ; changes : Changes.t - } - - let make ?comment ~changes () = { comment; changes } - - let parse xml = - Some - { comment = Util.option_bind (Xml.member "Comment" xml) String.parse - ; changes = - Xml.required - "Changes" - (Util.option_bind (Xml.member "Changes" xml) Changes.parse) + end +module ThrottlingException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Changes.member", Changes.to_query v.changes)) - ; Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("changes", Changes.to_json v.changes) - ; Util.option_map v.comment (fun f -> "comment", String.to_json f) - ]) - - let of_json j = - { comment = Util.option_map (Json.lookup j "comment") String.of_json - ; changes = Changes.of_json (Util.of_option_exn (Json.lookup j "changes")) - } -end - -module VPCs = struct - type t = VPC.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map VPC.parse (Xml.members "VPC" xml)) - - let to_query v = Query.to_query_list VPC.to_query v - - let to_json v = `List (List.map VPC.to_json v) - - let of_json j = Json.to_list VPC.of_json j -end - -module ListHostedZonesByNameResponse = struct - type t = - { hosted_zones : HostedZones.t - ; d_n_s_name : String.t option - ; hosted_zone_id : String.t option - ; is_truncated : Boolean.t - ; next_d_n_s_name : String.t option - ; next_hosted_zone_id : String.t option - ; max_items : String.t - } - - let make - ~hosted_zones - ?d_n_s_name - ?hosted_zone_id - ~is_truncated - ?next_d_n_s_name - ?next_hosted_zone_id - ~max_items - () = - { hosted_zones - ; d_n_s_name - ; hosted_zone_id - ; is_truncated - ; next_d_n_s_name - ; next_hosted_zone_id - ; max_items - } - - let parse xml = - Some - { hosted_zones = - Xml.required - "HostedZones" - (Util.option_bind (Xml.member "HostedZones" xml) HostedZones.parse) - ; d_n_s_name = Util.option_bind (Xml.member "DNSName" xml) String.parse - ; hosted_zone_id = Util.option_bind (Xml.member "HostedZoneId" xml) String.parse - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_d_n_s_name = Util.option_bind (Xml.member "NextDNSName" xml) String.parse - ; next_hosted_zone_id = - Util.option_bind (Xml.member "NextHostedZoneId" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module InvalidInput = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_hosted_zone_id (fun f -> - Query.Pair ("NextHostedZoneId", String.to_query f)) - ; Util.option_map v.next_d_n_s_name (fun f -> - Query.Pair ("NextDNSName", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Util.option_map v.hosted_zone_id (fun f -> - Query.Pair ("HostedZoneId", String.to_query f)) - ; Util.option_map v.d_n_s_name (fun f -> - Query.Pair ("DNSName", String.to_query f)) - ; Some (Query.Pair ("HostedZones.member", HostedZones.to_query v.hosted_zones)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_hosted_zone_id (fun f -> - "next_hosted_zone_id", String.to_json f) - ; Util.option_map v.next_d_n_s_name (fun f -> - "next_d_n_s_name", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Util.option_map v.hosted_zone_id (fun f -> "hosted_zone_id", String.to_json f) - ; Util.option_map v.d_n_s_name (fun f -> "d_n_s_name", String.to_json f) - ; Some ("hosted_zones", HostedZones.to_json v.hosted_zones) - ]) - - let of_json j = - { hosted_zones = - HostedZones.of_json (Util.of_option_exn (Json.lookup j "hosted_zones")) - ; d_n_s_name = Util.option_map (Json.lookup j "d_n_s_name") String.of_json - ; hosted_zone_id = Util.option_map (Json.lookup j "hosted_zone_id") String.of_json - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_d_n_s_name = Util.option_map (Json.lookup j "next_d_n_s_name") String.of_json - ; next_hosted_zone_id = - Util.option_map (Json.lookup j "next_hosted_zone_id") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module DeleteReusableDelegationSetResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module HostedZoneNotFound = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListHealthChecksRequest = struct - type t = - { marker : String.t option - ; max_items : String.t option - } - - let make ?marker ?max_items () = { marker; max_items } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "marker" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse + end +module NoSuchDelegationSet = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - } -end - -module AssociateVPCWithHostedZoneResponse = struct - type t = { change_info : ChangeInfo.t } - - let make ~change_info () = { change_info } - - let parse xml = - Some - { change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) + end +module GetHealthCheckResponse = + struct + type t = { + health_check: HealthCheck.t } + let make ~health_check () = { health_check } + let parse xml = + Some + { + health_check = + (Xml.required "HealthCheck" + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheck", (HealthCheck.to_query v.health_check)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check", (HealthCheck.to_json v.health_check))]) + let of_json j = + { + health_check = + (HealthCheck.of_json + (Util.of_option_exn (Json.lookup j "health_check"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("change_info", ChangeInfo.to_json v.change_info) ]) - - let of_json j = - { change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - } -end - -module DelegationSetAlreadyReusable = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetChangeRequest = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module GetGeoLocationResponse = struct - type t = { geo_location_details : GeoLocationDetails.t } - - let make ~geo_location_details () = { geo_location_details } - - let parse xml = - Some - { geo_location_details = - Xml.required - "GeoLocationDetails" - (Util.option_bind - (Xml.member "GeoLocationDetails" xml) - GeoLocationDetails.parse) + end +module GetHealthCheckStatusRequest = + struct + type t = { + health_check_id: String.t } + let make ~health_check_id () = { health_check_id } + let parse xml = + Some + { + health_check_id = + (Xml.required "HealthCheckId" + (Util.option_bind (Xml.member "HealthCheckId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckId", (String.to_query v.health_check_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check_id", (String.to_json v.health_check_id))]) + let of_json j = + { + health_check_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_id"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module ListTagsForResourceRequest = + struct + type t = { + resource_type: TagResourceType.t ; + resource_id: String.t } + let make ~resource_type ~resource_id () = + { resource_type; resource_id } + let parse xml = + Some + { + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) + TagResourceType.parse)); + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("ResourceId", (String.to_query v.resource_id))); + Some (Query.Pair - ("GeoLocationDetails", GeoLocationDetails.to_query v.geo_location_details)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("geo_location_details", GeoLocationDetails.to_json v.geo_location_details) - ]) - - let of_json j = - { geo_location_details = - GeoLocationDetails.of_json - (Util.of_option_exn (Json.lookup j "geo_location_details")) - } -end - -module GetHealthCheckLastFailureReasonResponse = struct - type t = { health_check_observations : HealthCheckObservations.t } - - let make ~health_check_observations () = { health_check_observations } - - let parse xml = - Some - { health_check_observations = - Xml.required - "HealthCheckObservations" - (Util.option_bind - (Xml.member "HealthCheckObservations" xml) - HealthCheckObservations.parse) + ("ResourceType", (TagResourceType.to_query v.resource_type)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("resource_id", (String.to_json v.resource_id)); + Some ("resource_type", (TagResourceType.to_json v.resource_type))]) + let of_json j = + { + resource_type = + (TagResourceType.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))) + } + end +module HostedZoneNotEmpty = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetCheckerIpRangesRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetHealthCheckLastFailureReasonRequest = + struct + type t = { + health_check_id: String.t } + let make ~health_check_id () = { health_check_id } + let parse xml = + Some + { + health_check_id = + (Xml.required "HealthCheckId" + (Util.option_bind (Xml.member "HealthCheckId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckId", (String.to_query v.health_check_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check_id", (String.to_json v.health_check_id))]) + let of_json j = + { + health_check_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_id"))) + } + end +module LimitsExceeded = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module PublicZoneVPCAssociation = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetHealthCheckRequest = + struct + type t = { + health_check_id: String.t } + let make ~health_check_id () = { health_check_id } + let parse xml = + Some + { + health_check_id = + (Xml.required "HealthCheckId" + (Util.option_bind (Xml.member "HealthCheckId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckId", (String.to_query v.health_check_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check_id", (String.to_json v.health_check_id))]) + let of_json j = + { + health_check_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_id"))) + } + end +module ListResourceRecordSetsRequest = + struct + type t = + { + hosted_zone_id: String.t ; + start_record_name: String.t option ; + start_record_type: RRType.t option ; + start_record_identifier: String.t option ; + max_items: String.t option } + let make ~hosted_zone_id ?start_record_name ?start_record_type + ?start_record_identifier ?max_items () = + { + hosted_zone_id; + start_record_name; + start_record_type; + start_record_identifier; + max_items + } + let parse xml = + Some + { + hosted_zone_id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + start_record_name = + (Util.option_bind (Xml.member "name" xml) String.parse); + start_record_type = + (Util.option_bind (Xml.member "type" xml) RRType.parse); + start_record_identifier = + (Util.option_bind (Xml.member "identifier" xml) String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.start_record_identifier + (fun f -> Query.Pair ("identifier", (String.to_query f))); + Util.option_map v.start_record_type + (fun f -> Query.Pair ("type", (RRType.to_query f))); + Util.option_map v.start_record_name + (fun f -> Query.Pair ("name", (String.to_query f))); + Some (Query.Pair ("Id", (String.to_query v.hosted_zone_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.start_record_identifier + (fun f -> ("start_record_identifier", (String.to_json f))); + Util.option_map v.start_record_type + (fun f -> ("start_record_type", (RRType.to_json f))); + Util.option_map v.start_record_name + (fun f -> ("start_record_name", (String.to_json f))); + Some ("hosted_zone_id", (String.to_json v.hosted_zone_id))]) + let of_json j = + { + hosted_zone_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_id"))); + start_record_name = + (Util.option_map (Json.lookup j "start_record_name") String.of_json); + start_record_type = + (Util.option_map (Json.lookup j "start_record_type") RRType.of_json); + start_record_identifier = + (Util.option_map (Json.lookup j "start_record_identifier") + String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module NoSuchChange = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetReusableDelegationSetResponse = + struct + type t = { + delegation_set: DelegationSet.t } + let make ~delegation_set () = { delegation_set } + let parse xml = + Some + { + delegation_set = + (Xml.required "DelegationSet" + (Util.option_bind (Xml.member "DelegationSet" xml) + DelegationSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("DelegationSet", (DelegationSet.to_query v.delegation_set)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("delegation_set", (DelegationSet.to_json v.delegation_set))]) + let of_json j = + { + delegation_set = + (DelegationSet.of_json + (Util.of_option_exn (Json.lookup j "delegation_set"))) + } + end +module ChangeResourceRecordSetsResponse = + struct + type t = { + change_info: ChangeInfo.t } + let make ~change_info () = { change_info } + let parse xml = + Some + { + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_info", (ChangeInfo.to_json v.change_info))]) + let of_json j = + { + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))) + } + end +module ChangeTagsForResourceResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidChangeBatch = + struct + type t = { + messages: ErrorMessages.t } + let make ?(messages= []) () = { messages } + let parse xml = + Some + { + messages = + (Util.of_option [] + (Util.option_bind (Xml.member "messages" xml) + ErrorMessages.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("messages.member", (ErrorMessages.to_query v.messages)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("messages", (ErrorMessages.to_json v.messages))]) + let of_json j = + { + messages = + (ErrorMessages.of_json + (Util.of_option_exn (Json.lookup j "messages"))) + } + end +module GetGeoLocationRequest = + struct + type t = + { + continent_code: String.t option ; + country_code: String.t option ; + subdivision_code: String.t option } + let make ?continent_code ?country_code ?subdivision_code () = + { continent_code; country_code; subdivision_code } + let parse xml = + Some + { + continent_code = + (Util.option_bind (Xml.member "continentcode" xml) String.parse); + country_code = + (Util.option_bind (Xml.member "countrycode" xml) String.parse); + subdivision_code = + (Util.option_bind (Xml.member "subdivisioncode" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.subdivision_code + (fun f -> Query.Pair ("subdivisioncode", (String.to_query f))); + Util.option_map v.country_code + (fun f -> Query.Pair ("countrycode", (String.to_query f))); + Util.option_map v.continent_code + (fun f -> Query.Pair ("continentcode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.subdivision_code + (fun f -> ("subdivision_code", (String.to_json f))); + Util.option_map v.country_code + (fun f -> ("country_code", (String.to_json f))); + Util.option_map v.continent_code + (fun f -> ("continent_code", (String.to_json f)))]) + let of_json j = + { + continent_code = + (Util.option_map (Json.lookup j "continent_code") String.of_json); + country_code = + (Util.option_map (Json.lookup j "country_code") String.of_json); + subdivision_code = + (Util.option_map (Json.lookup j "subdivision_code") String.of_json) + } + end +module GetHostedZoneCountRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module UpdateHealthCheckRequest = + struct + type t = + { + health_check_id: String.t ; + health_check_version: Long.t option ; + i_p_address: String.t option ; + port: Integer.t option ; + resource_path: String.t option ; + fully_qualified_domain_name: String.t option ; + search_string: String.t option ; + failure_threshold: Integer.t option } + let make ~health_check_id ?health_check_version ?i_p_address ?port + ?resource_path ?fully_qualified_domain_name ?search_string + ?failure_threshold () = + { + health_check_id; + health_check_version; + i_p_address; + port; + resource_path; + fully_qualified_domain_name; + search_string; + failure_threshold + } + let parse xml = + Some + { + health_check_id = + (Xml.required "HealthCheckId" + (Util.option_bind (Xml.member "HealthCheckId" xml) + String.parse)); + health_check_version = + (Util.option_bind (Xml.member "HealthCheckVersion" xml) + Long.parse); + i_p_address = + (Util.option_bind (Xml.member "IPAddress" xml) String.parse); + port = (Util.option_bind (Xml.member "Port" xml) Integer.parse); + resource_path = + (Util.option_bind (Xml.member "ResourcePath" xml) String.parse); + fully_qualified_domain_name = + (Util.option_bind (Xml.member "FullyQualifiedDomainName" xml) + String.parse); + search_string = + (Util.option_bind (Xml.member "SearchString" xml) String.parse); + failure_threshold = + (Util.option_bind (Xml.member "FailureThreshold" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.failure_threshold + (fun f -> Query.Pair ("FailureThreshold", (Integer.to_query f))); + Util.option_map v.search_string + (fun f -> Query.Pair ("SearchString", (String.to_query f))); + Util.option_map v.fully_qualified_domain_name + (fun f -> + Query.Pair ("FullyQualifiedDomainName", (String.to_query f))); + Util.option_map v.resource_path + (fun f -> Query.Pair ("ResourcePath", (String.to_query f))); + Util.option_map v.port + (fun f -> Query.Pair ("Port", (Integer.to_query f))); + Util.option_map v.i_p_address + (fun f -> Query.Pair ("IPAddress", (String.to_query f))); + Util.option_map v.health_check_version + (fun f -> Query.Pair ("HealthCheckVersion", (Long.to_query f))); + Some (Query.Pair - ( "HealthCheckObservations.member" - , HealthCheckObservations.to_query v.health_check_observations )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "health_check_observations" - , HealthCheckObservations.to_json v.health_check_observations ) - ]) - - let of_json j = - { health_check_observations = - HealthCheckObservations.of_json - (Util.of_option_exn (Json.lookup j "health_check_observations")) - } -end - -module GetHostedZoneRequest = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module DelegationSetAlreadyCreated = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListReusableDelegationSetsRequest = struct - type t = - { marker : String.t option - ; max_items : String.t option - } - - let make ?marker ?max_items () = { marker; max_items } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "marker" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse + ("HealthCheckId", (String.to_query v.health_check_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.failure_threshold + (fun f -> ("failure_threshold", (Integer.to_json f))); + Util.option_map v.search_string + (fun f -> ("search_string", (String.to_json f))); + Util.option_map v.fully_qualified_domain_name + (fun f -> ("fully_qualified_domain_name", (String.to_json f))); + Util.option_map v.resource_path + (fun f -> ("resource_path", (String.to_json f))); + Util.option_map v.port (fun f -> ("port", (Integer.to_json f))); + Util.option_map v.i_p_address + (fun f -> ("i_p_address", (String.to_json f))); + Util.option_map v.health_check_version + (fun f -> ("health_check_version", (Long.to_json f))); + Some ("health_check_id", (String.to_json v.health_check_id))]) + let of_json j = + { + health_check_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_id"))); + health_check_version = + (Util.option_map (Json.lookup j "health_check_version") + Long.of_json); + i_p_address = + (Util.option_map (Json.lookup j "i_p_address") String.of_json); + port = (Util.option_map (Json.lookup j "port") Integer.of_json); + resource_path = + (Util.option_map (Json.lookup j "resource_path") String.of_json); + fully_qualified_domain_name = + (Util.option_map (Json.lookup j "fully_qualified_domain_name") + String.of_json); + search_string = + (Util.option_map (Json.lookup j "search_string") String.of_json); + failure_threshold = + (Util.option_map (Json.lookup j "failure_threshold") + Integer.of_json) + } + end +module GetHealthCheckCountResponse = + struct + type t = { + health_check_count: Long.t } + let make ~health_check_count () = { health_check_count } + let parse xml = + Some + { + health_check_count = + (Xml.required "HealthCheckCount" + (Util.option_bind (Xml.member "HealthCheckCount" xml) + Long.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckCount", (Long.to_query v.health_check_count)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check_count", (Long.to_json v.health_check_count))]) + let of_json j = + { + health_check_count = + (Long.of_json + (Util.of_option_exn (Json.lookup j "health_check_count"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - } -end - -module InvalidArgument = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module CreateHostedZoneResponse = struct - type t = - { hosted_zone : HostedZone.t - ; change_info : ChangeInfo.t - ; delegation_set : DelegationSet.t - ; v_p_c : VPC.t option - ; location : String.t - } - - let make ~hosted_zone ~change_info ~delegation_set ?v_p_c ~location () = - { hosted_zone; change_info; delegation_set; v_p_c; location } - - let parse xml = - Some - { hosted_zone = - Xml.required - "HostedZone" - (Util.option_bind (Xml.member "HostedZone" xml) HostedZone.parse) - ; change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) - ; delegation_set = - Xml.required - "DelegationSet" - (Util.option_bind (Xml.member "DelegationSet" xml) DelegationSet.parse) - ; v_p_c = Util.option_bind (Xml.member "VPC" xml) VPC.parse - ; location = - Xml.required - "Location" - (Util.option_bind (Xml.member "Location" xml) String.parse) + end +module NoSuchHostedZone = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Location", String.to_query v.location)) - ; Util.option_map v.v_p_c (fun f -> Query.Pair ("VPC", VPC.to_query f)) - ; Some (Query.Pair ("DelegationSet", DelegationSet.to_query v.delegation_set)) - ; Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) - ; Some (Query.Pair ("HostedZone", HostedZone.to_query v.hosted_zone)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("location", String.to_json v.location) - ; Util.option_map v.v_p_c (fun f -> "v_p_c", VPC.to_json f) - ; Some ("delegation_set", DelegationSet.to_json v.delegation_set) - ; Some ("change_info", ChangeInfo.to_json v.change_info) - ; Some ("hosted_zone", HostedZone.to_json v.hosted_zone) - ]) - - let of_json j = - { hosted_zone = HostedZone.of_json (Util.of_option_exn (Json.lookup j "hosted_zone")) - ; change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - ; delegation_set = - DelegationSet.of_json (Util.of_option_exn (Json.lookup j "delegation_set")) - ; v_p_c = Util.option_map (Json.lookup j "v_p_c") VPC.of_json - ; location = String.of_json (Util.of_option_exn (Json.lookup j "location")) - } -end - -module GetHealthCheckStatusResponse = struct - type t = { health_check_observations : HealthCheckObservations.t } - - let make ~health_check_observations () = { health_check_observations } - - let parse xml = - Some - { health_check_observations = - Xml.required - "HealthCheckObservations" - (Util.option_bind - (Xml.member "HealthCheckObservations" xml) - HealthCheckObservations.parse) + end +module DeleteReusableDelegationSetRequest = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module VPCAssociationNotFound = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module ConflictingDomainExists = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ListTagsForResourcesRequest = + struct + type t = + { + resource_type: TagResourceType.t ; + resource_ids: TagResourceIdList.t } + let make ~resource_type ~resource_ids () = + { resource_type; resource_ids } + let parse xml = + Some + { + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) + TagResourceType.parse)); + resource_ids = + (Xml.required "ResourceIds" + (Util.option_bind (Xml.member "ResourceIds" xml) + TagResourceIdList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ResourceIds.member", + (TagResourceIdList.to_query v.resource_ids))); + Some (Query.Pair - ( "HealthCheckObservations.member" - , HealthCheckObservations.to_query v.health_check_observations )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "health_check_observations" - , HealthCheckObservations.to_json v.health_check_observations ) - ]) - - let of_json j = - { health_check_observations = - HealthCheckObservations.of_json - (Util.of_option_exn (Json.lookup j "health_check_observations")) - } -end - -module GetCheckerIpRangesResponse = struct - type t = { checker_ip_ranges : CheckerIpRanges.t } - - let make ~checker_ip_ranges () = { checker_ip_ranges } - - let parse xml = - Some - { checker_ip_ranges = - Xml.required - "CheckerIpRanges" - (Util.option_bind (Xml.member "CheckerIpRanges" xml) CheckerIpRanges.parse) + ("ResourceType", (TagResourceType.to_query v.resource_type)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("resource_ids", (TagResourceIdList.to_json v.resource_ids)); + Some ("resource_type", (TagResourceType.to_json v.resource_type))]) + let of_json j = + { + resource_type = + (TagResourceType.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + resource_ids = + (TagResourceIdList.of_json + (Util.of_option_exn (Json.lookup j "resource_ids"))) + } + end +module ListHostedZonesRequest = + struct + type t = + { + marker: String.t option ; + max_items: String.t option ; + delegation_set_id: String.t option } + let make ?marker ?max_items ?delegation_set_id () = + { marker; max_items; delegation_set_id } + let parse xml = + Some + { + marker = (Util.option_bind (Xml.member "marker" xml) String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse); + delegation_set_id = + (Util.option_bind (Xml.member "delegationsetid" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delegation_set_id + (fun f -> Query.Pair ("delegationsetid", (String.to_query f))); + Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("marker", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delegation_set_id + (fun f -> ("delegation_set_id", (String.to_json f))); + Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f)))]) + let of_json j = + { + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json); + delegation_set_id = + (Util.option_map (Json.lookup j "delegation_set_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + end +module ListHostedZonesResponse = + struct + type t = + { + hosted_zones: HostedZones.t ; + marker: String.t option ; + is_truncated: Boolean.t ; + next_marker: String.t option ; + max_items: String.t } + let make ~hosted_zones ?marker ~is_truncated ?next_marker ~max_items + () = { hosted_zones; marker; is_truncated; next_marker; max_items } + let parse xml = + Some + { + hosted_zones = + (Xml.required "HostedZones" + (Util.option_bind (Xml.member "HostedZones" xml) + HostedZones.parse)); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_marker = + (Util.option_bind (Xml.member "NextMarker" xml) String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_marker + (fun f -> Query.Pair ("NextMarker", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Some (Query.Pair - ("CheckerIpRanges.member", CheckerIpRanges.to_query v.checker_ip_ranges)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("checker_ip_ranges", CheckerIpRanges.to_json v.checker_ip_ranges) ]) - - let of_json j = - { checker_ip_ranges = - CheckerIpRanges.of_json (Util.of_option_exn (Json.lookup j "checker_ip_ranges")) - } -end - -module ThrottlingException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module InvalidInput = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module NoSuchDelegationSet = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetHealthCheckResponse = struct - type t = { health_check : HealthCheck.t } - - let make ~health_check () = { health_check } - - let parse xml = - Some - { health_check = - Xml.required - "HealthCheck" - (Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse) + ("HostedZones.member", (HostedZones.to_query v.hosted_zones)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_marker + (fun f -> ("next_marker", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Some ("hosted_zones", (HostedZones.to_json v.hosted_zones))]) + let of_json j = + { + hosted_zones = + (HostedZones.of_json + (Util.of_option_exn (Json.lookup j "hosted_zones"))); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_marker = + (Util.option_map (Json.lookup j "next_marker") String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheck", HealthCheck.to_query v.health_check)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("health_check", HealthCheck.to_json v.health_check) ]) - - let of_json j = - { health_check = - HealthCheck.of_json (Util.of_option_exn (Json.lookup j "health_check")) - } -end - -module GetHealthCheckStatusRequest = struct - type t = { health_check_id : String.t } - - let make ~health_check_id () = { health_check_id } - - let parse xml = - Some - { health_check_id = - Xml.required - "HealthCheckId" - (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) + end +module CreateReusableDelegationSetRequest = + struct + type t = { + caller_reference: String.t ; + hosted_zone_id: String.t option } + let make ~caller_reference ?hosted_zone_id () = + { caller_reference; hosted_zone_id } + let parse xml = + Some + { + caller_reference = + (Xml.required "CallerReference" + (Util.option_bind (Xml.member "CallerReference" xml) + String.parse)); + hosted_zone_id = + (Util.option_bind (Xml.member "HostedZoneId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.hosted_zone_id + (fun f -> Query.Pair ("HostedZoneId", (String.to_query f))); + Some + (Query.Pair + ("CallerReference", (String.to_query v.caller_reference)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.hosted_zone_id + (fun f -> ("hosted_zone_id", (String.to_json f))); + Some ("caller_reference", (String.to_json v.caller_reference))]) + let of_json j = + { + caller_reference = + (String.of_json + (Util.of_option_exn (Json.lookup j "caller_reference"))); + hosted_zone_id = + (Util.option_map (Json.lookup j "hosted_zone_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckId", String.to_query v.health_check_id)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_id", String.to_json v.health_check_id) ]) - - let of_json j = - { health_check_id = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_id")) - } -end - -module ListTagsForResourceRequest = struct - type t = - { resource_type : TagResourceType.t - ; resource_id : String.t - } - - let make ~resource_type ~resource_id () = { resource_type; resource_id } - - let parse xml = - Some - { resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) TagResourceType.parse) - ; resource_id = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse) + end +module ListTagsForResourceResponse = + struct + type t = { + resource_tag_set: ResourceTagSet.t } + let make ~resource_tag_set () = { resource_tag_set } + let parse xml = + Some + { + resource_tag_set = + (Xml.required "ResourceTagSet" + (Util.option_bind (Xml.member "ResourceTagSet" xml) + ResourceTagSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ResourceTagSet", + (ResourceTagSet.to_query v.resource_tag_set)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("resource_tag_set", + (ResourceTagSet.to_json v.resource_tag_set))]) + let of_json j = + { + resource_tag_set = + (ResourceTagSet.of_json + (Util.of_option_exn (Json.lookup j "resource_tag_set"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) - ; Some (Query.Pair ("ResourceType", TagResourceType.to_query v.resource_type)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("resource_id", String.to_json v.resource_id) - ; Some ("resource_type", TagResourceType.to_json v.resource_type) - ]) - - let of_json j = - { resource_type = - TagResourceType.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) - } -end - -module HostedZoneNotEmpty = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetCheckerIpRangesRequest = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetHealthCheckLastFailureReasonRequest = struct - type t = { health_check_id : String.t } - - let make ~health_check_id () = { health_check_id } - - let parse xml = - Some - { health_check_id = - Xml.required - "HealthCheckId" - (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) + end +module CreateHealthCheckResponse = + struct + type t = { + health_check: HealthCheck.t ; + location: String.t } + let make ~health_check ~location () = { health_check; location } + let parse xml = + Some + { + health_check = + (Xml.required "HealthCheck" + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse)); + location = + (Xml.required "Location" + (Util.option_bind (Xml.member "Location" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Location", (String.to_query v.location))); + Some + (Query.Pair + ("HealthCheck", (HealthCheck.to_query v.health_check)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("location", (String.to_json v.location)); + Some ("health_check", (HealthCheck.to_json v.health_check))]) + let of_json j = + { + health_check = + (HealthCheck.of_json + (Util.of_option_exn (Json.lookup j "health_check"))); + location = + (String.of_json (Util.of_option_exn (Json.lookup j "location"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckId", String.to_query v.health_check_id)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_id", String.to_json v.health_check_id) ]) - - let of_json j = - { health_check_id = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_id")) - } -end - -module LimitsExceeded = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module PublicZoneVPCAssociation = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetHealthCheckRequest = struct - type t = { health_check_id : String.t } - - let make ~health_check_id () = { health_check_id } - - let parse xml = - Some - { health_check_id = - Xml.required - "HealthCheckId" - (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) + end +module GetChangeResponse = + struct + type t = { + change_info: ChangeInfo.t } + let make ~change_info () = { change_info } + let parse xml = + Some + { + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_info", (ChangeInfo.to_json v.change_info))]) + let of_json j = + { + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckId", String.to_query v.health_check_id)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_id", String.to_json v.health_check_id) ]) - - let of_json j = - { health_check_id = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_id")) - } -end - -module ListResourceRecordSetsRequest = struct - type t = - { hosted_zone_id : String.t - ; start_record_name : String.t option - ; start_record_type : RRType.t option - ; start_record_identifier : String.t option - ; max_items : String.t option - } - - let make - ~hosted_zone_id - ?start_record_name - ?start_record_type - ?start_record_identifier - ?max_items - () = - { hosted_zone_id - ; start_record_name - ; start_record_type - ; start_record_identifier - ; max_items - } - - let parse xml = - Some - { hosted_zone_id = - Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; start_record_name = Util.option_bind (Xml.member "name" xml) String.parse - ; start_record_type = Util.option_bind (Xml.member "type" xml) RRType.parse - ; start_record_identifier = - Util.option_bind (Xml.member "identifier" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse + end +module InvalidVPCId = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.start_record_identifier (fun f -> - Query.Pair ("identifier", String.to_query f)) - ; Util.option_map v.start_record_type (fun f -> - Query.Pair ("type", RRType.to_query f)) - ; Util.option_map v.start_record_name (fun f -> - Query.Pair ("name", String.to_query f)) - ; Some (Query.Pair ("Id", String.to_query v.hosted_zone_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.start_record_identifier (fun f -> - "start_record_identifier", String.to_json f) - ; Util.option_map v.start_record_type (fun f -> - "start_record_type", RRType.to_json f) - ; Util.option_map v.start_record_name (fun f -> - "start_record_name", String.to_json f) - ; Some ("hosted_zone_id", String.to_json v.hosted_zone_id) - ]) - - let of_json j = - { hosted_zone_id = - String.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_id")) - ; start_record_name = - Util.option_map (Json.lookup j "start_record_name") String.of_json - ; start_record_type = - Util.option_map (Json.lookup j "start_record_type") RRType.of_json - ; start_record_identifier = - Util.option_map (Json.lookup j "start_record_identifier") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - } -end - -module NoSuchChange = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetReusableDelegationSetResponse = struct - type t = { delegation_set : DelegationSet.t } - - let make ~delegation_set () = { delegation_set } - - let parse xml = - Some - { delegation_set = - Xml.required - "DelegationSet" - (Util.option_bind (Xml.member "DelegationSet" xml) DelegationSet.parse) + end +module ListGeoLocationsResponse = + struct + type t = + { + geo_location_details_list: GeoLocationDetailsList.t ; + is_truncated: Boolean.t ; + next_continent_code: String.t option ; + next_country_code: String.t option ; + next_subdivision_code: String.t option ; + max_items: String.t } + let make ~geo_location_details_list ~is_truncated ?next_continent_code + ?next_country_code ?next_subdivision_code ~max_items () = + { + geo_location_details_list; + is_truncated; + next_continent_code; + next_country_code; + next_subdivision_code; + max_items } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DelegationSet", DelegationSet.to_query v.delegation_set)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("delegation_set", DelegationSet.to_json v.delegation_set) ]) - - let of_json j = - { delegation_set = - DelegationSet.of_json (Util.of_option_exn (Json.lookup j "delegation_set")) - } -end - -module ChangeResourceRecordSetsResponse = struct - type t = { change_info : ChangeInfo.t } - - let make ~change_info () = { change_info } - - let parse xml = - Some - { change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) + let parse xml = + Some + { + geo_location_details_list = + (Xml.required "GeoLocationDetailsList" + (Util.option_bind (Xml.member "GeoLocationDetailsList" xml) + GeoLocationDetailsList.parse)); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_continent_code = + (Util.option_bind (Xml.member "NextContinentCode" xml) + String.parse); + next_country_code = + (Util.option_bind (Xml.member "NextCountryCode" xml) String.parse); + next_subdivision_code = + (Util.option_bind (Xml.member "NextSubdivisionCode" xml) + String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_subdivision_code + (fun f -> + Query.Pair ("NextSubdivisionCode", (String.to_query f))); + Util.option_map v.next_country_code + (fun f -> Query.Pair ("NextCountryCode", (String.to_query f))); + Util.option_map v.next_continent_code + (fun f -> Query.Pair ("NextContinentCode", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Some + (Query.Pair + ("GeoLocationDetailsList.member", + (GeoLocationDetailsList.to_query + v.geo_location_details_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_subdivision_code + (fun f -> ("next_subdivision_code", (String.to_json f))); + Util.option_map v.next_country_code + (fun f -> ("next_country_code", (String.to_json f))); + Util.option_map v.next_continent_code + (fun f -> ("next_continent_code", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Some + ("geo_location_details_list", + (GeoLocationDetailsList.to_json v.geo_location_details_list))]) + let of_json j = + { + geo_location_details_list = + (GeoLocationDetailsList.of_json + (Util.of_option_exn (Json.lookup j "geo_location_details_list"))); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_continent_code = + (Util.option_map (Json.lookup j "next_continent_code") + String.of_json); + next_country_code = + (Util.option_map (Json.lookup j "next_country_code") String.of_json); + next_subdivision_code = + (Util.option_map (Json.lookup j "next_subdivision_code") + String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("change_info", ChangeInfo.to_json v.change_info) ]) - - let of_json j = - { change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - } -end - -module ChangeTagsForResourceResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidChangeBatch = struct - type t = { messages : ErrorMessages.t } - - let make ?(messages = []) () = { messages } - - let parse xml = - Some - { messages = - Util.of_option - [] - (Util.option_bind (Xml.member "messages" xml) ErrorMessages.parse) + end +module ListHealthChecksResponse = + struct + type t = + { + health_checks: HealthChecks.t ; + marker: String.t ; + is_truncated: Boolean.t ; + next_marker: String.t option ; + max_items: String.t } + let make ~health_checks ~marker ~is_truncated ?next_marker ~max_items + () = { health_checks; marker; is_truncated; next_marker; max_items } + let parse xml = + Some + { + health_checks = + (Xml.required "HealthChecks" + (Util.option_bind (Xml.member "HealthChecks" xml) + HealthChecks.parse)); + marker = + (Xml.required "Marker" + (Util.option_bind (Xml.member "Marker" xml) String.parse)); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_marker = + (Util.option_bind (Xml.member "NextMarker" xml) String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_marker + (fun f -> Query.Pair ("NextMarker", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Some (Query.Pair ("Marker", (String.to_query v.marker))); + Some + (Query.Pair + ("HealthChecks.member", + (HealthChecks.to_query v.health_checks)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_marker + (fun f -> ("next_marker", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Some ("marker", (String.to_json v.marker)); + Some ("health_checks", (HealthChecks.to_json v.health_checks))]) + let of_json j = + { + health_checks = + (HealthChecks.of_json + (Util.of_option_exn (Json.lookup j "health_checks"))); + marker = + (String.of_json (Util.of_option_exn (Json.lookup j "marker"))); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_marker = + (Util.option_map (Json.lookup j "next_marker") String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("messages.member", ErrorMessages.to_query v.messages)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("messages", ErrorMessages.to_json v.messages) ]) - - let of_json j = - { messages = ErrorMessages.of_json (Util.of_option_exn (Json.lookup j "messages")) } -end - -module GetGeoLocationRequest = struct - type t = - { continent_code : String.t option - ; country_code : String.t option - ; subdivision_code : String.t option - } - - let make ?continent_code ?country_code ?subdivision_code () = - { continent_code; country_code; subdivision_code } - - let parse xml = - Some - { continent_code = Util.option_bind (Xml.member "continentcode" xml) String.parse - ; country_code = Util.option_bind (Xml.member "countrycode" xml) String.parse - ; subdivision_code = - Util.option_bind (Xml.member "subdivisioncode" xml) String.parse + end +module IncompatibleVersion = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.subdivision_code (fun f -> - Query.Pair ("subdivisioncode", String.to_query f)) - ; Util.option_map v.country_code (fun f -> - Query.Pair ("countrycode", String.to_query f)) - ; Util.option_map v.continent_code (fun f -> - Query.Pair ("continentcode", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.subdivision_code (fun f -> - "subdivision_code", String.to_json f) - ; Util.option_map v.country_code (fun f -> "country_code", String.to_json f) - ; Util.option_map v.continent_code (fun f -> "continent_code", String.to_json f) - ]) - - let of_json j = - { continent_code = Util.option_map (Json.lookup j "continent_code") String.of_json - ; country_code = Util.option_map (Json.lookup j "country_code") String.of_json - ; subdivision_code = Util.option_map (Json.lookup j "subdivision_code") String.of_json - } -end - -module GetHostedZoneCountRequest = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module UpdateHealthCheckRequest = struct - type t = - { health_check_id : String.t - ; health_check_version : Long.t option - ; i_p_address : String.t option - ; port : Integer.t option - ; resource_path : String.t option - ; fully_qualified_domain_name : String.t option - ; search_string : String.t option - ; failure_threshold : Integer.t option - } - - let make - ~health_check_id - ?health_check_version - ?i_p_address - ?port - ?resource_path - ?fully_qualified_domain_name - ?search_string - ?failure_threshold - () = - { health_check_id - ; health_check_version - ; i_p_address - ; port - ; resource_path - ; fully_qualified_domain_name - ; search_string - ; failure_threshold - } - - let parse xml = - Some - { health_check_id = - Xml.required - "HealthCheckId" - (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) - ; health_check_version = - Util.option_bind (Xml.member "HealthCheckVersion" xml) Long.parse - ; i_p_address = Util.option_bind (Xml.member "IPAddress" xml) String.parse - ; port = Util.option_bind (Xml.member "Port" xml) Integer.parse - ; resource_path = Util.option_bind (Xml.member "ResourcePath" xml) String.parse - ; fully_qualified_domain_name = - Util.option_bind (Xml.member "FullyQualifiedDomainName" xml) String.parse - ; search_string = Util.option_bind (Xml.member "SearchString" xml) String.parse - ; failure_threshold = - Util.option_bind (Xml.member "FailureThreshold" xml) Integer.parse + end +module HealthCheckInUse = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.failure_threshold (fun f -> - Query.Pair ("FailureThreshold", Integer.to_query f)) - ; Util.option_map v.search_string (fun f -> - Query.Pair ("SearchString", String.to_query f)) - ; Util.option_map v.fully_qualified_domain_name (fun f -> - Query.Pair ("FullyQualifiedDomainName", String.to_query f)) - ; Util.option_map v.resource_path (fun f -> - Query.Pair ("ResourcePath", String.to_query f)) - ; Util.option_map v.port (fun f -> Query.Pair ("Port", Integer.to_query f)) - ; Util.option_map v.i_p_address (fun f -> - Query.Pair ("IPAddress", String.to_query f)) - ; Util.option_map v.health_check_version (fun f -> - Query.Pair ("HealthCheckVersion", Long.to_query f)) - ; Some (Query.Pair ("HealthCheckId", String.to_query v.health_check_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.failure_threshold (fun f -> - "failure_threshold", Integer.to_json f) - ; Util.option_map v.search_string (fun f -> "search_string", String.to_json f) - ; Util.option_map v.fully_qualified_domain_name (fun f -> - "fully_qualified_domain_name", String.to_json f) - ; Util.option_map v.resource_path (fun f -> "resource_path", String.to_json f) - ; Util.option_map v.port (fun f -> "port", Integer.to_json f) - ; Util.option_map v.i_p_address (fun f -> "i_p_address", String.to_json f) - ; Util.option_map v.health_check_version (fun f -> - "health_check_version", Long.to_json f) - ; Some ("health_check_id", String.to_json v.health_check_id) - ]) - - let of_json j = - { health_check_id = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_id")) - ; health_check_version = - Util.option_map (Json.lookup j "health_check_version") Long.of_json - ; i_p_address = Util.option_map (Json.lookup j "i_p_address") String.of_json - ; port = Util.option_map (Json.lookup j "port") Integer.of_json - ; resource_path = Util.option_map (Json.lookup j "resource_path") String.of_json - ; fully_qualified_domain_name = - Util.option_map (Json.lookup j "fully_qualified_domain_name") String.of_json - ; search_string = Util.option_map (Json.lookup j "search_string") String.of_json - ; failure_threshold = - Util.option_map (Json.lookup j "failure_threshold") Integer.of_json - } -end - -module GetHealthCheckCountResponse = struct - type t = { health_check_count : Long.t } - - let make ~health_check_count () = { health_check_count } - - let parse xml = - Some - { health_check_count = - Xml.required - "HealthCheckCount" - (Util.option_bind (Xml.member "HealthCheckCount" xml) Long.parse) + end +module TooManyHealthChecks = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckCount", Long.to_query v.health_check_count)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_count", Long.to_json v.health_check_count) ]) - - let of_json j = - { health_check_count = - Long.of_json (Util.of_option_exn (Json.lookup j "health_check_count")) - } -end - -module NoSuchHostedZone = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeleteReusableDelegationSetRequest = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module VPCAssociationNotFound = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ConflictingDomainExists = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListTagsForResourcesRequest = struct - type t = - { resource_type : TagResourceType.t - ; resource_ids : TagResourceIdList.t - } - - let make ~resource_type ~resource_ids () = { resource_type; resource_ids } - - let parse xml = - Some - { resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) TagResourceType.parse) - ; resource_ids = - Xml.required - "ResourceIds" - (Util.option_bind (Xml.member "ResourceIds" xml) TagResourceIdList.parse) + end +module DeleteHostedZoneRequest = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module UpdateHealthCheckResponse = + struct + type t = { + health_check: HealthCheck.t } + let make ~health_check () = { health_check } + let parse xml = + Some + { + health_check = + (Xml.required "HealthCheck" + (Util.option_bind (Xml.member "HealthCheck" xml) + HealthCheck.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheck", (HealthCheck.to_query v.health_check)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check", (HealthCheck.to_json v.health_check))]) + let of_json j = + { + health_check = + (HealthCheck.of_json + (Util.of_option_exn (Json.lookup j "health_check"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("ResourceIds.member", TagResourceIdList.to_query v.resource_ids)) - ; Some (Query.Pair ("ResourceType", TagResourceType.to_query v.resource_type)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("resource_ids", TagResourceIdList.to_json v.resource_ids) - ; Some ("resource_type", TagResourceType.to_json v.resource_type) - ]) - - let of_json j = - { resource_type = - TagResourceType.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; resource_ids = - TagResourceIdList.of_json (Util.of_option_exn (Json.lookup j "resource_ids")) - } -end - -module ListHostedZonesRequest = struct - type t = - { marker : String.t option - ; max_items : String.t option - ; delegation_set_id : String.t option - } - - let make ?marker ?max_items ?delegation_set_id () = - { marker; max_items; delegation_set_id } - - let parse xml = - Some - { marker = Util.option_bind (Xml.member "marker" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse - ; delegation_set_id = - Util.option_bind (Xml.member "delegationsetid" xml) String.parse + end +module ChangeTagsForResourceRequest = + struct + type t = + { + resource_type: TagResourceType.t ; + resource_id: String.t ; + add_tags: TagList.t ; + remove_tag_keys: TagKeyList.t } + let make ~resource_type ~resource_id ?(add_tags= []) + ?(remove_tag_keys= []) () = + { resource_type; resource_id; add_tags; remove_tag_keys } + let parse xml = + Some + { + resource_type = + (Xml.required "ResourceType" + (Util.option_bind (Xml.member "ResourceType" xml) + TagResourceType.parse)); + resource_id = + (Xml.required "ResourceId" + (Util.option_bind (Xml.member "ResourceId" xml) String.parse)); + add_tags = + (Util.of_option [] + (Util.option_bind (Xml.member "AddTags" xml) TagList.parse)); + remove_tag_keys = + (Util.of_option [] + (Util.option_bind (Xml.member "RemoveTagKeys" xml) + TagKeyList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RemoveTagKeys.member", + (TagKeyList.to_query v.remove_tag_keys))); + Some + (Query.Pair ("AddTags.member", (TagList.to_query v.add_tags))); + Some (Query.Pair ("ResourceId", (String.to_query v.resource_id))); + Some + (Query.Pair + ("ResourceType", (TagResourceType.to_query v.resource_type)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("remove_tag_keys", (TagKeyList.to_json v.remove_tag_keys)); + Some ("add_tags", (TagList.to_json v.add_tags)); + Some ("resource_id", (String.to_json v.resource_id)); + Some ("resource_type", (TagResourceType.to_json v.resource_type))]) + let of_json j = + { + resource_type = + (TagResourceType.of_json + (Util.of_option_exn (Json.lookup j "resource_type"))); + resource_id = + (String.of_json (Util.of_option_exn (Json.lookup j "resource_id"))); + add_tags = + (TagList.of_json (Util.of_option_exn (Json.lookup j "add_tags"))); + remove_tag_keys = + (TagKeyList.of_json + (Util.of_option_exn (Json.lookup j "remove_tag_keys"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delegation_set_id (fun f -> - Query.Pair ("delegationsetid", String.to_query f)) - ; Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("marker", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delegation_set_id (fun f -> - "delegation_set_id", String.to_json f) - ; Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ]) - - let of_json j = - { marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - ; delegation_set_id = - Util.option_map (Json.lookup j "delegation_set_id") String.of_json - } -end - -module ListHostedZonesResponse = struct - type t = - { hosted_zones : HostedZones.t - ; marker : String.t option - ; is_truncated : Boolean.t - ; next_marker : String.t option - ; max_items : String.t - } - - let make ~hosted_zones ?marker ~is_truncated ?next_marker ~max_items () = - { hosted_zones; marker; is_truncated; next_marker; max_items } - - let parse xml = - Some - { hosted_zones = - Xml.required - "HostedZones" - (Util.option_bind (Xml.member "HostedZones" xml) HostedZones.parse) - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_marker = Util.option_bind (Xml.member "NextMarker" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module DelegationSetNotAvailable = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_marker (fun f -> - Query.Pair ("NextMarker", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Some (Query.Pair ("HostedZones.member", HostedZones.to_query v.hosted_zones)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_marker (fun f -> "next_marker", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Some ("hosted_zones", HostedZones.to_json v.hosted_zones) - ]) - - let of_json j = - { hosted_zones = - HostedZones.of_json (Util.of_option_exn (Json.lookup j "hosted_zones")) - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_marker = Util.option_map (Json.lookup j "next_marker") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module CreateReusableDelegationSetRequest = struct - type t = - { caller_reference : String.t - ; hosted_zone_id : String.t option - } - - let make ~caller_reference ?hosted_zone_id () = { caller_reference; hosted_zone_id } - - let parse xml = - Some - { caller_reference = - Xml.required - "CallerReference" - (Util.option_bind (Xml.member "CallerReference" xml) String.parse) - ; hosted_zone_id = Util.option_bind (Xml.member "HostedZoneId" xml) String.parse + end +module ListTagsForResourcesResponse = + struct + type t = { + resource_tag_sets: ResourceTagSetList.t } + let make ~resource_tag_sets () = { resource_tag_sets } + let parse xml = + Some + { + resource_tag_sets = + (Xml.required "ResourceTagSets" + (Util.option_bind (Xml.member "ResourceTagSets" xml) + ResourceTagSetList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ResourceTagSets.member", + (ResourceTagSetList.to_query v.resource_tag_sets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("resource_tag_sets", + (ResourceTagSetList.to_json v.resource_tag_sets))]) + let of_json j = + { + resource_tag_sets = + (ResourceTagSetList.of_json + (Util.of_option_exn (Json.lookup j "resource_tag_sets"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.hosted_zone_id (fun f -> - Query.Pair ("HostedZoneId", String.to_query f)) - ; Some (Query.Pair ("CallerReference", String.to_query v.caller_reference)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.hosted_zone_id (fun f -> "hosted_zone_id", String.to_json f) - ; Some ("caller_reference", String.to_json v.caller_reference) - ]) - - let of_json j = - { caller_reference = - String.of_json (Util.of_option_exn (Json.lookup j "caller_reference")) - ; hosted_zone_id = Util.option_map (Json.lookup j "hosted_zone_id") String.of_json - } -end - -module ListTagsForResourceResponse = struct - type t = { resource_tag_set : ResourceTagSet.t } - - let make ~resource_tag_set () = { resource_tag_set } - - let parse xml = - Some - { resource_tag_set = - Xml.required - "ResourceTagSet" - (Util.option_bind (Xml.member "ResourceTagSet" xml) ResourceTagSet.parse) + end +module AssociateVPCWithHostedZoneRequest = + struct + type t = + { + hosted_zone_id: String.t ; + v_p_c: VPC.t ; + comment: String.t option } + let make ~hosted_zone_id ~v_p_c ?comment () = + { hosted_zone_id; v_p_c; comment } + let parse xml = + Some + { + hosted_zone_id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + v_p_c = + (Xml.required "VPC" + (Util.option_bind (Xml.member "VPC" xml) VPC.parse)); + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f))); + Some (Query.Pair ("VPC", (VPC.to_query v.v_p_c))); + Some (Query.Pair ("Id", (String.to_query v.hosted_zone_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> ("comment", (String.to_json f))); + Some ("v_p_c", (VPC.to_json v.v_p_c)); + Some ("hosted_zone_id", (String.to_json v.hosted_zone_id))]) + let of_json j = + { + hosted_zone_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_id"))); + v_p_c = (VPC.of_json (Util.of_option_exn (Json.lookup j "v_p_c"))); + comment = (Util.option_map (Json.lookup j "comment") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("ResourceTagSet", ResourceTagSet.to_query v.resource_tag_set)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("resource_tag_set", ResourceTagSet.to_json v.resource_tag_set) ]) - - let of_json j = - { resource_tag_set = - ResourceTagSet.of_json (Util.of_option_exn (Json.lookup j "resource_tag_set")) - } -end - -module CreateHealthCheckResponse = struct - type t = - { health_check : HealthCheck.t - ; location : String.t - } - - let make ~health_check ~location () = { health_check; location } - - let parse xml = - Some - { health_check = - Xml.required - "HealthCheck" - (Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse) - ; location = - Xml.required - "Location" - (Util.option_bind (Xml.member "Location" xml) String.parse) + end +module GetHostedZoneCountResponse = + struct + type t = { + hosted_zone_count: Long.t } + let make ~hosted_zone_count () = { hosted_zone_count } + let parse xml = + Some + { + hosted_zone_count = + (Xml.required "HostedZoneCount" + (Util.option_bind (Xml.member "HostedZoneCount" xml) + Long.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HostedZoneCount", (Long.to_query v.hosted_zone_count)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("hosted_zone_count", (Long.to_json v.hosted_zone_count))]) + let of_json j = + { + hosted_zone_count = + (Long.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_count"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Location", String.to_query v.location)) - ; Some (Query.Pair ("HealthCheck", HealthCheck.to_query v.health_check)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("location", String.to_json v.location) - ; Some ("health_check", HealthCheck.to_json v.health_check) - ]) - - let of_json j = - { health_check = - HealthCheck.of_json (Util.of_option_exn (Json.lookup j "health_check")) - ; location = String.of_json (Util.of_option_exn (Json.lookup j "location")) - } -end - -module GetChangeResponse = struct - type t = { change_info : ChangeInfo.t } - - let make ~change_info () = { change_info } - - let parse xml = - Some - { change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) + end +module TooManyHostedZones = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("change_info", ChangeInfo.to_json v.change_info) ]) - - let of_json j = - { change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - } -end - -module InvalidVPCId = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListGeoLocationsResponse = struct - type t = - { geo_location_details_list : GeoLocationDetailsList.t - ; is_truncated : Boolean.t - ; next_continent_code : String.t option - ; next_country_code : String.t option - ; next_subdivision_code : String.t option - ; max_items : String.t - } - - let make - ~geo_location_details_list - ~is_truncated - ?next_continent_code - ?next_country_code - ?next_subdivision_code - ~max_items - () = - { geo_location_details_list - ; is_truncated - ; next_continent_code - ; next_country_code - ; next_subdivision_code - ; max_items - } - - let parse xml = - Some - { geo_location_details_list = - Xml.required - "GeoLocationDetailsList" - (Util.option_bind - (Xml.member "GeoLocationDetailsList" xml) - GeoLocationDetailsList.parse) - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_continent_code = - Util.option_bind (Xml.member "NextContinentCode" xml) String.parse - ; next_country_code = - Util.option_bind (Xml.member "NextCountryCode" xml) String.parse - ; next_subdivision_code = - Util.option_bind (Xml.member "NextSubdivisionCode" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module DisassociateVPCFromHostedZoneRequest = + struct + type t = + { + hosted_zone_id: String.t ; + v_p_c: VPC.t ; + comment: String.t option } + let make ~hosted_zone_id ~v_p_c ?comment () = + { hosted_zone_id; v_p_c; comment } + let parse xml = + Some + { + hosted_zone_id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + v_p_c = + (Xml.required "VPC" + (Util.option_bind (Xml.member "VPC" xml) VPC.parse)); + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f))); + Some (Query.Pair ("VPC", (VPC.to_query v.v_p_c))); + Some (Query.Pair ("Id", (String.to_query v.hosted_zone_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> ("comment", (String.to_json f))); + Some ("v_p_c", (VPC.to_json v.v_p_c)); + Some ("hosted_zone_id", (String.to_json v.hosted_zone_id))]) + let of_json j = + { + hosted_zone_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_id"))); + v_p_c = (VPC.of_json (Util.of_option_exn (Json.lookup j "v_p_c"))); + comment = (Util.option_map (Json.lookup j "comment") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_subdivision_code (fun f -> - Query.Pair ("NextSubdivisionCode", String.to_query f)) - ; Util.option_map v.next_country_code (fun f -> - Query.Pair ("NextCountryCode", String.to_query f)) - ; Util.option_map v.next_continent_code (fun f -> - Query.Pair ("NextContinentCode", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Some - (Query.Pair - ( "GeoLocationDetailsList.member" - , GeoLocationDetailsList.to_query v.geo_location_details_list )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_subdivision_code (fun f -> - "next_subdivision_code", String.to_json f) - ; Util.option_map v.next_country_code (fun f -> - "next_country_code", String.to_json f) - ; Util.option_map v.next_continent_code (fun f -> - "next_continent_code", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Some - ( "geo_location_details_list" - , GeoLocationDetailsList.to_json v.geo_location_details_list ) - ]) - - let of_json j = - { geo_location_details_list = - GeoLocationDetailsList.of_json - (Util.of_option_exn (Json.lookup j "geo_location_details_list")) - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_continent_code = - Util.option_map (Json.lookup j "next_continent_code") String.of_json - ; next_country_code = - Util.option_map (Json.lookup j "next_country_code") String.of_json - ; next_subdivision_code = - Util.option_map (Json.lookup j "next_subdivision_code") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module ListHealthChecksResponse = struct - type t = - { health_checks : HealthChecks.t - ; marker : String.t - ; is_truncated : Boolean.t - ; next_marker : String.t option - ; max_items : String.t - } - - let make ~health_checks ~marker ~is_truncated ?next_marker ~max_items () = - { health_checks; marker; is_truncated; next_marker; max_items } - - let parse xml = - Some - { health_checks = - Xml.required - "HealthChecks" - (Util.option_bind (Xml.member "HealthChecks" xml) HealthChecks.parse) - ; marker = - Xml.required "Marker" (Util.option_bind (Xml.member "Marker" xml) String.parse) - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_marker = Util.option_bind (Xml.member "NextMarker" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module ListGeoLocationsRequest = + struct + type t = + { + start_continent_code: String.t option ; + start_country_code: String.t option ; + start_subdivision_code: String.t option ; + max_items: String.t option } + let make ?start_continent_code ?start_country_code + ?start_subdivision_code ?max_items () = + { + start_continent_code; + start_country_code; + start_subdivision_code; + max_items + } + let parse xml = + Some + { + start_continent_code = + (Util.option_bind (Xml.member "startcontinentcode" xml) + String.parse); + start_country_code = + (Util.option_bind (Xml.member "startcountrycode" xml) + String.parse); + start_subdivision_code = + (Util.option_bind (Xml.member "startsubdivisioncode" xml) + String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.start_subdivision_code + (fun f -> + Query.Pair ("startsubdivisioncode", (String.to_query f))); + Util.option_map v.start_country_code + (fun f -> Query.Pair ("startcountrycode", (String.to_query f))); + Util.option_map v.start_continent_code + (fun f -> Query.Pair ("startcontinentcode", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.start_subdivision_code + (fun f -> ("start_subdivision_code", (String.to_json f))); + Util.option_map v.start_country_code + (fun f -> ("start_country_code", (String.to_json f))); + Util.option_map v.start_continent_code + (fun f -> ("start_continent_code", (String.to_json f)))]) + let of_json j = + { + start_continent_code = + (Util.option_map (Json.lookup j "start_continent_code") + String.of_json); + start_country_code = + (Util.option_map (Json.lookup j "start_country_code") + String.of_json); + start_subdivision_code = + (Util.option_map (Json.lookup j "start_subdivision_code") + String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_marker (fun f -> - Query.Pair ("NextMarker", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Some (Query.Pair ("Marker", String.to_query v.marker)) - ; Some - (Query.Pair ("HealthChecks.member", HealthChecks.to_query v.health_checks)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_marker (fun f -> "next_marker", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Some ("marker", String.to_json v.marker) - ; Some ("health_checks", HealthChecks.to_json v.health_checks) - ]) - - let of_json j = - { health_checks = - HealthChecks.of_json (Util.of_option_exn (Json.lookup j "health_checks")) - ; marker = String.of_json (Util.of_option_exn (Json.lookup j "marker")) - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_marker = Util.option_map (Json.lookup j "next_marker") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module IncompatibleVersion = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module HealthCheckInUse = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module TooManyHealthChecks = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeleteHostedZoneRequest = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module UpdateHealthCheckResponse = struct - type t = { health_check : HealthCheck.t } - - let make ~health_check () = { health_check } - - let parse xml = - Some - { health_check = - Xml.required - "HealthCheck" - (Util.option_bind (Xml.member "HealthCheck" xml) HealthCheck.parse) + end +module CreateReusableDelegationSetResponse = + struct + type t = { + delegation_set: DelegationSet.t ; + location: String.t } + let make ~delegation_set ~location () = { delegation_set; location } + let parse xml = + Some + { + delegation_set = + (Xml.required "DelegationSet" + (Util.option_bind (Xml.member "DelegationSet" xml) + DelegationSet.parse)); + location = + (Xml.required "Location" + (Util.option_bind (Xml.member "Location" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Location", (String.to_query v.location))); + Some + (Query.Pair + ("DelegationSet", (DelegationSet.to_query v.delegation_set)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("location", (String.to_json v.location)); + Some ("delegation_set", (DelegationSet.to_json v.delegation_set))]) + let of_json j = + { + delegation_set = + (DelegationSet.of_json + (Util.of_option_exn (Json.lookup j "delegation_set"))); + location = + (String.of_json (Util.of_option_exn (Json.lookup j "location"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheck", HealthCheck.to_query v.health_check)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("health_check", HealthCheck.to_json v.health_check) ]) - - let of_json j = - { health_check = - HealthCheck.of_json (Util.of_option_exn (Json.lookup j "health_check")) - } -end - -module ChangeTagsForResourceRequest = struct - type t = - { resource_type : TagResourceType.t - ; resource_id : String.t - ; add_tags : TagList.t - ; remove_tag_keys : TagKeyList.t - } - - let make ~resource_type ~resource_id ?(add_tags = []) ?(remove_tag_keys = []) () = - { resource_type; resource_id; add_tags; remove_tag_keys } - - let parse xml = - Some - { resource_type = - Xml.required - "ResourceType" - (Util.option_bind (Xml.member "ResourceType" xml) TagResourceType.parse) - ; resource_id = - Xml.required - "ResourceId" - (Util.option_bind (Xml.member "ResourceId" xml) String.parse) - ; add_tags = - Util.of_option [] (Util.option_bind (Xml.member "AddTags" xml) TagList.parse) - ; remove_tag_keys = - Util.of_option - [] - (Util.option_bind (Xml.member "RemoveTagKeys" xml) TagKeyList.parse) + end +module DisassociateVPCFromHostedZoneResponse = + struct + type t = { + change_info: ChangeInfo.t } + let make ~change_info () = { change_info } + let parse xml = + Some + { + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_info", (ChangeInfo.to_json v.change_info))]) + let of_json j = + { + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("RemoveTagKeys.member", TagKeyList.to_query v.remove_tag_keys)) - ; Some (Query.Pair ("AddTags.member", TagList.to_query v.add_tags)) - ; Some (Query.Pair ("ResourceId", String.to_query v.resource_id)) - ; Some (Query.Pair ("ResourceType", TagResourceType.to_query v.resource_type)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("remove_tag_keys", TagKeyList.to_json v.remove_tag_keys) - ; Some ("add_tags", TagList.to_json v.add_tags) - ; Some ("resource_id", String.to_json v.resource_id) - ; Some ("resource_type", TagResourceType.to_json v.resource_type) - ]) - - let of_json j = - { resource_type = - TagResourceType.of_json (Util.of_option_exn (Json.lookup j "resource_type")) - ; resource_id = String.of_json (Util.of_option_exn (Json.lookup j "resource_id")) - ; add_tags = TagList.of_json (Util.of_option_exn (Json.lookup j "add_tags")) - ; remove_tag_keys = - TagKeyList.of_json (Util.of_option_exn (Json.lookup j "remove_tag_keys")) - } -end - -module DelegationSetNotAvailable = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListTagsForResourcesResponse = struct - type t = { resource_tag_sets : ResourceTagSetList.t } - - let make ~resource_tag_sets () = { resource_tag_sets } - - let parse xml = - Some - { resource_tag_sets = - Xml.required - "ResourceTagSets" - (Util.option_bind (Xml.member "ResourceTagSets" xml) ResourceTagSetList.parse) + end +module ListResourceRecordSetsResponse = + struct + type t = + { + resource_record_sets: ResourceRecordSets.t ; + is_truncated: Boolean.t ; + next_record_name: String.t option ; + next_record_type: RRType.t option ; + next_record_identifier: String.t option ; + max_items: String.t } + let make ~resource_record_sets ~is_truncated ?next_record_name + ?next_record_type ?next_record_identifier ~max_items () = + { + resource_record_sets; + is_truncated; + next_record_name; + next_record_type; + next_record_identifier; + max_items } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + resource_record_sets = + (Xml.required "ResourceRecordSets" + (Util.option_bind (Xml.member "ResourceRecordSets" xml) + ResourceRecordSets.parse)); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_record_name = + (Util.option_bind (Xml.member "NextRecordName" xml) String.parse); + next_record_type = + (Util.option_bind (Xml.member "NextRecordType" xml) RRType.parse); + next_record_identifier = + (Util.option_bind (Xml.member "NextRecordIdentifier" xml) + String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_record_identifier + (fun f -> + Query.Pair ("NextRecordIdentifier", (String.to_query f))); + Util.option_map v.next_record_type + (fun f -> Query.Pair ("NextRecordType", (RRType.to_query f))); + Util.option_map v.next_record_name + (fun f -> Query.Pair ("NextRecordName", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Some (Query.Pair - ("ResourceTagSets.member", ResourceTagSetList.to_query v.resource_tag_sets)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("resource_tag_sets", ResourceTagSetList.to_json v.resource_tag_sets) ]) - - let of_json j = - { resource_tag_sets = - ResourceTagSetList.of_json - (Util.of_option_exn (Json.lookup j "resource_tag_sets")) - } -end - -module AssociateVPCWithHostedZoneRequest = struct - type t = - { hosted_zone_id : String.t - ; v_p_c : VPC.t - ; comment : String.t option - } - - let make ~hosted_zone_id ~v_p_c ?comment () = { hosted_zone_id; v_p_c; comment } - - let parse xml = - Some - { hosted_zone_id = - Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; v_p_c = Xml.required "VPC" (Util.option_bind (Xml.member "VPC" xml) VPC.parse) - ; comment = Util.option_bind (Xml.member "Comment" xml) String.parse + ("ResourceRecordSets.member", + (ResourceRecordSets.to_query v.resource_record_sets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_record_identifier + (fun f -> ("next_record_identifier", (String.to_json f))); + Util.option_map v.next_record_type + (fun f -> ("next_record_type", (RRType.to_json f))); + Util.option_map v.next_record_name + (fun f -> ("next_record_name", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Some + ("resource_record_sets", + (ResourceRecordSets.to_json v.resource_record_sets))]) + let of_json j = + { + resource_record_sets = + (ResourceRecordSets.of_json + (Util.of_option_exn (Json.lookup j "resource_record_sets"))); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_record_name = + (Util.option_map (Json.lookup j "next_record_name") String.of_json); + next_record_type = + (Util.option_map (Json.lookup j "next_record_type") RRType.of_json); + next_record_identifier = + (Util.option_map (Json.lookup j "next_record_identifier") + String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) + } + end +module NoSuchGeoLocation = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ; Some (Query.Pair ("VPC", VPC.to_query v.v_p_c)) - ; Some (Query.Pair ("Id", String.to_query v.hosted_zone_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> "comment", String.to_json f) - ; Some ("v_p_c", VPC.to_json v.v_p_c) - ; Some ("hosted_zone_id", String.to_json v.hosted_zone_id) - ]) - - let of_json j = - { hosted_zone_id = - String.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_id")) - ; v_p_c = VPC.of_json (Util.of_option_exn (Json.lookup j "v_p_c")) - ; comment = Util.option_map (Json.lookup j "comment") String.of_json - } -end - -module GetHostedZoneCountResponse = struct - type t = { hosted_zone_count : Long.t } - - let make ~hosted_zone_count () = { hosted_zone_count } - - let parse xml = - Some - { hosted_zone_count = - Xml.required - "HostedZoneCount" - (Util.option_bind (Xml.member "HostedZoneCount" xml) Long.parse) + end +module GetHealthCheckCountRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DelegationSetInUse = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HostedZoneCount", Long.to_query v.hosted_zone_count)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("hosted_zone_count", Long.to_json v.hosted_zone_count) ]) - - let of_json j = - { hosted_zone_count = - Long.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_count")) - } -end - -module TooManyHostedZones = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DisassociateVPCFromHostedZoneRequest = struct - type t = - { hosted_zone_id : String.t - ; v_p_c : VPC.t - ; comment : String.t option - } - - let make ~hosted_zone_id ~v_p_c ?comment () = { hosted_zone_id; v_p_c; comment } - - let parse xml = - Some - { hosted_zone_id = - Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; v_p_c = Xml.required "VPC" (Util.option_bind (Xml.member "VPC" xml) VPC.parse) - ; comment = Util.option_bind (Xml.member "Comment" xml) String.parse + end +module GetReusableDelegationSetRequest = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module DeleteHostedZoneResponse = + struct + type t = { + change_info: ChangeInfo.t } + let make ~change_info () = { change_info } + let parse xml = + Some + { + change_info = + (Xml.required "ChangeInfo" + (Util.option_bind (Xml.member "ChangeInfo" xml) + ChangeInfo.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("ChangeInfo", (ChangeInfo.to_query v.change_info)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_info", (ChangeInfo.to_json v.change_info))]) + let of_json j = + { + change_info = + (ChangeInfo.of_json + (Util.of_option_exn (Json.lookup j "change_info"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ; Some (Query.Pair ("VPC", VPC.to_query v.v_p_c)) - ; Some (Query.Pair ("Id", String.to_query v.hosted_zone_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> "comment", String.to_json f) - ; Some ("v_p_c", VPC.to_json v.v_p_c) - ; Some ("hosted_zone_id", String.to_json v.hosted_zone_id) - ]) - - let of_json j = - { hosted_zone_id = - String.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_id")) - ; v_p_c = VPC.of_json (Util.of_option_exn (Json.lookup j "v_p_c")) - ; comment = Util.option_map (Json.lookup j "comment") String.of_json - } -end - -module ListGeoLocationsRequest = struct - type t = - { start_continent_code : String.t option - ; start_country_code : String.t option - ; start_subdivision_code : String.t option - ; max_items : String.t option - } - - let make ?start_continent_code ?start_country_code ?start_subdivision_code ?max_items () - = - { start_continent_code; start_country_code; start_subdivision_code; max_items } - - let parse xml = - Some - { start_continent_code = - Util.option_bind (Xml.member "startcontinentcode" xml) String.parse - ; start_country_code = - Util.option_bind (Xml.member "startcountrycode" xml) String.parse - ; start_subdivision_code = - Util.option_bind (Xml.member "startsubdivisioncode" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse + end +module NoSuchHealthCheck = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.start_subdivision_code (fun f -> - Query.Pair ("startsubdivisioncode", String.to_query f)) - ; Util.option_map v.start_country_code (fun f -> - Query.Pair ("startcountrycode", String.to_query f)) - ; Util.option_map v.start_continent_code (fun f -> - Query.Pair ("startcontinentcode", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.start_subdivision_code (fun f -> - "start_subdivision_code", String.to_json f) - ; Util.option_map v.start_country_code (fun f -> - "start_country_code", String.to_json f) - ; Util.option_map v.start_continent_code (fun f -> - "start_continent_code", String.to_json f) - ]) - - let of_json j = - { start_continent_code = - Util.option_map (Json.lookup j "start_continent_code") String.of_json - ; start_country_code = - Util.option_map (Json.lookup j "start_country_code") String.of_json - ; start_subdivision_code = - Util.option_map (Json.lookup j "start_subdivision_code") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - } -end - -module CreateReusableDelegationSetResponse = struct - type t = - { delegation_set : DelegationSet.t - ; location : String.t - } - - let make ~delegation_set ~location () = { delegation_set; location } - - let parse xml = - Some - { delegation_set = - Xml.required - "DelegationSet" - (Util.option_bind (Xml.member "DelegationSet" xml) DelegationSet.parse) - ; location = - Xml.required - "Location" - (Util.option_bind (Xml.member "Location" xml) String.parse) + end +module DelegationSetNotReusable = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Location", String.to_query v.location)) - ; Some (Query.Pair ("DelegationSet", DelegationSet.to_query v.delegation_set)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("location", String.to_json v.location) - ; Some ("delegation_set", DelegationSet.to_json v.delegation_set) - ]) - - let of_json j = - { delegation_set = - DelegationSet.of_json (Util.of_option_exn (Json.lookup j "delegation_set")) - ; location = String.of_json (Util.of_option_exn (Json.lookup j "location")) - } -end - -module DisassociateVPCFromHostedZoneResponse = struct - type t = { change_info : ChangeInfo.t } - - let make ~change_info () = { change_info } - - let parse xml = - Some - { change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) + end +module HealthCheckVersionMismatch = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("change_info", ChangeInfo.to_json v.change_info) ]) - - let of_json j = - { change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - } -end - -module ListResourceRecordSetsResponse = struct - type t = - { resource_record_sets : ResourceRecordSets.t - ; is_truncated : Boolean.t - ; next_record_name : String.t option - ; next_record_type : RRType.t option - ; next_record_identifier : String.t option - ; max_items : String.t - } - - let make - ~resource_record_sets - ~is_truncated - ?next_record_name - ?next_record_type - ?next_record_identifier - ~max_items - () = - { resource_record_sets - ; is_truncated - ; next_record_name - ; next_record_type - ; next_record_identifier - ; max_items - } - - let parse xml = - Some - { resource_record_sets = - Xml.required - "ResourceRecordSets" - (Util.option_bind - (Xml.member "ResourceRecordSets" xml) - ResourceRecordSets.parse) - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_record_name = Util.option_bind (Xml.member "NextRecordName" xml) String.parse - ; next_record_type = Util.option_bind (Xml.member "NextRecordType" xml) RRType.parse - ; next_record_identifier = - Util.option_bind (Xml.member "NextRecordIdentifier" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module InvalidDomainName = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_record_identifier (fun f -> - Query.Pair ("NextRecordIdentifier", String.to_query f)) - ; Util.option_map v.next_record_type (fun f -> - Query.Pair ("NextRecordType", RRType.to_query f)) - ; Util.option_map v.next_record_name (fun f -> - Query.Pair ("NextRecordName", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Some + end +module ListReusableDelegationSetsResponse = + struct + type t = + { + delegation_sets: DelegationSets.t ; + marker: String.t ; + is_truncated: Boolean.t ; + next_marker: String.t option ; + max_items: String.t } + let make ~delegation_sets ~marker ~is_truncated ?next_marker + ~max_items () = + { delegation_sets; marker; is_truncated; next_marker; max_items } + let parse xml = + Some + { + delegation_sets = + (Xml.required "DelegationSets" + (Util.option_bind (Xml.member "DelegationSets" xml) + DelegationSets.parse)); + marker = + (Xml.required "Marker" + (Util.option_bind (Xml.member "Marker" xml) String.parse)); + is_truncated = + (Xml.required "IsTruncated" + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse)); + next_marker = + (Util.option_bind (Xml.member "NextMarker" xml) String.parse); + max_items = + (Xml.required "MaxItems" + (Util.option_bind (Xml.member "MaxItems" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("MaxItems", (String.to_query v.max_items))); + Util.option_map v.next_marker + (fun f -> Query.Pair ("NextMarker", (String.to_query f))); + Some + (Query.Pair ("IsTruncated", (Boolean.to_query v.is_truncated))); + Some (Query.Pair ("Marker", (String.to_query v.marker))); + Some (Query.Pair - ( "ResourceRecordSets.member" - , ResourceRecordSets.to_query v.resource_record_sets )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_record_identifier (fun f -> - "next_record_identifier", String.to_json f) - ; Util.option_map v.next_record_type (fun f -> - "next_record_type", RRType.to_json f) - ; Util.option_map v.next_record_name (fun f -> - "next_record_name", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Some ("resource_record_sets", ResourceRecordSets.to_json v.resource_record_sets) - ]) - - let of_json j = - { resource_record_sets = - ResourceRecordSets.of_json - (Util.of_option_exn (Json.lookup j "resource_record_sets")) - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_record_name = Util.option_map (Json.lookup j "next_record_name") String.of_json - ; next_record_type = Util.option_map (Json.lookup j "next_record_type") RRType.of_json - ; next_record_identifier = - Util.option_map (Json.lookup j "next_record_identifier") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module NoSuchGeoLocation = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetHealthCheckCountRequest = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DelegationSetInUse = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetReusableDelegationSetRequest = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module DeleteHostedZoneResponse = struct - type t = { change_info : ChangeInfo.t } - - let make ~change_info () = { change_info } - - let parse xml = - Some - { change_info = - Xml.required - "ChangeInfo" - (Util.option_bind (Xml.member "ChangeInfo" xml) ChangeInfo.parse) + ("DelegationSets.member", + (DelegationSets.to_query v.delegation_sets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("max_items", (String.to_json v.max_items)); + Util.option_map v.next_marker + (fun f -> ("next_marker", (String.to_json f))); + Some ("is_truncated", (Boolean.to_json v.is_truncated)); + Some ("marker", (String.to_json v.marker)); + Some + ("delegation_sets", (DelegationSets.to_json v.delegation_sets))]) + let of_json j = + { + delegation_sets = + (DelegationSets.of_json + (Util.of_option_exn (Json.lookup j "delegation_sets"))); + marker = + (String.of_json (Util.of_option_exn (Json.lookup j "marker"))); + is_truncated = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "is_truncated"))); + next_marker = + (Util.option_map (Json.lookup j "next_marker") String.of_json); + max_items = + (String.of_json (Util.of_option_exn (Json.lookup j "max_items"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeInfo", ChangeInfo.to_query v.change_info)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("change_info", ChangeInfo.to_json v.change_info) ]) - - let of_json j = - { change_info = ChangeInfo.of_json (Util.of_option_exn (Json.lookup j "change_info")) - } -end - -module NoSuchHealthCheck = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DelegationSetNotReusable = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module HealthCheckVersionMismatch = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module InvalidDomainName = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListReusableDelegationSetsResponse = struct - type t = - { delegation_sets : DelegationSets.t - ; marker : String.t - ; is_truncated : Boolean.t - ; next_marker : String.t option - ; max_items : String.t - } - - let make ~delegation_sets ~marker ~is_truncated ?next_marker ~max_items () = - { delegation_sets; marker; is_truncated; next_marker; max_items } - - let parse xml = - Some - { delegation_sets = - Xml.required - "DelegationSets" - (Util.option_bind (Xml.member "DelegationSets" xml) DelegationSets.parse) - ; marker = - Xml.required "Marker" (Util.option_bind (Xml.member "Marker" xml) String.parse) - ; is_truncated = - Xml.required - "IsTruncated" - (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse) - ; next_marker = Util.option_bind (Xml.member "NextMarker" xml) String.parse - ; max_items = - Xml.required - "MaxItems" - (Util.option_bind (Xml.member "MaxItems" xml) String.parse) + end +module DeleteHealthCheckResponse = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module UpdateHostedZoneCommentResponse = + struct + type t = { + hosted_zone: HostedZone.t } + let make ~hosted_zone () = { hosted_zone } + let parse xml = + Some + { + hosted_zone = + (Xml.required "HostedZone" + (Util.option_bind (Xml.member "HostedZone" xml) + HostedZone.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("HostedZone", (HostedZone.to_query v.hosted_zone)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("hosted_zone", (HostedZone.to_json v.hosted_zone))]) + let of_json j = + { + hosted_zone = + (HostedZone.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("MaxItems", String.to_query v.max_items)) - ; Util.option_map v.next_marker (fun f -> - Query.Pair ("NextMarker", String.to_query f)) - ; Some (Query.Pair ("IsTruncated", Boolean.to_query v.is_truncated)) - ; Some (Query.Pair ("Marker", String.to_query v.marker)) - ; Some + end +module CreateHealthCheckRequest = + struct + type t = + { + caller_reference: String.t ; + health_check_config: HealthCheckConfig.t } + let make ~caller_reference ~health_check_config () = + { caller_reference; health_check_config } + let parse xml = + Some + { + caller_reference = + (Xml.required "CallerReference" + (Util.option_bind (Xml.member "CallerReference" xml) + String.parse)); + health_check_config = + (Xml.required "HealthCheckConfig" + (Util.option_bind (Xml.member "HealthCheckConfig" xml) + HealthCheckConfig.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckConfig", + (HealthCheckConfig.to_query v.health_check_config))); + Some (Query.Pair - ("DelegationSets.member", DelegationSets.to_query v.delegation_sets)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("max_items", String.to_json v.max_items) - ; Util.option_map v.next_marker (fun f -> "next_marker", String.to_json f) - ; Some ("is_truncated", Boolean.to_json v.is_truncated) - ; Some ("marker", String.to_json v.marker) - ; Some ("delegation_sets", DelegationSets.to_json v.delegation_sets) - ]) - - let of_json j = - { delegation_sets = - DelegationSets.of_json (Util.of_option_exn (Json.lookup j "delegation_sets")) - ; marker = String.of_json (Util.of_option_exn (Json.lookup j "marker")) - ; is_truncated = Boolean.of_json (Util.of_option_exn (Json.lookup j "is_truncated")) - ; next_marker = Util.option_map (Json.lookup j "next_marker") String.of_json - ; max_items = String.of_json (Util.of_option_exn (Json.lookup j "max_items")) - } -end - -module DeleteHealthCheckResponse = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module UpdateHostedZoneCommentResponse = struct - type t = { hosted_zone : HostedZone.t } - - let make ~hosted_zone () = { hosted_zone } - - let parse xml = - Some - { hosted_zone = - Xml.required - "HostedZone" - (Util.option_bind (Xml.member "HostedZone" xml) HostedZone.parse) + ("CallerReference", (String.to_query v.caller_reference)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("health_check_config", + (HealthCheckConfig.to_json v.health_check_config)); + Some ("caller_reference", (String.to_json v.caller_reference))]) + let of_json j = + { + caller_reference = + (String.of_json + (Util.of_option_exn (Json.lookup j "caller_reference"))); + health_check_config = + (HealthCheckConfig.of_json + (Util.of_option_exn (Json.lookup j "health_check_config"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HostedZone", HostedZone.to_query v.hosted_zone)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("hosted_zone", HostedZone.to_json v.hosted_zone) ]) - - let of_json j = - { hosted_zone = HostedZone.of_json (Util.of_option_exn (Json.lookup j "hosted_zone")) - } -end - -module CreateHealthCheckRequest = struct - type t = - { caller_reference : String.t - ; health_check_config : HealthCheckConfig.t - } - - let make ~caller_reference ~health_check_config () = - { caller_reference; health_check_config } - - let parse xml = - Some - { caller_reference = - Xml.required - "CallerReference" - (Util.option_bind (Xml.member "CallerReference" xml) String.parse) - ; health_check_config = - Xml.required - "HealthCheckConfig" - (Util.option_bind - (Xml.member "HealthCheckConfig" xml) - HealthCheckConfig.parse) + end +module CreateHostedZoneRequest = + struct + type t = + { + name: String.t ; + v_p_c: VPC.t option ; + caller_reference: String.t ; + hosted_zone_config: HostedZoneConfig.t option ; + delegation_set_id: String.t option } + let make ~name ?v_p_c ~caller_reference ?hosted_zone_config + ?delegation_set_id () = + { name; v_p_c; caller_reference; hosted_zone_config; delegation_set_id } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + v_p_c = (Util.option_bind (Xml.member "VPC" xml) VPC.parse); + caller_reference = + (Xml.required "CallerReference" + (Util.option_bind (Xml.member "CallerReference" xml) + String.parse)); + hosted_zone_config = + (Util.option_bind (Xml.member "HostedZoneConfig" xml) + HostedZoneConfig.parse); + delegation_set_id = + (Util.option_bind (Xml.member "DelegationSetId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delegation_set_id + (fun f -> Query.Pair ("DelegationSetId", (String.to_query f))); + Util.option_map v.hosted_zone_config + (fun f -> + Query.Pair + ("HostedZoneConfig", (HostedZoneConfig.to_query f))); + Some (Query.Pair - ("HealthCheckConfig", HealthCheckConfig.to_query v.health_check_config)) - ; Some (Query.Pair ("CallerReference", String.to_query v.caller_reference)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_config", HealthCheckConfig.to_json v.health_check_config) - ; Some ("caller_reference", String.to_json v.caller_reference) - ]) - - let of_json j = - { caller_reference = - String.of_json (Util.of_option_exn (Json.lookup j "caller_reference")) - ; health_check_config = - HealthCheckConfig.of_json - (Util.of_option_exn (Json.lookup j "health_check_config")) - } -end - -module CreateHostedZoneRequest = struct - type t = - { name : String.t - ; v_p_c : VPC.t option - ; caller_reference : String.t - ; hosted_zone_config : HostedZoneConfig.t option - ; delegation_set_id : String.t option - } - - let make ~name ?v_p_c ~caller_reference ?hosted_zone_config ?delegation_set_id () = - { name; v_p_c; caller_reference; hosted_zone_config; delegation_set_id } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; v_p_c = Util.option_bind (Xml.member "VPC" xml) VPC.parse - ; caller_reference = - Xml.required - "CallerReference" - (Util.option_bind (Xml.member "CallerReference" xml) String.parse) - ; hosted_zone_config = - Util.option_bind (Xml.member "HostedZoneConfig" xml) HostedZoneConfig.parse - ; delegation_set_id = - Util.option_bind (Xml.member "DelegationSetId" xml) String.parse + ("CallerReference", (String.to_query v.caller_reference))); + Util.option_map v.v_p_c + (fun f -> Query.Pair ("VPC", (VPC.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delegation_set_id + (fun f -> ("delegation_set_id", (String.to_json f))); + Util.option_map v.hosted_zone_config + (fun f -> ("hosted_zone_config", (HostedZoneConfig.to_json f))); + Some ("caller_reference", (String.to_json v.caller_reference)); + Util.option_map v.v_p_c (fun f -> ("v_p_c", (VPC.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + v_p_c = (Util.option_map (Json.lookup j "v_p_c") VPC.of_json); + caller_reference = + (String.of_json + (Util.of_option_exn (Json.lookup j "caller_reference"))); + hosted_zone_config = + (Util.option_map (Json.lookup j "hosted_zone_config") + HostedZoneConfig.of_json); + delegation_set_id = + (Util.option_map (Json.lookup j "delegation_set_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delegation_set_id (fun f -> - Query.Pair ("DelegationSetId", String.to_query f)) - ; Util.option_map v.hosted_zone_config (fun f -> - Query.Pair ("HostedZoneConfig", HostedZoneConfig.to_query f)) - ; Some (Query.Pair ("CallerReference", String.to_query v.caller_reference)) - ; Util.option_map v.v_p_c (fun f -> Query.Pair ("VPC", VPC.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delegation_set_id (fun f -> - "delegation_set_id", String.to_json f) - ; Util.option_map v.hosted_zone_config (fun f -> - "hosted_zone_config", HostedZoneConfig.to_json f) - ; Some ("caller_reference", String.to_json v.caller_reference) - ; Util.option_map v.v_p_c (fun f -> "v_p_c", VPC.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; v_p_c = Util.option_map (Json.lookup j "v_p_c") VPC.of_json - ; caller_reference = - String.of_json (Util.of_option_exn (Json.lookup j "caller_reference")) - ; hosted_zone_config = - Util.option_map (Json.lookup j "hosted_zone_config") HostedZoneConfig.of_json - ; delegation_set_id = - Util.option_map (Json.lookup j "delegation_set_id") String.of_json - } -end - -module DeleteHealthCheckRequest = struct - type t = { health_check_id : String.t } - - let make ~health_check_id () = { health_check_id } - - let parse xml = - Some - { health_check_id = - Xml.required - "HealthCheckId" - (Util.option_bind (Xml.member "HealthCheckId" xml) String.parse) + end +module DeleteHealthCheckRequest = + struct + type t = { + health_check_id: String.t } + let make ~health_check_id () = { health_check_id } + let parse xml = + Some + { + health_check_id = + (Xml.required "HealthCheckId" + (Util.option_bind (Xml.member "HealthCheckId" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("HealthCheckId", (String.to_query v.health_check_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("health_check_id", (String.to_json v.health_check_id))]) + let of_json j = + { + health_check_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "health_check_id"))) + } + end +module LastVPCAssociation = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module PriorRequestNotComplete = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ChangeResourceRecordSetsRequest = + struct + type t = { + hosted_zone_id: String.t ; + change_batch: ChangeBatch.t } + let make ~hosted_zone_id ~change_batch () = + { hosted_zone_id; change_batch } + let parse xml = + Some + { + hosted_zone_id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + change_batch = + (Xml.required "ChangeBatch" + (Util.option_bind (Xml.member "ChangeBatch" xml) + ChangeBatch.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ChangeBatch", (ChangeBatch.to_query v.change_batch))); + Some (Query.Pair ("Id", (String.to_query v.hosted_zone_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("change_batch", (ChangeBatch.to_json v.change_batch)); + Some ("hosted_zone_id", (String.to_json v.hosted_zone_id))]) + let of_json j = + { + hosted_zone_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone_id"))); + change_batch = + (ChangeBatch.of_json + (Util.of_option_exn (Json.lookup j "change_batch"))) + } + end +module GetHostedZoneResponse = + struct + type t = + { + hosted_zone: HostedZone.t ; + delegation_set: DelegationSet.t option ; + v_p_cs: VPCs.t } + let make ~hosted_zone ?delegation_set ?(v_p_cs= []) () = + { hosted_zone; delegation_set; v_p_cs } + let parse xml = + Some + { + hosted_zone = + (Xml.required "HostedZone" + (Util.option_bind (Xml.member "HostedZone" xml) + HostedZone.parse)); + delegation_set = + (Util.option_bind (Xml.member "DelegationSet" xml) + DelegationSet.parse); + v_p_cs = + (Util.of_option [] + (Util.option_bind (Xml.member "VPCs" xml) VPCs.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("VPCs.member", (VPCs.to_query v.v_p_cs))); + Util.option_map v.delegation_set + (fun f -> + Query.Pair ("DelegationSet", (DelegationSet.to_query f))); + Some + (Query.Pair ("HostedZone", (HostedZone.to_query v.hosted_zone)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("v_p_cs", (VPCs.to_json v.v_p_cs)); + Util.option_map v.delegation_set + (fun f -> ("delegation_set", (DelegationSet.to_json f))); + Some ("hosted_zone", (HostedZone.to_json v.hosted_zone))]) + let of_json j = + { + hosted_zone = + (HostedZone.of_json + (Util.of_option_exn (Json.lookup j "hosted_zone"))); + delegation_set = + (Util.option_map (Json.lookup j "delegation_set") + DelegationSet.of_json); + v_p_cs = (VPCs.of_json (Util.of_option_exn (Json.lookup j "v_p_cs"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("HealthCheckId", String.to_query v.health_check_id)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("health_check_id", String.to_json v.health_check_id) ]) - - let of_json j = - { health_check_id = - String.of_json (Util.of_option_exn (Json.lookup j "health_check_id")) - } -end - -module LastVPCAssociation = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module PriorRequestNotComplete = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ChangeResourceRecordSetsRequest = struct - type t = - { hosted_zone_id : String.t - ; change_batch : ChangeBatch.t - } - - let make ~hosted_zone_id ~change_batch () = { hosted_zone_id; change_batch } - - let parse xml = - Some - { hosted_zone_id = - Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; change_batch = - Xml.required - "ChangeBatch" - (Util.option_bind (Xml.member "ChangeBatch" xml) ChangeBatch.parse) + end +module HostedZoneAlreadyExists = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ChangeBatch", ChangeBatch.to_query v.change_batch)) - ; Some (Query.Pair ("Id", String.to_query v.hosted_zone_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("change_batch", ChangeBatch.to_json v.change_batch) - ; Some ("hosted_zone_id", String.to_json v.hosted_zone_id) - ]) - - let of_json j = - { hosted_zone_id = - String.of_json (Util.of_option_exn (Json.lookup j "hosted_zone_id")) - ; change_batch = - ChangeBatch.of_json (Util.of_option_exn (Json.lookup j "change_batch")) - } -end - -module GetHostedZoneResponse = struct - type t = - { hosted_zone : HostedZone.t - ; delegation_set : DelegationSet.t option - ; v_p_cs : VPCs.t - } - - let make ~hosted_zone ?delegation_set ?(v_p_cs = []) () = - { hosted_zone; delegation_set; v_p_cs } - - let parse xml = - Some - { hosted_zone = - Xml.required - "HostedZone" - (Util.option_bind (Xml.member "HostedZone" xml) HostedZone.parse) - ; delegation_set = - Util.option_bind (Xml.member "DelegationSet" xml) DelegationSet.parse - ; v_p_cs = Util.of_option [] (Util.option_bind (Xml.member "VPCs" xml) VPCs.parse) + end +module ListHostedZonesByNameRequest = + struct + type t = + { + d_n_s_name: String.t option ; + hosted_zone_id: String.t option ; + max_items: String.t option } + let make ?d_n_s_name ?hosted_zone_id ?max_items () = + { d_n_s_name; hosted_zone_id; max_items } + let parse xml = + Some + { + d_n_s_name = + (Util.option_bind (Xml.member "dnsname" xml) String.parse); + hosted_zone_id = + (Util.option_bind (Xml.member "hostedzoneid" xml) String.parse); + max_items = + (Util.option_bind (Xml.member "maxitems" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> Query.Pair ("maxitems", (String.to_query f))); + Util.option_map v.hosted_zone_id + (fun f -> Query.Pair ("hostedzoneid", (String.to_query f))); + Util.option_map v.d_n_s_name + (fun f -> Query.Pair ("dnsname", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_items + (fun f -> ("max_items", (String.to_json f))); + Util.option_map v.hosted_zone_id + (fun f -> ("hosted_zone_id", (String.to_json f))); + Util.option_map v.d_n_s_name + (fun f -> ("d_n_s_name", (String.to_json f)))]) + let of_json j = + { + d_n_s_name = + (Util.option_map (Json.lookup j "d_n_s_name") String.of_json); + hosted_zone_id = + (Util.option_map (Json.lookup j "hosted_zone_id") String.of_json); + max_items = + (Util.option_map (Json.lookup j "max_items") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VPCs.member", VPCs.to_query v.v_p_cs)) - ; Util.option_map v.delegation_set (fun f -> - Query.Pair ("DelegationSet", DelegationSet.to_query f)) - ; Some (Query.Pair ("HostedZone", HostedZone.to_query v.hosted_zone)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("v_p_cs", VPCs.to_json v.v_p_cs) - ; Util.option_map v.delegation_set (fun f -> - "delegation_set", DelegationSet.to_json f) - ; Some ("hosted_zone", HostedZone.to_json v.hosted_zone) - ]) - - let of_json j = - { hosted_zone = HostedZone.of_json (Util.of_option_exn (Json.lookup j "hosted_zone")) - ; delegation_set = - Util.option_map (Json.lookup j "delegation_set") DelegationSet.of_json - ; v_p_cs = VPCs.of_json (Util.of_option_exn (Json.lookup j "v_p_cs")) - } -end - -module HostedZoneAlreadyExists = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ListHostedZonesByNameRequest = struct - type t = - { d_n_s_name : String.t option - ; hosted_zone_id : String.t option - ; max_items : String.t option - } - - let make ?d_n_s_name ?hosted_zone_id ?max_items () = - { d_n_s_name; hosted_zone_id; max_items } - - let parse xml = - Some - { d_n_s_name = Util.option_bind (Xml.member "dnsname" xml) String.parse - ; hosted_zone_id = Util.option_bind (Xml.member "hostedzoneid" xml) String.parse - ; max_items = Util.option_bind (Xml.member "maxitems" xml) String.parse + end +module UpdateHostedZoneCommentRequest = + struct + type t = { + id: String.t ; + comment: String.t option } + let make ~id ?comment () = { id; comment } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + comment = + (Util.option_bind (Xml.member "Comment" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> Query.Pair ("Comment", (String.to_query f))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.comment + (fun f -> ("comment", (String.to_json f))); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + comment = (Util.option_map (Json.lookup j "comment") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> - Query.Pair ("maxitems", String.to_query f)) - ; Util.option_map v.hosted_zone_id (fun f -> - Query.Pair ("hostedzoneid", String.to_query f)) - ; Util.option_map v.d_n_s_name (fun f -> - Query.Pair ("dnsname", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_items (fun f -> "max_items", String.to_json f) - ; Util.option_map v.hosted_zone_id (fun f -> "hosted_zone_id", String.to_json f) - ; Util.option_map v.d_n_s_name (fun f -> "d_n_s_name", String.to_json f) - ]) - - let of_json j = - { d_n_s_name = Util.option_map (Json.lookup j "d_n_s_name") String.of_json - ; hosted_zone_id = Util.option_map (Json.lookup j "hosted_zone_id") String.of_json - ; max_items = Util.option_map (Json.lookup j "max_items") String.of_json - } -end - -module UpdateHostedZoneCommentRequest = struct - type t = - { id : String.t - ; comment : String.t option - } - - let make ~id ?comment () = { id; comment } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; comment = Util.option_bind (Xml.member "Comment" xml) String.parse + end +module HealthCheckAlreadyExists = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> Query.Pair ("Comment", String.to_query f)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.comment (fun f -> "comment", String.to_json f) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; comment = Util.option_map (Json.lookup j "comment") String.of_json - } -end - -module HealthCheckAlreadyExists = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end + end \ No newline at end of file diff --git a/libraries/route53/lib/updateHealthCheck.ml b/libraries/route53/lib/updateHealthCheck.ml index 322e07ffd..0048296a7 100644 --- a/libraries/route53/lib/updateHealthCheck.ml +++ b/libraries/route53/lib/updateHealthCheck.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = UpdateHealthCheckRequest.t - type output = UpdateHealthCheckResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "UpdateHealthCheck" ] ] + [("Version", ["2013-04-01"]); ("Action", ["UpdateHealthCheck"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UpdateHealthCheckRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (UpdateHealthCheckRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "UpdateHealthCheckResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp UpdateHealthCheckResponse.parse) + Util.or_error (Util.option_bind resp UpdateHealthCheckResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed UpdateHealthCheckResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed UpdateHealthCheckResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UpdateHealthCheckResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UpdateHealthCheckResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/updateHealthCheck.mli b/libraries/route53/lib/updateHealthCheck.mli index cd2bcafc7..d2eec556d 100644 --- a/libraries/route53/lib/updateHealthCheck.mli +++ b/libraries/route53/lib/updateHealthCheck.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateHealthCheckRequest.t - type output = UpdateHealthCheckResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib/updateHostedZoneComment.ml b/libraries/route53/lib/updateHostedZoneComment.ml index b727f7a6f..c12d5bef1 100644 --- a/libraries/route53/lib/updateHostedZoneComment.ml +++ b/libraries/route53/lib/updateHostedZoneComment.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = UpdateHostedZoneCommentRequest.t - type output = UpdateHostedZoneCommentResponse.t - type error = Errors_internal.t - let service = "route53" - 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", [ "2013-04-01" ]; "Action", [ "UpdateHostedZoneComment" ] ] + [("Version", ["2013-04-01"]); + ("Action", ["UpdateHostedZoneComment"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (UpdateHostedZoneCommentRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (UpdateHostedZoneCommentRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp UpdateHostedZoneCommentResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed UpdateHostedZoneCommentResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed UpdateHostedZoneCommentResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UpdateHostedZoneCommentResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UpdateHostedZoneCommentResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/route53/lib/updateHostedZoneComment.mli b/libraries/route53/lib/updateHostedZoneComment.mli index 92c56b936..5eecdfa42 100644 --- a/libraries/route53/lib/updateHostedZoneComment.mli +++ b/libraries/route53/lib/updateHostedZoneComment.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateHostedZoneCommentRequest.t - type output = UpdateHostedZoneCommentResponse.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 \ No newline at end of file diff --git a/libraries/route53/lib_test/dune b/libraries/route53/lib_test/dune index ffe6c7321..a8fbbd205 100644 --- a/libraries/route53/lib_test/dune +++ b/libraries/route53/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_route53_test) - (libraries aws aws_route53 aws-async aws-lwt oUnit yojson async cohttp-async - lwt cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_route53 aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/route53/lib_test/test_async.ml b/libraries/route53/lib_test/test_async.ml index 70018caaa..a7079bcfd 100644 --- a/libraries/route53/lib_test/test_async.ml +++ b/libraries/route53/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_route53_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/route53/lib_test/test_lwt.ml b/libraries/route53/lib_test/test_lwt.ml index e38d2eb8c..5ee5c5fb0 100644 --- a/libraries/route53/lib_test/test_lwt.ml +++ b/libraries/route53/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_route53_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/s3/lib/abortMultipartUpload.ml b/libraries/s3/lib/abortMultipartUpload.ml index fd100f8eb..d1aac624a 100644 --- a/libraries/s3/lib/abortMultipartUpload.ml +++ b/libraries/s3/lib/abortMultipartUpload.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = AbortMultipartUploadRequest.t - type output = AbortMultipartUploadOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "AbortMultipartUpload" ] ] + [("Version", ["2006-03-01"]); ("Action", ["AbortMultipartUpload"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AbortMultipartUploadRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render (AbortMultipartUploadRequest.to_query req))))) in + (`DELETE, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "AbortMultipartUploadResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp AbortMultipartUploadOutput.parse) + Util.or_error (Util.option_bind resp AbortMultipartUploadOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AbortMultipartUploadOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AbortMultipartUploadOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AbortMultipartUploadOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AbortMultipartUploadOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/abortMultipartUpload.mli b/libraries/s3/lib/abortMultipartUpload.mli index 82dcc88e8..cca659c06 100644 --- a/libraries/s3/lib/abortMultipartUpload.mli +++ b/libraries/s3/lib/abortMultipartUpload.mli @@ -1,10 +1,7 @@ open Types - type input = AbortMultipartUploadRequest.t - type output = AbortMultipartUploadOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/completeMultipartUpload.ml b/libraries/s3/lib/completeMultipartUpload.ml index 154a37527..c07624c5a 100644 --- a/libraries/s3/lib/completeMultipartUpload.ml +++ b/libraries/s3/lib/completeMultipartUpload.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CompleteMultipartUploadRequest.t - type output = CompleteMultipartUploadOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "CompleteMultipartUpload" ] ] + [("Version", ["2006-03-01"]); + ("Action", ["CompleteMultipartUpload"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CompleteMultipartUploadRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CompleteMultipartUploadRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp CompleteMultipartUploadOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CompleteMultipartUploadOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CompleteMultipartUploadOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CompleteMultipartUploadOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CompleteMultipartUploadOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/completeMultipartUpload.mli b/libraries/s3/lib/completeMultipartUpload.mli index 9733f2e31..4c68ac022 100644 --- a/libraries/s3/lib/completeMultipartUpload.mli +++ b/libraries/s3/lib/completeMultipartUpload.mli @@ -1,10 +1,7 @@ open Types - type input = CompleteMultipartUploadRequest.t - type output = CompleteMultipartUploadOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/copyObject.ml b/libraries/s3/lib/copyObject.ml index 3d8ce6668..76889c030 100644 --- a/libraries/s3/lib/copyObject.ml +++ b/libraries/s3/lib/copyObject.ml @@ -1,57 +1,54 @@ open Types open Aws - type input = CopyObjectRequest.t - type output = CopyObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "CopyObject" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["CopyObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CopyObjectRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (CopyObjectRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CopyObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CopyObjectOutput.parse) + Util.or_error (Util.option_bind resp CopyObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CopyObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed CopyObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CopyObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CopyObjectOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/copyObject.mli b/libraries/s3/lib/copyObject.mli index 0596d5540..a17b413f2 100644 --- a/libraries/s3/lib/copyObject.mli +++ b/libraries/s3/lib/copyObject.mli @@ -1,10 +1,7 @@ open Types - type input = CopyObjectRequest.t - type output = CopyObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/createBucket.ml b/libraries/s3/lib/createBucket.ml index fa71c0058..4fec21c24 100644 --- a/libraries/s3/lib/createBucket.ml +++ b/libraries/s3/lib/createBucket.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = CreateBucketRequest.t - type output = CreateBucketOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "CreateBucket" ] ] + [("Version", ["2006-03-01"]); ("Action", ["CreateBucket"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateBucketRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateBucketRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateBucketResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateBucketOutput.parse) + Util.or_error (Util.option_bind resp CreateBucketOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateBucketOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateBucketOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateBucketOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateBucketOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/createBucket.mli b/libraries/s3/lib/createBucket.mli index c07444b88..ebc69b592 100644 --- a/libraries/s3/lib/createBucket.mli +++ b/libraries/s3/lib/createBucket.mli @@ -1,10 +1,7 @@ open Types - type input = CreateBucketRequest.t - type output = CreateBucketOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/createMultipartUpload.ml b/libraries/s3/lib/createMultipartUpload.ml index 3121c5546..d992a733c 100644 --- a/libraries/s3/lib/createMultipartUpload.ml +++ b/libraries/s3/lib/createMultipartUpload.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = CreateMultipartUploadRequest.t - type output = CreateMultipartUploadOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "CreateMultipartUpload" ] ] + [("Version", ["2006-03-01"]); ("Action", ["CreateMultipartUpload"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateMultipartUploadRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateMultipartUploadRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateMultipartUploadResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateMultipartUploadOutput.parse) + Util.or_error (Util.option_bind resp CreateMultipartUploadOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateMultipartUploadOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateMultipartUploadOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateMultipartUploadOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateMultipartUploadOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/createMultipartUpload.mli b/libraries/s3/lib/createMultipartUpload.mli index 9ad33bfa6..f258f4c68 100644 --- a/libraries/s3/lib/createMultipartUpload.mli +++ b/libraries/s3/lib/createMultipartUpload.mli @@ -1,10 +1,7 @@ open Types - type input = CreateMultipartUploadRequest.t - type output = CreateMultipartUploadOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucket.ml b/libraries/s3/lib/deleteBucket.ml index f3a9fac72..00b61275d 100644 --- a/libraries/s3/lib/deleteBucket.ml +++ b/libraries/s3/lib/deleteBucket.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteBucketRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucket" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucket"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteBucketRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteBucketRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucket.mli b/libraries/s3/lib/deleteBucket.mli index 38738887b..ba0882076 100644 --- a/libraries/s3/lib/deleteBucket.mli +++ b/libraries/s3/lib/deleteBucket.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketCors.ml b/libraries/s3/lib/deleteBucketCors.ml index 594d5db91..245620d66 100644 --- a/libraries/s3/lib/deleteBucketCors.ml +++ b/libraries/s3/lib/deleteBucketCors.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteBucketCorsRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketCors" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketCors"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteBucketCorsRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteBucketCorsRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketCors.mli b/libraries/s3/lib/deleteBucketCors.mli index 1ada45372..afb91f562 100644 --- a/libraries/s3/lib/deleteBucketCors.mli +++ b/libraries/s3/lib/deleteBucketCors.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketCorsRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketLifecycle.ml b/libraries/s3/lib/deleteBucketLifecycle.ml index b1d8bea34..3963080a8 100644 --- a/libraries/s3/lib/deleteBucketLifecycle.ml +++ b/libraries/s3/lib/deleteBucketLifecycle.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteBucketLifecycleRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketLifecycle" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketLifecycle"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteBucketLifecycleRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render (DeleteBucketLifecycleRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketLifecycle.mli b/libraries/s3/lib/deleteBucketLifecycle.mli index 7f07f7eea..db0c9862e 100644 --- a/libraries/s3/lib/deleteBucketLifecycle.mli +++ b/libraries/s3/lib/deleteBucketLifecycle.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketLifecycleRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketPolicy.ml b/libraries/s3/lib/deleteBucketPolicy.ml index 598a0c222..9ba56140d 100644 --- a/libraries/s3/lib/deleteBucketPolicy.ml +++ b/libraries/s3/lib/deleteBucketPolicy.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteBucketPolicyRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketPolicy" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteBucketPolicyRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteBucketPolicyRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketPolicy.mli b/libraries/s3/lib/deleteBucketPolicy.mli index 114187658..df07cd2da 100644 --- a/libraries/s3/lib/deleteBucketPolicy.mli +++ b/libraries/s3/lib/deleteBucketPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketPolicyRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketReplication.ml b/libraries/s3/lib/deleteBucketReplication.ml index 48353e578..fc444ef4d 100644 --- a/libraries/s3/lib/deleteBucketReplication.ml +++ b/libraries/s3/lib/deleteBucketReplication.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = DeleteBucketReplicationRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketReplication" ] ] + [("Version", ["2006-03-01"]); + ("Action", ["DeleteBucketReplication"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteBucketReplicationRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render (DeleteBucketReplicationRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketReplication.mli b/libraries/s3/lib/deleteBucketReplication.mli index 57dc2cc11..e20bc287e 100644 --- a/libraries/s3/lib/deleteBucketReplication.mli +++ b/libraries/s3/lib/deleteBucketReplication.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketReplicationRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketTagging.ml b/libraries/s3/lib/deleteBucketTagging.ml index 5d37a4ffa..291edf5e4 100644 --- a/libraries/s3/lib/deleteBucketTagging.ml +++ b/libraries/s3/lib/deleteBucketTagging.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteBucketTaggingRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketTagging" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketTagging"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteBucketTaggingRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render (DeleteBucketTaggingRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketTagging.mli b/libraries/s3/lib/deleteBucketTagging.mli index 94c87ebcf..34349a22b 100644 --- a/libraries/s3/lib/deleteBucketTagging.mli +++ b/libraries/s3/lib/deleteBucketTagging.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketTaggingRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketWebsite.ml b/libraries/s3/lib/deleteBucketWebsite.ml index 12d80b8af..8322b2c99 100644 --- a/libraries/s3/lib/deleteBucketWebsite.ml +++ b/libraries/s3/lib/deleteBucketWebsite.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = DeleteBucketWebsiteRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteBucketWebsite" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketWebsite"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DeleteBucketWebsiteRequest.to_query req))))) - in - `DELETE, uri, [] - + (Query.render (DeleteBucketWebsiteRequest.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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteBucketWebsite.mli b/libraries/s3/lib/deleteBucketWebsite.mli index ac8b23dad..ec2b96785 100644 --- a/libraries/s3/lib/deleteBucketWebsite.mli +++ b/libraries/s3/lib/deleteBucketWebsite.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteBucketWebsiteRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteObject.ml b/libraries/s3/lib/deleteObject.ml index 79579419b..2704979f5 100644 --- a/libraries/s3/lib/deleteObject.ml +++ b/libraries/s3/lib/deleteObject.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DeleteObjectRequest.t - type output = DeleteObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteObject" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteObjectRequest.to_query req))))) - in - `DELETE, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteObjectRequest.to_query req))))) in + (`DELETE, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DeleteObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DeleteObjectOutput.parse) + Util.or_error (Util.option_bind resp DeleteObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DeleteObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteObjectOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteObject.mli b/libraries/s3/lib/deleteObject.mli index 31888733b..510898a0d 100644 --- a/libraries/s3/lib/deleteObject.mli +++ b/libraries/s3/lib/deleteObject.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteObjectRequest.t - type output = DeleteObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteObjects.ml b/libraries/s3/lib/deleteObjects.ml index b661dd293..1a3e74600 100644 --- a/libraries/s3/lib/deleteObjects.ml +++ b/libraries/s3/lib/deleteObjects.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = DeleteObjectsRequest.t - type output = DeleteObjectsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "DeleteObjects" ] ] + [("Version", ["2006-03-01"]); ("Action", ["DeleteObjects"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteObjectsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteObjectsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DeleteObjectsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DeleteObjectsOutput.parse) + Util.or_error (Util.option_bind resp DeleteObjectsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DeleteObjectsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DeleteObjectsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteObjectsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteObjectsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/deleteObjects.mli b/libraries/s3/lib/deleteObjects.mli index 23909ada3..9cf8baba7 100644 --- a/libraries/s3/lib/deleteObjects.mli +++ b/libraries/s3/lib/deleteObjects.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteObjectsRequest.t - type output = DeleteObjectsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/dune b/libraries/s3/lib/dune index a007cf5b6..5a1a317a9 100644 --- a/libraries/s3/lib/dune +++ b/libraries/s3/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_s3) + (name aws_s3) (public_name aws-s3) (synopsis "aws-Amazon Simple Storage Service") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/s3/lib/errors_internal.ml b/libraries/s3/lib/errors_internal.ml index bcf0c07f6..4b8f7745c 100644 --- a/libraries/s3/lib/errors_internal.ml +++ b/libraries/s3/lib/errors_internal.ml @@ -1,67 +1,64 @@ type t = - | AuthFailure - | Blocked - | BucketAlreadyExists - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | NoSuchBucket - | NoSuchKey - | NoSuchUpload - | ObjectAlreadyInActiveTierError - | ObjectNotInActiveTierError - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | BucketAlreadyExists + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | NoSuchBucket + | NoSuchKey + | NoSuchUpload + | ObjectAlreadyInActiveTierError + | ObjectNotInActiveTierError + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -97,7 +94,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -133,7 +129,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -169,4 +164,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/s3/lib/getBucketAcl.ml b/libraries/s3/lib/getBucketAcl.ml index c6b5fb4cd..3f65beef0 100644 --- a/libraries/s3/lib/getBucketAcl.ml +++ b/libraries/s3/lib/getBucketAcl.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = GetBucketAclRequest.t - type output = GetBucketAclOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketAcl" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketAclRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketAclRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketAclResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketAclOutput.parse) + Util.or_error (Util.option_bind resp GetBucketAclOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetBucketAclOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketAclOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketAclOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketAclOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketAcl.mli b/libraries/s3/lib/getBucketAcl.mli index 8842b8826..d28885d8a 100644 --- a/libraries/s3/lib/getBucketAcl.mli +++ b/libraries/s3/lib/getBucketAcl.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketAclRequest.t - type output = GetBucketAclOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketCors.ml b/libraries/s3/lib/getBucketCors.ml index e983cb3d3..498dac37d 100644 --- a/libraries/s3/lib/getBucketCors.ml +++ b/libraries/s3/lib/getBucketCors.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = GetBucketCorsRequest.t - type output = GetBucketCorsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketCors" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketCors"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketCorsRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketCorsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketCorsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketCorsOutput.parse) + Util.or_error (Util.option_bind resp GetBucketCorsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetBucketCorsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketCorsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketCorsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketCorsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketCors.mli b/libraries/s3/lib/getBucketCors.mli index 2a0b175e9..c98e0898f 100644 --- a/libraries/s3/lib/getBucketCors.mli +++ b/libraries/s3/lib/getBucketCors.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketCorsRequest.t - type output = GetBucketCorsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLifecycle.ml b/libraries/s3/lib/getBucketLifecycle.ml index dae3b4a74..61e96e6d7 100644 --- a/libraries/s3/lib/getBucketLifecycle.ml +++ b/libraries/s3/lib/getBucketLifecycle.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = GetBucketLifecycleRequest.t - type output = GetBucketLifecycleOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketLifecycle" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketLifecycle"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketLifecycleRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketLifecycleRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketLifecycleResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketLifecycleOutput.parse) + Util.or_error (Util.option_bind resp GetBucketLifecycleOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketLifecycleOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBucketLifecycleOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketLifecycleOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketLifecycleOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLifecycle.mli b/libraries/s3/lib/getBucketLifecycle.mli index f6e3f98b9..95d91c048 100644 --- a/libraries/s3/lib/getBucketLifecycle.mli +++ b/libraries/s3/lib/getBucketLifecycle.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketLifecycleRequest.t - type output = GetBucketLifecycleOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLocation.ml b/libraries/s3/lib/getBucketLocation.ml index 0e2a5bbe2..43fedcc45 100644 --- a/libraries/s3/lib/getBucketLocation.ml +++ b/libraries/s3/lib/getBucketLocation.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = GetBucketLocationRequest.t - type output = GetBucketLocationOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketLocation" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketLocation"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketLocationRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketLocationRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketLocationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketLocationOutput.parse) + Util.or_error (Util.option_bind resp GetBucketLocationOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketLocationOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBucketLocationOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketLocationOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketLocationOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLocation.mli b/libraries/s3/lib/getBucketLocation.mli index a60e005bb..0d5fe39fd 100644 --- a/libraries/s3/lib/getBucketLocation.mli +++ b/libraries/s3/lib/getBucketLocation.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketLocationRequest.t - type output = GetBucketLocationOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLogging.ml b/libraries/s3/lib/getBucketLogging.ml index b90bcef1a..08794b961 100644 --- a/libraries/s3/lib/getBucketLogging.ml +++ b/libraries/s3/lib/getBucketLogging.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetBucketLoggingRequest.t - type output = GetBucketLoggingOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketLogging" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketLogging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketLoggingRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketLoggingRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketLoggingResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketLoggingOutput.parse) + Util.or_error (Util.option_bind resp GetBucketLoggingOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketLoggingOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketLoggingOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketLoggingOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketLoggingOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketLogging.mli b/libraries/s3/lib/getBucketLogging.mli index fc27801c2..824448bdc 100644 --- a/libraries/s3/lib/getBucketLogging.mli +++ b/libraries/s3/lib/getBucketLogging.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketLoggingRequest.t - type output = GetBucketLoggingOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketNotification.ml b/libraries/s3/lib/getBucketNotification.ml index 5344a5463..5c70adfe4 100644 --- a/libraries/s3/lib/getBucketNotification.ml +++ b/libraries/s3/lib/getBucketNotification.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = GetBucketNotificationConfigurationRequest.t - type output = NotificationConfigurationDeprecated.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketNotification" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketNotification"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetBucketNotificationConfigurationRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render + (GetBucketNotificationConfigurationRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,34 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp NotificationConfigurationDeprecated.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed NotificationConfigurationDeprecated." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed NotificationConfigurationDeprecated." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing NotificationConfigurationDeprecated - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing NotificationConfigurationDeprecated - missing field in \ - body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketNotification.mli b/libraries/s3/lib/getBucketNotification.mli index f33873873..d9728a637 100644 --- a/libraries/s3/lib/getBucketNotification.mli +++ b/libraries/s3/lib/getBucketNotification.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketNotificationConfigurationRequest.t - type output = NotificationConfigurationDeprecated.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketNotificationConfiguration.ml b/libraries/s3/lib/getBucketNotificationConfiguration.ml index 2a3564568..1f2255bab 100644 --- a/libraries/s3/lib/getBucketNotificationConfiguration.ml +++ b/libraries/s3/lib/getBucketNotificationConfiguration.ml @@ -1,62 +1,61 @@ open Types open Aws - type input = GetBucketNotificationConfigurationRequest.t - type output = NotificationConfiguration.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ] - ; "Action", [ "GetBucketNotificationConfiguration" ] - ] + [("Version", ["2006-03-01"]); + ("Action", ["GetBucketNotificationConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetBucketNotificationConfigurationRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render + (GetBucketNotificationConfigurationRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in - let resp = Xml.member "GetBucketNotificationConfigurationResponse" (snd xml) in + let resp = + Xml.member "GetBucketNotificationConfigurationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp NotificationConfiguration.parse) + Util.or_error (Util.option_bind resp NotificationConfiguration.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed NotificationConfiguration." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed NotificationConfiguration." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing NotificationConfiguration - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing NotificationConfiguration - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketNotificationConfiguration.mli b/libraries/s3/lib/getBucketNotificationConfiguration.mli index 16c78763b..f19025159 100644 --- a/libraries/s3/lib/getBucketNotificationConfiguration.mli +++ b/libraries/s3/lib/getBucketNotificationConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketNotificationConfigurationRequest.t - type output = NotificationConfiguration.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketPolicy.ml b/libraries/s3/lib/getBucketPolicy.ml index 5d3eec4aa..eae12dbcd 100644 --- a/libraries/s3/lib/getBucketPolicy.ml +++ b/libraries/s3/lib/getBucketPolicy.ml @@ -1,58 +1,57 @@ open Types open Aws - type input = GetBucketPolicyRequest.t - type output = GetBucketPolicyOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketPolicy" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketPolicyRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketPolicyRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketPolicyResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketPolicyOutput.parse) + Util.or_error (Util.option_bind resp GetBucketPolicyOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketPolicyOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketPolicyOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketPolicyOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketPolicyOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketPolicy.mli b/libraries/s3/lib/getBucketPolicy.mli index cd6543624..5f0ee8893 100644 --- a/libraries/s3/lib/getBucketPolicy.mli +++ b/libraries/s3/lib/getBucketPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketPolicyRequest.t - type output = GetBucketPolicyOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketReplication.ml b/libraries/s3/lib/getBucketReplication.ml index 64ddfe0ae..9c2259375 100644 --- a/libraries/s3/lib/getBucketReplication.ml +++ b/libraries/s3/lib/getBucketReplication.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = GetBucketReplicationRequest.t - type output = GetBucketReplicationOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketReplication" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketReplication"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetBucketReplicationRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (GetBucketReplicationRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketReplicationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketReplicationOutput.parse) + Util.or_error (Util.option_bind resp GetBucketReplicationOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketReplicationOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBucketReplicationOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketReplicationOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketReplicationOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketReplication.mli b/libraries/s3/lib/getBucketReplication.mli index ee6583f3e..e20203374 100644 --- a/libraries/s3/lib/getBucketReplication.mli +++ b/libraries/s3/lib/getBucketReplication.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketReplicationRequest.t - type output = GetBucketReplicationOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketRequestPayment.ml b/libraries/s3/lib/getBucketRequestPayment.ml index eecd0db98..49e4b5930 100644 --- a/libraries/s3/lib/getBucketRequestPayment.ml +++ b/libraries/s3/lib/getBucketRequestPayment.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = GetBucketRequestPaymentRequest.t - type output = GetBucketRequestPaymentOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketRequestPayment" ] ] + [("Version", ["2006-03-01"]); + ("Action", ["GetBucketRequestPayment"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetBucketRequestPaymentRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (GetBucketRequestPaymentRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,32 +24,37 @@ let of_http body = Util.or_error (Util.option_bind resp GetBucketRequestPaymentOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketRequestPaymentOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBucketRequestPaymentOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketRequestPaymentOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketRequestPaymentOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketRequestPayment.mli b/libraries/s3/lib/getBucketRequestPayment.mli index 36b74a6a2..a29907fdb 100644 --- a/libraries/s3/lib/getBucketRequestPayment.mli +++ b/libraries/s3/lib/getBucketRequestPayment.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketRequestPaymentRequest.t - type output = GetBucketRequestPaymentOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketTagging.ml b/libraries/s3/lib/getBucketTagging.ml index 24ca2ef35..74589ab70 100644 --- a/libraries/s3/lib/getBucketTagging.ml +++ b/libraries/s3/lib/getBucketTagging.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetBucketTaggingRequest.t - type output = GetBucketTaggingOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketTagging" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketTagging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketTaggingRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketTaggingRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketTaggingResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketTaggingOutput.parse) + Util.or_error (Util.option_bind resp GetBucketTaggingOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketTaggingOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketTaggingOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketTaggingOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketTaggingOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketTagging.mli b/libraries/s3/lib/getBucketTagging.mli index 20d833c8a..7ba0c274b 100644 --- a/libraries/s3/lib/getBucketTagging.mli +++ b/libraries/s3/lib/getBucketTagging.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketTaggingRequest.t - type output = GetBucketTaggingOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketVersioning.ml b/libraries/s3/lib/getBucketVersioning.ml index 912e280aa..fd78af890 100644 --- a/libraries/s3/lib/getBucketVersioning.ml +++ b/libraries/s3/lib/getBucketVersioning.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = GetBucketVersioningRequest.t - type output = GetBucketVersioningOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketVersioning" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketVersioning"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (GetBucketVersioningRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (GetBucketVersioningRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketVersioningResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketVersioningOutput.parse) + Util.or_error (Util.option_bind resp GetBucketVersioningOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketVersioningOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetBucketVersioningOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketVersioningOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketVersioningOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketVersioning.mli b/libraries/s3/lib/getBucketVersioning.mli index 580ebd51d..f223c663d 100644 --- a/libraries/s3/lib/getBucketVersioning.mli +++ b/libraries/s3/lib/getBucketVersioning.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketVersioningRequest.t - type output = GetBucketVersioningOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketWebsite.ml b/libraries/s3/lib/getBucketWebsite.ml index 0e5198756..c72250740 100644 --- a/libraries/s3/lib/getBucketWebsite.ml +++ b/libraries/s3/lib/getBucketWebsite.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetBucketWebsiteRequest.t - type output = GetBucketWebsiteOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetBucketWebsite" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetBucketWebsite"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetBucketWebsiteRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetBucketWebsiteRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetBucketWebsiteResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetBucketWebsiteOutput.parse) + Util.or_error (Util.option_bind resp GetBucketWebsiteOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetBucketWebsiteOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetBucketWebsiteOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetBucketWebsiteOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetBucketWebsiteOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getBucketWebsite.mli b/libraries/s3/lib/getBucketWebsite.mli index 0c9a25aec..e2c0feb4b 100644 --- a/libraries/s3/lib/getBucketWebsite.mli +++ b/libraries/s3/lib/getBucketWebsite.mli @@ -1,10 +1,7 @@ open Types - type input = GetBucketWebsiteRequest.t - type output = GetBucketWebsiteOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getObject.ml b/libraries/s3/lib/getObject.ml index 826128e51..b699a6fc0 100644 --- a/libraries/s3/lib/getObject.ml +++ b/libraries/s3/lib/getObject.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = GetObjectRequest.t - type output = GetObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetObject" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["GetObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetObjectRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetObjectRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetObjectOutput.parse) + Util.or_error (Util.option_bind resp GetObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed GetObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetObjectOutput - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getObject.mli b/libraries/s3/lib/getObject.mli index b55387141..87b928017 100644 --- a/libraries/s3/lib/getObject.mli +++ b/libraries/s3/lib/getObject.mli @@ -1,10 +1,7 @@ open Types - type input = GetObjectRequest.t - type output = GetObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getObjectAcl.ml b/libraries/s3/lib/getObjectAcl.ml index 303a7156e..591f1c97a 100644 --- a/libraries/s3/lib/getObjectAcl.ml +++ b/libraries/s3/lib/getObjectAcl.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = GetObjectAclRequest.t - type output = GetObjectAclOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetObjectAcl" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetObjectAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetObjectAclRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetObjectAclRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetObjectAclResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetObjectAclOutput.parse) + Util.or_error (Util.option_bind resp GetObjectAclOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetObjectAclOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetObjectAclOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetObjectAclOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetObjectAclOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getObjectAcl.mli b/libraries/s3/lib/getObjectAcl.mli index 5c3d59abf..533e57e32 100644 --- a/libraries/s3/lib/getObjectAcl.mli +++ b/libraries/s3/lib/getObjectAcl.mli @@ -1,10 +1,7 @@ open Types - type input = GetObjectAclRequest.t - type output = GetObjectAclOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/getObjectTorrent.ml b/libraries/s3/lib/getObjectTorrent.ml index 2de8f98c1..b783d6e3d 100644 --- a/libraries/s3/lib/getObjectTorrent.ml +++ b/libraries/s3/lib/getObjectTorrent.ml @@ -1,59 +1,57 @@ open Types open Aws - type input = GetObjectTorrentRequest.t - type output = GetObjectTorrentOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "GetObjectTorrent" ] ] + [("Version", ["2006-03-01"]); ("Action", ["GetObjectTorrent"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetObjectTorrentRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (GetObjectTorrentRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetObjectTorrentResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetObjectTorrentOutput.parse) + Util.or_error (Util.option_bind resp GetObjectTorrentOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetObjectTorrentOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetObjectTorrentOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetObjectTorrentOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetObjectTorrentOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/getObjectTorrent.mli b/libraries/s3/lib/getObjectTorrent.mli index 982e0e5d2..ed3c27538 100644 --- a/libraries/s3/lib/getObjectTorrent.mli +++ b/libraries/s3/lib/getObjectTorrent.mli @@ -1,10 +1,7 @@ open Types - type input = GetObjectTorrentRequest.t - type output = GetObjectTorrentOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/headBucket.ml b/libraries/s3/lib/headBucket.ml index 26f0c8d26..506829fb8 100644 --- a/libraries/s3/lib/headBucket.ml +++ b/libraries/s3/lib/headBucket.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = HeadBucketRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "HeadBucket" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["HeadBucket"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (HeadBucketRequest.to_query req))))) - in - `HEAD, uri, [] - + (Uri.query_of_encoded + (Query.render (HeadBucketRequest.to_query req))))) in + (`HEAD, 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 \ No newline at end of file diff --git a/libraries/s3/lib/headBucket.mli b/libraries/s3/lib/headBucket.mli index 529563431..98d04c601 100644 --- a/libraries/s3/lib/headBucket.mli +++ b/libraries/s3/lib/headBucket.mli @@ -1,10 +1,7 @@ open Types - type input = HeadBucketRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/headObject.ml b/libraries/s3/lib/headObject.ml index 2eb88fd94..c50b971f4 100644 --- a/libraries/s3/lib/headObject.ml +++ b/libraries/s3/lib/headObject.ml @@ -1,57 +1,54 @@ open Types open Aws - type input = HeadObjectRequest.t - type output = HeadObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "HeadObject" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["HeadObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (HeadObjectRequest.to_query req))))) - in - `HEAD, uri, [] - + (Uri.query_of_encoded + (Query.render (HeadObjectRequest.to_query req))))) in + (`HEAD, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "HeadObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp HeadObjectOutput.parse) + Util.or_error (Util.option_bind resp HeadObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed HeadObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed HeadObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing HeadObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing HeadObjectOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/headObject.mli b/libraries/s3/lib/headObject.mli index 6641a3906..4624598a4 100644 --- a/libraries/s3/lib/headObject.mli +++ b/libraries/s3/lib/headObject.mli @@ -1,10 +1,7 @@ open Types - type input = HeadObjectRequest.t - type output = HeadObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/listBuckets.ml b/libraries/s3/lib/listBuckets.ml index 8191359a4..ecf71e91b 100644 --- a/libraries/s3/lib/listBuckets.ml +++ b/libraries/s3/lib/listBuckets.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = Aws.BaseTypes.Unit.t - type output = ListBucketsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "ListBuckets" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["ListBuckets"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (Aws.BaseTypes.Unit.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (Aws.BaseTypes.Unit.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListBucketsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListBucketsOutput.parse) + Util.or_error (Util.option_bind resp ListBucketsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListBucketsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListBucketsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListBucketsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListBucketsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/listBuckets.mli b/libraries/s3/lib/listBuckets.mli index 860844424..4764b29b8 100644 --- a/libraries/s3/lib/listBuckets.mli +++ b/libraries/s3/lib/listBuckets.mli @@ -1,10 +1,7 @@ open Types - type input = Aws.BaseTypes.Unit.t - type output = ListBucketsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/listMultipartUploads.ml b/libraries/s3/lib/listMultipartUploads.ml index da6c76839..28da98544 100644 --- a/libraries/s3/lib/listMultipartUploads.ml +++ b/libraries/s3/lib/listMultipartUploads.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = ListMultipartUploadsRequest.t - type output = ListMultipartUploadsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "ListMultipartUploads" ] ] + [("Version", ["2006-03-01"]); ("Action", ["ListMultipartUploads"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListMultipartUploadsRequest.to_query req))))) - in - `GET, uri, [] - + (Query.render (ListMultipartUploadsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListMultipartUploadsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListMultipartUploadsOutput.parse) + Util.or_error (Util.option_bind resp ListMultipartUploadsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListMultipartUploadsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListMultipartUploadsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListMultipartUploadsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListMultipartUploadsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/listMultipartUploads.mli b/libraries/s3/lib/listMultipartUploads.mli index 2714c7d7e..e802bbe5e 100644 --- a/libraries/s3/lib/listMultipartUploads.mli +++ b/libraries/s3/lib/listMultipartUploads.mli @@ -1,10 +1,7 @@ open Types - type input = ListMultipartUploadsRequest.t - type output = ListMultipartUploadsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/listObjectVersions.ml b/libraries/s3/lib/listObjectVersions.ml index 34c80df24..4adc0a9b0 100644 --- a/libraries/s3/lib/listObjectVersions.ml +++ b/libraries/s3/lib/listObjectVersions.ml @@ -1,59 +1,58 @@ open Types open Aws - type input = ListObjectVersionsRequest.t - type output = ListObjectVersionsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "ListObjectVersions" ] ] + [("Version", ["2006-03-01"]); ("Action", ["ListObjectVersions"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListObjectVersionsRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListObjectVersionsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListObjectVersionsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListObjectVersionsOutput.parse) + Util.or_error (Util.option_bind resp ListObjectVersionsOutput.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListObjectVersionsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListObjectVersionsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListObjectVersionsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListObjectVersionsOutput - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/listObjectVersions.mli b/libraries/s3/lib/listObjectVersions.mli index 77dfd12a7..ffaa6fa38 100644 --- a/libraries/s3/lib/listObjectVersions.mli +++ b/libraries/s3/lib/listObjectVersions.mli @@ -1,10 +1,7 @@ open Types - type input = ListObjectVersionsRequest.t - type output = ListObjectVersionsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/listObjects.ml b/libraries/s3/lib/listObjects.ml index dd42389c5..e77ead791 100644 --- a/libraries/s3/lib/listObjects.ml +++ b/libraries/s3/lib/listObjects.ml @@ -1,57 +1,56 @@ open Types open Aws - type input = ListObjectsRequest.t - type output = ListObjectsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "ListObjects" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["ListObjects"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListObjectsRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListObjectsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListObjectsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListObjectsOutput.parse) + Util.or_error (Util.option_bind resp ListObjectsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListObjectsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListObjectsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListObjectsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListObjectsOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/listObjects.mli b/libraries/s3/lib/listObjects.mli index d0aee724d..00b3d6d10 100644 --- a/libraries/s3/lib/listObjects.mli +++ b/libraries/s3/lib/listObjects.mli @@ -1,10 +1,7 @@ open Types - type input = ListObjectsRequest.t - type output = ListObjectsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/listParts.ml b/libraries/s3/lib/listParts.ml index e6bf1358d..df1642303 100644 --- a/libraries/s3/lib/listParts.ml +++ b/libraries/s3/lib/listParts.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = ListPartsRequest.t - type output = ListPartsOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "ListParts" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["ListParts"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListPartsRequest.to_query req))))) - in - `GET, uri, [] - + (Uri.query_of_encoded + (Query.render (ListPartsRequest.to_query req))))) in + (`GET, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListPartsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListPartsOutput.parse) + Util.or_error (Util.option_bind resp ListPartsOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListPartsOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ListPartsOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListPartsOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListPartsOutput - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/listParts.mli b/libraries/s3/lib/listParts.mli index 8c612130a..d064506e1 100644 --- a/libraries/s3/lib/listParts.mli +++ b/libraries/s3/lib/listParts.mli @@ -1,10 +1,7 @@ open Types - type input = ListPartsRequest.t - type output = ListPartsOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketAcl.ml b/libraries/s3/lib/putBucketAcl.ml index 8a500a3eb..255da54ff 100644 --- a/libraries/s3/lib/putBucketAcl.ml +++ b/libraries/s3/lib/putBucketAcl.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketAclRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketAcl" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketAclRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketAclRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketAcl.mli b/libraries/s3/lib/putBucketAcl.mli index e05744368..7b28d0f29 100644 --- a/libraries/s3/lib/putBucketAcl.mli +++ b/libraries/s3/lib/putBucketAcl.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketAclRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketCors.ml b/libraries/s3/lib/putBucketCors.ml index 9a080f887..c6956db12 100644 --- a/libraries/s3/lib/putBucketCors.ml +++ b/libraries/s3/lib/putBucketCors.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketCorsRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketCors" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketCors"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketCorsRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketCorsRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketCors.mli b/libraries/s3/lib/putBucketCors.mli index 9f3dcb7e3..9d4508d86 100644 --- a/libraries/s3/lib/putBucketCors.mli +++ b/libraries/s3/lib/putBucketCors.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketCorsRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketLifecycle.ml b/libraries/s3/lib/putBucketLifecycle.ml index 711ead7c4..8715c55c5 100644 --- a/libraries/s3/lib/putBucketLifecycle.ml +++ b/libraries/s3/lib/putBucketLifecycle.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketLifecycleRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketLifecycle" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketLifecycle"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketLifecycleRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketLifecycleRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketLifecycle.mli b/libraries/s3/lib/putBucketLifecycle.mli index f646a8148..431eeb3d5 100644 --- a/libraries/s3/lib/putBucketLifecycle.mli +++ b/libraries/s3/lib/putBucketLifecycle.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketLifecycleRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketLogging.ml b/libraries/s3/lib/putBucketLogging.ml index 7ad9aff56..01dff061b 100644 --- a/libraries/s3/lib/putBucketLogging.ml +++ b/libraries/s3/lib/putBucketLogging.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketLoggingRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketLogging" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketLogging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketLoggingRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketLoggingRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketLogging.mli b/libraries/s3/lib/putBucketLogging.mli index 71fc4fc27..c6836f657 100644 --- a/libraries/s3/lib/putBucketLogging.mli +++ b/libraries/s3/lib/putBucketLogging.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketLoggingRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketNotification.ml b/libraries/s3/lib/putBucketNotification.ml index 64fa861f8..0a68560a9 100644 --- a/libraries/s3/lib/putBucketNotification.ml +++ b/libraries/s3/lib/putBucketNotification.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = PutBucketNotificationRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketNotification" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketNotification"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutBucketNotificationRequest.to_query req))))) - in - `PUT, uri, [] - + (Query.render (PutBucketNotificationRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketNotification.mli b/libraries/s3/lib/putBucketNotification.mli index d40d9f978..afefdab1e 100644 --- a/libraries/s3/lib/putBucketNotification.mli +++ b/libraries/s3/lib/putBucketNotification.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketNotificationRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketNotificationConfiguration.ml b/libraries/s3/lib/putBucketNotificationConfiguration.ml index fd248d967..69264ad1f 100644 --- a/libraries/s3/lib/putBucketNotificationConfiguration.ml +++ b/libraries/s3/lib/putBucketNotificationConfiguration.ml @@ -1,39 +1,32 @@ open Types open Aws - type input = PutBucketNotificationConfigurationRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ] - ; "Action", [ "PutBucketNotificationConfiguration" ] - ] + [("Version", ["2006-03-01"]); + ("Action", ["PutBucketNotificationConfiguration"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutBucketNotificationConfigurationRequest.to_query req))))) - in - `PUT, uri, [] - + (Query.render + (PutBucketNotificationConfigurationRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketNotificationConfiguration.mli b/libraries/s3/lib/putBucketNotificationConfiguration.mli index 8dcf09b8f..029947484 100644 --- a/libraries/s3/lib/putBucketNotificationConfiguration.mli +++ b/libraries/s3/lib/putBucketNotificationConfiguration.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketNotificationConfigurationRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketPolicy.ml b/libraries/s3/lib/putBucketPolicy.ml index de2715caf..45d5e91d6 100644 --- a/libraries/s3/lib/putBucketPolicy.ml +++ b/libraries/s3/lib/putBucketPolicy.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketPolicyRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketPolicy" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketPolicy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketPolicyRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketPolicyRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketPolicy.mli b/libraries/s3/lib/putBucketPolicy.mli index 88f2b73a3..fbfb711e6 100644 --- a/libraries/s3/lib/putBucketPolicy.mli +++ b/libraries/s3/lib/putBucketPolicy.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketPolicyRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketReplication.ml b/libraries/s3/lib/putBucketReplication.ml index a8e912cf6..5fb501708 100644 --- a/libraries/s3/lib/putBucketReplication.ml +++ b/libraries/s3/lib/putBucketReplication.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = PutBucketReplicationRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketReplication" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketReplication"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutBucketReplicationRequest.to_query req))))) - in - `PUT, uri, [] - + (Query.render (PutBucketReplicationRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketReplication.mli b/libraries/s3/lib/putBucketReplication.mli index 3be1362bf..0a430da48 100644 --- a/libraries/s3/lib/putBucketReplication.mli +++ b/libraries/s3/lib/putBucketReplication.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketReplicationRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketRequestPayment.ml b/libraries/s3/lib/putBucketRequestPayment.ml index 4b357d8df..0f3ca00aa 100644 --- a/libraries/s3/lib/putBucketRequestPayment.ml +++ b/libraries/s3/lib/putBucketRequestPayment.ml @@ -1,37 +1,31 @@ open Types open Aws - type input = PutBucketRequestPaymentRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketRequestPayment" ] ] + [("Version", ["2006-03-01"]); + ("Action", ["PutBucketRequestPayment"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutBucketRequestPaymentRequest.to_query req))))) - in - `PUT, uri, [] - + (Query.render (PutBucketRequestPaymentRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketRequestPayment.mli b/libraries/s3/lib/putBucketRequestPayment.mli index 1e8f17504..68719e0ec 100644 --- a/libraries/s3/lib/putBucketRequestPayment.mli +++ b/libraries/s3/lib/putBucketRequestPayment.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketRequestPaymentRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketTagging.ml b/libraries/s3/lib/putBucketTagging.ml index 5ea844342..fc1a11272 100644 --- a/libraries/s3/lib/putBucketTagging.ml +++ b/libraries/s3/lib/putBucketTagging.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketTaggingRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketTagging" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketTagging"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketTaggingRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketTaggingRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketTagging.mli b/libraries/s3/lib/putBucketTagging.mli index f66187150..639f3e4f3 100644 --- a/libraries/s3/lib/putBucketTagging.mli +++ b/libraries/s3/lib/putBucketTagging.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketTaggingRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketVersioning.ml b/libraries/s3/lib/putBucketVersioning.ml index 8ca969876..6f298c277 100644 --- a/libraries/s3/lib/putBucketVersioning.ml +++ b/libraries/s3/lib/putBucketVersioning.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = PutBucketVersioningRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketVersioning" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketVersioning"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (PutBucketVersioningRequest.to_query req))))) - in - `PUT, uri, [] - + (Query.render (PutBucketVersioningRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketVersioning.mli b/libraries/s3/lib/putBucketVersioning.mli index 8bb9901ec..deafac0e8 100644 --- a/libraries/s3/lib/putBucketVersioning.mli +++ b/libraries/s3/lib/putBucketVersioning.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketVersioningRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketWebsite.ml b/libraries/s3/lib/putBucketWebsite.ml index 168ce6be3..120bc629c 100644 --- a/libraries/s3/lib/putBucketWebsite.ml +++ b/libraries/s3/lib/putBucketWebsite.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = PutBucketWebsiteRequest.t - type output = unit - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutBucketWebsite" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutBucketWebsite"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutBucketWebsiteRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutBucketWebsiteRequest.to_query req))))) in + (`PUT, 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 \ No newline at end of file diff --git a/libraries/s3/lib/putBucketWebsite.mli b/libraries/s3/lib/putBucketWebsite.mli index 751d7daab..20169a6cc 100644 --- a/libraries/s3/lib/putBucketWebsite.mli +++ b/libraries/s3/lib/putBucketWebsite.mli @@ -1,10 +1,7 @@ open Types - type input = PutBucketWebsiteRequest.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 \ No newline at end of file diff --git a/libraries/s3/lib/putObject.ml b/libraries/s3/lib/putObject.ml index c5caba3d5..05662de02 100644 --- a/libraries/s3/lib/putObject.ml +++ b/libraries/s3/lib/putObject.ml @@ -1,56 +1,54 @@ open Types open Aws - type input = PutObjectRequest.t - type output = PutObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutObject" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["PutObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutObjectRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutObjectRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "PutObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp PutObjectOutput.parse) + Util.or_error (Util.option_bind resp PutObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed PutObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed PutObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PutObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PutObjectOutput - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/putObject.mli b/libraries/s3/lib/putObject.mli index 67667e13b..001f61fd8 100644 --- a/libraries/s3/lib/putObject.mli +++ b/libraries/s3/lib/putObject.mli @@ -1,10 +1,7 @@ open Types - type input = PutObjectRequest.t - type output = PutObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/putObjectAcl.ml b/libraries/s3/lib/putObjectAcl.ml index 01637538a..e3607e60a 100644 --- a/libraries/s3/lib/putObjectAcl.ml +++ b/libraries/s3/lib/putObjectAcl.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = PutObjectAclRequest.t - type output = PutObjectAclOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "PutObjectAcl" ] ] + [("Version", ["2006-03-01"]); ("Action", ["PutObjectAcl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutObjectAclRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (PutObjectAclRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "PutObjectAclResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp PutObjectAclOutput.parse) + Util.or_error (Util.option_bind resp PutObjectAclOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed PutObjectAclOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed PutObjectAclOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing PutObjectAclOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing PutObjectAclOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/putObjectAcl.mli b/libraries/s3/lib/putObjectAcl.mli index d309e16d6..84b626e36 100644 --- a/libraries/s3/lib/putObjectAcl.mli +++ b/libraries/s3/lib/putObjectAcl.mli @@ -1,10 +1,7 @@ open Types - type input = PutObjectAclRequest.t - type output = PutObjectAclOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/restoreObject.ml b/libraries/s3/lib/restoreObject.ml index b13db2183..7404dcec3 100644 --- a/libraries/s3/lib/restoreObject.ml +++ b/libraries/s3/lib/restoreObject.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = RestoreObjectRequest.t - type output = RestoreObjectOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "RestoreObject" ] ] + [("Version", ["2006-03-01"]); ("Action", ["RestoreObject"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RestoreObjectRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RestoreObjectRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "RestoreObjectResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp RestoreObjectOutput.parse) + Util.or_error (Util.option_bind resp RestoreObjectOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed RestoreObjectOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed RestoreObjectOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing RestoreObjectOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing RestoreObjectOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/restoreObject.mli b/libraries/s3/lib/restoreObject.mli index bd8cbc7db..63cd4a791 100644 --- a/libraries/s3/lib/restoreObject.mli +++ b/libraries/s3/lib/restoreObject.mli @@ -1,10 +1,7 @@ open Types - type input = RestoreObjectRequest.t - type output = RestoreObjectOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/types.ml b/libraries/s3/lib/types.ml index 69ed6c1ac..df4cd20be 100644 --- a/libraries/s3/lib/types.ml +++ b/libraries/s3/lib/types.ml @@ -1,9644 +1,10275 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module FilterRuleName = struct - type t = - | Prefix - | Suffix - - let str_to_t = [ "suffix", Suffix; "prefix", Prefix ] - - let t_to_str = [ Suffix, "suffix"; Prefix, "prefix" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module FilterRule = struct - type t = - { name : FilterRuleName.t option - ; value : String.t option - } - - let make ?name ?value () = { name; value } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) FilterRuleName.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.name (fun f -> - Query.Pair ("Name", FilterRuleName.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.name (fun f -> "name", FilterRuleName.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") FilterRuleName.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - } -end - -module Type = struct - type t = - | CanonicalUser - | AmazonCustomerByEmail - | Group - - let str_to_t = - [ "Group", Group - ; "AmazonCustomerByEmail", AmazonCustomerByEmail - ; "CanonicalUser", CanonicalUser - ] - - let t_to_str = - [ Group, "Group" - ; AmazonCustomerByEmail, "AmazonCustomerByEmail" - ; CanonicalUser, "CanonicalUser" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module FilterRuleList = struct - type t = FilterRule.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map FilterRule.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list FilterRule.to_query v - - let to_json v = `List (List.map FilterRule.to_json v) - - let of_json j = Json.to_list FilterRule.of_json j -end - -module TransitionStorageClass = struct - type t = GLACIER - - let str_to_t = [ "GLACIER", GLACIER ] - - let t_to_str = [ GLACIER, "GLACIER" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BucketLogsPermission = struct - type t = - | FULL_CONTROL - | READ - | WRITE - - let str_to_t = [ "WRITE", WRITE; "READ", READ; "FULL_CONTROL", FULL_CONTROL ] - - let t_to_str = [ WRITE, "WRITE"; READ, "READ"; FULL_CONTROL, "FULL_CONTROL" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Grantee = struct - type t = - { display_name : String.t option - ; email_address : String.t option - ; i_d : String.t option - ; type_ : Type.t - ; u_r_i : String.t option - } - - let make ?display_name ?email_address ?i_d ~type_ ?u_r_i () = - { display_name; email_address; i_d; type_; u_r_i } - - let parse xml = - Some - { display_name = Util.option_bind (Xml.member "DisplayName" xml) String.parse - ; email_address = Util.option_bind (Xml.member "EmailAddress" xml) String.parse - ; i_d = Util.option_bind (Xml.member "ID" xml) String.parse - ; type_ = - Xml.required - "xsi:type" - (Util.option_bind (Xml.member "xsi:type" xml) Type.parse) - ; u_r_i = Util.option_bind (Xml.member "URI" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.u_r_i (fun f -> Query.Pair ("URI", String.to_query f)) - ; Some (Query.Pair ("xsi:type", Type.to_query v.type_)) - ; Util.option_map v.i_d (fun f -> Query.Pair ("ID", String.to_query f)) - ; Util.option_map v.email_address (fun f -> - Query.Pair ("EmailAddress", String.to_query f)) - ; Util.option_map v.display_name (fun f -> - Query.Pair ("DisplayName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.u_r_i (fun f -> "u_r_i", String.to_json f) - ; Some ("type_", Type.to_json v.type_) - ; Util.option_map v.i_d (fun f -> "i_d", String.to_json f) - ; Util.option_map v.email_address (fun f -> "email_address", String.to_json f) - ; Util.option_map v.display_name (fun f -> "display_name", String.to_json f) - ]) - - let of_json j = - { display_name = Util.option_map (Json.lookup j "display_name") String.of_json - ; email_address = Util.option_map (Json.lookup j "email_address") String.of_json - ; i_d = Util.option_map (Json.lookup j "i_d") String.of_json - ; type_ = Type.of_json (Util.of_option_exn (Json.lookup j "type_")) - ; u_r_i = Util.option_map (Json.lookup j "u_r_i") String.of_json - } -end - -module Protocol = struct - type t = - | Http - | Https - - let str_to_t = [ "https", Https; "http", Http ] - - let t_to_str = [ Https, "https"; Http, "http" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Event = struct - type t = - | S3_ReducedRedundancyLostObject - | S3_ObjectCreated__ - | S3_ObjectCreated_Put - | S3_ObjectCreated_Post - | S3_ObjectCreated_Copy - | S3_ObjectCreated_CompleteMultipartUpload - | S3_ObjectRemoved__ - | S3_ObjectRemoved_Delete - | S3_ObjectRemoved_DeleteMarkerCreated - - let str_to_t = - [ "s3:ObjectRemoved:DeleteMarkerCreated", S3_ObjectRemoved_DeleteMarkerCreated - ; "s3:ObjectRemoved:Delete", S3_ObjectRemoved_Delete - ; "s3:ObjectRemoved:*", S3_ObjectRemoved__ - ; "s3:ObjectCreated:CompleteMultipartUpload", S3_ObjectCreated_CompleteMultipartUpload - ; "s3:ObjectCreated:Copy", S3_ObjectCreated_Copy - ; "s3:ObjectCreated:Post", S3_ObjectCreated_Post - ; "s3:ObjectCreated:Put", S3_ObjectCreated_Put - ; "s3:ObjectCreated:*", S3_ObjectCreated__ - ; "s3:ReducedRedundancyLostObject", S3_ReducedRedundancyLostObject - ] - - let t_to_str = - [ S3_ObjectRemoved_DeleteMarkerCreated, "s3:ObjectRemoved:DeleteMarkerCreated" - ; S3_ObjectRemoved_Delete, "s3:ObjectRemoved:Delete" - ; S3_ObjectRemoved__, "s3:ObjectRemoved:*" - ; S3_ObjectCreated_CompleteMultipartUpload, "s3:ObjectCreated:CompleteMultipartUpload" - ; S3_ObjectCreated_Copy, "s3:ObjectCreated:Copy" - ; S3_ObjectCreated_Post, "s3:ObjectCreated:Post" - ; S3_ObjectCreated_Put, "s3:ObjectCreated:Put" - ; S3_ObjectCreated__, "s3:ObjectCreated:*" - ; S3_ReducedRedundancyLostObject, "s3:ReducedRedundancyLostObject" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module S3KeyFilter = struct - type t = { filter_rules : FilterRuleList.t } - - let make ?(filter_rules = []) () = { filter_rules } - - let parse xml = Some { filter_rules = Util.of_option [] (FilterRuleList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("FilterRule", FilterRuleList.to_query v.filter_rules)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("filter_rules", FilterRuleList.to_json v.filter_rules) ]) - - let of_json j = - { filter_rules = - FilterRuleList.of_json (Util.of_option_exn (Json.lookup j "filter_rules")) - } -end - -module Destination = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module ReplicationRuleStatus = struct - type t = - | Enabled - | Disabled - - let str_to_t = [ "Disabled", Disabled; "Enabled", Enabled ] - - let t_to_str = [ Disabled, "Disabled"; Enabled, "Enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ExpirationStatus = struct - type t = - | Enabled - | Disabled - - let str_to_t = [ "Disabled", Disabled; "Enabled", Enabled ] - - let t_to_str = [ Disabled, "Disabled"; Enabled, "Enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module LifecycleExpiration = struct - type t = - { date : DateTime.t option - ; days : Integer.t option - } - - let make ?date ?days () = { date; days } - - let parse xml = - Some - { date = Util.option_bind (Xml.member "Date" xml) DateTime.parse - ; days = Util.option_bind (Xml.member "Days" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.days (fun f -> Query.Pair ("Days", Integer.to_query f)) - ; Util.option_map v.date (fun f -> Query.Pair ("Date", DateTime.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.days (fun f -> "days", Integer.to_json f) - ; Util.option_map v.date (fun f -> "date", DateTime.to_json f) - ]) - - let of_json j = - { date = Util.option_map (Json.lookup j "date") DateTime.of_json - ; days = Util.option_map (Json.lookup j "days") Integer.of_json - } -end - -module NoncurrentVersionExpiration = struct - type t = { noncurrent_days : Integer.t } - - let make ~noncurrent_days () = { noncurrent_days } - - let parse xml = - Some - { noncurrent_days = - Xml.required - "NoncurrentDays" - (Util.option_bind (Xml.member "NoncurrentDays" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("NoncurrentDays", Integer.to_query v.noncurrent_days)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("noncurrent_days", Integer.to_json v.noncurrent_days) ]) - - let of_json j = - { noncurrent_days = - Integer.of_json (Util.of_option_exn (Json.lookup j "noncurrent_days")) - } -end - -module NoncurrentVersionTransition = struct - type t = - { noncurrent_days : Integer.t - ; storage_class : TransitionStorageClass.t - } - - let make ~noncurrent_days ~storage_class () = { noncurrent_days; storage_class } - - let parse xml = - Some - { noncurrent_days = - Xml.required - "NoncurrentDays" - (Util.option_bind (Xml.member "NoncurrentDays" xml) Integer.parse) - ; storage_class = - Xml.required - "StorageClass" - (Util.option_bind - (Xml.member "StorageClass" xml) +module FilterRuleName = + struct + type t = + | Prefix + | Suffix + let str_to_t = [("suffix", Suffix); ("prefix", Prefix)] + let t_to_str = [(Suffix, "suffix"); (Prefix, "prefix")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module FilterRule = + struct + type t = { + name: FilterRuleName.t option ; + value: String.t option } + let make ?name ?value () = { name; value } + let parse xml = + Some + { + name = + (Util.option_bind (Xml.member "Name" xml) FilterRuleName.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (FilterRuleName.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.name + (fun f -> ("name", (FilterRuleName.to_json f)))]) + let of_json j = + { + name = + (Util.option_map (Json.lookup j "name") FilterRuleName.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json) + } + end +module Type = + struct + type t = + | CanonicalUser + | AmazonCustomerByEmail + | Group + let str_to_t = + [("Group", Group); + ("AmazonCustomerByEmail", AmazonCustomerByEmail); + ("CanonicalUser", CanonicalUser)] + let t_to_str = + [(Group, "Group"); + (AmazonCustomerByEmail, "AmazonCustomerByEmail"); + (CanonicalUser, "CanonicalUser")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module FilterRuleList = + struct + type t = FilterRule.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map FilterRule.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list FilterRule.to_query v + let to_json v = `List (List.map FilterRule.to_json v) + let of_json j = Json.to_list FilterRule.of_json j + end +module TransitionStorageClass = + struct + type t = + | GLACIER + let str_to_t = [("GLACIER", GLACIER)] + let t_to_str = [(GLACIER, "GLACIER")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BucketLogsPermission = + struct + type t = + | FULL_CONTROL + | READ + | WRITE + let str_to_t = + [("WRITE", WRITE); ("READ", READ); ("FULL_CONTROL", FULL_CONTROL)] + let t_to_str = + [(WRITE, "WRITE"); (READ, "READ"); (FULL_CONTROL, "FULL_CONTROL")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Grantee = + struct + type t = + { + display_name: String.t option ; + email_address: String.t option ; + i_d: String.t option ; + type_: Type.t ; + u_r_i: String.t option } + let make ?display_name ?email_address ?i_d ~type_ ?u_r_i () = + { display_name; email_address; i_d; type_; u_r_i } + let parse xml = + Some + { + display_name = + (Util.option_bind (Xml.member "DisplayName" xml) String.parse); + email_address = + (Util.option_bind (Xml.member "EmailAddress" xml) String.parse); + i_d = (Util.option_bind (Xml.member "ID" xml) String.parse); + type_ = + (Xml.required "xsi:type" + (Util.option_bind (Xml.member "xsi:type" xml) Type.parse)); + u_r_i = (Util.option_bind (Xml.member "URI" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.u_r_i + (fun f -> Query.Pair ("URI", (String.to_query f))); + Some (Query.Pair ("xsi:type", (Type.to_query v.type_))); + Util.option_map v.i_d + (fun f -> Query.Pair ("ID", (String.to_query f))); + Util.option_map v.email_address + (fun f -> Query.Pair ("EmailAddress", (String.to_query f))); + Util.option_map v.display_name + (fun f -> Query.Pair ("DisplayName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.u_r_i (fun f -> ("u_r_i", (String.to_json f))); + Some ("type_", (Type.to_json v.type_)); + Util.option_map v.i_d (fun f -> ("i_d", (String.to_json f))); + Util.option_map v.email_address + (fun f -> ("email_address", (String.to_json f))); + Util.option_map v.display_name + (fun f -> ("display_name", (String.to_json f)))]) + let of_json j = + { + display_name = + (Util.option_map (Json.lookup j "display_name") String.of_json); + email_address = + (Util.option_map (Json.lookup j "email_address") String.of_json); + i_d = (Util.option_map (Json.lookup j "i_d") String.of_json); + type_ = (Type.of_json (Util.of_option_exn (Json.lookup j "type_"))); + u_r_i = (Util.option_map (Json.lookup j "u_r_i") String.of_json) + } + end +module Protocol = + struct + type t = + | Http + | Https + let str_to_t = [("https", Https); ("http", Http)] + let t_to_str = [(Https, "https"); (Http, "http")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Event = + struct + type t = + | S3_ReducedRedundancyLostObject + | S3_ObjectCreated__ + | S3_ObjectCreated_Put + | S3_ObjectCreated_Post + | S3_ObjectCreated_Copy + | S3_ObjectCreated_CompleteMultipartUpload + | S3_ObjectRemoved__ + | S3_ObjectRemoved_Delete + | S3_ObjectRemoved_DeleteMarkerCreated + let str_to_t = + [("s3:ObjectRemoved:DeleteMarkerCreated", + S3_ObjectRemoved_DeleteMarkerCreated); + ("s3:ObjectRemoved:Delete", S3_ObjectRemoved_Delete); + ("s3:ObjectRemoved:*", S3_ObjectRemoved__); + ("s3:ObjectCreated:CompleteMultipartUpload", + S3_ObjectCreated_CompleteMultipartUpload); + ("s3:ObjectCreated:Copy", S3_ObjectCreated_Copy); + ("s3:ObjectCreated:Post", S3_ObjectCreated_Post); + ("s3:ObjectCreated:Put", S3_ObjectCreated_Put); + ("s3:ObjectCreated:*", S3_ObjectCreated__); + ("s3:ReducedRedundancyLostObject", S3_ReducedRedundancyLostObject)] + let t_to_str = + [(S3_ObjectRemoved_DeleteMarkerCreated, + "s3:ObjectRemoved:DeleteMarkerCreated"); + (S3_ObjectRemoved_Delete, "s3:ObjectRemoved:Delete"); + (S3_ObjectRemoved__, "s3:ObjectRemoved:*"); + (S3_ObjectCreated_CompleteMultipartUpload, + "s3:ObjectCreated:CompleteMultipartUpload"); + (S3_ObjectCreated_Copy, "s3:ObjectCreated:Copy"); + (S3_ObjectCreated_Post, "s3:ObjectCreated:Post"); + (S3_ObjectCreated_Put, "s3:ObjectCreated:Put"); + (S3_ObjectCreated__, "s3:ObjectCreated:*"); + (S3_ReducedRedundancyLostObject, "s3:ReducedRedundancyLostObject")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module S3KeyFilter = + struct + type t = { + filter_rules: FilterRuleList.t } + let make ?(filter_rules= []) () = { filter_rules } + let parse xml = + Some { filter_rules = (Util.of_option [] (FilterRuleList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("FilterRule", (FilterRuleList.to_query v.filter_rules)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("filter_rules", (FilterRuleList.to_json v.filter_rules))]) + let of_json j = + { + filter_rules = + (FilterRuleList.of_json + (Util.of_option_exn (Json.lookup j "filter_rules"))) + } + end +module Destination = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module ReplicationRuleStatus = + struct + type t = + | Enabled + | Disabled + let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] + let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ExpirationStatus = + struct + type t = + | Enabled + | Disabled + let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] + let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module LifecycleExpiration = + struct + type t = { + date: DateTime.t option ; + days: Integer.t option } + let make ?date ?days () = { date; days } + let parse xml = + Some + { + date = (Util.option_bind (Xml.member "Date" xml) DateTime.parse); + days = (Util.option_bind (Xml.member "Days" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.days + (fun f -> Query.Pair ("Days", (Integer.to_query f))); + Util.option_map v.date + (fun f -> Query.Pair ("Date", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.days (fun f -> ("days", (Integer.to_json f))); + Util.option_map v.date (fun f -> ("date", (DateTime.to_json f)))]) + let of_json j = + { + date = (Util.option_map (Json.lookup j "date") DateTime.of_json); + days = (Util.option_map (Json.lookup j "days") Integer.of_json) + } + end +module NoncurrentVersionExpiration = + struct + type t = { + noncurrent_days: Integer.t } + let make ~noncurrent_days () = { noncurrent_days } + let parse xml = + Some + { + noncurrent_days = + (Xml.required "NoncurrentDays" + (Util.option_bind (Xml.member "NoncurrentDays" xml) + Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NoncurrentDays", (Integer.to_query v.noncurrent_days)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("noncurrent_days", (Integer.to_json v.noncurrent_days))]) + let of_json j = + { + noncurrent_days = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "noncurrent_days"))) + } + end +module NoncurrentVersionTransition = + struct + type t = + { + noncurrent_days: Integer.t ; + storage_class: TransitionStorageClass.t } + let make ~noncurrent_days ~storage_class () = + { noncurrent_days; storage_class } + let parse xml = + Some + { + noncurrent_days = + (Xml.required "NoncurrentDays" + (Util.option_bind (Xml.member "NoncurrentDays" xml) + Integer.parse)); + storage_class = + (Xml.required "StorageClass" + (Util.option_bind (Xml.member "StorageClass" xml) + TransitionStorageClass.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("StorageClass", + (TransitionStorageClass.to_query v.storage_class))); + Some + (Query.Pair + ("NoncurrentDays", (Integer.to_query v.noncurrent_days)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("storage_class", + (TransitionStorageClass.to_json v.storage_class)); + Some ("noncurrent_days", (Integer.to_json v.noncurrent_days))]) + let of_json j = + { + noncurrent_days = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "noncurrent_days"))); + storage_class = + (TransitionStorageClass.of_json + (Util.of_option_exn (Json.lookup j "storage_class"))) + } + end +module Transition = + struct + type t = + { + date: DateTime.t option ; + days: Integer.t option ; + storage_class: TransitionStorageClass.t option } + let make ?date ?days ?storage_class () = { date; days; storage_class } + let parse xml = + Some + { + date = (Util.option_bind (Xml.member "Date" xml) DateTime.parse); + days = (Util.option_bind (Xml.member "Days" xml) Integer.parse); + storage_class = + (Util.option_bind (Xml.member "StorageClass" xml) TransitionStorageClass.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("StorageClass", TransitionStorageClass.to_query v.storage_class)) - ; Some (Query.Pair ("NoncurrentDays", Integer.to_query v.noncurrent_days)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("storage_class", TransitionStorageClass.to_json v.storage_class) - ; Some ("noncurrent_days", Integer.to_json v.noncurrent_days) - ]) - - let of_json j = - { noncurrent_days = - Integer.of_json (Util.of_option_exn (Json.lookup j "noncurrent_days")) - ; storage_class = - TransitionStorageClass.of_json - (Util.of_option_exn (Json.lookup j "storage_class")) - } -end - -module Transition = struct - type t = - { date : DateTime.t option - ; days : Integer.t option - ; storage_class : TransitionStorageClass.t option - } - - let make ?date ?days ?storage_class () = { date; days; storage_class } - - let parse xml = - Some - { date = Util.option_bind (Xml.member "Date" xml) DateTime.parse - ; days = Util.option_bind (Xml.member "Days" xml) Integer.parse - ; storage_class = - Util.option_bind (Xml.member "StorageClass" xml) TransitionStorageClass.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.storage_class (fun f -> - Query.Pair ("StorageClass", TransitionStorageClass.to_query f)) - ; Util.option_map v.days (fun f -> Query.Pair ("Days", Integer.to_query f)) - ; Util.option_map v.date (fun f -> Query.Pair ("Date", DateTime.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.storage_class (fun f -> - "storage_class", TransitionStorageClass.to_json f) - ; Util.option_map v.days (fun f -> "days", Integer.to_json f) - ; Util.option_map v.date (fun f -> "date", DateTime.to_json f) - ]) - - let of_json j = - { date = Util.option_map (Json.lookup j "date") DateTime.of_json - ; days = Util.option_map (Json.lookup j "days") Integer.of_json - ; storage_class = - Util.option_map (Json.lookup j "storage_class") TransitionStorageClass.of_json - } -end - -module Permission = struct - type t = - | FULL_CONTROL - | WRITE - | WRITE_ACP - | READ - | READ_ACP - - let str_to_t = - [ "READ_ACP", READ_ACP - ; "READ", READ - ; "WRITE_ACP", WRITE_ACP - ; "WRITE", WRITE - ; "FULL_CONTROL", FULL_CONTROL - ] - - let t_to_str = - [ READ_ACP, "READ_ACP" - ; READ, "READ" - ; WRITE_ACP, "WRITE_ACP" - ; WRITE, "WRITE" - ; FULL_CONTROL, "FULL_CONTROL" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module TargetGrant = struct - type t = - { grantee : Grantee.t option - ; permission : BucketLogsPermission.t option - } - - let make ?grantee ?permission () = { grantee; permission } - - let parse xml = - Some - { grantee = Util.option_bind (Xml.member "Grantee" xml) Grantee.parse - ; permission = - Util.option_bind (Xml.member "Permission" xml) BucketLogsPermission.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.permission (fun f -> - Query.Pair ("Permission", BucketLogsPermission.to_query f)) - ; Util.option_map v.grantee (fun f -> Query.Pair ("Grantee", Grantee.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.permission (fun f -> - "permission", BucketLogsPermission.to_json f) - ; Util.option_map v.grantee (fun f -> "grantee", Grantee.to_json f) - ]) - - let of_json j = - { grantee = Util.option_map (Json.lookup j "grantee") Grantee.of_json - ; permission = - Util.option_map (Json.lookup j "permission") BucketLogsPermission.of_json - } -end - -module Condition = struct - type t = - { http_error_code_returned_equals : String.t option - ; key_prefix_equals : String.t option - } - - let make ?http_error_code_returned_equals ?key_prefix_equals () = - { http_error_code_returned_equals; key_prefix_equals } - - let parse xml = - Some - { http_error_code_returned_equals = - Util.option_bind (Xml.member "HttpErrorCodeReturnedEquals" xml) String.parse - ; key_prefix_equals = - Util.option_bind (Xml.member "KeyPrefixEquals" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.key_prefix_equals (fun f -> - Query.Pair ("KeyPrefixEquals", String.to_query f)) - ; Util.option_map v.http_error_code_returned_equals (fun f -> - Query.Pair ("HttpErrorCodeReturnedEquals", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.key_prefix_equals (fun f -> - "key_prefix_equals", String.to_json f) - ; Util.option_map v.http_error_code_returned_equals (fun f -> - "http_error_code_returned_equals", String.to_json f) - ]) - - let of_json j = - { http_error_code_returned_equals = - Util.option_map (Json.lookup j "http_error_code_returned_equals") String.of_json - ; key_prefix_equals = - Util.option_map (Json.lookup j "key_prefix_equals") String.of_json - } -end - -module Redirect = struct - type t = - { host_name : String.t option - ; http_redirect_code : String.t option - ; protocol : Protocol.t option - ; replace_key_prefix_with : String.t option - ; replace_key_with : String.t option - } - - let make - ?host_name - ?http_redirect_code - ?protocol - ?replace_key_prefix_with - ?replace_key_with - () = - { host_name; http_redirect_code; protocol; replace_key_prefix_with; replace_key_with } - - let parse xml = - Some - { host_name = Util.option_bind (Xml.member "HostName" xml) String.parse - ; http_redirect_code = - Util.option_bind (Xml.member "HttpRedirectCode" xml) String.parse - ; protocol = Util.option_bind (Xml.member "Protocol" xml) Protocol.parse - ; replace_key_prefix_with = - Util.option_bind (Xml.member "ReplaceKeyPrefixWith" xml) String.parse - ; replace_key_with = Util.option_bind (Xml.member "ReplaceKeyWith" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replace_key_with (fun f -> - Query.Pair ("ReplaceKeyWith", String.to_query f)) - ; Util.option_map v.replace_key_prefix_with (fun f -> - Query.Pair ("ReplaceKeyPrefixWith", String.to_query f)) - ; Util.option_map v.protocol (fun f -> - Query.Pair ("Protocol", Protocol.to_query f)) - ; Util.option_map v.http_redirect_code (fun f -> - Query.Pair ("HttpRedirectCode", String.to_query f)) - ; Util.option_map v.host_name (fun f -> - Query.Pair ("HostName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replace_key_with (fun f -> - "replace_key_with", String.to_json f) - ; Util.option_map v.replace_key_prefix_with (fun f -> - "replace_key_prefix_with", String.to_json f) - ; Util.option_map v.protocol (fun f -> "protocol", Protocol.to_json f) - ; Util.option_map v.http_redirect_code (fun f -> - "http_redirect_code", String.to_json f) - ; Util.option_map v.host_name (fun f -> "host_name", String.to_json f) - ]) - - let of_json j = - { host_name = Util.option_map (Json.lookup j "host_name") String.of_json - ; http_redirect_code = - Util.option_map (Json.lookup j "http_redirect_code") String.of_json - ; protocol = Util.option_map (Json.lookup j "protocol") Protocol.of_json - ; replace_key_prefix_with = - Util.option_map (Json.lookup j "replace_key_prefix_with") String.of_json - ; replace_key_with = Util.option_map (Json.lookup j "replace_key_with") String.of_json - } -end - -module EventList = struct - type t = Event.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Event.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Event.to_query v - - let to_json v = `List (List.map Event.to_json v) - - let of_json j = Json.to_list Event.of_json j -end - -module NotificationConfigurationFilter = struct - type t = { key : S3KeyFilter.t option } - - let make ?key () = { key } - - let parse xml = - Some { key = Util.option_bind (Xml.member "S3Key" xml) S3KeyFilter.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.key (fun f -> Query.Pair ("S3Key", S3KeyFilter.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.key (fun f -> "key", S3KeyFilter.to_json f) ]) - - let of_json j = { key = Util.option_map (Json.lookup j "key") S3KeyFilter.of_json } -end - -module AllowedHeaders = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AllowedMethods = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AllowedOrigins = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ExposeHeaders = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ReplicationRule = struct - type t = - { i_d : String.t option - ; prefix : String.t - ; status : ReplicationRuleStatus.t - ; destination : Destination.t - } - - let make ?i_d ~prefix ~status ~destination () = { i_d; prefix; status; destination } - - let parse xml = - Some - { i_d = Util.option_bind (Xml.member "ID" xml) String.parse - ; prefix = - Xml.required "Prefix" (Util.option_bind (Xml.member "Prefix" xml) String.parse) - ; status = - Xml.required - "Status" - (Util.option_bind (Xml.member "Status" xml) ReplicationRuleStatus.parse) - ; destination = - Xml.required - "Destination" - (Util.option_bind (Xml.member "Destination" xml) Destination.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Destination", Destination.to_query v.destination)) - ; Some (Query.Pair ("Status", ReplicationRuleStatus.to_query v.status)) - ; Some (Query.Pair ("Prefix", String.to_query v.prefix)) - ; Util.option_map v.i_d (fun f -> Query.Pair ("ID", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("destination", Destination.to_json v.destination) - ; Some ("status", ReplicationRuleStatus.to_json v.status) - ; Some ("prefix", String.to_json v.prefix) - ; Util.option_map v.i_d (fun f -> "i_d", String.to_json f) - ]) - - let of_json j = - { i_d = Util.option_map (Json.lookup j "i_d") String.of_json - ; prefix = String.of_json (Util.of_option_exn (Json.lookup j "prefix")) - ; status = ReplicationRuleStatus.of_json (Util.of_option_exn (Json.lookup j "status")) - ; destination = Destination.of_json (Util.of_option_exn (Json.lookup j "destination")) - } -end - -module ObjectStorageClass = struct - type t = - | STANDARD - | REDUCED_REDUNDANCY - | GLACIER - - let str_to_t = - [ "GLACIER", GLACIER; "REDUCED_REDUNDANCY", REDUCED_REDUNDANCY; "STANDARD", STANDARD ] - - let t_to_str = - [ GLACIER, "GLACIER"; REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"; STANDARD, "STANDARD" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Owner = struct - type t = - { display_name : String.t option - ; i_d : String.t option - } - - let make ?display_name ?i_d () = { display_name; i_d } - - let parse xml = - Some - { display_name = Util.option_bind (Xml.member "DisplayName" xml) String.parse - ; i_d = Util.option_bind (Xml.member "ID" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.i_d (fun f -> Query.Pair ("ID", String.to_query f)) - ; Util.option_map v.display_name (fun f -> - Query.Pair ("DisplayName", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.i_d (fun f -> "i_d", String.to_json f) - ; Util.option_map v.display_name (fun f -> "display_name", String.to_json f) - ]) - - let of_json j = - { display_name = Util.option_map (Json.lookup j "display_name") String.of_json - ; i_d = Util.option_map (Json.lookup j "i_d") String.of_json - } -end - -module Rule = struct - type t = - { expiration : LifecycleExpiration.t option - ; i_d : String.t option - ; prefix : String.t - ; status : ExpirationStatus.t - ; transition : Transition.t option - ; noncurrent_version_transition : NoncurrentVersionTransition.t option - ; noncurrent_version_expiration : NoncurrentVersionExpiration.t option - } - - let make - ?expiration - ?i_d - ~prefix - ~status - ?transition - ?noncurrent_version_transition - ?noncurrent_version_expiration - () = - { expiration - ; i_d - ; prefix - ; status - ; transition - ; noncurrent_version_transition - ; noncurrent_version_expiration - } - - let parse xml = - Some - { expiration = - Util.option_bind (Xml.member "Expiration" xml) LifecycleExpiration.parse - ; i_d = Util.option_bind (Xml.member "ID" xml) String.parse - ; prefix = - Xml.required "Prefix" (Util.option_bind (Xml.member "Prefix" xml) String.parse) - ; status = - Xml.required - "Status" - (Util.option_bind (Xml.member "Status" xml) ExpirationStatus.parse) - ; transition = Util.option_bind (Xml.member "Transition" xml) Transition.parse - ; noncurrent_version_transition = - Util.option_bind - (Xml.member "NoncurrentVersionTransition" xml) - NoncurrentVersionTransition.parse - ; noncurrent_version_expiration = - Util.option_bind - (Xml.member "NoncurrentVersionExpiration" xml) - NoncurrentVersionExpiration.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.noncurrent_version_expiration (fun f -> - Query.Pair - ("NoncurrentVersionExpiration", NoncurrentVersionExpiration.to_query f)) - ; Util.option_map v.noncurrent_version_transition (fun f -> - Query.Pair - ("NoncurrentVersionTransition", NoncurrentVersionTransition.to_query f)) - ; Util.option_map v.transition (fun f -> - Query.Pair ("Transition", Transition.to_query f)) - ; Some (Query.Pair ("Status", ExpirationStatus.to_query v.status)) - ; Some (Query.Pair ("Prefix", String.to_query v.prefix)) - ; Util.option_map v.i_d (fun f -> Query.Pair ("ID", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("Expiration", LifecycleExpiration.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.noncurrent_version_expiration (fun f -> - "noncurrent_version_expiration", NoncurrentVersionExpiration.to_json f) - ; Util.option_map v.noncurrent_version_transition (fun f -> - "noncurrent_version_transition", NoncurrentVersionTransition.to_json f) - ; Util.option_map v.transition (fun f -> "transition", Transition.to_json f) - ; Some ("status", ExpirationStatus.to_json v.status) - ; Some ("prefix", String.to_json v.prefix) - ; Util.option_map v.i_d (fun f -> "i_d", String.to_json f) - ; Util.option_map v.expiration (fun f -> - "expiration", LifecycleExpiration.to_json f) - ]) - - let of_json j = - { expiration = - Util.option_map (Json.lookup j "expiration") LifecycleExpiration.of_json - ; i_d = Util.option_map (Json.lookup j "i_d") String.of_json - ; prefix = String.of_json (Util.of_option_exn (Json.lookup j "prefix")) - ; status = ExpirationStatus.of_json (Util.of_option_exn (Json.lookup j "status")) - ; transition = Util.option_map (Json.lookup j "transition") Transition.of_json - ; noncurrent_version_transition = - Util.option_map - (Json.lookup j "noncurrent_version_transition") - NoncurrentVersionTransition.of_json - ; noncurrent_version_expiration = - Util.option_map - (Json.lookup j "noncurrent_version_expiration") - NoncurrentVersionExpiration.of_json - } -end - -module Grant = struct - type t = - { grantee : Grantee.t option - ; permission : Permission.t option - } - - let make ?grantee ?permission () = { grantee; permission } - - let parse xml = - Some - { grantee = Util.option_bind (Xml.member "Grantee" xml) Grantee.parse - ; permission = Util.option_bind (Xml.member "Permission" xml) Permission.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.permission (fun f -> - Query.Pair ("Permission", Permission.to_query f)) - ; Util.option_map v.grantee (fun f -> Query.Pair ("Grantee", Grantee.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.permission (fun f -> "permission", Permission.to_json f) - ; Util.option_map v.grantee (fun f -> "grantee", Grantee.to_json f) - ]) - - let of_json j = - { grantee = Util.option_map (Json.lookup j "grantee") Grantee.of_json - ; permission = Util.option_map (Json.lookup j "permission") Permission.of_json - } -end - -module TargetGrants = struct - type t = TargetGrant.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map TargetGrant.parse (Xml.members "Grant" xml)) - - let to_query v = Query.to_query_list TargetGrant.to_query v - - let to_json v = `List (List.map TargetGrant.to_json v) - - let of_json j = Json.to_list TargetGrant.of_json j -end - -module CompletedPart = struct - type t = - { e_tag : String.t - ; part_number : Integer.t - } - - let make ~e_tag ~part_number () = { e_tag; part_number } - - let parse xml = - Some - { e_tag = - Xml.required "ETag" (Util.option_bind (Xml.member "ETag" xml) String.parse) - ; part_number = - Xml.required - "PartNumber" - (Util.option_bind (Xml.member "PartNumber" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("PartNumber", Integer.to_query v.part_number)) - ; Some (Query.Pair ("ETag", String.to_query v.e_tag)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("part_number", Integer.to_json v.part_number) - ; Some ("e_tag", String.to_json v.e_tag) - ]) - - let of_json j = - { e_tag = String.of_json (Util.of_option_exn (Json.lookup j "e_tag")) - ; part_number = Integer.of_json (Util.of_option_exn (Json.lookup j "part_number")) - } -end - -module ObjectVersionStorageClass = struct - type t = STANDARD - - let str_to_t = [ "STANDARD", STANDARD ] - - let t_to_str = [ STANDARD, "STANDARD" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ObjectIdentifier = struct - type t = - { key : String.t - ; version_id : String.t option - } - - let make ~key ?version_id () = { key; version_id } - - let parse xml = - Some - { key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; version_id = Util.option_bind (Xml.member "VersionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.version_id (fun f -> - Query.Pair ("VersionId", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Some ("key", String.to_json v.key) - ]) - - let of_json j = - { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - } -end - -module Initiator = struct - type t = - { i_d : String.t option - ; display_name : String.t option - } - - let make ?i_d ?display_name () = { i_d; display_name } - - let parse xml = - Some - { i_d = Util.option_bind (Xml.member "ID" xml) String.parse - ; display_name = Util.option_bind (Xml.member "DisplayName" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.display_name (fun f -> - Query.Pair ("DisplayName", String.to_query f)) - ; Util.option_map v.i_d (fun f -> Query.Pair ("ID", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.display_name (fun f -> "display_name", String.to_json f) - ; Util.option_map v.i_d (fun f -> "i_d", String.to_json f) - ]) - - let of_json j = - { i_d = Util.option_map (Json.lookup j "i_d") String.of_json - ; display_name = Util.option_map (Json.lookup j "display_name") String.of_json - } -end - -module StorageClass = struct - type t = - | STANDARD - | REDUCED_REDUNDANCY - - let str_to_t = [ "REDUCED_REDUNDANCY", REDUCED_REDUNDANCY; "STANDARD", STANDARD ] - - let t_to_str = [ REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"; STANDARD, "STANDARD" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Tag = struct - type t = - { key : String.t - ; value : String.t - } - - let make ~key ~value () = { key; value } - - let parse xml = - Some - { key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value); Some ("key", String.to_json v.key) ]) - - let of_json j = - { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module RoutingRule = struct - type t = - { condition : Condition.t option - ; redirect : Redirect.t - } - - let make ?condition ~redirect () = { condition; redirect } - - let parse xml = - Some - { condition = Util.option_bind (Xml.member "Condition" xml) Condition.parse - ; redirect = - Xml.required - "Redirect" - (Util.option_bind (Xml.member "Redirect" xml) Redirect.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Redirect", Redirect.to_query v.redirect)) - ; Util.option_map v.condition (fun f -> - Query.Pair ("Condition", Condition.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("redirect", Redirect.to_json v.redirect) - ; Util.option_map v.condition (fun f -> "condition", Condition.to_json f) - ]) - - let of_json j = - { condition = Util.option_map (Json.lookup j "condition") Condition.of_json - ; redirect = Redirect.of_json (Util.of_option_exn (Json.lookup j "redirect")) - } -end - -module LambdaFunctionConfiguration = struct - type t = - { id : String.t option - ; lambda_function_arn : String.t - ; events : EventList.t - ; filter : NotificationConfigurationFilter.t option - } - - let make ?id ~lambda_function_arn ~events ?filter () = - { id; lambda_function_arn; events; filter } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; lambda_function_arn = - Xml.required - "CloudFunction" - (Util.option_bind (Xml.member "CloudFunction" xml) String.parse) - ; events = Xml.required "Event" (EventList.parse xml) - ; filter = - Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - Query.Pair ("Filter", NotificationConfigurationFilter.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Some (Query.Pair ("CloudFunction", String.to_query v.lambda_function_arn)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - "filter", NotificationConfigurationFilter.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Some ("lambda_function_arn", String.to_json v.lambda_function_arn) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; lambda_function_arn = - String.of_json (Util.of_option_exn (Json.lookup j "lambda_function_arn")) - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; filter = - Util.option_map (Json.lookup j "filter") NotificationConfigurationFilter.of_json - } -end - -module QueueConfiguration = struct - type t = - { id : String.t option - ; queue_arn : String.t - ; events : EventList.t - ; filter : NotificationConfigurationFilter.t option - } - - let make ?id ~queue_arn ~events ?filter () = { id; queue_arn; events; filter } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; queue_arn = - Xml.required "Queue" (Util.option_bind (Xml.member "Queue" xml) String.parse) - ; events = Xml.required "Event" (EventList.parse xml) - ; filter = - Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - Query.Pair ("Filter", NotificationConfigurationFilter.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Some (Query.Pair ("Queue", String.to_query v.queue_arn)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - "filter", NotificationConfigurationFilter.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Some ("queue_arn", String.to_json v.queue_arn) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; queue_arn = String.of_json (Util.of_option_exn (Json.lookup j "queue_arn")) - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; filter = - Util.option_map (Json.lookup j "filter") NotificationConfigurationFilter.of_json - } -end - -module TopicConfiguration = struct - type t = - { id : String.t option - ; topic_arn : String.t - ; events : EventList.t - ; filter : NotificationConfigurationFilter.t option - } - - let make ?id ~topic_arn ~events ?filter () = { id; topic_arn; events; filter } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; topic_arn = - Xml.required "Topic" (Util.option_bind (Xml.member "Topic" xml) String.parse) - ; events = Xml.required "Event" (EventList.parse xml) - ; filter = - Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - Query.Pair ("Filter", NotificationConfigurationFilter.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Some (Query.Pair ("Topic", String.to_query v.topic_arn)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.filter (fun f -> - "filter", NotificationConfigurationFilter.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Some ("topic_arn", String.to_json v.topic_arn) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; topic_arn = String.of_json (Util.of_option_exn (Json.lookup j "topic_arn")) - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; filter = - Util.option_map (Json.lookup j "filter") NotificationConfigurationFilter.of_json - } -end - -module CORSRule = struct - type t = - { allowed_headers : AllowedHeaders.t - ; allowed_methods : AllowedMethods.t - ; allowed_origins : AllowedOrigins.t - ; expose_headers : ExposeHeaders.t - ; max_age_seconds : Integer.t option - } - - let make - ?(allowed_headers = []) - ?(allowed_methods = []) - ?(allowed_origins = []) - ?(expose_headers = []) - ?max_age_seconds - () = - { allowed_headers; allowed_methods; allowed_origins; expose_headers; max_age_seconds } - - let parse xml = - Some - { allowed_headers = Util.of_option [] (AllowedHeaders.parse xml) - ; allowed_methods = Util.of_option [] (AllowedMethods.parse xml) - ; allowed_origins = Util.of_option [] (AllowedOrigins.parse xml) - ; expose_headers = Util.of_option [] (ExposeHeaders.parse xml) - ; max_age_seconds = Util.option_bind (Xml.member "MaxAgeSeconds" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.max_age_seconds (fun f -> - Query.Pair ("MaxAgeSeconds", Integer.to_query f)) - ; Some (Query.Pair ("ExposeHeader", ExposeHeaders.to_query v.expose_headers)) - ; Some (Query.Pair ("AllowedOrigin", AllowedOrigins.to_query v.allowed_origins)) - ; Some (Query.Pair ("AllowedMethod", AllowedMethods.to_query v.allowed_methods)) - ; Some (Query.Pair ("AllowedHeader", AllowedHeaders.to_query v.allowed_headers)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.max_age_seconds (fun f -> - "max_age_seconds", Integer.to_json f) - ; Some ("expose_headers", ExposeHeaders.to_json v.expose_headers) - ; Some ("allowed_origins", AllowedOrigins.to_json v.allowed_origins) - ; Some ("allowed_methods", AllowedMethods.to_json v.allowed_methods) - ; Some ("allowed_headers", AllowedHeaders.to_json v.allowed_headers) - ]) - - let of_json j = - { allowed_headers = - AllowedHeaders.of_json (Util.of_option_exn (Json.lookup j "allowed_headers")) - ; allowed_methods = - AllowedMethods.of_json (Util.of_option_exn (Json.lookup j "allowed_methods")) - ; allowed_origins = - AllowedOrigins.of_json (Util.of_option_exn (Json.lookup j "allowed_origins")) - ; expose_headers = - ExposeHeaders.of_json (Util.of_option_exn (Json.lookup j "expose_headers")) - ; max_age_seconds = Util.option_map (Json.lookup j "max_age_seconds") Integer.of_json - } -end - -module ReplicationRules = struct - type t = ReplicationRule.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReplicationRule.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ReplicationRule.to_query v - - let to_json v = `List (List.map ReplicationRule.to_json v) - - let of_json j = Json.to_list ReplicationRule.of_json j -end - -module CommonPrefix = struct - type t = { prefix : String.t option } - - let make ?prefix () = { prefix } - - let parse xml = - Some { prefix = Util.option_bind (Xml.member "Prefix" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> "prefix", String.to_json f) ]) - - let of_json j = { prefix = Util.option_map (Json.lookup j "prefix") String.of_json } -end - -module Object = struct - type t = - { key : String.t - ; last_modified : DateTime.t - ; e_tag : String.t - ; size : Integer.t - ; storage_class : ObjectStorageClass.t - ; owner : Owner.t option - } - - let make ~key ~last_modified ~e_tag ~size ~storage_class ?owner () = - { key; last_modified; e_tag; size; storage_class; owner } - - let parse xml = - Some - { key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; last_modified = - Xml.required - "LastModified" + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.storage_class + (fun f -> + Query.Pair + ("StorageClass", (TransitionStorageClass.to_query f))); + Util.option_map v.days + (fun f -> Query.Pair ("Days", (Integer.to_query f))); + Util.option_map v.date + (fun f -> Query.Pair ("Date", (DateTime.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.storage_class + (fun f -> ("storage_class", (TransitionStorageClass.to_json f))); + Util.option_map v.days (fun f -> ("days", (Integer.to_json f))); + Util.option_map v.date (fun f -> ("date", (DateTime.to_json f)))]) + let of_json j = + { + date = (Util.option_map (Json.lookup j "date") DateTime.of_json); + days = (Util.option_map (Json.lookup j "days") Integer.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + TransitionStorageClass.of_json) + } + end +module Permission = + struct + type t = + | FULL_CONTROL + | WRITE + | WRITE_ACP + | READ + | READ_ACP + let str_to_t = + [("READ_ACP", READ_ACP); + ("READ", READ); + ("WRITE_ACP", WRITE_ACP); + ("WRITE", WRITE); + ("FULL_CONTROL", FULL_CONTROL)] + let t_to_str = + [(READ_ACP, "READ_ACP"); + (READ, "READ"); + (WRITE_ACP, "WRITE_ACP"); + (WRITE, "WRITE"); + (FULL_CONTROL, "FULL_CONTROL")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module TargetGrant = + struct + type t = + { + grantee: Grantee.t option ; + permission: BucketLogsPermission.t option } + let make ?grantee ?permission () = { grantee; permission } + let parse xml = + Some + { + grantee = + (Util.option_bind (Xml.member "Grantee" xml) Grantee.parse); + permission = + (Util.option_bind (Xml.member "Permission" xml) + BucketLogsPermission.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.permission + (fun f -> + Query.Pair ("Permission", (BucketLogsPermission.to_query f))); + Util.option_map v.grantee + (fun f -> Query.Pair ("Grantee", (Grantee.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.permission + (fun f -> ("permission", (BucketLogsPermission.to_json f))); + Util.option_map v.grantee + (fun f -> ("grantee", (Grantee.to_json f)))]) + let of_json j = + { + grantee = (Util.option_map (Json.lookup j "grantee") Grantee.of_json); + permission = + (Util.option_map (Json.lookup j "permission") + BucketLogsPermission.of_json) + } + end +module Condition = + struct + type t = + { + http_error_code_returned_equals: String.t option ; + key_prefix_equals: String.t option } + let make ?http_error_code_returned_equals ?key_prefix_equals () = + { http_error_code_returned_equals; key_prefix_equals } + let parse xml = + Some + { + http_error_code_returned_equals = + (Util.option_bind (Xml.member "HttpErrorCodeReturnedEquals" xml) + String.parse); + key_prefix_equals = + (Util.option_bind (Xml.member "KeyPrefixEquals" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.key_prefix_equals + (fun f -> Query.Pair ("KeyPrefixEquals", (String.to_query f))); + Util.option_map v.http_error_code_returned_equals + (fun f -> + Query.Pair + ("HttpErrorCodeReturnedEquals", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.key_prefix_equals + (fun f -> ("key_prefix_equals", (String.to_json f))); + Util.option_map v.http_error_code_returned_equals + (fun f -> + ("http_error_code_returned_equals", (String.to_json f)))]) + let of_json j = + { + http_error_code_returned_equals = + (Util.option_map (Json.lookup j "http_error_code_returned_equals") + String.of_json); + key_prefix_equals = + (Util.option_map (Json.lookup j "key_prefix_equals") String.of_json) + } + end +module Redirect = + struct + type t = + { + host_name: String.t option ; + http_redirect_code: String.t option ; + protocol: Protocol.t option ; + replace_key_prefix_with: String.t option ; + replace_key_with: String.t option } + let make ?host_name ?http_redirect_code ?protocol + ?replace_key_prefix_with ?replace_key_with () = + { + host_name; + http_redirect_code; + protocol; + replace_key_prefix_with; + replace_key_with + } + let parse xml = + Some + { + host_name = + (Util.option_bind (Xml.member "HostName" xml) String.parse); + http_redirect_code = + (Util.option_bind (Xml.member "HttpRedirectCode" xml) + String.parse); + protocol = + (Util.option_bind (Xml.member "Protocol" xml) Protocol.parse); + replace_key_prefix_with = + (Util.option_bind (Xml.member "ReplaceKeyPrefixWith" xml) + String.parse); + replace_key_with = + (Util.option_bind (Xml.member "ReplaceKeyWith" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replace_key_with + (fun f -> Query.Pair ("ReplaceKeyWith", (String.to_query f))); + Util.option_map v.replace_key_prefix_with + (fun f -> + Query.Pair ("ReplaceKeyPrefixWith", (String.to_query f))); + Util.option_map v.protocol + (fun f -> Query.Pair ("Protocol", (Protocol.to_query f))); + Util.option_map v.http_redirect_code + (fun f -> Query.Pair ("HttpRedirectCode", (String.to_query f))); + Util.option_map v.host_name + (fun f -> Query.Pair ("HostName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replace_key_with + (fun f -> ("replace_key_with", (String.to_json f))); + Util.option_map v.replace_key_prefix_with + (fun f -> ("replace_key_prefix_with", (String.to_json f))); + Util.option_map v.protocol + (fun f -> ("protocol", (Protocol.to_json f))); + Util.option_map v.http_redirect_code + (fun f -> ("http_redirect_code", (String.to_json f))); + Util.option_map v.host_name + (fun f -> ("host_name", (String.to_json f)))]) + let of_json j = + { + host_name = + (Util.option_map (Json.lookup j "host_name") String.of_json); + http_redirect_code = + (Util.option_map (Json.lookup j "http_redirect_code") + String.of_json); + protocol = + (Util.option_map (Json.lookup j "protocol") Protocol.of_json); + replace_key_prefix_with = + (Util.option_map (Json.lookup j "replace_key_prefix_with") + String.of_json); + replace_key_with = + (Util.option_map (Json.lookup j "replace_key_with") String.of_json) + } + end +module EventList = + struct + type t = Event.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Event.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Event.to_query v + let to_json v = `List (List.map Event.to_json v) + let of_json j = Json.to_list Event.of_json j + end +module NotificationConfigurationFilter = + struct + type t = { + key: S3KeyFilter.t option } + let make ?key () = { key } + let parse xml = + Some + { key = (Util.option_bind (Xml.member "S3Key" xml) S3KeyFilter.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.key + (fun f -> Query.Pair ("S3Key", (S3KeyFilter.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.key (fun f -> ("key", (S3KeyFilter.to_json f)))]) + let of_json j = + { key = (Util.option_map (Json.lookup j "key") S3KeyFilter.of_json) } + end +module AllowedHeaders = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AllowedMethods = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AllowedOrigins = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ExposeHeaders = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ReplicationRule = + struct + type t = + { + i_d: String.t option ; + prefix: String.t ; + status: ReplicationRuleStatus.t ; + destination: Destination.t } + let make ?i_d ~prefix ~status ~destination () = + { i_d; prefix; status; destination } + let parse xml = + Some + { + i_d = (Util.option_bind (Xml.member "ID" xml) String.parse); + prefix = + (Xml.required "Prefix" + (Util.option_bind (Xml.member "Prefix" xml) String.parse)); + status = + (Xml.required "Status" + (Util.option_bind (Xml.member "Status" xml) + ReplicationRuleStatus.parse)); + destination = + (Xml.required "Destination" + (Util.option_bind (Xml.member "Destination" xml) + Destination.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Destination", (Destination.to_query v.destination))); + Some + (Query.Pair + ("Status", (ReplicationRuleStatus.to_query v.status))); + Some (Query.Pair ("Prefix", (String.to_query v.prefix))); + Util.option_map v.i_d + (fun f -> Query.Pair ("ID", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("destination", (Destination.to_json v.destination)); + Some ("status", (ReplicationRuleStatus.to_json v.status)); + Some ("prefix", (String.to_json v.prefix)); + Util.option_map v.i_d (fun f -> ("i_d", (String.to_json f)))]) + let of_json j = + { + i_d = (Util.option_map (Json.lookup j "i_d") String.of_json); + prefix = + (String.of_json (Util.of_option_exn (Json.lookup j "prefix"))); + status = + (ReplicationRuleStatus.of_json + (Util.of_option_exn (Json.lookup j "status"))); + destination = + (Destination.of_json + (Util.of_option_exn (Json.lookup j "destination"))) + } + end +module ObjectStorageClass = + struct + type t = + | STANDARD + | REDUCED_REDUNDANCY + | GLACIER + let str_to_t = + [("GLACIER", GLACIER); + ("REDUCED_REDUNDANCY", REDUCED_REDUNDANCY); + ("STANDARD", STANDARD)] + let t_to_str = + [(GLACIER, "GLACIER"); + (REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"); + (STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Owner = + struct + type t = { + display_name: String.t option ; + i_d: String.t option } + let make ?display_name ?i_d () = { display_name; i_d } + let parse xml = + Some + { + display_name = + (Util.option_bind (Xml.member "DisplayName" xml) String.parse); + i_d = (Util.option_bind (Xml.member "ID" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.i_d + (fun f -> Query.Pair ("ID", (String.to_query f))); + Util.option_map v.display_name + (fun f -> Query.Pair ("DisplayName", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.i_d (fun f -> ("i_d", (String.to_json f))); + Util.option_map v.display_name + (fun f -> ("display_name", (String.to_json f)))]) + let of_json j = + { + display_name = + (Util.option_map (Json.lookup j "display_name") String.of_json); + i_d = (Util.option_map (Json.lookup j "i_d") String.of_json) + } + end +module Rule = + struct + type t = + { + expiration: LifecycleExpiration.t option ; + i_d: String.t option ; + prefix: String.t ; + status: ExpirationStatus.t ; + transition: Transition.t option ; + noncurrent_version_transition: NoncurrentVersionTransition.t option ; + noncurrent_version_expiration: NoncurrentVersionExpiration.t option } + let make ?expiration ?i_d ~prefix ~status ?transition + ?noncurrent_version_transition ?noncurrent_version_expiration () = + { + expiration; + i_d; + prefix; + status; + transition; + noncurrent_version_transition; + noncurrent_version_expiration + } + let parse xml = + Some + { + expiration = + (Util.option_bind (Xml.member "Expiration" xml) + LifecycleExpiration.parse); + i_d = (Util.option_bind (Xml.member "ID" xml) String.parse); + prefix = + (Xml.required "Prefix" + (Util.option_bind (Xml.member "Prefix" xml) String.parse)); + status = + (Xml.required "Status" + (Util.option_bind (Xml.member "Status" xml) + ExpirationStatus.parse)); + transition = + (Util.option_bind (Xml.member "Transition" xml) Transition.parse); + noncurrent_version_transition = + (Util.option_bind (Xml.member "NoncurrentVersionTransition" xml) + NoncurrentVersionTransition.parse); + noncurrent_version_expiration = + (Util.option_bind (Xml.member "NoncurrentVersionExpiration" xml) + NoncurrentVersionExpiration.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.noncurrent_version_expiration + (fun f -> + Query.Pair + ("NoncurrentVersionExpiration", + (NoncurrentVersionExpiration.to_query f))); + Util.option_map v.noncurrent_version_transition + (fun f -> + Query.Pair + ("NoncurrentVersionTransition", + (NoncurrentVersionTransition.to_query f))); + Util.option_map v.transition + (fun f -> Query.Pair ("Transition", (Transition.to_query f))); + Some (Query.Pair ("Status", (ExpirationStatus.to_query v.status))); + Some (Query.Pair ("Prefix", (String.to_query v.prefix))); + Util.option_map v.i_d + (fun f -> Query.Pair ("ID", (String.to_query f))); + Util.option_map v.expiration + (fun f -> + Query.Pair ("Expiration", (LifecycleExpiration.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.noncurrent_version_expiration + (fun f -> + ("noncurrent_version_expiration", + (NoncurrentVersionExpiration.to_json f))); + Util.option_map v.noncurrent_version_transition + (fun f -> + ("noncurrent_version_transition", + (NoncurrentVersionTransition.to_json f))); + Util.option_map v.transition + (fun f -> ("transition", (Transition.to_json f))); + Some ("status", (ExpirationStatus.to_json v.status)); + Some ("prefix", (String.to_json v.prefix)); + Util.option_map v.i_d (fun f -> ("i_d", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (LifecycleExpiration.to_json f)))]) + let of_json j = + { + expiration = + (Util.option_map (Json.lookup j "expiration") + LifecycleExpiration.of_json); + i_d = (Util.option_map (Json.lookup j "i_d") String.of_json); + prefix = + (String.of_json (Util.of_option_exn (Json.lookup j "prefix"))); + status = + (ExpirationStatus.of_json + (Util.of_option_exn (Json.lookup j "status"))); + transition = + (Util.option_map (Json.lookup j "transition") Transition.of_json); + noncurrent_version_transition = + (Util.option_map (Json.lookup j "noncurrent_version_transition") + NoncurrentVersionTransition.of_json); + noncurrent_version_expiration = + (Util.option_map (Json.lookup j "noncurrent_version_expiration") + NoncurrentVersionExpiration.of_json) + } + end +module Grant = + struct + type t = { + grantee: Grantee.t option ; + permission: Permission.t option } + let make ?grantee ?permission () = { grantee; permission } + let parse xml = + Some + { + grantee = + (Util.option_bind (Xml.member "Grantee" xml) Grantee.parse); + permission = + (Util.option_bind (Xml.member "Permission" xml) Permission.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.permission + (fun f -> Query.Pair ("Permission", (Permission.to_query f))); + Util.option_map v.grantee + (fun f -> Query.Pair ("Grantee", (Grantee.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.permission + (fun f -> ("permission", (Permission.to_json f))); + Util.option_map v.grantee + (fun f -> ("grantee", (Grantee.to_json f)))]) + let of_json j = + { + grantee = (Util.option_map (Json.lookup j "grantee") Grantee.of_json); + permission = + (Util.option_map (Json.lookup j "permission") Permission.of_json) + } + end +module TargetGrants = + struct + type t = TargetGrant.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map TargetGrant.parse (Xml.members "Grant" xml)) + let to_query v = Query.to_query_list TargetGrant.to_query v + let to_json v = `List (List.map TargetGrant.to_json v) + let of_json j = Json.to_list TargetGrant.of_json j + end +module CompletedPart = + struct + type t = { + e_tag: String.t ; + part_number: Integer.t } + let make ~e_tag ~part_number () = { e_tag; part_number } + let parse xml = + Some + { + e_tag = + (Xml.required "ETag" + (Util.option_bind (Xml.member "ETag" xml) String.parse)); + part_number = + (Xml.required "PartNumber" + (Util.option_bind (Xml.member "PartNumber" xml) Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("PartNumber", (Integer.to_query v.part_number))); + Some (Query.Pair ("ETag", (String.to_query v.e_tag)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("part_number", (Integer.to_json v.part_number)); + Some ("e_tag", (String.to_json v.e_tag))]) + let of_json j = + { + e_tag = (String.of_json (Util.of_option_exn (Json.lookup j "e_tag"))); + part_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "part_number"))) + } + end +module ObjectVersionStorageClass = + struct + type t = + | STANDARD + let str_to_t = [("STANDARD", STANDARD)] + let t_to_str = [(STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ObjectIdentifier = + struct + type t = { + key: String.t ; + version_id: String.t option } + let make ~key ?version_id () = { key; version_id } + let parse xml = + Some + { + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + version_id = + (Util.option_bind (Xml.member "VersionId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.version_id + (fun f -> Query.Pair ("VersionId", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Some ("key", (String.to_json v.key))]) + let of_json j = + { + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json) + } + end +module Initiator = + struct + type t = { + i_d: String.t option ; + display_name: String.t option } + let make ?i_d ?display_name () = { i_d; display_name } + let parse xml = + Some + { + i_d = (Util.option_bind (Xml.member "ID" xml) String.parse); + display_name = + (Util.option_bind (Xml.member "DisplayName" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.display_name + (fun f -> Query.Pair ("DisplayName", (String.to_query f))); + Util.option_map v.i_d + (fun f -> Query.Pair ("ID", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.display_name + (fun f -> ("display_name", (String.to_json f))); + Util.option_map v.i_d (fun f -> ("i_d", (String.to_json f)))]) + let of_json j = + { + i_d = (Util.option_map (Json.lookup j "i_d") String.of_json); + display_name = + (Util.option_map (Json.lookup j "display_name") String.of_json) + } + end +module StorageClass = + struct + type t = + | STANDARD + | REDUCED_REDUNDANCY + let str_to_t = + [("REDUCED_REDUNDANCY", REDUCED_REDUNDANCY); ("STANDARD", STANDARD)] + let t_to_str = + [(REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"); (STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Tag = + struct + type t = { + key: String.t ; + value: String.t } + let make ~key ~value () = { key; value } + let parse xml = + Some + { + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("key", (String.to_json v.key))]) + let of_json j = + { + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) + } + end +module RoutingRule = + struct + type t = { + condition: Condition.t option ; + redirect: Redirect.t } + let make ?condition ~redirect () = { condition; redirect } + let parse xml = + Some + { + condition = + (Util.option_bind (Xml.member "Condition" xml) Condition.parse); + redirect = + (Xml.required "Redirect" + (Util.option_bind (Xml.member "Redirect" xml) Redirect.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Redirect", (Redirect.to_query v.redirect))); + Util.option_map v.condition + (fun f -> Query.Pair ("Condition", (Condition.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("redirect", (Redirect.to_json v.redirect)); + Util.option_map v.condition + (fun f -> ("condition", (Condition.to_json f)))]) + let of_json j = + { + condition = + (Util.option_map (Json.lookup j "condition") Condition.of_json); + redirect = + (Redirect.of_json (Util.of_option_exn (Json.lookup j "redirect"))) + } + end +module LambdaFunctionConfiguration = + struct + type t = + { + id: String.t option ; + lambda_function_arn: String.t ; + events: EventList.t ; + filter: NotificationConfigurationFilter.t option } + let make ?id ~lambda_function_arn ~events ?filter () = + { id; lambda_function_arn; events; filter } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + lambda_function_arn = + (Xml.required "CloudFunction" + (Util.option_bind (Xml.member "CloudFunction" xml) + String.parse)); + events = (Xml.required "Event" (EventList.parse xml)); + filter = + (Util.option_bind (Xml.member "Filter" xml) + NotificationConfigurationFilter.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + Query.Pair + ("Filter", (NotificationConfigurationFilter.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Some + (Query.Pair + ("CloudFunction", (String.to_query v.lambda_function_arn))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + ("filter", (NotificationConfigurationFilter.to_json f))); + Some ("events", (EventList.to_json v.events)); + Some + ("lambda_function_arn", (String.to_json v.lambda_function_arn)); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + lambda_function_arn = + (String.of_json + (Util.of_option_exn (Json.lookup j "lambda_function_arn"))); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + filter = + (Util.option_map (Json.lookup j "filter") + NotificationConfigurationFilter.of_json) + } + end +module QueueConfiguration = + struct + type t = + { + id: String.t option ; + queue_arn: String.t ; + events: EventList.t ; + filter: NotificationConfigurationFilter.t option } + let make ?id ~queue_arn ~events ?filter () = + { id; queue_arn; events; filter } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + queue_arn = + (Xml.required "Queue" + (Util.option_bind (Xml.member "Queue" xml) String.parse)); + events = (Xml.required "Event" (EventList.parse xml)); + filter = + (Util.option_bind (Xml.member "Filter" xml) + NotificationConfigurationFilter.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + Query.Pair + ("Filter", (NotificationConfigurationFilter.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Some (Query.Pair ("Queue", (String.to_query v.queue_arn))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + ("filter", (NotificationConfigurationFilter.to_json f))); + Some ("events", (EventList.to_json v.events)); + Some ("queue_arn", (String.to_json v.queue_arn)); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + queue_arn = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_arn"))); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + filter = + (Util.option_map (Json.lookup j "filter") + NotificationConfigurationFilter.of_json) + } + end +module TopicConfiguration = + struct + type t = + { + id: String.t option ; + topic_arn: String.t ; + events: EventList.t ; + filter: NotificationConfigurationFilter.t option } + let make ?id ~topic_arn ~events ?filter () = + { id; topic_arn; events; filter } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + topic_arn = + (Xml.required "Topic" + (Util.option_bind (Xml.member "Topic" xml) String.parse)); + events = (Xml.required "Event" (EventList.parse xml)); + filter = + (Util.option_bind (Xml.member "Filter" xml) + NotificationConfigurationFilter.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + Query.Pair + ("Filter", (NotificationConfigurationFilter.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Some (Query.Pair ("Topic", (String.to_query v.topic_arn))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.filter + (fun f -> + ("filter", (NotificationConfigurationFilter.to_json f))); + Some ("events", (EventList.to_json v.events)); + Some ("topic_arn", (String.to_json v.topic_arn)); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + topic_arn = + (String.of_json (Util.of_option_exn (Json.lookup j "topic_arn"))); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + filter = + (Util.option_map (Json.lookup j "filter") + NotificationConfigurationFilter.of_json) + } + end +module CORSRule = + struct + type t = + { + allowed_headers: AllowedHeaders.t ; + allowed_methods: AllowedMethods.t ; + allowed_origins: AllowedOrigins.t ; + expose_headers: ExposeHeaders.t ; + max_age_seconds: Integer.t option } + let make ?(allowed_headers= []) ?(allowed_methods= []) + ?(allowed_origins= []) ?(expose_headers= []) ?max_age_seconds () = + { + allowed_headers; + allowed_methods; + allowed_origins; + expose_headers; + max_age_seconds + } + let parse xml = + Some + { + allowed_headers = (Util.of_option [] (AllowedHeaders.parse xml)); + allowed_methods = (Util.of_option [] (AllowedMethods.parse xml)); + allowed_origins = (Util.of_option [] (AllowedOrigins.parse xml)); + expose_headers = (Util.of_option [] (ExposeHeaders.parse xml)); + max_age_seconds = + (Util.option_bind (Xml.member "MaxAgeSeconds" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.max_age_seconds + (fun f -> Query.Pair ("MaxAgeSeconds", (Integer.to_query f))); + Some + (Query.Pair + ("ExposeHeader", (ExposeHeaders.to_query v.expose_headers))); + Some + (Query.Pair + ("AllowedOrigin", + (AllowedOrigins.to_query v.allowed_origins))); + Some + (Query.Pair + ("AllowedMethod", + (AllowedMethods.to_query v.allowed_methods))); + Some + (Query.Pair + ("AllowedHeader", + (AllowedHeaders.to_query v.allowed_headers)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.max_age_seconds + (fun f -> ("max_age_seconds", (Integer.to_json f))); + Some ("expose_headers", (ExposeHeaders.to_json v.expose_headers)); + Some + ("allowed_origins", (AllowedOrigins.to_json v.allowed_origins)); + Some + ("allowed_methods", (AllowedMethods.to_json v.allowed_methods)); + Some + ("allowed_headers", (AllowedHeaders.to_json v.allowed_headers))]) + let of_json j = + { + allowed_headers = + (AllowedHeaders.of_json + (Util.of_option_exn (Json.lookup j "allowed_headers"))); + allowed_methods = + (AllowedMethods.of_json + (Util.of_option_exn (Json.lookup j "allowed_methods"))); + allowed_origins = + (AllowedOrigins.of_json + (Util.of_option_exn (Json.lookup j "allowed_origins"))); + expose_headers = + (ExposeHeaders.of_json + (Util.of_option_exn (Json.lookup j "expose_headers"))); + max_age_seconds = + (Util.option_map (Json.lookup j "max_age_seconds") Integer.of_json) + } + end +module ReplicationRules = + struct + type t = ReplicationRule.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReplicationRule.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ReplicationRule.to_query v + let to_json v = `List (List.map ReplicationRule.to_json v) + let of_json j = Json.to_list ReplicationRule.of_json j + end +module CommonPrefix = + struct + type t = { + prefix: String.t option } + let make ?prefix () = { prefix } + let parse xml = + Some + { prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> ("prefix", (String.to_json f)))]) + let of_json j = + { prefix = (Util.option_map (Json.lookup j "prefix") String.of_json) } + end +module Object = + struct + type t = + { + key: String.t ; + last_modified: DateTime.t ; + e_tag: String.t ; + size: Integer.t ; + storage_class: ObjectStorageClass.t ; + owner: Owner.t option } + let make ~key ~last_modified ~e_tag ~size ~storage_class ?owner () + = { key; last_modified; e_tag; size; storage_class; owner } + let parse xml = + Some + { + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + last_modified = + (Xml.required "LastModified" + (Util.option_bind (Xml.member "LastModified" xml) + DateTime.parse)); + e_tag = + (Xml.required "ETag" + (Util.option_bind (Xml.member "ETag" xml) String.parse)); + size = + (Xml.required "Size" + (Util.option_bind (Xml.member "Size" xml) Integer.parse)); + storage_class = + (Xml.required "StorageClass" + (Util.option_bind (Xml.member "StorageClass" xml) + ObjectStorageClass.parse)); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Some + (Query.Pair + ("StorageClass", + (ObjectStorageClass.to_query v.storage_class))); + Some (Query.Pair ("Size", (Integer.to_query v.size))); + Some (Query.Pair ("ETag", (String.to_query v.e_tag))); + Some + (Query.Pair + ("LastModified", (DateTime.to_query v.last_modified))); + Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Some + ("storage_class", (ObjectStorageClass.to_json v.storage_class)); + Some ("size", (Integer.to_json v.size)); + Some ("e_tag", (String.to_json v.e_tag)); + Some ("last_modified", (DateTime.to_json v.last_modified)); + Some ("key", (String.to_json v.key))]) + let of_json j = + { + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + last_modified = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "last_modified"))); + e_tag = (String.of_json (Util.of_option_exn (Json.lookup j "e_tag"))); + size = (Integer.of_json (Util.of_option_exn (Json.lookup j "size"))); + storage_class = + (ObjectStorageClass.of_json + (Util.of_option_exn (Json.lookup j "storage_class"))); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json) + } + end +module Rules = + struct + type t = Rule.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Rule.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Rule.to_query v + let to_json v = `List (List.map Rule.to_json v) + let of_json j = Json.to_list Rule.of_json j + end +module Grants = + struct + type t = Grant.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Grant.parse (Xml.members "Grant" xml)) + let to_query v = Query.to_query_list Grant.to_query v + let to_json v = `List (List.map Grant.to_json v) + let of_json j = Json.to_list Grant.of_json j + end +module BucketLocationConstraint = + struct + type t = + | EU + | Eu_west_1 + | Us_west_1 + | Us_west_2 + | Ap_southeast_1 + | Ap_southeast_2 + | Ap_northeast_1 + | Sa_east_1 + | Cn_north_1 + | Eu_central_1 + let str_to_t = + [("eu-central-1", Eu_central_1); + ("cn-north-1", Cn_north_1); + ("sa-east-1", Sa_east_1); + ("ap-northeast-1", Ap_northeast_1); + ("ap-southeast-2", Ap_southeast_2); + ("ap-southeast-1", Ap_southeast_1); + ("us-west-2", Us_west_2); + ("us-west-1", Us_west_1); + ("eu-west-1", Eu_west_1); + ("EU", EU)] + let t_to_str = + [(Eu_central_1, "eu-central-1"); + (Cn_north_1, "cn-north-1"); + (Sa_east_1, "sa-east-1"); + (Ap_northeast_1, "ap-northeast-1"); + (Ap_southeast_2, "ap-southeast-2"); + (Ap_southeast_1, "ap-southeast-1"); + (Us_west_2, "us-west-2"); + (Us_west_1, "us-west-1"); + (Eu_west_1, "eu-west-1"); + (EU, "EU")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module LoggingEnabled = + struct + type t = + { + target_bucket: String.t option ; + target_grants: TargetGrants.t ; + target_prefix: String.t option } + let make ?target_bucket ?(target_grants= []) ?target_prefix () = + { target_bucket; target_grants; target_prefix } + let parse xml = + Some + { + target_bucket = + (Util.option_bind (Xml.member "TargetBucket" xml) String.parse); + target_grants = + (Util.of_option [] + (Util.option_bind (Xml.member "TargetGrants" xml) + TargetGrants.parse)); + target_prefix = + (Util.option_bind (Xml.member "TargetPrefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.target_prefix + (fun f -> Query.Pair ("TargetPrefix", (String.to_query f))); + Some + (Query.Pair + ("TargetGrants.member", + (TargetGrants.to_query v.target_grants))); + Util.option_map v.target_bucket + (fun f -> Query.Pair ("TargetBucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.target_prefix + (fun f -> ("target_prefix", (String.to_json f))); + Some ("target_grants", (TargetGrants.to_json v.target_grants)); + Util.option_map v.target_bucket + (fun f -> ("target_bucket", (String.to_json f)))]) + let of_json j = + { + target_bucket = + (Util.option_map (Json.lookup j "target_bucket") String.of_json); + target_grants = + (TargetGrants.of_json + (Util.of_option_exn (Json.lookup j "target_grants"))); + target_prefix = + (Util.option_map (Json.lookup j "target_prefix") String.of_json) + } + end +module CompletedPartList = + struct + type t = CompletedPart.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CompletedPart.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list CompletedPart.to_query v + let to_json v = `List (List.map CompletedPart.to_json v) + let of_json j = Json.to_list CompletedPart.of_json j + end +module Bucket = + struct + type t = { + name: String.t ; + creation_date: DateTime.t } + let make ~name ~creation_date () = { name; creation_date } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + creation_date = + (Xml.required "CreationDate" + (Util.option_bind (Xml.member "CreationDate" xml) + DateTime.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CreationDate", (DateTime.to_query v.creation_date))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("creation_date", (DateTime.to_json v.creation_date)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + creation_date = + (DateTime.of_json + (Util.of_option_exn (Json.lookup j "creation_date"))) + } + end +module CloudFunctionConfiguration = + struct + type t = + { + id: String.t option ; + event: Event.t option ; + events: EventList.t ; + cloud_function: String.t option ; + invocation_role: String.t option } + let make ?id ?event ?(events= []) ?cloud_function ?invocation_role + () = { id; event; events; cloud_function; invocation_role } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + event = (Util.option_bind (Xml.member "Event" xml) Event.parse); + events = (Util.of_option [] (EventList.parse xml)); + cloud_function = + (Util.option_bind (Xml.member "CloudFunction" xml) String.parse); + invocation_role = + (Util.option_bind (Xml.member "InvocationRole" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.invocation_role + (fun f -> Query.Pair ("InvocationRole", (String.to_query f))); + Util.option_map v.cloud_function + (fun f -> Query.Pair ("CloudFunction", (String.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Util.option_map v.event + (fun f -> Query.Pair ("Event", (Event.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.invocation_role + (fun f -> ("invocation_role", (String.to_json f))); + Util.option_map v.cloud_function + (fun f -> ("cloud_function", (String.to_json f))); + Some ("events", (EventList.to_json v.events)); + Util.option_map v.event (fun f -> ("event", (Event.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + event = (Util.option_map (Json.lookup j "event") Event.of_json); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + cloud_function = + (Util.option_map (Json.lookup j "cloud_function") String.of_json); + invocation_role = + (Util.option_map (Json.lookup j "invocation_role") String.of_json) + } + end +module QueueConfigurationDeprecated = + struct + type t = + { + id: String.t option ; + event: Event.t option ; + events: EventList.t ; + queue: String.t option } + let make ?id ?event ?(events= []) ?queue () = + { id; event; events; queue } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + event = (Util.option_bind (Xml.member "Event" xml) Event.parse); + events = (Util.of_option [] (EventList.parse xml)); + queue = (Util.option_bind (Xml.member "Queue" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue + (fun f -> Query.Pair ("Queue", (String.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Util.option_map v.event + (fun f -> Query.Pair ("Event", (Event.to_query f))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue (fun f -> ("queue", (String.to_json f))); + Some ("events", (EventList.to_json v.events)); + Util.option_map v.event (fun f -> ("event", (Event.to_json f))); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + event = (Util.option_map (Json.lookup j "event") Event.of_json); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + queue = (Util.option_map (Json.lookup j "queue") String.of_json) + } + end +module TopicConfigurationDeprecated = + struct + type t = + { + id: String.t option ; + events: EventList.t ; + event: Event.t option ; + topic: String.t option } + let make ?id ?(events= []) ?event ?topic () = + { id; events; event; topic } + let parse xml = + Some + { + id = (Util.option_bind (Xml.member "Id" xml) String.parse); + events = (Util.of_option [] (EventList.parse xml)); + event = (Util.option_bind (Xml.member "Event" xml) Event.parse); + topic = (Util.option_bind (Xml.member "Topic" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.topic + (fun f -> Query.Pair ("Topic", (String.to_query f))); + Util.option_map v.event + (fun f -> Query.Pair ("Event", (Event.to_query f))); + Some (Query.Pair ("Event", (EventList.to_query v.events))); + Util.option_map v.id + (fun f -> Query.Pair ("Id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.topic (fun f -> ("topic", (String.to_json f))); + Util.option_map v.event (fun f -> ("event", (Event.to_json f))); + Some ("events", (EventList.to_json v.events)); + Util.option_map v.id (fun f -> ("id", (String.to_json f)))]) + let of_json j = + { + id = (Util.option_map (Json.lookup j "id") String.of_json); + events = + (EventList.of_json (Util.of_option_exn (Json.lookup j "events"))); + event = (Util.option_map (Json.lookup j "event") Event.of_json); + topic = (Util.option_map (Json.lookup j "topic") String.of_json) + } + end +module DeleteMarkerEntry = + struct + type t = + { + owner: Owner.t option ; + key: String.t option ; + version_id: String.t option ; + is_latest: Boolean.t option ; + last_modified: DateTime.t option } + let make ?owner ?key ?version_id ?is_latest ?last_modified () = + { owner; key; version_id; is_latest; last_modified } + let parse xml = + Some + { + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "VersionId" xml) String.parse); + is_latest = + (Util.option_bind (Xml.member "IsLatest" xml) Boolean.parse); + last_modified = (Util.option_bind (Xml.member "LastModified" xml) DateTime.parse) - ; e_tag = - Xml.required "ETag" (Util.option_bind (Xml.member "ETag" xml) String.parse) - ; size = - Xml.required "Size" (Util.option_bind (Xml.member "Size" xml) Integer.parse) - ; storage_class = - Xml.required - "StorageClass" - (Util.option_bind (Xml.member "StorageClass" xml) ObjectStorageClass.parse) - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Some (Query.Pair ("StorageClass", ObjectStorageClass.to_query v.storage_class)) - ; Some (Query.Pair ("Size", Integer.to_query v.size)) - ; Some (Query.Pair ("ETag", String.to_query v.e_tag)) - ; Some (Query.Pair ("LastModified", DateTime.to_query v.last_modified)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Some ("storage_class", ObjectStorageClass.to_json v.storage_class) - ; Some ("size", Integer.to_json v.size) - ; Some ("e_tag", String.to_json v.e_tag) - ; Some ("last_modified", DateTime.to_json v.last_modified) - ; Some ("key", String.to_json v.key) - ]) - - let of_json j = - { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; last_modified = - DateTime.of_json (Util.of_option_exn (Json.lookup j "last_modified")) - ; e_tag = String.of_json (Util.of_option_exn (Json.lookup j "e_tag")) - ; size = Integer.of_json (Util.of_option_exn (Json.lookup j "size")) - ; storage_class = - ObjectStorageClass.of_json (Util.of_option_exn (Json.lookup j "storage_class")) - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - } -end - -module Rules = struct - type t = Rule.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Rule.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Rule.to_query v - - let to_json v = `List (List.map Rule.to_json v) - - let of_json j = Json.to_list Rule.of_json j -end - -module Grants = struct - type t = Grant.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Grant.parse (Xml.members "Grant" xml)) - - let to_query v = Query.to_query_list Grant.to_query v - - let to_json v = `List (List.map Grant.to_json v) - - let of_json j = Json.to_list Grant.of_json j -end - -module BucketLocationConstraint = struct - type t = - | EU - | Eu_west_1 - | Us_west_1 - | Us_west_2 - | Ap_southeast_1 - | Ap_southeast_2 - | Ap_northeast_1 - | Sa_east_1 - | Cn_north_1 - | Eu_central_1 - - let str_to_t = - [ "eu-central-1", Eu_central_1 - ; "cn-north-1", Cn_north_1 - ; "sa-east-1", Sa_east_1 - ; "ap-northeast-1", Ap_northeast_1 - ; "ap-southeast-2", Ap_southeast_2 - ; "ap-southeast-1", Ap_southeast_1 - ; "us-west-2", Us_west_2 - ; "us-west-1", Us_west_1 - ; "eu-west-1", Eu_west_1 - ; "EU", EU - ] - - let t_to_str = - [ Eu_central_1, "eu-central-1" - ; Cn_north_1, "cn-north-1" - ; Sa_east_1, "sa-east-1" - ; Ap_northeast_1, "ap-northeast-1" - ; Ap_southeast_2, "ap-southeast-2" - ; Ap_southeast_1, "ap-southeast-1" - ; Us_west_2, "us-west-2" - ; Us_west_1, "us-west-1" - ; Eu_west_1, "eu-west-1" - ; EU, "EU" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module LoggingEnabled = struct - type t = - { target_bucket : String.t option - ; target_grants : TargetGrants.t - ; target_prefix : String.t option - } - - let make ?target_bucket ?(target_grants = []) ?target_prefix () = - { target_bucket; target_grants; target_prefix } - - let parse xml = - Some - { target_bucket = Util.option_bind (Xml.member "TargetBucket" xml) String.parse - ; target_grants = - Util.of_option - [] - (Util.option_bind (Xml.member "TargetGrants" xml) TargetGrants.parse) - ; target_prefix = Util.option_bind (Xml.member "TargetPrefix" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.target_prefix (fun f -> - Query.Pair ("TargetPrefix", String.to_query f)) - ; Some - (Query.Pair ("TargetGrants.member", TargetGrants.to_query v.target_grants)) - ; Util.option_map v.target_bucket (fun f -> - Query.Pair ("TargetBucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.target_prefix (fun f -> "target_prefix", String.to_json f) - ; Some ("target_grants", TargetGrants.to_json v.target_grants) - ; Util.option_map v.target_bucket (fun f -> "target_bucket", String.to_json f) - ]) - - let of_json j = - { target_bucket = Util.option_map (Json.lookup j "target_bucket") String.of_json - ; target_grants = - TargetGrants.of_json (Util.of_option_exn (Json.lookup j "target_grants")) - ; target_prefix = Util.option_map (Json.lookup j "target_prefix") String.of_json - } -end - -module CompletedPartList = struct - type t = CompletedPart.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map CompletedPart.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list CompletedPart.to_query v - - let to_json v = `List (List.map CompletedPart.to_json v) - - let of_json j = Json.to_list CompletedPart.of_json j -end - -module Bucket = struct - type t = - { name : String.t - ; creation_date : DateTime.t - } - - let make ~name ~creation_date () = { name; creation_date } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; creation_date = - Xml.required - "CreationDate" - (Util.option_bind (Xml.member "CreationDate" xml) DateTime.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CreationDate", DateTime.to_query v.creation_date)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("creation_date", DateTime.to_json v.creation_date) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; creation_date = - DateTime.of_json (Util.of_option_exn (Json.lookup j "creation_date")) - } -end - -module CloudFunctionConfiguration = struct - type t = - { id : String.t option - ; event : Event.t option - ; events : EventList.t - ; cloud_function : String.t option - ; invocation_role : String.t option - } - - let make ?id ?event ?(events = []) ?cloud_function ?invocation_role () = - { id; event; events; cloud_function; invocation_role } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; event = Util.option_bind (Xml.member "Event" xml) Event.parse - ; events = Util.of_option [] (EventList.parse xml) - ; cloud_function = Util.option_bind (Xml.member "CloudFunction" xml) String.parse - ; invocation_role = Util.option_bind (Xml.member "InvocationRole" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.invocation_role (fun f -> - Query.Pair ("InvocationRole", String.to_query f)) - ; Util.option_map v.cloud_function (fun f -> - Query.Pair ("CloudFunction", String.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Util.option_map v.event (fun f -> Query.Pair ("Event", Event.to_query f)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.invocation_role (fun f -> - "invocation_role", String.to_json f) - ; Util.option_map v.cloud_function (fun f -> "cloud_function", String.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Util.option_map v.event (fun f -> "event", Event.to_json f) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; event = Util.option_map (Json.lookup j "event") Event.of_json - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; cloud_function = Util.option_map (Json.lookup j "cloud_function") String.of_json - ; invocation_role = Util.option_map (Json.lookup j "invocation_role") String.of_json - } -end - -module QueueConfigurationDeprecated = struct - type t = - { id : String.t option - ; event : Event.t option - ; events : EventList.t - ; queue : String.t option - } - - let make ?id ?event ?(events = []) ?queue () = { id; event; events; queue } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; event = Util.option_bind (Xml.member "Event" xml) Event.parse - ; events = Util.of_option [] (EventList.parse xml) - ; queue = Util.option_bind (Xml.member "Queue" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.queue (fun f -> Query.Pair ("Queue", String.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Util.option_map v.event (fun f -> Query.Pair ("Event", Event.to_query f)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.queue (fun f -> "queue", String.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Util.option_map v.event (fun f -> "event", Event.to_json f) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; event = Util.option_map (Json.lookup j "event") Event.of_json - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; queue = Util.option_map (Json.lookup j "queue") String.of_json - } -end - -module TopicConfigurationDeprecated = struct - type t = - { id : String.t option - ; events : EventList.t - ; event : Event.t option - ; topic : String.t option - } - - let make ?id ?(events = []) ?event ?topic () = { id; events; event; topic } - - let parse xml = - Some - { id = Util.option_bind (Xml.member "Id" xml) String.parse - ; events = Util.of_option [] (EventList.parse xml) - ; event = Util.option_bind (Xml.member "Event" xml) Event.parse - ; topic = Util.option_bind (Xml.member "Topic" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.topic (fun f -> Query.Pair ("Topic", String.to_query f)) - ; Util.option_map v.event (fun f -> Query.Pair ("Event", Event.to_query f)) - ; Some (Query.Pair ("Event", EventList.to_query v.events)) - ; Util.option_map v.id (fun f -> Query.Pair ("Id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.topic (fun f -> "topic", String.to_json f) - ; Util.option_map v.event (fun f -> "event", Event.to_json f) - ; Some ("events", EventList.to_json v.events) - ; Util.option_map v.id (fun f -> "id", String.to_json f) - ]) - - let of_json j = - { id = Util.option_map (Json.lookup j "id") String.of_json - ; events = EventList.of_json (Util.of_option_exn (Json.lookup j "events")) - ; event = Util.option_map (Json.lookup j "event") Event.of_json - ; topic = Util.option_map (Json.lookup j "topic") String.of_json - } -end - -module DeleteMarkerEntry = struct - type t = - { owner : Owner.t option - ; key : String.t option - ; version_id : String.t option - ; is_latest : Boolean.t option - ; last_modified : DateTime.t option - } - - let make ?owner ?key ?version_id ?is_latest ?last_modified () = - { owner; key; version_id; is_latest; last_modified } - - let parse xml = - Some - { owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; version_id = Util.option_bind (Xml.member "VersionId" xml) String.parse - ; is_latest = Util.option_bind (Xml.member "IsLatest" xml) Boolean.parse - ; last_modified = Util.option_bind (Xml.member "LastModified" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> - Query.Pair ("LastModified", DateTime.to_query f)) - ; Util.option_map v.is_latest (fun f -> - Query.Pair ("IsLatest", Boolean.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("VersionId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.is_latest (fun f -> "is_latest", Boolean.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ]) - - let of_json j = - { owner = Util.option_map (Json.lookup j "owner") Owner.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; is_latest = Util.option_map (Json.lookup j "is_latest") Boolean.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - } -end - -module ObjectVersion = struct - type t = - { e_tag : String.t option - ; size : Integer.t option - ; storage_class : ObjectVersionStorageClass.t option - ; key : String.t option - ; version_id : String.t option - ; is_latest : Boolean.t option - ; last_modified : DateTime.t option - ; owner : Owner.t option - } - - let make - ?e_tag - ?size - ?storage_class - ?key - ?version_id - ?is_latest - ?last_modified - ?owner - () = - { e_tag; size; storage_class; key; version_id; is_latest; last_modified; owner } - - let parse xml = - Some - { e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; size = Util.option_bind (Xml.member "Size" xml) Integer.parse - ; storage_class = - Util.option_bind (Xml.member "StorageClass" xml) ObjectVersionStorageClass.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; version_id = Util.option_bind (Xml.member "VersionId" xml) String.parse - ; is_latest = Util.option_bind (Xml.member "IsLatest" xml) Boolean.parse - ; last_modified = Util.option_bind (Xml.member "LastModified" xml) DateTime.parse - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Util.option_map v.last_modified (fun f -> - Query.Pair ("LastModified", DateTime.to_query f)) - ; Util.option_map v.is_latest (fun f -> - Query.Pair ("IsLatest", Boolean.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("VersionId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("StorageClass", ObjectVersionStorageClass.to_query f)) - ; Util.option_map v.size (fun f -> Query.Pair ("Size", Integer.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.is_latest (fun f -> "is_latest", Boolean.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", ObjectVersionStorageClass.to_json f) - ; Util.option_map v.size (fun f -> "size", Integer.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ]) - - let of_json j = - { e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; size = Util.option_map (Json.lookup j "size") Integer.of_json - ; storage_class = - Util.option_map (Json.lookup j "storage_class") ObjectVersionStorageClass.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; is_latest = Util.option_map (Json.lookup j "is_latest") Boolean.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - } -end - -module BucketVersioningStatus = struct - type t = - | Enabled - | Suspended - - let str_to_t = [ "Suspended", Suspended; "Enabled", Enabled ] - - let t_to_str = [ Suspended, "Suspended"; Enabled, "Enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module MFADelete = struct - type t = - | Enabled - | Disabled - - let str_to_t = [ "Disabled", Disabled; "Enabled", Enabled ] - - let t_to_str = [ Disabled, "Disabled"; Enabled, "Enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module Payer = struct - type t = - | Requester - | BucketOwner - - let str_to_t = [ "BucketOwner", BucketOwner; "Requester", Requester ] - - let t_to_str = [ BucketOwner, "BucketOwner"; Requester, "Requester" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DeletedObject = struct - type t = - { key : String.t option - ; version_id : String.t option - ; delete_marker : Boolean.t option - ; delete_marker_version_id : String.t option - } - - let make ?key ?version_id ?delete_marker ?delete_marker_version_id () = - { key; version_id; delete_marker; delete_marker_version_id } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; version_id = Util.option_bind (Xml.member "VersionId" xml) String.parse - ; delete_marker = Util.option_bind (Xml.member "DeleteMarker" xml) Boolean.parse - ; delete_marker_version_id = - Util.option_bind (Xml.member "DeleteMarkerVersionId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.delete_marker_version_id (fun f -> - Query.Pair ("DeleteMarkerVersionId", String.to_query f)) - ; Util.option_map v.delete_marker (fun f -> - Query.Pair ("DeleteMarker", Boolean.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("VersionId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.delete_marker_version_id (fun f -> - "delete_marker_version_id", String.to_json f) - ; Util.option_map v.delete_marker (fun f -> "delete_marker", Boolean.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; delete_marker = Util.option_map (Json.lookup j "delete_marker") Boolean.of_json - ; delete_marker_version_id = - Util.option_map (Json.lookup j "delete_marker_version_id") String.of_json - } -end - -module Error = struct - type t = - { key : String.t option - ; version_id : String.t option - ; code : String.t option - ; message : String.t option - } - - let make ?key ?version_id ?code ?message () = { key; version_id; code; message } - - let parse xml = - Some - { key = Util.option_bind (Xml.member "Key" xml) String.parse - ; version_id = Util.option_bind (Xml.member "VersionId" xml) String.parse - ; code = Util.option_bind (Xml.member "Code" xml) String.parse - ; message = Util.option_bind (Xml.member "Message" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.code (fun f -> Query.Pair ("Code", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("VersionId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.code (fun f -> "code", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ]) - - let of_json j = - { key = Util.option_map (Json.lookup j "key") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; code = Util.option_map (Json.lookup j "code") String.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module ObjectIdentifierList = struct - type t = ObjectIdentifier.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ObjectIdentifier.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ObjectIdentifier.to_query v - - let to_json v = `List (List.map ObjectIdentifier.to_json v) - - let of_json j = Json.to_list ObjectIdentifier.of_json j -end - -module Part = struct - type t = - { part_number : Integer.t option - ; last_modified : DateTime.t option - ; e_tag : String.t option - ; size : Integer.t option - } - - let make ?part_number ?last_modified ?e_tag ?size () = - { part_number; last_modified; e_tag; size } - - let parse xml = - Some - { part_number = Util.option_bind (Xml.member "PartNumber" xml) Integer.parse - ; last_modified = Util.option_bind (Xml.member "LastModified" xml) DateTime.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; size = Util.option_bind (Xml.member "Size" xml) Integer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.size (fun f -> Query.Pair ("Size", Integer.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.last_modified (fun f -> - Query.Pair ("LastModified", DateTime.to_query f)) - ; Util.option_map v.part_number (fun f -> - Query.Pair ("PartNumber", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.size (fun f -> "size", Integer.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.part_number (fun f -> "part_number", Integer.to_json f) - ]) - - let of_json j = - { part_number = Util.option_map (Json.lookup j "part_number") Integer.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; size = Util.option_map (Json.lookup j "size") Integer.of_json - } -end - -module MultipartUpload = struct - type t = - { upload_id : String.t option - ; key : String.t option - ; initiated : DateTime.t option - ; storage_class : StorageClass.t option - ; owner : Owner.t option - ; initiator : Initiator.t option - } - - let make ?upload_id ?key ?initiated ?storage_class ?owner ?initiator () = - { upload_id; key; initiated; storage_class; owner; initiator } - - let parse xml = - Some - { upload_id = Util.option_bind (Xml.member "UploadId" xml) String.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; initiated = Util.option_bind (Xml.member "Initiated" xml) DateTime.parse - ; storage_class = - Util.option_bind (Xml.member "StorageClass" xml) StorageClass.parse - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - ; initiator = Util.option_bind (Xml.member "Initiator" xml) Initiator.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.initiator (fun f -> - Query.Pair ("Initiator", Initiator.to_query f)) - ; Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("StorageClass", StorageClass.to_query f)) - ; Util.option_map v.initiated (fun f -> - Query.Pair ("Initiated", DateTime.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.upload_id (fun f -> - Query.Pair ("UploadId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.initiator (fun f -> "initiator", Initiator.to_json f) - ; Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.initiated (fun f -> "initiated", DateTime.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.upload_id (fun f -> "upload_id", String.to_json f) - ]) - - let of_json j = - { upload_id = Util.option_map (Json.lookup j "upload_id") String.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; initiated = Util.option_map (Json.lookup j "initiated") DateTime.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - ; initiator = Util.option_map (Json.lookup j "initiator") Initiator.of_json - } -end - -module TagSet = struct - type t = Tag.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) - - let to_query v = Query.to_query_list Tag.to_query v - - let to_json v = `List (List.map Tag.to_json v) - - let of_json j = Json.to_list Tag.of_json j -end - -module ErrorDocument = struct - type t = { key : String.t } - - let make ~key () = { key } - - let parse xml = - Some - { key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Key", String.to_query v.key)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("key", String.to_json v.key) ]) - - let of_json j = { key = String.of_json (Util.of_option_exn (Json.lookup j "key")) } -end - -module IndexDocument = struct - type t = { suffix : String.t } - - let make ~suffix () = { suffix } - - let parse xml = - Some - { suffix = - Xml.required "Suffix" (Util.option_bind (Xml.member "Suffix" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Suffix", String.to_query v.suffix)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("suffix", String.to_json v.suffix) ]) - - let of_json j = - { suffix = String.of_json (Util.of_option_exn (Json.lookup j "suffix")) } -end - -module RedirectAllRequestsTo = struct - type t = - { host_name : String.t - ; protocol : Protocol.t option - } - - let make ~host_name ?protocol () = { host_name; protocol } - - let parse xml = - Some - { host_name = - Xml.required - "HostName" - (Util.option_bind (Xml.member "HostName" xml) String.parse) - ; protocol = Util.option_bind (Xml.member "Protocol" xml) Protocol.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.protocol (fun f -> - Query.Pair ("Protocol", Protocol.to_query f)) - ; Some (Query.Pair ("HostName", String.to_query v.host_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.protocol (fun f -> "protocol", Protocol.to_json f) - ; Some ("host_name", String.to_json v.host_name) - ]) - - let of_json j = - { host_name = String.of_json (Util.of_option_exn (Json.lookup j "host_name")) - ; protocol = Util.option_map (Json.lookup j "protocol") Protocol.of_json - } -end - -module RoutingRules = struct - type t = RoutingRule.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map RoutingRule.parse (Xml.members "RoutingRule" xml)) - - let to_query v = Query.to_query_list RoutingRule.to_query v - - let to_json v = `List (List.map RoutingRule.to_json v) - - let of_json j = Json.to_list RoutingRule.of_json j -end - -module LambdaFunctionConfigurationList = struct - type t = LambdaFunctionConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map LambdaFunctionConfiguration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list LambdaFunctionConfiguration.to_query v - - let to_json v = `List (List.map LambdaFunctionConfiguration.to_json v) - - let of_json j = Json.to_list LambdaFunctionConfiguration.of_json j -end - -module QueueConfigurationList = struct - type t = QueueConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map QueueConfiguration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list QueueConfiguration.to_query v - - let to_json v = `List (List.map QueueConfiguration.to_json v) - - let of_json j = Json.to_list QueueConfiguration.of_json j -end - -module TopicConfigurationList = struct - type t = TopicConfiguration.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map TopicConfiguration.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list TopicConfiguration.to_query v - - let to_json v = `List (List.map TopicConfiguration.to_json v) - - let of_json j = Json.to_list TopicConfiguration.of_json j -end - -module CORSRules = struct - type t = CORSRule.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map CORSRule.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list CORSRule.to_query v - - let to_json v = `List (List.map CORSRule.to_json v) - - let of_json j = Json.to_list CORSRule.of_json j -end - -module RequestPayer = struct - type t = Requester - - let str_to_t = [ "requester", Requester ] - - let t_to_str = [ Requester, "requester" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module RequestCharged = struct - type t = Requester - - let str_to_t = [ "requester", Requester ] - - let t_to_str = [ Requester, "requester" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ServerSideEncryption = struct - type t = - | AES256 - | Aws_kms - - let str_to_t = [ "aws:kms", Aws_kms; "AES256", AES256 ] - - let t_to_str = [ Aws_kms, "aws:kms"; AES256, "AES256" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ReplicationConfiguration = struct - type t = - { role : String.t - ; rules : ReplicationRules.t - } - - let make ~role ~rules () = { role; rules } - - let parse xml = - Some - { role = Xml.required "Role" (Util.option_bind (Xml.member "Role" xml) String.parse) - ; rules = Xml.required "Rule" (ReplicationRules.parse xml) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Rule", ReplicationRules.to_query v.rules)) - ; Some (Query.Pair ("Role", String.to_query v.role)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("rules", ReplicationRules.to_json v.rules) - ; Some ("role", String.to_json v.role) - ]) - - let of_json j = - { role = String.of_json (Util.of_option_exn (Json.lookup j "role")) - ; rules = ReplicationRules.of_json (Util.of_option_exn (Json.lookup j "rules")) - } -end - -module CommonPrefixList = struct - type t = CommonPrefix.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map CommonPrefix.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list CommonPrefix.to_query v - - let to_json v = `List (List.map CommonPrefix.to_json v) - - let of_json j = Json.to_list CommonPrefix.of_json j -end - -module EncodingType = struct - type t = Url - - let str_to_t = [ "url", Url ] - - let t_to_str = [ Url, "url" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module ObjectList = struct - type t = Object.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Object.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Object.to_query v - - let to_json v = `List (List.map Object.to_json v) - - let of_json j = Json.to_list Object.of_json j -end - -module Metadata = struct - type t = (String.t, String.t) Hashtbl.t - - let make elems () = elems - - let parse xml = None - - let to_query v = Query.to_query_hashtbl String.to_string String.to_query v - - let to_json v = - `Assoc - (Hashtbl.fold (fun k v acc -> (String.to_string k, String.to_json v) :: acc) v []) - - let of_json j = Json.to_hashtbl String.of_string String.of_json j -end - -module ReplicationStatus = struct - type t = - | COMPLETE - | PENDING - | FAILED - | REPLICA - - let str_to_t = - [ "REPLICA", REPLICA; "FAILED", FAILED; "PENDING", PENDING; "COMPLETE", COMPLETE ] - - let t_to_str = - [ REPLICA, "REPLICA"; FAILED, "FAILED"; PENDING, "PENDING"; COMPLETE, "COMPLETE" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module LifecycleConfiguration = struct - type t = { rules : Rules.t } - - let make ~rules () = { rules } - - let parse xml = Some { rules = Xml.required "Rule" (Rules.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Rule", Rules.to_query v.rules)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("rules", Rules.to_json v.rules) ]) - - let of_json j = { rules = Rules.of_json (Util.of_option_exn (Json.lookup j "rules")) } -end - -module AccessControlPolicy = struct - type t = - { grants : Grants.t - ; owner : Owner.t option - } - - let make ?(grants = []) ?owner () = { grants; owner } - - let parse xml = - Some - { grants = - Util.of_option - [] - (Util.option_bind (Xml.member "AccessControlList" xml) Grants.parse) - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Some (Query.Pair ("AccessControlList", Grants.to_query v.grants)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Some ("grants", Grants.to_json v.grants) - ]) - - let of_json j = - { grants = Grants.of_json (Util.of_option_exn (Json.lookup j "grants")) - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - } -end - -module ObjectCannedACL = struct - type t = - | Private - | Public_read - | Public_read_write - | Authenticated_read - | Bucket_owner_read - | Bucket_owner_full_control - - let str_to_t = - [ "bucket-owner-full-control", Bucket_owner_full_control - ; "bucket-owner-read", Bucket_owner_read - ; "authenticated-read", Authenticated_read - ; "public-read-write", Public_read_write - ; "public-read", Public_read - ; "private", Private - ] - - let t_to_str = - [ Bucket_owner_full_control, "bucket-owner-full-control" - ; Bucket_owner_read, "bucket-owner-read" - ; Authenticated_read, "authenticated-read" - ; Public_read_write, "public-read-write" - ; Public_read, "public-read" - ; Private, "private" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module BucketCannedACL = struct - type t = - | Private - | Public_read - | Public_read_write - | Authenticated_read - - let str_to_t = - [ "authenticated-read", Authenticated_read - ; "public-read-write", Public_read_write - ; "public-read", Public_read - ; "private", Private - ] - - let t_to_str = - [ Authenticated_read, "authenticated-read" - ; Public_read_write, "public-read-write" - ; Public_read, "public-read" - ; Private, "private" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module CreateBucketConfiguration = struct - type t = { location_constraint : BucketLocationConstraint.t option } - - let make ?location_constraint () = { location_constraint } - - let parse xml = - Some - { location_constraint = - Util.option_bind - (Xml.member "LocationConstraint" xml) - BucketLocationConstraint.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.location_constraint (fun f -> - Query.Pair ("LocationConstraint", BucketLocationConstraint.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.location_constraint (fun f -> - "location_constraint", BucketLocationConstraint.to_json f) - ]) - - let of_json j = - { location_constraint = - Util.option_map - (Json.lookup j "location_constraint") - BucketLocationConstraint.of_json - } -end - -module BucketLoggingStatus = struct - type t = { logging_enabled : LoggingEnabled.t option } - - let make ?logging_enabled () = { logging_enabled } - - let parse xml = - Some - { logging_enabled = - Util.option_bind (Xml.member "LoggingEnabled" xml) LoggingEnabled.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.logging_enabled (fun f -> - Query.Pair ("LoggingEnabled", LoggingEnabled.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.logging_enabled (fun f -> - "logging_enabled", LoggingEnabled.to_json f) - ]) - - let of_json j = - { logging_enabled = - Util.option_map (Json.lookup j "logging_enabled") LoggingEnabled.of_json - } -end - -module CompletedMultipartUpload = struct - type t = { parts : CompletedPartList.t } - - let make ?(parts = []) () = { parts } - - let parse xml = Some { parts = Util.of_option [] (CompletedPartList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Part", CompletedPartList.to_query v.parts)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("parts", CompletedPartList.to_json v.parts) ]) - - let of_json j = - { parts = CompletedPartList.of_json (Util.of_option_exn (Json.lookup j "parts")) } -end - -module Buckets = struct - type t = Bucket.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Bucket.parse (Xml.members "Bucket" xml)) - - let to_query v = Query.to_query_list Bucket.to_query v - - let to_json v = `List (List.map Bucket.to_json v) - - let of_json j = Json.to_list Bucket.of_json j -end - -module RestoreRequest = struct - type t = { days : Integer.t } - - let make ~days () = { days } - - let parse xml = - Some - { days = - Xml.required "Days" (Util.option_bind (Xml.member "Days" xml) Integer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Days", Integer.to_query v.days)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("days", Integer.to_json v.days) ]) - - let of_json j = { days = Integer.of_json (Util.of_option_exn (Json.lookup j "days")) } -end - -module NotificationConfigurationDeprecated = struct - type t = - { topic_configuration : TopicConfigurationDeprecated.t option - ; queue_configuration : QueueConfigurationDeprecated.t option - ; cloud_function_configuration : CloudFunctionConfiguration.t option - } - - let make ?topic_configuration ?queue_configuration ?cloud_function_configuration () = - { topic_configuration; queue_configuration; cloud_function_configuration } - - let parse xml = - Some - { topic_configuration = - Util.option_bind - (Xml.member "TopicConfiguration" xml) - TopicConfigurationDeprecated.parse - ; queue_configuration = - Util.option_bind - (Xml.member "QueueConfiguration" xml) - QueueConfigurationDeprecated.parse - ; cloud_function_configuration = - Util.option_bind - (Xml.member "CloudFunctionConfiguration" xml) - CloudFunctionConfiguration.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.cloud_function_configuration (fun f -> - Query.Pair - ("CloudFunctionConfiguration", CloudFunctionConfiguration.to_query f)) - ; Util.option_map v.queue_configuration (fun f -> - Query.Pair ("QueueConfiguration", QueueConfigurationDeprecated.to_query f)) - ; Util.option_map v.topic_configuration (fun f -> - Query.Pair ("TopicConfiguration", TopicConfigurationDeprecated.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.cloud_function_configuration (fun f -> - "cloud_function_configuration", CloudFunctionConfiguration.to_json f) - ; Util.option_map v.queue_configuration (fun f -> - "queue_configuration", QueueConfigurationDeprecated.to_json f) - ; Util.option_map v.topic_configuration (fun f -> - "topic_configuration", TopicConfigurationDeprecated.to_json f) - ]) - - let of_json j = - { topic_configuration = - Util.option_map - (Json.lookup j "topic_configuration") - TopicConfigurationDeprecated.of_json - ; queue_configuration = - Util.option_map - (Json.lookup j "queue_configuration") - QueueConfigurationDeprecated.of_json - ; cloud_function_configuration = - Util.option_map - (Json.lookup j "cloud_function_configuration") - CloudFunctionConfiguration.of_json - } -end - -module DeleteMarkers = struct - type t = DeleteMarkerEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DeleteMarkerEntry.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list DeleteMarkerEntry.to_query v - - let to_json v = `List (List.map DeleteMarkerEntry.to_json v) - - let of_json j = Json.to_list DeleteMarkerEntry.of_json j -end - -module ObjectVersionList = struct - type t = ObjectVersion.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ObjectVersion.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list ObjectVersion.to_query v - - let to_json v = `List (List.map ObjectVersion.to_json v) - - let of_json j = Json.to_list ObjectVersion.of_json j -end - -module VersioningConfiguration = struct - type t = - { m_f_a_delete : MFADelete.t option - ; status : BucketVersioningStatus.t option - } - - let make ?m_f_a_delete ?status () = { m_f_a_delete; status } - - let parse xml = - Some - { m_f_a_delete = Util.option_bind (Xml.member "MfaDelete" xml) MFADelete.parse - ; status = Util.option_bind (Xml.member "Status" xml) BucketVersioningStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> - Query.Pair ("Status", BucketVersioningStatus.to_query f)) - ; Util.option_map v.m_f_a_delete (fun f -> - Query.Pair ("MfaDelete", MFADelete.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", BucketVersioningStatus.to_json f) - ; Util.option_map v.m_f_a_delete (fun f -> "m_f_a_delete", MFADelete.to_json f) - ]) - - let of_json j = - { m_f_a_delete = Util.option_map (Json.lookup j "m_f_a_delete") MFADelete.of_json - ; status = Util.option_map (Json.lookup j "status") BucketVersioningStatus.of_json - } -end - -module RequestPaymentConfiguration = struct - type t = { payer : Payer.t } - - let make ~payer () = { payer } - - let parse xml = - Some - { payer = - Xml.required "Payer" (Util.option_bind (Xml.member "Payer" xml) Payer.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Payer", Payer.to_query v.payer)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("payer", Payer.to_json v.payer) ]) - - let of_json j = { payer = Payer.of_json (Util.of_option_exn (Json.lookup j "payer")) } -end - -module DeletedObjects = struct - type t = DeletedObject.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DeletedObject.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list DeletedObject.to_query v - - let to_json v = `List (List.map DeletedObject.to_json v) - - let of_json j = Json.to_list DeletedObject.of_json j -end - -module Errors = struct - type t = Error.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Error.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Error.to_query v - - let to_json v = `List (List.map Error.to_json v) - - let of_json j = Json.to_list Error.of_json j -end - -module CopyPartResult = struct - type t = - { e_tag : String.t option - ; last_modified : DateTime.t option - } - - let make ?e_tag ?last_modified () = { e_tag; last_modified } - - let parse xml = - Some - { e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; last_modified = Util.option_bind (Xml.member "LastModified" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> - Query.Pair ("LastModified", DateTime.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ]) - - let of_json j = - { e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - } -end - -module Delete = struct - type t = - { objects : ObjectIdentifierList.t - ; quiet : Boolean.t option - } - - let make ~objects ?quiet () = { objects; quiet } - - let parse xml = - Some - { objects = Xml.required "Object" (ObjectIdentifierList.parse xml) - ; quiet = Util.option_bind (Xml.member "Quiet" xml) Boolean.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.quiet (fun f -> Query.Pair ("Quiet", Boolean.to_query f)) - ; Some (Query.Pair ("Object", ObjectIdentifierList.to_query v.objects)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.quiet (fun f -> "quiet", Boolean.to_json f) - ; Some ("objects", ObjectIdentifierList.to_json v.objects) - ]) - - let of_json j = - { objects = - ObjectIdentifierList.of_json (Util.of_option_exn (Json.lookup j "objects")) - ; quiet = Util.option_map (Json.lookup j "quiet") Boolean.of_json - } -end - -module Parts = struct - type t = Part.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Part.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list Part.to_query v - - let to_json v = `List (List.map Part.to_json v) - - let of_json j = Json.to_list Part.of_json j -end - -module MultipartUploadList = struct - type t = MultipartUpload.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map MultipartUpload.parse (Xml.members "member" xml)) - - let to_query v = Query.to_query_list MultipartUpload.to_query v - - let to_json v = `List (List.map MultipartUpload.to_json v) - - let of_json j = Json.to_list MultipartUpload.of_json j -end - -module MFADeleteStatus = struct - type t = - | Enabled - | Disabled - - let str_to_t = [ "Disabled", Disabled; "Enabled", Enabled ] - - let t_to_str = [ Disabled, "Disabled"; Enabled, "Enabled" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module MetadataDirective = struct - type t = - | COPY - | REPLACE - - let str_to_t = [ "REPLACE", REPLACE; "COPY", COPY ] - - let t_to_str = [ REPLACE, "REPLACE"; COPY, "COPY" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module CopyObjectResult = struct - type t = - { e_tag : String.t option - ; last_modified : DateTime.t option - } - - let make ?e_tag ?last_modified () = { e_tag; last_modified } - - let parse xml = - Some - { e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; last_modified = Util.option_bind (Xml.member "LastModified" xml) DateTime.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> - Query.Pair ("LastModified", DateTime.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ]) - - let of_json j = - { e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - } -end - -module Tagging = struct - type t = { tag_set : TagSet.t } - - let make ~tag_set () = { tag_set } - - let parse xml = - Some - { tag_set = - Xml.required "TagSet" (Util.option_bind (Xml.member "TagSet" xml) TagSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet.member", TagSet.to_query v.tag_set)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("tag_set", TagSet.to_json v.tag_set) ]) - - let of_json j = - { tag_set = TagSet.of_json (Util.of_option_exn (Json.lookup j "tag_set")) } -end - -module WebsiteConfiguration = struct - type t = - { error_document : ErrorDocument.t option - ; index_document : IndexDocument.t option - ; redirect_all_requests_to : RedirectAllRequestsTo.t option - ; routing_rules : RoutingRules.t - } - - let make - ?error_document - ?index_document - ?redirect_all_requests_to - ?(routing_rules = []) - () = - { error_document; index_document; redirect_all_requests_to; routing_rules } - - let parse xml = - Some - { error_document = - Util.option_bind (Xml.member "ErrorDocument" xml) ErrorDocument.parse - ; index_document = - Util.option_bind (Xml.member "IndexDocument" xml) IndexDocument.parse - ; redirect_all_requests_to = - Util.option_bind - (Xml.member "RedirectAllRequestsTo" xml) - RedirectAllRequestsTo.parse - ; routing_rules = - Util.of_option - [] - (Util.option_bind (Xml.member "RoutingRules" xml) RoutingRules.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("RoutingRules.member", RoutingRules.to_query v.routing_rules)) - ; Util.option_map v.redirect_all_requests_to (fun f -> - Query.Pair ("RedirectAllRequestsTo", RedirectAllRequestsTo.to_query f)) - ; Util.option_map v.index_document (fun f -> - Query.Pair ("IndexDocument", IndexDocument.to_query f)) - ; Util.option_map v.error_document (fun f -> - Query.Pair ("ErrorDocument", ErrorDocument.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("routing_rules", RoutingRules.to_json v.routing_rules) - ; Util.option_map v.redirect_all_requests_to (fun f -> - "redirect_all_requests_to", RedirectAllRequestsTo.to_json f) - ; Util.option_map v.index_document (fun f -> - "index_document", IndexDocument.to_json f) - ; Util.option_map v.error_document (fun f -> - "error_document", ErrorDocument.to_json f) - ]) - - let of_json j = - { error_document = - Util.option_map (Json.lookup j "error_document") ErrorDocument.of_json - ; index_document = - Util.option_map (Json.lookup j "index_document") IndexDocument.of_json - ; redirect_all_requests_to = - Util.option_map - (Json.lookup j "redirect_all_requests_to") - RedirectAllRequestsTo.of_json - ; routing_rules = - RoutingRules.of_json (Util.of_option_exn (Json.lookup j "routing_rules")) - } -end - -module NotificationConfiguration = struct - type t = - { topic_configurations : TopicConfigurationList.t - ; queue_configurations : QueueConfigurationList.t - ; lambda_function_configurations : LambdaFunctionConfigurationList.t - } - - let make - ?(topic_configurations = []) - ?(queue_configurations = []) - ?(lambda_function_configurations = []) - () = - { topic_configurations; queue_configurations; lambda_function_configurations } - - let parse xml = - Some - { topic_configurations = Util.of_option [] (TopicConfigurationList.parse xml) - ; queue_configurations = Util.of_option [] (QueueConfigurationList.parse xml) - ; lambda_function_configurations = - Util.of_option [] (LambdaFunctionConfigurationList.parse xml) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> Query.Pair ("LastModified", (DateTime.to_query f))); + Util.option_map v.is_latest + (fun f -> Query.Pair ("IsLatest", (Boolean.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("VersionId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.is_latest + (fun f -> ("is_latest", (Boolean.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f)))]) + let of_json j = + { + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + is_latest = + (Util.option_map (Json.lookup j "is_latest") Boolean.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json) + } + end +module ObjectVersion = + struct + type t = + { + e_tag: String.t option ; + size: Integer.t option ; + storage_class: ObjectVersionStorageClass.t option ; + key: String.t option ; + version_id: String.t option ; + is_latest: Boolean.t option ; + last_modified: DateTime.t option ; + owner: Owner.t option } + let make ?e_tag ?size ?storage_class ?key ?version_id ?is_latest + ?last_modified ?owner () = + { + e_tag; + size; + storage_class; + key; + version_id; + is_latest; + last_modified; + owner + } + let parse xml = + Some + { + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + size = (Util.option_bind (Xml.member "Size" xml) Integer.parse); + storage_class = + (Util.option_bind (Xml.member "StorageClass" xml) + ObjectVersionStorageClass.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "VersionId" xml) String.parse); + is_latest = + (Util.option_bind (Xml.member "IsLatest" xml) Boolean.parse); + last_modified = + (Util.option_bind (Xml.member "LastModified" xml) DateTime.parse); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Util.option_map v.last_modified + (fun f -> Query.Pair ("LastModified", (DateTime.to_query f))); + Util.option_map v.is_latest + (fun f -> Query.Pair ("IsLatest", (Boolean.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("VersionId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair + ("StorageClass", (ObjectVersionStorageClass.to_query f))); + Util.option_map v.size + (fun f -> Query.Pair ("Size", (Integer.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.is_latest + (fun f -> ("is_latest", (Boolean.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.storage_class + (fun f -> + ("storage_class", (ObjectVersionStorageClass.to_json f))); + Util.option_map v.size (fun f -> ("size", (Integer.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f)))]) + let of_json j = + { + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + size = (Util.option_map (Json.lookup j "size") Integer.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + ObjectVersionStorageClass.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + is_latest = + (Util.option_map (Json.lookup j "is_latest") Boolean.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json) + } + end +module BucketVersioningStatus = + struct + type t = + | Enabled + | Suspended + let str_to_t = [("Suspended", Suspended); ("Enabled", Enabled)] + let t_to_str = [(Suspended, "Suspended"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MFADelete = + struct + type t = + | Enabled + | Disabled + let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] + let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module Payer = + struct + type t = + | Requester + | BucketOwner + let str_to_t = [("BucketOwner", BucketOwner); ("Requester", Requester)] + let t_to_str = [(BucketOwner, "BucketOwner"); (Requester, "Requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DeletedObject = + struct + type t = + { + key: String.t option ; + version_id: String.t option ; + delete_marker: Boolean.t option ; + delete_marker_version_id: String.t option } + let make ?key ?version_id ?delete_marker ?delete_marker_version_id () + = { key; version_id; delete_marker; delete_marker_version_id } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "VersionId" xml) String.parse); + delete_marker = + (Util.option_bind (Xml.member "DeleteMarker" xml) Boolean.parse); + delete_marker_version_id = + (Util.option_bind (Xml.member "DeleteMarkerVersionId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.delete_marker_version_id + (fun f -> + Query.Pair ("DeleteMarkerVersionId", (String.to_query f))); + Util.option_map v.delete_marker + (fun f -> Query.Pair ("DeleteMarker", (Boolean.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("VersionId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.delete_marker_version_id + (fun f -> ("delete_marker_version_id", (String.to_json f))); + Util.option_map v.delete_marker + (fun f -> ("delete_marker", (Boolean.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + delete_marker = + (Util.option_map (Json.lookup j "delete_marker") Boolean.of_json); + delete_marker_version_id = + (Util.option_map (Json.lookup j "delete_marker_version_id") + String.of_json) + } + end +module Error = + struct + type t = + { + key: String.t option ; + version_id: String.t option ; + code: String.t option ; + message: String.t option } + let make ?key ?version_id ?code ?message () = + { key; version_id; code; message } + let parse xml = + Some + { + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "VersionId" xml) String.parse); + code = (Util.option_bind (Xml.member "Code" xml) String.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.code + (fun f -> Query.Pair ("Code", (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("VersionId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.code (fun f -> ("code", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f)))]) + let of_json j = + { + key = (Util.option_map (Json.lookup j "key") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + code = (Util.option_map (Json.lookup j "code") String.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ObjectIdentifierList = + struct + type t = ObjectIdentifier.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ObjectIdentifier.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ObjectIdentifier.to_query v + let to_json v = `List (List.map ObjectIdentifier.to_json v) + let of_json j = Json.to_list ObjectIdentifier.of_json j + end +module Part = + struct + type t = + { + part_number: Integer.t option ; + last_modified: DateTime.t option ; + e_tag: String.t option ; + size: Integer.t option } + let make ?part_number ?last_modified ?e_tag ?size () = + { part_number; last_modified; e_tag; size } + let parse xml = + Some + { + part_number = + (Util.option_bind (Xml.member "PartNumber" xml) Integer.parse); + last_modified = + (Util.option_bind (Xml.member "LastModified" xml) DateTime.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + size = (Util.option_bind (Xml.member "Size" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.size + (fun f -> Query.Pair ("Size", (Integer.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.last_modified + (fun f -> Query.Pair ("LastModified", (DateTime.to_query f))); + Util.option_map v.part_number + (fun f -> Query.Pair ("PartNumber", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.size (fun f -> ("size", (Integer.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.part_number + (fun f -> ("part_number", (Integer.to_json f)))]) + let of_json j = + { + part_number = + (Util.option_map (Json.lookup j "part_number") Integer.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + size = (Util.option_map (Json.lookup j "size") Integer.of_json) + } + end +module MultipartUpload = + struct + type t = + { + upload_id: String.t option ; + key: String.t option ; + initiated: DateTime.t option ; + storage_class: StorageClass.t option ; + owner: Owner.t option ; + initiator: Initiator.t option } + let make ?upload_id ?key ?initiated ?storage_class ?owner ?initiator + () = { upload_id; key; initiated; storage_class; owner; initiator } + let parse xml = + Some + { + upload_id = + (Util.option_bind (Xml.member "UploadId" xml) String.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + initiated = + (Util.option_bind (Xml.member "Initiated" xml) DateTime.parse); + storage_class = + (Util.option_bind (Xml.member "StorageClass" xml) + StorageClass.parse); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); + initiator = + (Util.option_bind (Xml.member "Initiator" xml) Initiator.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.initiator + (fun f -> Query.Pair ("Initiator", (Initiator.to_query f))); + Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Util.option_map v.storage_class + (fun f -> Query.Pair ("StorageClass", (StorageClass.to_query f))); + Util.option_map v.initiated + (fun f -> Query.Pair ("Initiated", (DateTime.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.upload_id + (fun f -> Query.Pair ("UploadId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.initiator + (fun f -> ("initiator", (Initiator.to_json f))); + Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.initiated + (fun f -> ("initiated", (DateTime.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.upload_id + (fun f -> ("upload_id", (String.to_json f)))]) + let of_json j = + { + upload_id = + (Util.option_map (Json.lookup j "upload_id") String.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + initiated = + (Util.option_map (Json.lookup j "initiated") DateTime.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json); + initiator = + (Util.option_map (Json.lookup j "initiator") Initiator.of_json) + } + end +module TagSet = + struct + type t = Tag.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Tag.parse (Xml.members "Tag" xml)) + let to_query v = Query.to_query_list Tag.to_query v + let to_json v = `List (List.map Tag.to_json v) + let of_json j = Json.to_list Tag.of_json j + end +module ErrorDocument = + struct + type t = { + key: String.t } + let make ~key () = { key } + let parse xml = + Some + { + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Key", (String.to_query v.key)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("key", (String.to_json v.key))]) + let of_json j = + { key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))) } + end +module IndexDocument = + struct + type t = { + suffix: String.t } + let make ~suffix () = { suffix } + let parse xml = + Some + { + suffix = + (Xml.required "Suffix" + (Util.option_bind (Xml.member "Suffix" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Suffix", (String.to_query v.suffix)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("suffix", (String.to_json v.suffix))]) + let of_json j = + { + suffix = + (String.of_json (Util.of_option_exn (Json.lookup j "suffix"))) + } + end +module RedirectAllRequestsTo = + struct + type t = { + host_name: String.t ; + protocol: Protocol.t option } + let make ~host_name ?protocol () = { host_name; protocol } + let parse xml = + Some + { + host_name = + (Xml.required "HostName" + (Util.option_bind (Xml.member "HostName" xml) String.parse)); + protocol = + (Util.option_bind (Xml.member "Protocol" xml) Protocol.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.protocol + (fun f -> Query.Pair ("Protocol", (Protocol.to_query f))); + Some (Query.Pair ("HostName", (String.to_query v.host_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.protocol + (fun f -> ("protocol", (Protocol.to_json f))); + Some ("host_name", (String.to_json v.host_name))]) + let of_json j = + { + host_name = + (String.of_json (Util.of_option_exn (Json.lookup j "host_name"))); + protocol = + (Util.option_map (Json.lookup j "protocol") Protocol.of_json) + } + end +module RoutingRules = + struct + type t = RoutingRule.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map RoutingRule.parse (Xml.members "RoutingRule" xml)) + let to_query v = Query.to_query_list RoutingRule.to_query v + let to_json v = `List (List.map RoutingRule.to_json v) + let of_json j = Json.to_list RoutingRule.of_json j + end +module LambdaFunctionConfigurationList = + struct + type t = LambdaFunctionConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map LambdaFunctionConfiguration.parse + (Xml.members "member" xml)) + let to_query v = + Query.to_query_list LambdaFunctionConfiguration.to_query v + let to_json v = `List (List.map LambdaFunctionConfiguration.to_json v) + let of_json j = Json.to_list LambdaFunctionConfiguration.of_json j + end +module QueueConfigurationList = + struct + type t = QueueConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map QueueConfiguration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list QueueConfiguration.to_query v + let to_json v = `List (List.map QueueConfiguration.to_json v) + let of_json j = Json.to_list QueueConfiguration.of_json j + end +module TopicConfigurationList = + struct + type t = TopicConfiguration.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map TopicConfiguration.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list TopicConfiguration.to_query v + let to_json v = `List (List.map TopicConfiguration.to_json v) + let of_json j = Json.to_list TopicConfiguration.of_json j + end +module CORSRules = + struct + type t = CORSRule.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map CORSRule.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list CORSRule.to_query v + let to_json v = `List (List.map CORSRule.to_json v) + let of_json j = Json.to_list CORSRule.of_json j + end +module RequestPayer = + struct + type t = + | Requester + let str_to_t = [("requester", Requester)] + let t_to_str = [(Requester, "requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module RequestCharged = + struct + type t = + | Requester + let str_to_t = [("requester", Requester)] + let t_to_str = [(Requester, "requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ServerSideEncryption = + struct + type t = + | AES256 + | Aws_kms + let str_to_t = [("aws:kms", Aws_kms); ("AES256", AES256)] + let t_to_str = [(Aws_kms, "aws:kms"); (AES256, "AES256")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ReplicationConfiguration = + struct + type t = { + role: String.t ; + rules: ReplicationRules.t } + let make ~role ~rules () = { role; rules } + let parse xml = + Some + { + role = + (Xml.required "Role" + (Util.option_bind (Xml.member "Role" xml) String.parse)); + rules = (Xml.required "Rule" (ReplicationRules.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Rule", (ReplicationRules.to_query v.rules))); + Some (Query.Pair ("Role", (String.to_query v.role)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("rules", (ReplicationRules.to_json v.rules)); + Some ("role", (String.to_json v.role))]) + let of_json j = + { + role = (String.of_json (Util.of_option_exn (Json.lookup j "role"))); + rules = + (ReplicationRules.of_json + (Util.of_option_exn (Json.lookup j "rules"))) + } + end +module CommonPrefixList = + struct + type t = CommonPrefix.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CommonPrefix.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list CommonPrefix.to_query v + let to_json v = `List (List.map CommonPrefix.to_json v) + let of_json j = Json.to_list CommonPrefix.of_json j + end +module EncodingType = + struct + type t = + | Url + let str_to_t = [("url", Url)] + let t_to_str = [(Url, "url")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module ObjectList = + struct + type t = Object.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Object.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Object.to_query v + let to_json v = `List (List.map Object.to_json v) + let of_json j = Json.to_list Object.of_json j + end +module Metadata = + struct + type t = (String.t, String.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl String.to_string String.to_query v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> ((String.to_string k), (String.to_json v)) :: acc) + v []) + let of_json j = Json.to_hashtbl String.of_string String.of_json j + end +module ReplicationStatus = + struct + type t = + | COMPLETE + | PENDING + | FAILED + | REPLICA + let str_to_t = + [("REPLICA", REPLICA); + ("FAILED", FAILED); + ("PENDING", PENDING); + ("COMPLETE", COMPLETE)] + let t_to_str = + [(REPLICA, "REPLICA"); + (FAILED, "FAILED"); + (PENDING, "PENDING"); + (COMPLETE, "COMPLETE")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module LifecycleConfiguration = + struct + type t = { + rules: Rules.t } + let make ~rules () = { rules } + let parse xml = Some { rules = (Xml.required "Rule" (Rules.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Rule", (Rules.to_query v.rules)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("rules", (Rules.to_json v.rules))]) + let of_json j = + { rules = (Rules.of_json (Util.of_option_exn (Json.lookup j "rules"))) + } + end +module AccessControlPolicy = + struct + type t = { + grants: Grants.t ; + owner: Owner.t option } + let make ?(grants= []) ?owner () = { grants; owner } + let parse xml = + Some + { + grants = + (Util.of_option [] + (Util.option_bind (Xml.member "AccessControlList" xml) + Grants.parse)); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Some + (Query.Pair ("AccessControlList", (Grants.to_query v.grants)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Some ("grants", (Grants.to_json v.grants))]) + let of_json j = + { + grants = + (Grants.of_json (Util.of_option_exn (Json.lookup j "grants"))); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json) + } + end +module ObjectCannedACL = + struct + type t = + | Private + | Public_read + | Public_read_write + | Authenticated_read + | Bucket_owner_read + | Bucket_owner_full_control + let str_to_t = + [("bucket-owner-full-control", Bucket_owner_full_control); + ("bucket-owner-read", Bucket_owner_read); + ("authenticated-read", Authenticated_read); + ("public-read-write", Public_read_write); + ("public-read", Public_read); + ("private", Private)] + let t_to_str = + [(Bucket_owner_full_control, "bucket-owner-full-control"); + (Bucket_owner_read, "bucket-owner-read"); + (Authenticated_read, "authenticated-read"); + (Public_read_write, "public-read-write"); + (Public_read, "public-read"); + (Private, "private")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module BucketCannedACL = + struct + type t = + | Private + | Public_read + | Public_read_write + | Authenticated_read + let str_to_t = + [("authenticated-read", Authenticated_read); + ("public-read-write", Public_read_write); + ("public-read", Public_read); + ("private", Private)] + let t_to_str = + [(Authenticated_read, "authenticated-read"); + (Public_read_write, "public-read-write"); + (Public_read, "public-read"); + (Private, "private")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module CreateBucketConfiguration = + struct + type t = { + location_constraint: BucketLocationConstraint.t option } + let make ?location_constraint () = { location_constraint } + let parse xml = + Some + { + location_constraint = + (Util.option_bind (Xml.member "LocationConstraint" xml) + BucketLocationConstraint.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.location_constraint + (fun f -> + Query.Pair + ("LocationConstraint", + (BucketLocationConstraint.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.location_constraint + (fun f -> + ("location_constraint", + (BucketLocationConstraint.to_json f)))]) + let of_json j = + { + location_constraint = + (Util.option_map (Json.lookup j "location_constraint") + BucketLocationConstraint.of_json) + } + end +module BucketLoggingStatus = + struct + type t = { + logging_enabled: LoggingEnabled.t option } + let make ?logging_enabled () = { logging_enabled } + let parse xml = + Some + { + logging_enabled = + (Util.option_bind (Xml.member "LoggingEnabled" xml) + LoggingEnabled.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.logging_enabled + (fun f -> + Query.Pair ("LoggingEnabled", (LoggingEnabled.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.logging_enabled + (fun f -> ("logging_enabled", (LoggingEnabled.to_json f)))]) + let of_json j = + { + logging_enabled = + (Util.option_map (Json.lookup j "logging_enabled") + LoggingEnabled.of_json) + } + end +module CompletedMultipartUpload = + struct + type t = { + parts: CompletedPartList.t } + let make ?(parts= []) () = { parts } + let parse xml = + Some { parts = (Util.of_option [] (CompletedPartList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Part", (CompletedPartList.to_query v.parts)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("parts", (CompletedPartList.to_json v.parts))]) + let of_json j = + { + parts = + (CompletedPartList.of_json + (Util.of_option_exn (Json.lookup j "parts"))) + } + end +module Buckets = + struct + type t = Bucket.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Bucket.parse (Xml.members "Bucket" xml)) + let to_query v = Query.to_query_list Bucket.to_query v + let to_json v = `List (List.map Bucket.to_json v) + let of_json j = Json.to_list Bucket.of_json j + end +module RestoreRequest = + struct + type t = { + days: Integer.t } + let make ~days () = { days } + let parse xml = + Some + { + days = + (Xml.required "Days" + (Util.option_bind (Xml.member "Days" xml) Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Days", (Integer.to_query v.days)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("days", (Integer.to_json v.days))]) + let of_json j = + { days = (Integer.of_json (Util.of_option_exn (Json.lookup j "days"))) + } + end +module NotificationConfigurationDeprecated = + struct + type t = + { + topic_configuration: TopicConfigurationDeprecated.t option ; + queue_configuration: QueueConfigurationDeprecated.t option ; + cloud_function_configuration: CloudFunctionConfiguration.t option } + let make ?topic_configuration ?queue_configuration + ?cloud_function_configuration () = + { + topic_configuration; + queue_configuration; + cloud_function_configuration + } + let parse xml = + Some + { + topic_configuration = + (Util.option_bind (Xml.member "TopicConfiguration" xml) + TopicConfigurationDeprecated.parse); + queue_configuration = + (Util.option_bind (Xml.member "QueueConfiguration" xml) + QueueConfigurationDeprecated.parse); + cloud_function_configuration = + (Util.option_bind (Xml.member "CloudFunctionConfiguration" xml) + CloudFunctionConfiguration.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.cloud_function_configuration + (fun f -> + Query.Pair + ("CloudFunctionConfiguration", + (CloudFunctionConfiguration.to_query f))); + Util.option_map v.queue_configuration + (fun f -> + Query.Pair + ("QueueConfiguration", + (QueueConfigurationDeprecated.to_query f))); + Util.option_map v.topic_configuration + (fun f -> + Query.Pair + ("TopicConfiguration", + (TopicConfigurationDeprecated.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.cloud_function_configuration + (fun f -> + ("cloud_function_configuration", + (CloudFunctionConfiguration.to_json f))); + Util.option_map v.queue_configuration + (fun f -> + ("queue_configuration", + (QueueConfigurationDeprecated.to_json f))); + Util.option_map v.topic_configuration + (fun f -> + ("topic_configuration", + (TopicConfigurationDeprecated.to_json f)))]) + let of_json j = + { + topic_configuration = + (Util.option_map (Json.lookup j "topic_configuration") + TopicConfigurationDeprecated.of_json); + queue_configuration = + (Util.option_map (Json.lookup j "queue_configuration") + QueueConfigurationDeprecated.of_json); + cloud_function_configuration = + (Util.option_map (Json.lookup j "cloud_function_configuration") + CloudFunctionConfiguration.of_json) + } + end +module DeleteMarkers = + struct + type t = DeleteMarkerEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeleteMarkerEntry.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list DeleteMarkerEntry.to_query v + let to_json v = `List (List.map DeleteMarkerEntry.to_json v) + let of_json j = Json.to_list DeleteMarkerEntry.of_json j + end +module ObjectVersionList = + struct + type t = ObjectVersion.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ObjectVersion.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list ObjectVersion.to_query v + let to_json v = `List (List.map ObjectVersion.to_json v) + let of_json j = Json.to_list ObjectVersion.of_json j + end +module VersioningConfiguration = + struct + type t = + { + m_f_a_delete: MFADelete.t option ; + status: BucketVersioningStatus.t option } + let make ?m_f_a_delete ?status () = { m_f_a_delete; status } + let parse xml = + Some + { + m_f_a_delete = + (Util.option_bind (Xml.member "MfaDelete" xml) MFADelete.parse); + status = + (Util.option_bind (Xml.member "Status" xml) + BucketVersioningStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> + Query.Pair ("Status", (BucketVersioningStatus.to_query f))); + Util.option_map v.m_f_a_delete + (fun f -> Query.Pair ("MfaDelete", (MFADelete.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (BucketVersioningStatus.to_json f))); + Util.option_map v.m_f_a_delete + (fun f -> ("m_f_a_delete", (MFADelete.to_json f)))]) + let of_json j = + { + m_f_a_delete = + (Util.option_map (Json.lookup j "m_f_a_delete") MFADelete.of_json); + status = + (Util.option_map (Json.lookup j "status") + BucketVersioningStatus.of_json) + } + end +module RequestPaymentConfiguration = + struct + type t = { + payer: Payer.t } + let make ~payer () = { payer } + let parse xml = + Some + { + payer = + (Xml.required "Payer" + (Util.option_bind (Xml.member "Payer" xml) Payer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Payer", (Payer.to_query v.payer)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("payer", (Payer.to_json v.payer))]) + let of_json j = + { payer = (Payer.of_json (Util.of_option_exn (Json.lookup j "payer"))) + } + end +module DeletedObjects = + struct + type t = DeletedObject.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeletedObject.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list DeletedObject.to_query v + let to_json v = `List (List.map DeletedObject.to_json v) + let of_json j = Json.to_list DeletedObject.of_json j + end +module Errors = + struct + type t = Error.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Error.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Error.to_query v + let to_json v = `List (List.map Error.to_json v) + let of_json j = Json.to_list Error.of_json j + end +module CopyPartResult = + struct + type t = { + e_tag: String.t option ; + last_modified: DateTime.t option } + let make ?e_tag ?last_modified () = { e_tag; last_modified } + let parse xml = + Some + { + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + last_modified = + (Util.option_bind (Xml.member "LastModified" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> Query.Pair ("LastModified", (DateTime.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f)))]) + let of_json j = + { + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json) + } + end +module Delete = + struct + type t = { + objects: ObjectIdentifierList.t ; + quiet: Boolean.t option } + let make ~objects ?quiet () = { objects; quiet } + let parse xml = + Some + { + objects = (Xml.required "Object" (ObjectIdentifierList.parse xml)); + quiet = (Util.option_bind (Xml.member "Quiet" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.quiet + (fun f -> Query.Pair ("Quiet", (Boolean.to_query f))); + Some (Query.Pair - ( "CloudFunctionConfiguration" - , LambdaFunctionConfigurationList.to_query - v.lambda_function_configurations )) - ; Some + ("Object", (ObjectIdentifierList.to_query v.objects)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.quiet (fun f -> ("quiet", (Boolean.to_json f))); + Some ("objects", (ObjectIdentifierList.to_json v.objects))]) + let of_json j = + { + objects = + (ObjectIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "objects"))); + quiet = (Util.option_map (Json.lookup j "quiet") Boolean.of_json) + } + end +module Parts = + struct + type t = Part.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Part.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list Part.to_query v + let to_json v = `List (List.map Part.to_json v) + let of_json j = Json.to_list Part.of_json j + end +module MultipartUploadList = + struct + type t = MultipartUpload.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map MultipartUpload.parse (Xml.members "member" xml)) + let to_query v = Query.to_query_list MultipartUpload.to_query v + let to_json v = `List (List.map MultipartUpload.to_json v) + let of_json j = Json.to_list MultipartUpload.of_json j + end +module MFADeleteStatus = + struct + type t = + | Enabled + | Disabled + let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] + let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MetadataDirective = + struct + type t = + | COPY + | REPLACE + let str_to_t = [("REPLACE", REPLACE); ("COPY", COPY)] + let t_to_str = [(REPLACE, "REPLACE"); (COPY, "COPY")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module CopyObjectResult = + struct + type t = { + e_tag: String.t option ; + last_modified: DateTime.t option } + let make ?e_tag ?last_modified () = { e_tag; last_modified } + let parse xml = + Some + { + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + last_modified = + (Util.option_bind (Xml.member "LastModified" xml) DateTime.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> Query.Pair ("LastModified", (DateTime.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f)))]) + let of_json j = + { + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json) + } + end +module Tagging = + struct + type t = { + tag_set: TagSet.t } + let make ~tag_set () = { tag_set } + let parse xml = + Some + { + tag_set = + (Xml.required "TagSet" + (Util.option_bind (Xml.member "TagSet" xml) TagSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet.member", (TagSet.to_query v.tag_set)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("tag_set", (TagSet.to_json v.tag_set))]) + let of_json j = + { + tag_set = + (TagSet.of_json (Util.of_option_exn (Json.lookup j "tag_set"))) + } + end +module WebsiteConfiguration = + struct + type t = + { + error_document: ErrorDocument.t option ; + index_document: IndexDocument.t option ; + redirect_all_requests_to: RedirectAllRequestsTo.t option ; + routing_rules: RoutingRules.t } + let make ?error_document ?index_document ?redirect_all_requests_to + ?(routing_rules= []) () = + { + error_document; + index_document; + redirect_all_requests_to; + routing_rules + } + let parse xml = + Some + { + error_document = + (Util.option_bind (Xml.member "ErrorDocument" xml) + ErrorDocument.parse); + index_document = + (Util.option_bind (Xml.member "IndexDocument" xml) + IndexDocument.parse); + redirect_all_requests_to = + (Util.option_bind (Xml.member "RedirectAllRequestsTo" xml) + RedirectAllRequestsTo.parse); + routing_rules = + (Util.of_option [] + (Util.option_bind (Xml.member "RoutingRules" xml) + RoutingRules.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RoutingRules.member", + (RoutingRules.to_query v.routing_rules))); + Util.option_map v.redirect_all_requests_to + (fun f -> + Query.Pair + ("RedirectAllRequestsTo", + (RedirectAllRequestsTo.to_query f))); + Util.option_map v.index_document + (fun f -> + Query.Pair ("IndexDocument", (IndexDocument.to_query f))); + Util.option_map v.error_document + (fun f -> + Query.Pair ("ErrorDocument", (ErrorDocument.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("routing_rules", (RoutingRules.to_json v.routing_rules)); + Util.option_map v.redirect_all_requests_to + (fun f -> + ("redirect_all_requests_to", + (RedirectAllRequestsTo.to_json f))); + Util.option_map v.index_document + (fun f -> ("index_document", (IndexDocument.to_json f))); + Util.option_map v.error_document + (fun f -> ("error_document", (ErrorDocument.to_json f)))]) + let of_json j = + { + error_document = + (Util.option_map (Json.lookup j "error_document") + ErrorDocument.of_json); + index_document = + (Util.option_map (Json.lookup j "index_document") + IndexDocument.of_json); + redirect_all_requests_to = + (Util.option_map (Json.lookup j "redirect_all_requests_to") + RedirectAllRequestsTo.of_json); + routing_rules = + (RoutingRules.of_json + (Util.of_option_exn (Json.lookup j "routing_rules"))) + } + end +module NotificationConfiguration = + struct + type t = + { + topic_configurations: TopicConfigurationList.t ; + queue_configurations: QueueConfigurationList.t ; + lambda_function_configurations: LambdaFunctionConfigurationList.t } + let make ?(topic_configurations= []) ?(queue_configurations= []) + ?(lambda_function_configurations= []) () = + { + topic_configurations; + queue_configurations; + lambda_function_configurations + } + let parse xml = + Some + { + topic_configurations = + (Util.of_option [] (TopicConfigurationList.parse xml)); + queue_configurations = + (Util.of_option [] (QueueConfigurationList.parse xml)); + lambda_function_configurations = + (Util.of_option [] (LambdaFunctionConfigurationList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("CloudFunctionConfiguration", + (LambdaFunctionConfigurationList.to_query + v.lambda_function_configurations))); + Some (Query.Pair - ( "QueueConfiguration" - , QueueConfigurationList.to_query v.queue_configurations )) - ; Some + ("QueueConfiguration", + (QueueConfigurationList.to_query v.queue_configurations))); + Some (Query.Pair - ( "TopicConfiguration" - , TopicConfigurationList.to_query v.topic_configurations )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "lambda_function_configurations" - , LambdaFunctionConfigurationList.to_json v.lambda_function_configurations ) - ; Some - ( "queue_configurations" - , QueueConfigurationList.to_json v.queue_configurations ) - ; Some - ( "topic_configurations" - , TopicConfigurationList.to_json v.topic_configurations ) - ]) - - let of_json j = - { topic_configurations = - TopicConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "topic_configurations")) - ; queue_configurations = - QueueConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "queue_configurations")) - ; lambda_function_configurations = - LambdaFunctionConfigurationList.of_json - (Util.of_option_exn (Json.lookup j "lambda_function_configurations")) - } -end - -module CORSConfiguration = struct - type t = { c_o_r_s_rules : CORSRules.t } - - let make ?(c_o_r_s_rules = []) () = { c_o_r_s_rules } - - let parse xml = Some { c_o_r_s_rules = Util.of_option [] (CORSRules.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CORSRule", CORSRules.to_query v.c_o_r_s_rules)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("c_o_r_s_rules", CORSRules.to_json v.c_o_r_s_rules) ]) - - let of_json j = - { c_o_r_s_rules = - CORSRules.of_json (Util.of_option_exn (Json.lookup j "c_o_r_s_rules")) - } -end - -module DeleteBucketTaggingRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetObjectTorrentRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?request_payer () = { bucket; key; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module CreateMultipartUploadOutput = struct - type t = - { bucket : String.t option - ; key : String.t option - ; upload_id : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?bucket - ?key - ?upload_id - ?server_side_encryption - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { bucket - ; key - ; upload_id - ; server_side_encryption - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { bucket = Util.option_bind (Xml.member "Bucket" xml) String.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; upload_id = Util.option_bind (Xml.member "UploadId" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.upload_id (fun f -> - Query.Pair ("UploadId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.upload_id (fun f -> "upload_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ]) - - let of_json j = - { bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; upload_id = Util.option_map (Json.lookup j "upload_id") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module GetBucketLoggingRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetBucketReplicationOutput = struct - type t = { replication_configuration : ReplicationConfiguration.t option } - - let make ?replication_configuration () = { replication_configuration } - - let parse xml = - Some - { replication_configuration = - Util.option_bind - (Xml.member "ReplicationConfiguration" xml) - ReplicationConfiguration.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_configuration (fun f -> - Query.Pair ("ReplicationConfiguration", ReplicationConfiguration.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_configuration (fun f -> - "replication_configuration", ReplicationConfiguration.to_json f) - ]) - - let of_json j = - { replication_configuration = - Util.option_map - (Json.lookup j "replication_configuration") - ReplicationConfiguration.of_json - } -end - -module AbortMultipartUploadOutput = struct - type t = { request_charged : RequestCharged.t option } - - let make ?request_charged () = { request_charged } - - let parse xml = - Some - { request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ]) - - let of_json j = - { request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module GetBucketWebsiteOutput = struct - type t = - { redirect_all_requests_to : RedirectAllRequestsTo.t option - ; index_document : IndexDocument.t option - ; error_document : ErrorDocument.t option - ; routing_rules : RoutingRules.t - } - - let make - ?redirect_all_requests_to - ?index_document - ?error_document - ?(routing_rules = []) - () = - { redirect_all_requests_to; index_document; error_document; routing_rules } - - let parse xml = - Some - { redirect_all_requests_to = - Util.option_bind - (Xml.member "RedirectAllRequestsTo" xml) - RedirectAllRequestsTo.parse - ; index_document = - Util.option_bind (Xml.member "IndexDocument" xml) IndexDocument.parse - ; error_document = - Util.option_bind (Xml.member "ErrorDocument" xml) ErrorDocument.parse - ; routing_rules = - Util.of_option - [] - (Util.option_bind (Xml.member "RoutingRules" xml) RoutingRules.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("RoutingRules.member", RoutingRules.to_query v.routing_rules)) - ; Util.option_map v.error_document (fun f -> - Query.Pair ("ErrorDocument", ErrorDocument.to_query f)) - ; Util.option_map v.index_document (fun f -> - Query.Pair ("IndexDocument", IndexDocument.to_query f)) - ; Util.option_map v.redirect_all_requests_to (fun f -> - Query.Pair ("RedirectAllRequestsTo", RedirectAllRequestsTo.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("routing_rules", RoutingRules.to_json v.routing_rules) - ; Util.option_map v.error_document (fun f -> - "error_document", ErrorDocument.to_json f) - ; Util.option_map v.index_document (fun f -> - "index_document", IndexDocument.to_json f) - ; Util.option_map v.redirect_all_requests_to (fun f -> - "redirect_all_requests_to", RedirectAllRequestsTo.to_json f) - ]) - - let of_json j = - { redirect_all_requests_to = - Util.option_map - (Json.lookup j "redirect_all_requests_to") - RedirectAllRequestsTo.of_json - ; index_document = - Util.option_map (Json.lookup j "index_document") IndexDocument.of_json - ; error_document = - Util.option_map (Json.lookup j "error_document") ErrorDocument.of_json - ; routing_rules = - RoutingRules.of_json (Util.of_option_exn (Json.lookup j "routing_rules")) - } -end - -module GetObjectRequest = struct - type t = - { bucket : String.t - ; if_match : String.t option - ; if_modified_since : DateTime.t option - ; if_none_match : String.t option - ; if_unmodified_since : DateTime.t option - ; key : String.t - ; range : String.t option - ; response_cache_control : String.t option - ; response_content_disposition : String.t option - ; response_content_encoding : String.t option - ; response_content_language : String.t option - ; response_content_type : String.t option - ; response_expires : DateTime.t option - ; version_id : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ~bucket - ?if_match - ?if_modified_since - ?if_none_match - ?if_unmodified_since - ~key - ?range - ?response_cache_control - ?response_content_disposition - ?response_content_encoding - ?response_content_language - ?response_content_type - ?response_expires - ?version_id - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?request_payer - () = - { bucket - ; if_match - ; if_modified_since - ; if_none_match - ; if_unmodified_since - ; key - ; range - ; response_cache_control - ; response_content_disposition - ; response_content_encoding - ; response_content_language - ; response_content_type - ; response_expires - ; version_id - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; request_payer - } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; if_match = Util.option_bind (Xml.member "If-Match" xml) String.parse - ; if_modified_since = - Util.option_bind (Xml.member "If-Modified-Since" xml) DateTime.parse - ; if_none_match = Util.option_bind (Xml.member "If-None-Match" xml) String.parse - ; if_unmodified_since = - Util.option_bind (Xml.member "If-Unmodified-Since" xml) DateTime.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; range = Util.option_bind (Xml.member "Range" xml) String.parse - ; response_cache_control = - Util.option_bind (Xml.member "response-cache-control" xml) String.parse - ; response_content_disposition = - Util.option_bind (Xml.member "response-content-disposition" xml) String.parse - ; response_content_encoding = - Util.option_bind (Xml.member "response-content-encoding" xml) String.parse - ; response_content_language = - Util.option_bind (Xml.member "response-content-language" xml) String.parse - ; response_content_type = - Util.option_bind (Xml.member "response-content-type" xml) String.parse - ; response_expires = - Util.option_bind (Xml.member "response-expires" xml) DateTime.parse - ; version_id = Util.option_bind (Xml.member "versionId" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("versionId", String.to_query f)) - ; Util.option_map v.response_expires (fun f -> - Query.Pair ("response-expires", DateTime.to_query f)) - ; Util.option_map v.response_content_type (fun f -> - Query.Pair ("response-content-type", String.to_query f)) - ; Util.option_map v.response_content_language (fun f -> - Query.Pair ("response-content-language", String.to_query f)) - ; Util.option_map v.response_content_encoding (fun f -> - Query.Pair ("response-content-encoding", String.to_query f)) - ; Util.option_map v.response_content_disposition (fun f -> - Query.Pair ("response-content-disposition", String.to_query f)) - ; Util.option_map v.response_cache_control (fun f -> - Query.Pair ("response-cache-control", String.to_query f)) - ; Util.option_map v.range (fun f -> Query.Pair ("Range", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.if_unmodified_since (fun f -> - Query.Pair ("If-Unmodified-Since", DateTime.to_query f)) - ; Util.option_map v.if_none_match (fun f -> - Query.Pair ("If-None-Match", String.to_query f)) - ; Util.option_map v.if_modified_since (fun f -> - Query.Pair ("If-Modified-Since", DateTime.to_query f)) - ; Util.option_map v.if_match (fun f -> - Query.Pair ("If-Match", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.response_expires (fun f -> - "response_expires", DateTime.to_json f) - ; Util.option_map v.response_content_type (fun f -> - "response_content_type", String.to_json f) - ; Util.option_map v.response_content_language (fun f -> - "response_content_language", String.to_json f) - ; Util.option_map v.response_content_encoding (fun f -> - "response_content_encoding", String.to_json f) - ; Util.option_map v.response_content_disposition (fun f -> - "response_content_disposition", String.to_json f) - ; Util.option_map v.response_cache_control (fun f -> - "response_cache_control", String.to_json f) - ; Util.option_map v.range (fun f -> "range", String.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.if_unmodified_since (fun f -> - "if_unmodified_since", DateTime.to_json f) - ; Util.option_map v.if_none_match (fun f -> "if_none_match", String.to_json f) - ; Util.option_map v.if_modified_since (fun f -> - "if_modified_since", DateTime.to_json f) - ; Util.option_map v.if_match (fun f -> "if_match", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; if_match = Util.option_map (Json.lookup j "if_match") String.of_json - ; if_modified_since = - Util.option_map (Json.lookup j "if_modified_since") DateTime.of_json - ; if_none_match = Util.option_map (Json.lookup j "if_none_match") String.of_json - ; if_unmodified_since = - Util.option_map (Json.lookup j "if_unmodified_since") DateTime.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; range = Util.option_map (Json.lookup j "range") String.of_json - ; response_cache_control = - Util.option_map (Json.lookup j "response_cache_control") String.of_json - ; response_content_disposition = - Util.option_map (Json.lookup j "response_content_disposition") String.of_json - ; response_content_encoding = - Util.option_map (Json.lookup j "response_content_encoding") String.of_json - ; response_content_language = - Util.option_map (Json.lookup j "response_content_language") String.of_json - ; response_content_type = - Util.option_map (Json.lookup j "response_content_type") String.of_json - ; response_expires = - Util.option_map (Json.lookup j "response_expires") DateTime.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module HeadObjectRequest = struct - type t = - { bucket : String.t - ; if_match : String.t option - ; if_modified_since : DateTime.t option - ; if_none_match : String.t option - ; if_unmodified_since : DateTime.t option - ; key : String.t - ; range : String.t option - ; version_id : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ~bucket - ?if_match - ?if_modified_since - ?if_none_match - ?if_unmodified_since - ~key - ?range - ?version_id - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?request_payer - () = - { bucket - ; if_match - ; if_modified_since - ; if_none_match - ; if_unmodified_since - ; key - ; range - ; version_id - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; request_payer - } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; if_match = Util.option_bind (Xml.member "If-Match" xml) String.parse - ; if_modified_since = - Util.option_bind (Xml.member "If-Modified-Since" xml) DateTime.parse - ; if_none_match = Util.option_bind (Xml.member "If-None-Match" xml) String.parse - ; if_unmodified_since = - Util.option_bind (Xml.member "If-Unmodified-Since" xml) DateTime.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; range = Util.option_bind (Xml.member "Range" xml) String.parse - ; version_id = Util.option_bind (Xml.member "versionId" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("versionId", String.to_query f)) - ; Util.option_map v.range (fun f -> Query.Pair ("Range", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.if_unmodified_since (fun f -> - Query.Pair ("If-Unmodified-Since", DateTime.to_query f)) - ; Util.option_map v.if_none_match (fun f -> - Query.Pair ("If-None-Match", String.to_query f)) - ; Util.option_map v.if_modified_since (fun f -> - Query.Pair ("If-Modified-Since", DateTime.to_query f)) - ; Util.option_map v.if_match (fun f -> - Query.Pair ("If-Match", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.range (fun f -> "range", String.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.if_unmodified_since (fun f -> - "if_unmodified_since", DateTime.to_json f) - ; Util.option_map v.if_none_match (fun f -> "if_none_match", String.to_json f) - ; Util.option_map v.if_modified_since (fun f -> - "if_modified_since", DateTime.to_json f) - ; Util.option_map v.if_match (fun f -> "if_match", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; if_match = Util.option_map (Json.lookup j "if_match") String.of_json - ; if_modified_since = - Util.option_map (Json.lookup j "if_modified_since") DateTime.of_json - ; if_none_match = Util.option_map (Json.lookup j "if_none_match") String.of_json - ; if_unmodified_since = - Util.option_map (Json.lookup j "if_unmodified_since") DateTime.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; range = Util.option_map (Json.lookup j "range") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module PutBucketReplicationRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; replication_configuration : ReplicationConfiguration.t - } - - let make ~bucket ?content_m_d5 ~replication_configuration () = - { bucket; content_m_d5; replication_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; replication_configuration = - Xml.required - "ReplicationConfiguration" + ("TopicConfiguration", + (TopicConfigurationList.to_query v.topic_configurations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("lambda_function_configurations", + (LambdaFunctionConfigurationList.to_json + v.lambda_function_configurations)); + Some + ("queue_configurations", + (QueueConfigurationList.to_json v.queue_configurations)); + Some + ("topic_configurations", + (TopicConfigurationList.to_json v.topic_configurations))]) + let of_json j = + { + topic_configurations = + (TopicConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "topic_configurations"))); + queue_configurations = + (QueueConfigurationList.of_json + (Util.of_option_exn (Json.lookup j "queue_configurations"))); + lambda_function_configurations = + (LambdaFunctionConfigurationList.of_json + (Util.of_option_exn + (Json.lookup j "lambda_function_configurations"))) + } + end +module CORSConfiguration = + struct + type t = { + c_o_r_s_rules: CORSRules.t } + let make ?(c_o_r_s_rules= []) () = { c_o_r_s_rules } + let parse xml = + Some { c_o_r_s_rules = (Util.of_option [] (CORSRules.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("CORSRule", (CORSRules.to_query v.c_o_r_s_rules)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("c_o_r_s_rules", (CORSRules.to_json v.c_o_r_s_rules))]) + let of_json j = + { + c_o_r_s_rules = + (CORSRules.of_json + (Util.of_option_exn (Json.lookup j "c_o_r_s_rules"))) + } + end +module DeleteBucketTaggingRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetObjectTorrentRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?request_payer () = + { bucket; key; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module CreateMultipartUploadOutput = + struct + type t = + { + bucket: String.t option ; + key: String.t option ; + upload_id: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?bucket ?key ?upload_id ?server_side_encryption + ?s_s_e_customer_algorithm ?s_s_e_customer_key_m_d5 + ?s_s_e_k_m_s_key_id ?request_charged () = + { + bucket; + key; + upload_id; + server_side_encryption; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + bucket = (Util.option_bind (Xml.member "Bucket" xml) String.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + upload_id = + (Util.option_bind (Xml.member "UploadId" xml) String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + s_s_e_customer_algorithm = (Util.option_bind - (Xml.member "ReplicationConfiguration" xml) + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.upload_id + (fun f -> Query.Pair ("UploadId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.upload_id + (fun f -> ("upload_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f)))]) + let of_json j = + { + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + upload_id = + (Util.option_map (Json.lookup j "upload_id") String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module GetBucketLoggingRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetBucketReplicationOutput = + struct + type t = { + replication_configuration: ReplicationConfiguration.t option } + let make ?replication_configuration () = { replication_configuration } + let parse xml = + Some + { + replication_configuration = + (Util.option_bind (Xml.member "ReplicationConfiguration" xml) ReplicationConfiguration.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "ReplicationConfiguration" - , ReplicationConfiguration.to_query v.replication_configuration )) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "replication_configuration" - , ReplicationConfiguration.to_json v.replication_configuration ) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; replication_configuration = - ReplicationConfiguration.of_json - (Util.of_option_exn (Json.lookup j "replication_configuration")) - } -end - -module ListObjectsOutput = struct - type t = - { is_truncated : Boolean.t option - ; marker : String.t option - ; next_marker : String.t option - ; contents : ObjectList.t - ; name : String.t option - ; prefix : String.t option - ; delimiter : String.t option - ; max_keys : Integer.t option - ; common_prefixes : CommonPrefixList.t - ; encoding_type : EncodingType.t option - } - - let make - ?is_truncated - ?marker - ?next_marker - ?(contents = []) - ?name - ?prefix - ?delimiter - ?max_keys - ?(common_prefixes = []) - ?encoding_type + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_configuration + (fun f -> + Query.Pair + ("ReplicationConfiguration", + (ReplicationConfiguration.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_configuration + (fun f -> + ("replication_configuration", + (ReplicationConfiguration.to_json f)))]) + let of_json j = + { + replication_configuration = + (Util.option_map (Json.lookup j "replication_configuration") + ReplicationConfiguration.of_json) + } + end +module AbortMultipartUploadOutput = + struct + type t = { + request_charged: RequestCharged.t option } + let make ?request_charged () = { request_charged } + let parse xml = + Some + { + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f)))]) + let of_json j = + { + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module GetBucketWebsiteOutput = + struct + type t = + { + redirect_all_requests_to: RedirectAllRequestsTo.t option ; + index_document: IndexDocument.t option ; + error_document: ErrorDocument.t option ; + routing_rules: RoutingRules.t } + let make ?redirect_all_requests_to ?index_document ?error_document + ?(routing_rules= []) () = + { + redirect_all_requests_to; + index_document; + error_document; + routing_rules + } + let parse xml = + Some + { + redirect_all_requests_to = + (Util.option_bind (Xml.member "RedirectAllRequestsTo" xml) + RedirectAllRequestsTo.parse); + index_document = + (Util.option_bind (Xml.member "IndexDocument" xml) + IndexDocument.parse); + error_document = + (Util.option_bind (Xml.member "ErrorDocument" xml) + ErrorDocument.parse); + routing_rules = + (Util.of_option [] + (Util.option_bind (Xml.member "RoutingRules" xml) + RoutingRules.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RoutingRules.member", + (RoutingRules.to_query v.routing_rules))); + Util.option_map v.error_document + (fun f -> + Query.Pair ("ErrorDocument", (ErrorDocument.to_query f))); + Util.option_map v.index_document + (fun f -> + Query.Pair ("IndexDocument", (IndexDocument.to_query f))); + Util.option_map v.redirect_all_requests_to + (fun f -> + Query.Pair + ("RedirectAllRequestsTo", + (RedirectAllRequestsTo.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("routing_rules", (RoutingRules.to_json v.routing_rules)); + Util.option_map v.error_document + (fun f -> ("error_document", (ErrorDocument.to_json f))); + Util.option_map v.index_document + (fun f -> ("index_document", (IndexDocument.to_json f))); + Util.option_map v.redirect_all_requests_to + (fun f -> + ("redirect_all_requests_to", + (RedirectAllRequestsTo.to_json f)))]) + let of_json j = + { + redirect_all_requests_to = + (Util.option_map (Json.lookup j "redirect_all_requests_to") + RedirectAllRequestsTo.of_json); + index_document = + (Util.option_map (Json.lookup j "index_document") + IndexDocument.of_json); + error_document = + (Util.option_map (Json.lookup j "error_document") + ErrorDocument.of_json); + routing_rules = + (RoutingRules.of_json + (Util.of_option_exn (Json.lookup j "routing_rules"))) + } + end +module GetObjectRequest = + struct + type t = + { + bucket: String.t ; + if_match: String.t option ; + if_modified_since: DateTime.t option ; + if_none_match: String.t option ; + if_unmodified_since: DateTime.t option ; + key: String.t ; + range: String.t option ; + response_cache_control: String.t option ; + response_content_disposition: String.t option ; + response_content_encoding: String.t option ; + response_content_language: String.t option ; + response_content_type: String.t option ; + response_expires: DateTime.t option ; + version_id: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ?if_match ?if_modified_since ?if_none_match + ?if_unmodified_since ~key ?range ?response_cache_control + ?response_content_disposition ?response_content_encoding + ?response_content_language ?response_content_type ?response_expires + ?version_id ?s_s_e_customer_algorithm ?s_s_e_customer_key + ?s_s_e_customer_key_m_d5 ?request_payer () = + { + bucket; + if_match; + if_modified_since; + if_none_match; + if_unmodified_since; + key; + range; + response_cache_control; + response_content_disposition; + response_content_encoding; + response_content_language; + response_content_type; + response_expires; + version_id; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + request_payer + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + if_match = + (Util.option_bind (Xml.member "If-Match" xml) String.parse); + if_modified_since = + (Util.option_bind (Xml.member "If-Modified-Since" xml) + DateTime.parse); + if_none_match = + (Util.option_bind (Xml.member "If-None-Match" xml) String.parse); + if_unmodified_since = + (Util.option_bind (Xml.member "If-Unmodified-Since" xml) + DateTime.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + range = (Util.option_bind (Xml.member "Range" xml) String.parse); + response_cache_control = + (Util.option_bind (Xml.member "response-cache-control" xml) + String.parse); + response_content_disposition = + (Util.option_bind (Xml.member "response-content-disposition" xml) + String.parse); + response_content_encoding = + (Util.option_bind (Xml.member "response-content-encoding" xml) + String.parse); + response_content_language = + (Util.option_bind (Xml.member "response-content-language" xml) + String.parse); + response_content_type = + (Util.option_bind (Xml.member "response-content-type" xml) + String.parse); + response_expires = + (Util.option_bind (Xml.member "response-expires" xml) + DateTime.parse); + version_id = + (Util.option_bind (Xml.member "versionId" xml) String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("versionId", (String.to_query f))); + Util.option_map v.response_expires + (fun f -> Query.Pair ("response-expires", (DateTime.to_query f))); + Util.option_map v.response_content_type + (fun f -> + Query.Pair ("response-content-type", (String.to_query f))); + Util.option_map v.response_content_language + (fun f -> + Query.Pair ("response-content-language", (String.to_query f))); + Util.option_map v.response_content_encoding + (fun f -> + Query.Pair ("response-content-encoding", (String.to_query f))); + Util.option_map v.response_content_disposition + (fun f -> + Query.Pair + ("response-content-disposition", (String.to_query f))); + Util.option_map v.response_cache_control + (fun f -> + Query.Pair ("response-cache-control", (String.to_query f))); + Util.option_map v.range + (fun f -> Query.Pair ("Range", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.if_unmodified_since + (fun f -> + Query.Pair ("If-Unmodified-Since", (DateTime.to_query f))); + Util.option_map v.if_none_match + (fun f -> Query.Pair ("If-None-Match", (String.to_query f))); + Util.option_map v.if_modified_since + (fun f -> + Query.Pair ("If-Modified-Since", (DateTime.to_query f))); + Util.option_map v.if_match + (fun f -> Query.Pair ("If-Match", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.response_expires + (fun f -> ("response_expires", (DateTime.to_json f))); + Util.option_map v.response_content_type + (fun f -> ("response_content_type", (String.to_json f))); + Util.option_map v.response_content_language + (fun f -> ("response_content_language", (String.to_json f))); + Util.option_map v.response_content_encoding + (fun f -> ("response_content_encoding", (String.to_json f))); + Util.option_map v.response_content_disposition + (fun f -> ("response_content_disposition", (String.to_json f))); + Util.option_map v.response_cache_control + (fun f -> ("response_cache_control", (String.to_json f))); + Util.option_map v.range (fun f -> ("range", (String.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.if_unmodified_since + (fun f -> ("if_unmodified_since", (DateTime.to_json f))); + Util.option_map v.if_none_match + (fun f -> ("if_none_match", (String.to_json f))); + Util.option_map v.if_modified_since + (fun f -> ("if_modified_since", (DateTime.to_json f))); + Util.option_map v.if_match + (fun f -> ("if_match", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + if_match = + (Util.option_map (Json.lookup j "if_match") String.of_json); + if_modified_since = + (Util.option_map (Json.lookup j "if_modified_since") + DateTime.of_json); + if_none_match = + (Util.option_map (Json.lookup j "if_none_match") String.of_json); + if_unmodified_since = + (Util.option_map (Json.lookup j "if_unmodified_since") + DateTime.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + range = (Util.option_map (Json.lookup j "range") String.of_json); + response_cache_control = + (Util.option_map (Json.lookup j "response_cache_control") + String.of_json); + response_content_disposition = + (Util.option_map (Json.lookup j "response_content_disposition") + String.of_json); + response_content_encoding = + (Util.option_map (Json.lookup j "response_content_encoding") + String.of_json); + response_content_language = + (Util.option_map (Json.lookup j "response_content_language") + String.of_json); + response_content_type = + (Util.option_map (Json.lookup j "response_content_type") + String.of_json); + response_expires = + (Util.option_map (Json.lookup j "response_expires") + DateTime.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module HeadObjectRequest = + struct + type t = + { + bucket: String.t ; + if_match: String.t option ; + if_modified_since: DateTime.t option ; + if_none_match: String.t option ; + if_unmodified_since: DateTime.t option ; + key: String.t ; + range: String.t option ; + version_id: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ?if_match ?if_modified_since ?if_none_match + ?if_unmodified_since ~key ?range ?version_id + ?s_s_e_customer_algorithm ?s_s_e_customer_key + ?s_s_e_customer_key_m_d5 ?request_payer () = + { + bucket; + if_match; + if_modified_since; + if_none_match; + if_unmodified_since; + key; + range; + version_id; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + request_payer + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + if_match = + (Util.option_bind (Xml.member "If-Match" xml) String.parse); + if_modified_since = + (Util.option_bind (Xml.member "If-Modified-Since" xml) + DateTime.parse); + if_none_match = + (Util.option_bind (Xml.member "If-None-Match" xml) String.parse); + if_unmodified_since = + (Util.option_bind (Xml.member "If-Unmodified-Since" xml) + DateTime.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + range = (Util.option_bind (Xml.member "Range" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "versionId" xml) String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("versionId", (String.to_query f))); + Util.option_map v.range + (fun f -> Query.Pair ("Range", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.if_unmodified_since + (fun f -> + Query.Pair ("If-Unmodified-Since", (DateTime.to_query f))); + Util.option_map v.if_none_match + (fun f -> Query.Pair ("If-None-Match", (String.to_query f))); + Util.option_map v.if_modified_since + (fun f -> + Query.Pair ("If-Modified-Since", (DateTime.to_query f))); + Util.option_map v.if_match + (fun f -> Query.Pair ("If-Match", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.range (fun f -> ("range", (String.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.if_unmodified_since + (fun f -> ("if_unmodified_since", (DateTime.to_json f))); + Util.option_map v.if_none_match + (fun f -> ("if_none_match", (String.to_json f))); + Util.option_map v.if_modified_since + (fun f -> ("if_modified_since", (DateTime.to_json f))); + Util.option_map v.if_match + (fun f -> ("if_match", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + if_match = + (Util.option_map (Json.lookup j "if_match") String.of_json); + if_modified_since = + (Util.option_map (Json.lookup j "if_modified_since") + DateTime.of_json); + if_none_match = + (Util.option_map (Json.lookup j "if_none_match") String.of_json); + if_unmodified_since = + (Util.option_map (Json.lookup j "if_unmodified_since") + DateTime.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + range = (Util.option_map (Json.lookup j "range") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module PutBucketReplicationRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + replication_configuration: ReplicationConfiguration.t } + let make ~bucket ?content_m_d5 ~replication_configuration () = + { bucket; content_m_d5; replication_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + replication_configuration = + (Xml.required "ReplicationConfiguration" + (Util.option_bind (Xml.member "ReplicationConfiguration" xml) + ReplicationConfiguration.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReplicationConfiguration", + (ReplicationConfiguration.to_query + v.replication_configuration))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("replication_configuration", + (ReplicationConfiguration.to_json v.replication_configuration)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + replication_configuration = + (ReplicationConfiguration.of_json + (Util.of_option_exn (Json.lookup j "replication_configuration"))) + } + end +module ListObjectsOutput = + struct + type t = + { + is_truncated: Boolean.t option ; + marker: String.t option ; + next_marker: String.t option ; + contents: ObjectList.t ; + name: String.t option ; + prefix: String.t option ; + delimiter: String.t option ; + max_keys: Integer.t option ; + common_prefixes: CommonPrefixList.t ; + encoding_type: EncodingType.t option } + let make ?is_truncated ?marker ?next_marker ?(contents= []) ?name + ?prefix ?delimiter ?max_keys ?(common_prefixes= []) ?encoding_type () = - { is_truncated - ; marker - ; next_marker - ; contents - ; name - ; prefix - ; delimiter - ; max_keys - ; common_prefixes - ; encoding_type - } - - let parse xml = - Some - { is_truncated = Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse - ; marker = Util.option_bind (Xml.member "Marker" xml) String.parse - ; next_marker = Util.option_bind (Xml.member "NextMarker" xml) String.parse - ; contents = Util.of_option [] (ObjectList.parse xml) - ; name = Util.option_bind (Xml.member "Name" xml) String.parse - ; prefix = Util.option_bind (Xml.member "Prefix" xml) String.parse - ; delimiter = Util.option_bind (Xml.member "Delimiter" xml) String.parse - ; max_keys = Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse - ; common_prefixes = Util.of_option [] (CommonPrefixList.parse xml) - ; encoding_type = - Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - Query.Pair ("EncodingType", EncodingType.to_query f)) - ; Some + { + is_truncated; + marker; + next_marker; + contents; + name; + prefix; + delimiter; + max_keys; + common_prefixes; + encoding_type + } + let parse xml = + Some + { + is_truncated = + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); + marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); + next_marker = + (Util.option_bind (Xml.member "NextMarker" xml) String.parse); + contents = (Util.of_option [] (ObjectList.parse xml)); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse); + delimiter = + (Util.option_bind (Xml.member "Delimiter" xml) String.parse); + max_keys = + (Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); + encoding_type = + (Util.option_bind (Xml.member "EncodingType" xml) + EncodingType.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> + Query.Pair ("EncodingType", (EncodingType.to_query f))); + Some (Query.Pair - ("CommonPrefixes.member", CommonPrefixList.to_query v.common_prefixes)) - ; Util.option_map v.max_keys (fun f -> - Query.Pair ("MaxKeys", Integer.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("Delimiter", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ; Some (Query.Pair ("Contents.member", ObjectList.to_query v.contents)) - ; Util.option_map v.next_marker (fun f -> - Query.Pair ("NextMarker", String.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("Marker", String.to_query f)) - ; Util.option_map v.is_truncated (fun f -> - Query.Pair ("IsTruncated", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Some ("common_prefixes", CommonPrefixList.to_json v.common_prefixes) - ; Util.option_map v.max_keys (fun f -> "max_keys", Integer.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ; Some ("contents", ObjectList.to_json v.contents) - ; Util.option_map v.next_marker (fun f -> "next_marker", String.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.is_truncated (fun f -> "is_truncated", Boolean.to_json f) - ]) - - let of_json j = - { is_truncated = Util.option_map (Json.lookup j "is_truncated") Boolean.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; next_marker = Util.option_map (Json.lookup j "next_marker") String.of_json - ; contents = ObjectList.of_json (Util.of_option_exn (Json.lookup j "contents")) - ; name = Util.option_map (Json.lookup j "name") String.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; max_keys = Util.option_map (Json.lookup j "max_keys") Integer.of_json - ; common_prefixes = - CommonPrefixList.of_json (Util.of_option_exn (Json.lookup j "common_prefixes")) - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - } -end - -module RestoreObjectOutput = struct - type t = { request_charged : RequestCharged.t option } - - let make ?request_charged () = { request_charged } - - let parse xml = - Some - { request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ]) - - let of_json j = - { request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module HeadObjectOutput = struct - type t = - { delete_marker : Boolean.t option - ; accept_ranges : String.t option - ; expiration : String.t option - ; restore : String.t option - ; last_modified : DateTime.t option - ; content_length : Integer.t option - ; e_tag : String.t option - ; missing_meta : Integer.t option - ; version_id : String.t option - ; cache_control : String.t option - ; content_disposition : String.t option - ; content_encoding : String.t option - ; content_language : String.t option - ; content_type : String.t option - ; expires : DateTime.t option - ; website_redirect_location : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; metadata : Metadata.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; storage_class : StorageClass.t option - ; request_charged : RequestCharged.t option - ; replication_status : ReplicationStatus.t option - } - - let make - ?delete_marker - ?accept_ranges - ?expiration - ?restore - ?last_modified - ?content_length - ?e_tag - ?missing_meta - ?version_id - ?cache_control - ?content_disposition - ?content_encoding - ?content_language - ?content_type - ?expires - ?website_redirect_location - ?server_side_encryption - ?metadata - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?storage_class - ?request_charged - ?replication_status - () = - { delete_marker - ; accept_ranges - ; expiration - ; restore - ; last_modified - ; content_length - ; e_tag - ; missing_meta - ; version_id - ; cache_control - ; content_disposition - ; content_encoding - ; content_language - ; content_type - ; expires - ; website_redirect_location - ; server_side_encryption - ; metadata - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; storage_class - ; request_charged - ; replication_status - } - - let parse xml = - Some - { delete_marker = - Util.option_bind (Xml.member "x-amz-delete-marker" xml) Boolean.parse - ; accept_ranges = Util.option_bind (Xml.member "accept-ranges" xml) String.parse - ; expiration = Util.option_bind (Xml.member "x-amz-expiration" xml) String.parse - ; restore = Util.option_bind (Xml.member "x-amz-restore" xml) String.parse - ; last_modified = Util.option_bind (Xml.member "Last-Modified" xml) DateTime.parse - ; content_length = Util.option_bind (Xml.member "Content-Length" xml) Integer.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; missing_meta = - Util.option_bind (Xml.member "x-amz-missing-meta" xml) Integer.parse - ; version_id = Util.option_bind (Xml.member "x-amz-version-id" xml) String.parse - ; cache_control = Util.option_bind (Xml.member "Cache-Control" xml) String.parse - ; content_disposition = - Util.option_bind (Xml.member "Content-Disposition" xml) String.parse - ; content_encoding = - Util.option_bind (Xml.member "Content-Encoding" xml) String.parse - ; content_language = - Util.option_bind (Xml.member "Content-Language" xml) String.parse - ; content_type = Util.option_bind (Xml.member "Content-Type" xml) String.parse - ; expires = Util.option_bind (Xml.member "Expires" xml) DateTime.parse - ; website_redirect_location = - Util.option_bind (Xml.member "x-amz-website-redirect-location" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; metadata = Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; storage_class = - Util.option_bind (Xml.member "x-amz-storage-class" xml) StorageClass.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - ; replication_status = - Util.option_bind - (Xml.member "x-amz-replication-status" xml) - ReplicationStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_status (fun f -> - Query.Pair ("x-amz-replication-status", ReplicationStatus.to_query f)) - ; Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("x-amz-storage-class", StorageClass.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.metadata (fun f -> - Query.Pair ("x-amz-meta-", Metadata.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.website_redirect_location (fun f -> - Query.Pair ("x-amz-website-redirect-location", String.to_query f)) - ; Util.option_map v.expires (fun f -> - Query.Pair ("Expires", DateTime.to_query f)) - ; Util.option_map v.content_type (fun f -> - Query.Pair ("Content-Type", String.to_query f)) - ; Util.option_map v.content_language (fun f -> - Query.Pair ("Content-Language", String.to_query f)) - ; Util.option_map v.content_encoding (fun f -> - Query.Pair ("Content-Encoding", String.to_query f)) - ; Util.option_map v.content_disposition (fun f -> - Query.Pair ("Content-Disposition", String.to_query f)) - ; Util.option_map v.cache_control (fun f -> - Query.Pair ("Cache-Control", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("x-amz-version-id", String.to_query f)) - ; Util.option_map v.missing_meta (fun f -> - Query.Pair ("x-amz-missing-meta", Integer.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.content_length (fun f -> - Query.Pair ("Content-Length", Integer.to_query f)) - ; Util.option_map v.last_modified (fun f -> - Query.Pair ("Last-Modified", DateTime.to_query f)) - ; Util.option_map v.restore (fun f -> - Query.Pair ("x-amz-restore", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("x-amz-expiration", String.to_query f)) - ; Util.option_map v.accept_ranges (fun f -> - Query.Pair ("accept-ranges", String.to_query f)) - ; Util.option_map v.delete_marker (fun f -> - Query.Pair ("x-amz-delete-marker", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_status (fun f -> - "replication_status", ReplicationStatus.to_json f) - ; Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.metadata (fun f -> "metadata", Metadata.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.website_redirect_location (fun f -> - "website_redirect_location", String.to_json f) - ; Util.option_map v.expires (fun f -> "expires", DateTime.to_json f) - ; Util.option_map v.content_type (fun f -> "content_type", String.to_json f) - ; Util.option_map v.content_language (fun f -> - "content_language", String.to_json f) - ; Util.option_map v.content_encoding (fun f -> - "content_encoding", String.to_json f) - ; Util.option_map v.content_disposition (fun f -> - "content_disposition", String.to_json f) - ; Util.option_map v.cache_control (fun f -> "cache_control", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.missing_meta (fun f -> "missing_meta", Integer.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.content_length (fun f -> "content_length", Integer.to_json f) - ; Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.restore (fun f -> "restore", String.to_json f) - ; Util.option_map v.expiration (fun f -> "expiration", String.to_json f) - ; Util.option_map v.accept_ranges (fun f -> "accept_ranges", String.to_json f) - ; Util.option_map v.delete_marker (fun f -> "delete_marker", Boolean.to_json f) - ]) - - let of_json j = - { delete_marker = Util.option_map (Json.lookup j "delete_marker") Boolean.of_json - ; accept_ranges = Util.option_map (Json.lookup j "accept_ranges") String.of_json - ; expiration = Util.option_map (Json.lookup j "expiration") String.of_json - ; restore = Util.option_map (Json.lookup j "restore") String.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - ; content_length = Util.option_map (Json.lookup j "content_length") Integer.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; missing_meta = Util.option_map (Json.lookup j "missing_meta") Integer.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; cache_control = Util.option_map (Json.lookup j "cache_control") String.of_json - ; content_disposition = - Util.option_map (Json.lookup j "content_disposition") String.of_json - ; content_encoding = Util.option_map (Json.lookup j "content_encoding") String.of_json - ; content_language = Util.option_map (Json.lookup j "content_language") String.of_json - ; content_type = Util.option_map (Json.lookup j "content_type") String.of_json - ; expires = Util.option_map (Json.lookup j "expires") DateTime.of_json - ; website_redirect_location = - Util.option_map (Json.lookup j "website_redirect_location") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; metadata = Util.option_map (Json.lookup j "metadata") Metadata.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - ; replication_status = - Util.option_map (Json.lookup j "replication_status") ReplicationStatus.of_json - } -end - -module GetBucketLifecycleOutput = struct - type t = { rules : Rules.t } - - let make ?(rules = []) () = { rules } - - let parse xml = Some { rules = Util.of_option [] (Rules.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Rule", Rules.to_query v.rules)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("rules", Rules.to_json v.rules) ]) - - let of_json j = { rules = Rules.of_json (Util.of_option_exn (Json.lookup j "rules")) } -end - -module PutBucketLifecycleRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; lifecycle_configuration : LifecycleConfiguration.t option - } - - let make ~bucket ?content_m_d5 ?lifecycle_configuration () = - { bucket; content_m_d5; lifecycle_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; lifecycle_configuration = - Util.option_bind - (Xml.member "LifecycleConfiguration" xml) - LifecycleConfiguration.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.lifecycle_configuration (fun f -> - Query.Pair ("LifecycleConfiguration", LifecycleConfiguration.to_query f)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.lifecycle_configuration (fun f -> - "lifecycle_configuration", LifecycleConfiguration.to_json f) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; lifecycle_configuration = - Util.option_map - (Json.lookup j "lifecycle_configuration") - LifecycleConfiguration.of_json - } -end - -module PutObjectAclOutput = struct - type t = { request_charged : RequestCharged.t option } - - let make ?request_charged () = { request_charged } - - let parse xml = - Some - { request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ]) - - let of_json j = - { request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module ListPartsRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; max_parts : Integer.t option - ; part_number_marker : Integer.t option - ; upload_id : String.t - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?max_parts ?part_number_marker ~upload_id ?request_payer () = - { bucket; key; max_parts; part_number_marker; upload_id; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; max_parts = Util.option_bind (Xml.member "max-parts" xml) Integer.parse - ; part_number_marker = - Util.option_bind (Xml.member "part-number-marker" xml) Integer.parse - ; upload_id = - Xml.required - "uploadId" - (Util.option_bind (Xml.member "uploadId" xml) String.parse) - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Some (Query.Pair ("uploadId", String.to_query v.upload_id)) - ; Util.option_map v.part_number_marker (fun f -> - Query.Pair ("part-number-marker", Integer.to_query f)) - ; Util.option_map v.max_parts (fun f -> - Query.Pair ("max-parts", Integer.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Some ("upload_id", String.to_json v.upload_id) - ; Util.option_map v.part_number_marker (fun f -> - "part_number_marker", Integer.to_json f) - ; Util.option_map v.max_parts (fun f -> "max_parts", Integer.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; max_parts = Util.option_map (Json.lookup j "max_parts") Integer.of_json - ; part_number_marker = - Util.option_map (Json.lookup j "part_number_marker") Integer.of_json - ; upload_id = String.of_json (Util.of_option_exn (Json.lookup j "upload_id")) - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetObjectTorrentOutput = struct - type t = - { body : Blob.t option - ; request_charged : RequestCharged.t option - } - - let make ?body ?request_charged () = { body; request_charged } - - let parse xml = - Some - { body = Util.option_bind (Xml.member "Body" xml) Blob.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.body (fun f -> Query.Pair ("Body", Blob.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.body (fun f -> "body", Blob.to_json f) - ]) - - let of_json j = - { body = Util.option_map (Json.lookup j "body") Blob.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module PutObjectAclRequest = struct - type t = - { a_c_l : ObjectCannedACL.t option - ; access_control_policy : AccessControlPolicy.t option - ; bucket : String.t - ; content_m_d5 : String.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write : String.t option - ; grant_write_a_c_p : String.t option - ; key : String.t - ; request_payer : RequestPayer.t option - } - - let make - ?a_c_l - ?access_control_policy - ~bucket - ?content_m_d5 - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write - ?grant_write_a_c_p - ~key - ?request_payer - () = - { a_c_l - ; access_control_policy - ; bucket - ; content_m_d5 - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write - ; grant_write_a_c_p - ; key - ; request_payer - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) ObjectCannedACL.parse - ; access_control_policy = - Util.option_bind - (Xml.member "AccessControlPolicy" xml) - AccessControlPolicy.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write = Util.option_bind (Xml.member "x-amz-grant-write" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_write (fun f -> - Query.Pair ("x-amz-grant-write", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.access_control_policy (fun f -> - Query.Pair ("AccessControlPolicy", AccessControlPolicy.to_query f)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", ObjectCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_write (fun f -> "grant_write", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.access_control_policy (fun f -> - "access_control_policy", AccessControlPolicy.to_json f) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", ObjectCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json - ; access_control_policy = - Util.option_map - (Json.lookup j "access_control_policy") - AccessControlPolicy.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write = Util.option_map (Json.lookup j "grant_write") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module CreateBucketRequest = struct - type t = - { a_c_l : BucketCannedACL.t option - ; bucket : String.t - ; create_bucket_configuration : CreateBucketConfiguration.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write : String.t option - ; grant_write_a_c_p : String.t option - } - - let make - ?a_c_l - ~bucket - ?create_bucket_configuration - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write - ?grant_write_a_c_p - () = - { a_c_l - ; bucket - ; create_bucket_configuration - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write - ; grant_write_a_c_p - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) BucketCannedACL.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; create_bucket_configuration = - Util.option_bind - (Xml.member "CreateBucketConfiguration" xml) - CreateBucketConfiguration.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write = Util.option_bind (Xml.member "x-amz-grant-write" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_write (fun f -> - Query.Pair ("x-amz-grant-write", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.create_bucket_configuration (fun f -> - Query.Pair - ("CreateBucketConfiguration", CreateBucketConfiguration.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", BucketCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_write (fun f -> "grant_write", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.create_bucket_configuration (fun f -> - "create_bucket_configuration", CreateBucketConfiguration.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", BucketCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") BucketCannedACL.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; create_bucket_configuration = - Util.option_map - (Json.lookup j "create_bucket_configuration") - CreateBucketConfiguration.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write = Util.option_map (Json.lookup j "grant_write") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - } -end - -module HeadBucketRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module DeleteObjectRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; m_f_a : String.t option - ; version_id : String.t option - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?m_f_a ?version_id ?request_payer () = - { bucket; key; m_f_a; version_id; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; m_f_a = Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse - ; version_id = Util.option_bind (Xml.member "versionId" xml) String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("versionId", String.to_query f)) - ; Util.option_map v.m_f_a (fun f -> Query.Pair ("x-amz-mfa", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.m_f_a (fun f -> "m_f_a", String.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; m_f_a = Util.option_map (Json.lookup j "m_f_a") String.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetBucketTaggingRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module AbortMultipartUploadRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; upload_id : String.t - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ~upload_id ?request_payer () = - { bucket; key; upload_id; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; upload_id = - Xml.required - "uploadId" - (Util.option_bind (Xml.member "uploadId" xml) String.parse) - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Some (Query.Pair ("uploadId", String.to_query v.upload_id)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Some ("upload_id", String.to_json v.upload_id) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; upload_id = String.of_json (Util.of_option_exn (Json.lookup j "upload_id")) - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetBucketLocationOutput = struct - type t = { location_constraint : BucketLocationConstraint.t option } - - let make ?location_constraint () = { location_constraint } - - let parse xml = - Some - { location_constraint = - Util.option_bind - (Xml.member "LocationConstraint" xml) - BucketLocationConstraint.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.location_constraint (fun f -> - Query.Pair ("LocationConstraint", BucketLocationConstraint.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.location_constraint (fun f -> - "location_constraint", BucketLocationConstraint.to_json f) - ]) - - let of_json j = - { location_constraint = - Util.option_map - (Json.lookup j "location_constraint") - BucketLocationConstraint.of_json - } -end - -module GetBucketCorsOutput = struct - type t = { c_o_r_s_rules : CORSRules.t } - - let make ?(c_o_r_s_rules = []) () = { c_o_r_s_rules } - - let parse xml = Some { c_o_r_s_rules = Util.of_option [] (CORSRules.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("CORSRule", CORSRules.to_query v.c_o_r_s_rules)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("c_o_r_s_rules", CORSRules.to_json v.c_o_r_s_rules) ]) - - let of_json j = - { c_o_r_s_rules = - CORSRules.of_json (Util.of_option_exn (Json.lookup j "c_o_r_s_rules")) - } -end - -module GetBucketPolicyRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module PutBucketLoggingRequest = struct - type t = - { bucket : String.t - ; bucket_logging_status : BucketLoggingStatus.t - ; content_m_d5 : String.t option - } - - let make ~bucket ~bucket_logging_status ?content_m_d5 () = - { bucket; bucket_logging_status; content_m_d5 } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; bucket_logging_status = - Xml.required - "BucketLoggingStatus" + ("CommonPrefixes.member", + (CommonPrefixList.to_query v.common_prefixes))); + Util.option_map v.max_keys + (fun f -> Query.Pair ("MaxKeys", (Integer.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("Delimiter", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Some + (Query.Pair + ("Contents.member", (ObjectList.to_query v.contents))); + Util.option_map v.next_marker + (fun f -> Query.Pair ("NextMarker", (String.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("Marker", (String.to_query f))); + Util.option_map v.is_truncated + (fun f -> Query.Pair ("IsTruncated", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Some + ("common_prefixes", + (CommonPrefixList.to_json v.common_prefixes)); + Util.option_map v.max_keys + (fun f -> ("max_keys", (Integer.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Some ("contents", (ObjectList.to_json v.contents)); + Util.option_map v.next_marker + (fun f -> ("next_marker", (String.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.is_truncated + (fun f -> ("is_truncated", (Boolean.to_json f)))]) + let of_json j = + { + is_truncated = + (Util.option_map (Json.lookup j "is_truncated") Boolean.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + next_marker = + (Util.option_map (Json.lookup j "next_marker") String.of_json); + contents = + (ObjectList.of_json (Util.of_option_exn (Json.lookup j "contents"))); + name = (Util.option_map (Json.lookup j "name") String.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + max_keys = + (Util.option_map (Json.lookup j "max_keys") Integer.of_json); + common_prefixes = + (CommonPrefixList.of_json + (Util.of_option_exn (Json.lookup j "common_prefixes"))); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json) + } + end +module RestoreObjectOutput = + struct + type t = { + request_charged: RequestCharged.t option } + let make ?request_charged () = { request_charged } + let parse xml = + Some + { + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f)))]) + let of_json j = + { + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module HeadObjectOutput = + struct + type t = + { + delete_marker: Boolean.t option ; + accept_ranges: String.t option ; + expiration: String.t option ; + restore: String.t option ; + last_modified: DateTime.t option ; + content_length: Integer.t option ; + e_tag: String.t option ; + missing_meta: Integer.t option ; + version_id: String.t option ; + cache_control: String.t option ; + content_disposition: String.t option ; + content_encoding: String.t option ; + content_language: String.t option ; + content_type: String.t option ; + expires: DateTime.t option ; + website_redirect_location: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + metadata: Metadata.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + storage_class: StorageClass.t option ; + request_charged: RequestCharged.t option ; + replication_status: ReplicationStatus.t option } + let make ?delete_marker ?accept_ranges ?expiration ?restore + ?last_modified ?content_length ?e_tag ?missing_meta ?version_id + ?cache_control ?content_disposition ?content_encoding + ?content_language ?content_type ?expires ?website_redirect_location + ?server_side_encryption ?metadata ?s_s_e_customer_algorithm + ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id ?storage_class + ?request_charged ?replication_status () = + { + delete_marker; + accept_ranges; + expiration; + restore; + last_modified; + content_length; + e_tag; + missing_meta; + version_id; + cache_control; + content_disposition; + content_encoding; + content_language; + content_type; + expires; + website_redirect_location; + server_side_encryption; + metadata; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + storage_class; + request_charged; + replication_status + } + let parse xml = + Some + { + delete_marker = + (Util.option_bind (Xml.member "x-amz-delete-marker" xml) + Boolean.parse); + accept_ranges = + (Util.option_bind (Xml.member "accept-ranges" xml) String.parse); + expiration = + (Util.option_bind (Xml.member "x-amz-expiration" xml) + String.parse); + restore = + (Util.option_bind (Xml.member "x-amz-restore" xml) String.parse); + last_modified = + (Util.option_bind (Xml.member "Last-Modified" xml) DateTime.parse); + content_length = + (Util.option_bind (Xml.member "Content-Length" xml) Integer.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + missing_meta = + (Util.option_bind (Xml.member "x-amz-missing-meta" xml) + Integer.parse); + version_id = + (Util.option_bind (Xml.member "x-amz-version-id" xml) + String.parse); + cache_control = + (Util.option_bind (Xml.member "Cache-Control" xml) String.parse); + content_disposition = + (Util.option_bind (Xml.member "Content-Disposition" xml) + String.parse); + content_encoding = + (Util.option_bind (Xml.member "Content-Encoding" xml) + String.parse); + content_language = + (Util.option_bind (Xml.member "Content-Language" xml) + String.parse); + content_type = + (Util.option_bind (Xml.member "Content-Type" xml) String.parse); + expires = + (Util.option_bind (Xml.member "Expires" xml) DateTime.parse); + website_redirect_location = + (Util.option_bind + (Xml.member "x-amz-website-redirect-location" xml) + String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + metadata = + (Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = (Util.option_bind - (Xml.member "BucketLoggingStatus" xml) - BucketLoggingStatus.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + storage_class = + (Util.option_bind (Xml.member "x-amz-storage-class" xml) + StorageClass.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse); + replication_status = + (Util.option_bind (Xml.member "x-amz-replication-status" xml) + ReplicationStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_status + (fun f -> + Query.Pair + ("x-amz-replication-status", + (ReplicationStatus.to_query f))); + Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair ("x-amz-storage-class", (StorageClass.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.metadata + (fun f -> Query.Pair ("x-amz-meta-", (Metadata.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.website_redirect_location + (fun f -> + Query.Pair + ("x-amz-website-redirect-location", (String.to_query f))); + Util.option_map v.expires + (fun f -> Query.Pair ("Expires", (DateTime.to_query f))); + Util.option_map v.content_type + (fun f -> Query.Pair ("Content-Type", (String.to_query f))); + Util.option_map v.content_language + (fun f -> Query.Pair ("Content-Language", (String.to_query f))); + Util.option_map v.content_encoding + (fun f -> Query.Pair ("Content-Encoding", (String.to_query f))); + Util.option_map v.content_disposition + (fun f -> + Query.Pair ("Content-Disposition", (String.to_query f))); + Util.option_map v.cache_control + (fun f -> Query.Pair ("Cache-Control", (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("x-amz-version-id", (String.to_query f))); + Util.option_map v.missing_meta + (fun f -> + Query.Pair ("x-amz-missing-meta", (Integer.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.content_length + (fun f -> Query.Pair ("Content-Length", (Integer.to_query f))); + Util.option_map v.last_modified + (fun f -> Query.Pair ("Last-Modified", (DateTime.to_query f))); + Util.option_map v.restore + (fun f -> Query.Pair ("x-amz-restore", (String.to_query f))); + Util.option_map v.expiration + (fun f -> Query.Pair ("x-amz-expiration", (String.to_query f))); + Util.option_map v.accept_ranges + (fun f -> Query.Pair ("accept-ranges", (String.to_query f))); + Util.option_map v.delete_marker + (fun f -> + Query.Pair ("x-amz-delete-marker", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_status + (fun f -> ("replication_status", (ReplicationStatus.to_json f))); + Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.metadata + (fun f -> ("metadata", (Metadata.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.website_redirect_location + (fun f -> ("website_redirect_location", (String.to_json f))); + Util.option_map v.expires + (fun f -> ("expires", (DateTime.to_json f))); + Util.option_map v.content_type + (fun f -> ("content_type", (String.to_json f))); + Util.option_map v.content_language + (fun f -> ("content_language", (String.to_json f))); + Util.option_map v.content_encoding + (fun f -> ("content_encoding", (String.to_json f))); + Util.option_map v.content_disposition + (fun f -> ("content_disposition", (String.to_json f))); + Util.option_map v.cache_control + (fun f -> ("cache_control", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.missing_meta + (fun f -> ("missing_meta", (Integer.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.content_length + (fun f -> ("content_length", (Integer.to_json f))); + Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.restore + (fun f -> ("restore", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (String.to_json f))); + Util.option_map v.accept_ranges + (fun f -> ("accept_ranges", (String.to_json f))); + Util.option_map v.delete_marker + (fun f -> ("delete_marker", (Boolean.to_json f)))]) + let of_json j = + { + delete_marker = + (Util.option_map (Json.lookup j "delete_marker") Boolean.of_json); + accept_ranges = + (Util.option_map (Json.lookup j "accept_ranges") String.of_json); + expiration = + (Util.option_map (Json.lookup j "expiration") String.of_json); + restore = (Util.option_map (Json.lookup j "restore") String.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json); + content_length = + (Util.option_map (Json.lookup j "content_length") Integer.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + missing_meta = + (Util.option_map (Json.lookup j "missing_meta") Integer.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + cache_control = + (Util.option_map (Json.lookup j "cache_control") String.of_json); + content_disposition = + (Util.option_map (Json.lookup j "content_disposition") + String.of_json); + content_encoding = + (Util.option_map (Json.lookup j "content_encoding") String.of_json); + content_language = + (Util.option_map (Json.lookup j "content_language") String.of_json); + content_type = + (Util.option_map (Json.lookup j "content_type") String.of_json); + expires = + (Util.option_map (Json.lookup j "expires") DateTime.of_json); + website_redirect_location = + (Util.option_map (Json.lookup j "website_redirect_location") + String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + metadata = + (Util.option_map (Json.lookup j "metadata") Metadata.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json); + replication_status = + (Util.option_map (Json.lookup j "replication_status") + ReplicationStatus.of_json) + } + end +module GetBucketLifecycleOutput = + struct + type t = { + rules: Rules.t } + let make ?(rules= []) () = { rules } + let parse xml = Some { rules = (Util.of_option [] (Rules.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Rule", (Rules.to_query v.rules)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("rules", (Rules.to_json v.rules))]) + let of_json j = + { rules = (Rules.of_json (Util.of_option_exn (Json.lookup j "rules"))) + } + end +module PutBucketLifecycleRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + lifecycle_configuration: LifecycleConfiguration.t option } + let make ~bucket ?content_m_d5 ?lifecycle_configuration () = + { bucket; content_m_d5; lifecycle_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + lifecycle_configuration = + (Util.option_bind (Xml.member "LifecycleConfiguration" xml) + LifecycleConfiguration.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.lifecycle_configuration + (fun f -> + Query.Pair + ("LifecycleConfiguration", + (LifecycleConfiguration.to_query f))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.lifecycle_configuration + (fun f -> + ("lifecycle_configuration", + (LifecycleConfiguration.to_json f))); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + lifecycle_configuration = + (Util.option_map (Json.lookup j "lifecycle_configuration") + LifecycleConfiguration.of_json) + } + end +module PutObjectAclOutput = + struct + type t = { + request_charged: RequestCharged.t option } + let make ?request_charged () = { request_charged } + let parse xml = + Some + { + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f)))]) + let of_json j = + { + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module ListPartsRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + max_parts: Integer.t option ; + part_number_marker: Integer.t option ; + upload_id: String.t ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?max_parts ?part_number_marker ~upload_id + ?request_payer () = + { bucket; key; max_parts; part_number_marker; upload_id; request_payer + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + max_parts = + (Util.option_bind (Xml.member "max-parts" xml) Integer.parse); + part_number_marker = + (Util.option_bind (Xml.member "part-number-marker" xml) + Integer.parse); + upload_id = + (Xml.required "uploadId" + (Util.option_bind (Xml.member "uploadId" xml) String.parse)); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Some (Query.Pair ("uploadId", (String.to_query v.upload_id))); + Util.option_map v.part_number_marker + (fun f -> + Query.Pair ("part-number-marker", (Integer.to_query f))); + Util.option_map v.max_parts + (fun f -> Query.Pair ("max-parts", (Integer.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Some ("upload_id", (String.to_json v.upload_id)); + Util.option_map v.part_number_marker + (fun f -> ("part_number_marker", (Integer.to_json f))); + Util.option_map v.max_parts + (fun f -> ("max_parts", (Integer.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + max_parts = + (Util.option_map (Json.lookup j "max_parts") Integer.of_json); + part_number_marker = + (Util.option_map (Json.lookup j "part_number_marker") + Integer.of_json); + upload_id = + (String.of_json (Util.of_option_exn (Json.lookup j "upload_id"))); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetObjectTorrentOutput = + struct + type t = { + body: Blob.t option ; + request_charged: RequestCharged.t option } + let make ?body ?request_charged () = { body; request_charged } + let parse xml = + Some + { + body = (Util.option_bind (Xml.member "Body" xml) Blob.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (Blob.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.body (fun f -> ("body", (Blob.to_json f)))]) + let of_json j = + { + body = (Util.option_map (Json.lookup j "body") Blob.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module PutObjectAclRequest = + struct + type t = + { + a_c_l: ObjectCannedACL.t option ; + access_control_policy: AccessControlPolicy.t option ; + bucket: String.t ; + content_m_d5: String.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write: String.t option ; + grant_write_a_c_p: String.t option ; + key: String.t ; + request_payer: RequestPayer.t option } + let make ?a_c_l ?access_control_policy ~bucket ?content_m_d5 + ?grant_full_control ?grant_read ?grant_read_a_c_p ?grant_write + ?grant_write_a_c_p ~key ?request_payer () = + { + a_c_l; + access_control_policy; + bucket; + content_m_d5; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write; + grant_write_a_c_p; + key; + request_payer + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + ObjectCannedACL.parse); + access_control_policy = + (Util.option_bind (Xml.member "AccessControlPolicy" xml) + AccessControlPolicy.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write = + (Util.option_bind (Xml.member "x-amz-grant-write" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_write + (fun f -> Query.Pair ("x-amz-grant-write", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.access_control_policy + (fun f -> + Query.Pair + ("AccessControlPolicy", (AccessControlPolicy.to_query f))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (ObjectCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_write + (fun f -> ("grant_write", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.access_control_policy + (fun f -> + ("access_control_policy", (AccessControlPolicy.to_json f))); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (ObjectCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json); + access_control_policy = + (Util.option_map (Json.lookup j "access_control_policy") + AccessControlPolicy.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write = + (Util.option_map (Json.lookup j "grant_write") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module CreateBucketRequest = + struct + type t = + { + a_c_l: BucketCannedACL.t option ; + bucket: String.t ; + create_bucket_configuration: CreateBucketConfiguration.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write: String.t option ; + grant_write_a_c_p: String.t option } + let make ?a_c_l ~bucket ?create_bucket_configuration + ?grant_full_control ?grant_read ?grant_read_a_c_p ?grant_write + ?grant_write_a_c_p () = + { + a_c_l; + bucket; + create_bucket_configuration; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write; + grant_write_a_c_p + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + BucketCannedACL.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + create_bucket_configuration = + (Util.option_bind (Xml.member "CreateBucketConfiguration" xml) + CreateBucketConfiguration.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write = + (Util.option_bind (Xml.member "x-amz-grant-write" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_write + (fun f -> Query.Pair ("x-amz-grant-write", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.create_bucket_configuration + (fun f -> + Query.Pair + ("CreateBucketConfiguration", + (CreateBucketConfiguration.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (BucketCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_write + (fun f -> ("grant_write", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.create_bucket_configuration + (fun f -> + ("create_bucket_configuration", + (CreateBucketConfiguration.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (BucketCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") BucketCannedACL.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + create_bucket_configuration = + (Util.option_map (Json.lookup j "create_bucket_configuration") + CreateBucketConfiguration.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write = + (Util.option_map (Json.lookup j "grant_write") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json) + } + end +module HeadBucketRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module DeleteObjectRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + m_f_a: String.t option ; + version_id: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?m_f_a ?version_id ?request_payer () = + { bucket; key; m_f_a; version_id; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + m_f_a = + (Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse); + version_id = + (Util.option_bind (Xml.member "versionId" xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("versionId", (String.to_query f))); + Util.option_map v.m_f_a + (fun f -> Query.Pair ("x-amz-mfa", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.m_f_a (fun f -> ("m_f_a", (String.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + m_f_a = (Util.option_map (Json.lookup j "m_f_a") String.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetBucketTaggingRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module AbortMultipartUploadRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + upload_id: String.t ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ~upload_id ?request_payer () = + { bucket; key; upload_id; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + upload_id = + (Xml.required "uploadId" + (Util.option_bind (Xml.member "uploadId" xml) String.parse)); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Some (Query.Pair ("uploadId", (String.to_query v.upload_id))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Some ("upload_id", (String.to_json v.upload_id)); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + upload_id = + (String.of_json (Util.of_option_exn (Json.lookup j "upload_id"))); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetBucketLocationOutput = + struct + type t = { + location_constraint: BucketLocationConstraint.t option } + let make ?location_constraint () = { location_constraint } + let parse xml = + Some + { + location_constraint = + (Util.option_bind (Xml.member "LocationConstraint" xml) + BucketLocationConstraint.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.location_constraint + (fun f -> + Query.Pair + ("LocationConstraint", + (BucketLocationConstraint.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.location_constraint + (fun f -> + ("location_constraint", + (BucketLocationConstraint.to_json f)))]) + let of_json j = + { + location_constraint = + (Util.option_map (Json.lookup j "location_constraint") + BucketLocationConstraint.of_json) + } + end +module GetBucketCorsOutput = + struct + type t = { + c_o_r_s_rules: CORSRules.t } + let make ?(c_o_r_s_rules= []) () = { c_o_r_s_rules } + let parse xml = + Some { c_o_r_s_rules = (Util.of_option [] (CORSRules.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("CORSRule", (CORSRules.to_query v.c_o_r_s_rules)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("c_o_r_s_rules", (CORSRules.to_json v.c_o_r_s_rules))]) + let of_json j = + { + c_o_r_s_rules = + (CORSRules.of_json + (Util.of_option_exn (Json.lookup j "c_o_r_s_rules"))) + } + end +module GetBucketPolicyRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module PutBucketLoggingRequest = + struct + type t = + { + bucket: String.t ; + bucket_logging_status: BucketLoggingStatus.t ; + content_m_d5: String.t option } + let make ~bucket ~bucket_logging_status ?content_m_d5 () = + { bucket; bucket_logging_status; content_m_d5 } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + bucket_logging_status = + (Xml.required "BucketLoggingStatus" + (Util.option_bind (Xml.member "BucketLoggingStatus" xml) + BucketLoggingStatus.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair - ( "BucketLoggingStatus" - , BucketLoggingStatus.to_query v.bucket_logging_status )) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some - ("bucket_logging_status", BucketLoggingStatus.to_json v.bucket_logging_status) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; bucket_logging_status = - BucketLoggingStatus.of_json - (Util.of_option_exn (Json.lookup j "bucket_logging_status")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - } -end - -module UploadPartRequest = struct - type t = - { body : Blob.t option - ; bucket : String.t - ; content_length : Integer.t option - ; content_m_d5 : String.t option - ; key : String.t - ; part_number : Integer.t - ; upload_id : String.t - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ?body - ~bucket - ?content_length - ?content_m_d5 - ~key - ~part_number - ~upload_id - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?request_payer - () = - { body - ; bucket - ; content_length - ; content_m_d5 - ; key - ; part_number - ; upload_id - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; request_payer - } - - let parse xml = - Some - { body = Util.option_bind (Xml.member "Body" xml) Blob.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_length = Util.option_bind (Xml.member "Content-Length" xml) Integer.parse - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; part_number = - Xml.required - "partNumber" - (Util.option_bind (Xml.member "partNumber" xml) Integer.parse) - ; upload_id = - Xml.required - "uploadId" - (Util.option_bind (Xml.member "uploadId" xml) String.parse) - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Some (Query.Pair ("uploadId", String.to_query v.upload_id)) - ; Some (Query.Pair ("partNumber", Integer.to_query v.part_number)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Util.option_map v.content_length (fun f -> - Query.Pair ("Content-Length", Integer.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.body (fun f -> Query.Pair ("Body", Blob.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Some ("upload_id", String.to_json v.upload_id) - ; Some ("part_number", Integer.to_json v.part_number) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Util.option_map v.content_length (fun f -> "content_length", Integer.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.body (fun f -> "body", Blob.to_json f) - ]) - - let of_json j = - { body = Util.option_map (Json.lookup j "body") Blob.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_length = Util.option_map (Json.lookup j "content_length") Integer.of_json - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; part_number = Integer.of_json (Util.of_option_exn (Json.lookup j "part_number")) - ; upload_id = String.of_json (Util.of_option_exn (Json.lookup j "upload_id")) - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetBucketVersioningRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module CompleteMultipartUploadRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; multipart_upload : CompletedMultipartUpload.t option - ; upload_id : String.t - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?multipart_upload ~upload_id ?request_payer () = - { bucket; key; multipart_upload; upload_id; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; multipart_upload = - Util.option_bind - (Xml.member "CompleteMultipartUpload" xml) - CompletedMultipartUpload.parse - ; upload_id = - Xml.required - "uploadId" - (Util.option_bind (Xml.member "uploadId" xml) String.parse) - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Some (Query.Pair ("uploadId", String.to_query v.upload_id)) - ; Util.option_map v.multipart_upload (fun f -> - Query.Pair ("CompleteMultipartUpload", CompletedMultipartUpload.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Some ("upload_id", String.to_json v.upload_id) - ; Util.option_map v.multipart_upload (fun f -> - "multipart_upload", CompletedMultipartUpload.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; multipart_upload = - Util.option_map - (Json.lookup j "multipart_upload") - CompletedMultipartUpload.of_json - ; upload_id = String.of_json (Util.of_option_exn (Json.lookup j "upload_id")) - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module DeleteBucketPolicyRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetBucketReplicationRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module NoSuchBucket = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteBucketRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module ObjectAlreadyInActiveTierError = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListBucketsOutput = struct - type t = - { buckets : Buckets.t - ; owner : Owner.t option - } - - let make ?(buckets = []) ?owner () = { buckets; owner } - - let parse xml = - Some - { buckets = - Util.of_option [] (Util.option_bind (Xml.member "Buckets" xml) Buckets.parse) - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Some (Query.Pair ("Buckets.member", Buckets.to_query v.buckets)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Some ("buckets", Buckets.to_json v.buckets) - ]) - - let of_json j = - { buckets = Buckets.of_json (Util.of_option_exn (Json.lookup j "buckets")) - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - } -end - -module GetBucketLocationRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module BucketAlreadyExists = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateMultipartUploadRequest = struct - type t = - { a_c_l : ObjectCannedACL.t option - ; bucket : String.t - ; cache_control : String.t option - ; content_disposition : String.t option - ; content_encoding : String.t option - ; content_language : String.t option - ; content_type : String.t option - ; expires : DateTime.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write_a_c_p : String.t option - ; key : String.t - ; metadata : Metadata.t option - ; server_side_encryption : ServerSideEncryption.t option - ; storage_class : StorageClass.t option - ; website_redirect_location : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ?a_c_l - ~bucket - ?cache_control - ?content_disposition - ?content_encoding - ?content_language - ?content_type - ?expires - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write_a_c_p - ~key - ?metadata - ?server_side_encryption - ?storage_class - ?website_redirect_location - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_payer - () = - { a_c_l - ; bucket - ; cache_control - ; content_disposition - ; content_encoding - ; content_language - ; content_type - ; expires - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write_a_c_p - ; key - ; metadata - ; server_side_encryption - ; storage_class - ; website_redirect_location - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_payer - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) ObjectCannedACL.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; cache_control = Util.option_bind (Xml.member "Cache-Control" xml) String.parse - ; content_disposition = - Util.option_bind (Xml.member "Content-Disposition" xml) String.parse - ; content_encoding = - Util.option_bind (Xml.member "Content-Encoding" xml) String.parse - ; content_language = - Util.option_bind (Xml.member "Content-Language" xml) String.parse - ; content_type = Util.option_bind (Xml.member "Content-Type" xml) String.parse - ; expires = Util.option_bind (Xml.member "Expires" xml) DateTime.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; metadata = Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; storage_class = - Util.option_bind (Xml.member "x-amz-storage-class" xml) StorageClass.parse - ; website_redirect_location = - Util.option_bind (Xml.member "x-amz-website-redirect-location" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.website_redirect_location (fun f -> - Query.Pair ("x-amz-website-redirect-location", String.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("x-amz-storage-class", StorageClass.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.metadata (fun f -> - Query.Pair ("x-amz-meta-", Metadata.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.expires (fun f -> - Query.Pair ("Expires", DateTime.to_query f)) - ; Util.option_map v.content_type (fun f -> - Query.Pair ("Content-Type", String.to_query f)) - ; Util.option_map v.content_language (fun f -> - Query.Pair ("Content-Language", String.to_query f)) - ; Util.option_map v.content_encoding (fun f -> - Query.Pair ("Content-Encoding", String.to_query f)) - ; Util.option_map v.content_disposition (fun f -> - Query.Pair ("Content-Disposition", String.to_query f)) - ; Util.option_map v.cache_control (fun f -> - Query.Pair ("Cache-Control", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", ObjectCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.website_redirect_location (fun f -> - "website_redirect_location", String.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.metadata (fun f -> "metadata", Metadata.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.expires (fun f -> "expires", DateTime.to_json f) - ; Util.option_map v.content_type (fun f -> "content_type", String.to_json f) - ; Util.option_map v.content_language (fun f -> - "content_language", String.to_json f) - ; Util.option_map v.content_encoding (fun f -> - "content_encoding", String.to_json f) - ; Util.option_map v.content_disposition (fun f -> - "content_disposition", String.to_json f) - ; Util.option_map v.cache_control (fun f -> "cache_control", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", ObjectCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; cache_control = Util.option_map (Json.lookup j "cache_control") String.of_json - ; content_disposition = - Util.option_map (Json.lookup j "content_disposition") String.of_json - ; content_encoding = Util.option_map (Json.lookup j "content_encoding") String.of_json - ; content_language = Util.option_map (Json.lookup j "content_language") String.of_json - ; content_type = Util.option_map (Json.lookup j "content_type") String.of_json - ; expires = Util.option_map (Json.lookup j "expires") DateTime.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; metadata = Util.option_map (Json.lookup j "metadata") Metadata.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; website_redirect_location = - Util.option_map (Json.lookup j "website_redirect_location") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetBucketPolicyOutput = struct - type t = { policy : String.t option } - - let make ?policy () = { policy } - - let parse xml = - Some { policy = Util.option_bind (Xml.member "Policy" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.policy (fun f -> Query.Pair ("Policy", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.policy (fun f -> "policy", String.to_json f) ]) - - let of_json j = { policy = Util.option_map (Json.lookup j "policy") String.of_json } -end - -module RestoreObjectRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; version_id : String.t option - ; restore_request : RestoreRequest.t option - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?version_id ?restore_request ?request_payer () = - { bucket; key; version_id; restore_request; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; version_id = Util.option_bind (Xml.member "versionId" xml) String.parse - ; restore_request = - Util.option_bind (Xml.member "RestoreRequest" xml) RestoreRequest.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.restore_request (fun f -> - Query.Pair ("RestoreRequest", RestoreRequest.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("versionId", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.restore_request (fun f -> - "restore_request", RestoreRequest.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; restore_request = - Util.option_map (Json.lookup j "restore_request") RestoreRequest.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module PutBucketPolicyRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; policy : String.t - } - - let make ~bucket ?content_m_d5 ~policy () = { bucket; content_m_d5; policy } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; policy = - Xml.required "Policy" (Util.option_bind (Xml.member "Policy" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Policy", String.to_query v.policy)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("policy", String.to_json v.policy) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; policy = String.of_json (Util.of_option_exn (Json.lookup j "policy")) - } -end - -module PutBucketNotificationRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; notification_configuration : NotificationConfigurationDeprecated.t - } - - let make ~bucket ?content_m_d5 ~notification_configuration () = - { bucket; content_m_d5; notification_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; notification_configuration = - Xml.required - "NotificationConfiguration" + ("BucketLoggingStatus", + (BucketLoggingStatus.to_query v.bucket_logging_status))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some + ("bucket_logging_status", + (BucketLoggingStatus.to_json v.bucket_logging_status)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + bucket_logging_status = + (BucketLoggingStatus.of_json + (Util.of_option_exn (Json.lookup j "bucket_logging_status"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json) + } + end +module UploadPartRequest = + struct + type t = + { + body: Blob.t option ; + bucket: String.t ; + content_length: Integer.t option ; + content_m_d5: String.t option ; + key: String.t ; + part_number: Integer.t ; + upload_id: String.t ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + request_payer: RequestPayer.t option } + let make ?body ~bucket ?content_length ?content_m_d5 ~key + ~part_number ~upload_id ?s_s_e_customer_algorithm + ?s_s_e_customer_key ?s_s_e_customer_key_m_d5 ?request_payer () = + { + body; + bucket; + content_length; + content_m_d5; + key; + part_number; + upload_id; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + request_payer + } + let parse xml = + Some + { + body = (Util.option_bind (Xml.member "Body" xml) Blob.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_length = + (Util.option_bind (Xml.member "Content-Length" xml) Integer.parse); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + part_number = + (Xml.required "partNumber" + (Util.option_bind (Xml.member "partNumber" xml) Integer.parse)); + upload_id = + (Xml.required "uploadId" + (Util.option_bind (Xml.member "uploadId" xml) String.parse)); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Some (Query.Pair ("uploadId", (String.to_query v.upload_id))); + Some (Query.Pair ("partNumber", (Integer.to_query v.part_number))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Util.option_map v.content_length + (fun f -> Query.Pair ("Content-Length", (Integer.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (Blob.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Some ("upload_id", (String.to_json v.upload_id)); + Some ("part_number", (Integer.to_json v.part_number)); + Some ("key", (String.to_json v.key)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Util.option_map v.content_length + (fun f -> ("content_length", (Integer.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.body (fun f -> ("body", (Blob.to_json f)))]) + let of_json j = + { + body = (Util.option_map (Json.lookup j "body") Blob.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_length = + (Util.option_map (Json.lookup j "content_length") Integer.of_json); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + part_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "part_number"))); + upload_id = + (String.of_json (Util.of_option_exn (Json.lookup j "upload_id"))); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetBucketVersioningRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module CompleteMultipartUploadRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + multipart_upload: CompletedMultipartUpload.t option ; + upload_id: String.t ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?multipart_upload ~upload_id ?request_payer () + = { bucket; key; multipart_upload; upload_id; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + multipart_upload = + (Util.option_bind (Xml.member "CompleteMultipartUpload" xml) + CompletedMultipartUpload.parse); + upload_id = + (Xml.required "uploadId" + (Util.option_bind (Xml.member "uploadId" xml) String.parse)); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Some (Query.Pair ("uploadId", (String.to_query v.upload_id))); + Util.option_map v.multipart_upload + (fun f -> + Query.Pair + ("CompleteMultipartUpload", + (CompletedMultipartUpload.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Some ("upload_id", (String.to_json v.upload_id)); + Util.option_map v.multipart_upload + (fun f -> + ("multipart_upload", (CompletedMultipartUpload.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + multipart_upload = + (Util.option_map (Json.lookup j "multipart_upload") + CompletedMultipartUpload.of_json); + upload_id = + (String.of_json (Util.of_option_exn (Json.lookup j "upload_id"))); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module DeleteBucketPolicyRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetBucketReplicationRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module NoSuchBucket = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteBucketRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module ObjectAlreadyInActiveTierError = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListBucketsOutput = + struct + type t = { + buckets: Buckets.t ; + owner: Owner.t option } + let make ?(buckets= []) ?owner () = { buckets; owner } + let parse xml = + Some + { + buckets = + (Util.of_option [] + (Util.option_bind (Xml.member "Buckets" xml) Buckets.parse)); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Some (Query.Pair ("Buckets.member", (Buckets.to_query v.buckets)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Some ("buckets", (Buckets.to_json v.buckets))]) + let of_json j = + { + buckets = + (Buckets.of_json (Util.of_option_exn (Json.lookup j "buckets"))); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json) + } + end +module GetBucketLocationRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module BucketAlreadyExists = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateMultipartUploadRequest = + struct + type t = + { + a_c_l: ObjectCannedACL.t option ; + bucket: String.t ; + cache_control: String.t option ; + content_disposition: String.t option ; + content_encoding: String.t option ; + content_language: String.t option ; + content_type: String.t option ; + expires: DateTime.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write_a_c_p: String.t option ; + key: String.t ; + metadata: Metadata.t option ; + server_side_encryption: ServerSideEncryption.t option ; + storage_class: StorageClass.t option ; + website_redirect_location: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_payer: RequestPayer.t option } + let make ?a_c_l ~bucket ?cache_control ?content_disposition + ?content_encoding ?content_language ?content_type ?expires + ?grant_full_control ?grant_read ?grant_read_a_c_p ?grant_write_a_c_p + ~key ?metadata ?server_side_encryption ?storage_class + ?website_redirect_location ?s_s_e_customer_algorithm + ?s_s_e_customer_key ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id + ?request_payer () = + { + a_c_l; + bucket; + cache_control; + content_disposition; + content_encoding; + content_language; + content_type; + expires; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write_a_c_p; + key; + metadata; + server_side_encryption; + storage_class; + website_redirect_location; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_payer + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + ObjectCannedACL.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + cache_control = + (Util.option_bind (Xml.member "Cache-Control" xml) String.parse); + content_disposition = + (Util.option_bind (Xml.member "Content-Disposition" xml) + String.parse); + content_encoding = + (Util.option_bind (Xml.member "Content-Encoding" xml) + String.parse); + content_language = + (Util.option_bind (Xml.member "Content-Language" xml) + String.parse); + content_type = + (Util.option_bind (Xml.member "Content-Type" xml) String.parse); + expires = + (Util.option_bind (Xml.member "Expires" xml) DateTime.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + metadata = + (Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + storage_class = + (Util.option_bind (Xml.member "x-amz-storage-class" xml) + StorageClass.parse); + website_redirect_location = + (Util.option_bind + (Xml.member "x-amz-website-redirect-location" xml) + String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.website_redirect_location + (fun f -> + Query.Pair + ("x-amz-website-redirect-location", (String.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair ("x-amz-storage-class", (StorageClass.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.metadata + (fun f -> Query.Pair ("x-amz-meta-", (Metadata.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.expires + (fun f -> Query.Pair ("Expires", (DateTime.to_query f))); + Util.option_map v.content_type + (fun f -> Query.Pair ("Content-Type", (String.to_query f))); + Util.option_map v.content_language + (fun f -> Query.Pair ("Content-Language", (String.to_query f))); + Util.option_map v.content_encoding + (fun f -> Query.Pair ("Content-Encoding", (String.to_query f))); + Util.option_map v.content_disposition + (fun f -> + Query.Pair ("Content-Disposition", (String.to_query f))); + Util.option_map v.cache_control + (fun f -> Query.Pair ("Cache-Control", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (ObjectCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.website_redirect_location + (fun f -> ("website_redirect_location", (String.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.metadata + (fun f -> ("metadata", (Metadata.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.expires + (fun f -> ("expires", (DateTime.to_json f))); + Util.option_map v.content_type + (fun f -> ("content_type", (String.to_json f))); + Util.option_map v.content_language + (fun f -> ("content_language", (String.to_json f))); + Util.option_map v.content_encoding + (fun f -> ("content_encoding", (String.to_json f))); + Util.option_map v.content_disposition + (fun f -> ("content_disposition", (String.to_json f))); + Util.option_map v.cache_control + (fun f -> ("cache_control", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (ObjectCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + cache_control = + (Util.option_map (Json.lookup j "cache_control") String.of_json); + content_disposition = + (Util.option_map (Json.lookup j "content_disposition") + String.of_json); + content_encoding = + (Util.option_map (Json.lookup j "content_encoding") String.of_json); + content_language = + (Util.option_map (Json.lookup j "content_language") String.of_json); + content_type = + (Util.option_map (Json.lookup j "content_type") String.of_json); + expires = + (Util.option_map (Json.lookup j "expires") DateTime.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + metadata = + (Util.option_map (Json.lookup j "metadata") Metadata.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + website_redirect_location = + (Util.option_map (Json.lookup j "website_redirect_location") + String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetBucketPolicyOutput = + struct + type t = { + policy: String.t option } + let make ?policy () = { policy } + let parse xml = + Some + { policy = (Util.option_bind (Xml.member "Policy" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.policy + (fun f -> Query.Pair ("Policy", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.policy + (fun f -> ("policy", (String.to_json f)))]) + let of_json j = + { policy = (Util.option_map (Json.lookup j "policy") String.of_json) } + end +module RestoreObjectRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + version_id: String.t option ; + restore_request: RestoreRequest.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?version_id ?restore_request ?request_payer () + = { bucket; key; version_id; restore_request; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + version_id = + (Util.option_bind (Xml.member "versionId" xml) String.parse); + restore_request = + (Util.option_bind (Xml.member "RestoreRequest" xml) + RestoreRequest.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.restore_request + (fun f -> + Query.Pair ("RestoreRequest", (RestoreRequest.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("versionId", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.restore_request + (fun f -> ("restore_request", (RestoreRequest.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + restore_request = + (Util.option_map (Json.lookup j "restore_request") + RestoreRequest.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module PutBucketPolicyRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + policy: String.t } + let make ~bucket ?content_m_d5 ~policy () = + { bucket; content_m_d5; policy } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + policy = + (Xml.required "Policy" + (Util.option_bind (Xml.member "Policy" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Policy", (String.to_query v.policy))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("policy", (String.to_json v.policy)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + policy = + (String.of_json (Util.of_option_exn (Json.lookup j "policy"))) + } + end +module PutBucketNotificationRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + notification_configuration: NotificationConfigurationDeprecated.t } + let make ~bucket ?content_m_d5 ~notification_configuration () = + { bucket; content_m_d5; notification_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + notification_configuration = + (Xml.required "NotificationConfiguration" + (Util.option_bind (Xml.member "NotificationConfiguration" xml) + NotificationConfigurationDeprecated.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NotificationConfiguration", + (NotificationConfigurationDeprecated.to_query + v.notification_configuration))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("notification_configuration", + (NotificationConfigurationDeprecated.to_json + v.notification_configuration)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + notification_configuration = + (NotificationConfigurationDeprecated.of_json + (Util.of_option_exn (Json.lookup j "notification_configuration"))) + } + end +module PutObjectOutput = + struct + type t = + { + expiration: String.t option ; + e_tag: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + version_id: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?expiration ?e_tag ?server_side_encryption ?version_id + ?s_s_e_customer_algorithm ?s_s_e_customer_key_m_d5 + ?s_s_e_k_m_s_key_id ?request_charged () = + { + expiration; + e_tag; + server_side_encryption; + version_id; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + expiration = + (Util.option_bind (Xml.member "x-amz-expiration" xml) + String.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + version_id = + (Util.option_bind (Xml.member "x-amz-version-id" xml) + String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = (Util.option_bind - (Xml.member "NotificationConfiguration" xml) - NotificationConfigurationDeprecated.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("x-amz-version-id", (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.expiration + (fun f -> Query.Pair ("x-amz-expiration", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (String.to_json f)))]) + let of_json j = + { + expiration = + (Util.option_map (Json.lookup j "expiration") String.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module GetBucketTaggingOutput = + struct + type t = { + tag_set: TagSet.t } + let make ~tag_set () = { tag_set } + let parse xml = + Some + { + tag_set = + (Xml.required "TagSet" + (Util.option_bind (Xml.member "TagSet" xml) TagSet.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("TagSet.member", (TagSet.to_query v.tag_set)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("tag_set", (TagSet.to_json v.tag_set))]) + let of_json j = + { + tag_set = + (TagSet.of_json (Util.of_option_exn (Json.lookup j "tag_set"))) + } + end +module ListObjectVersionsOutput = + struct + type t = + { + is_truncated: Boolean.t option ; + key_marker: String.t option ; + version_id_marker: String.t option ; + next_key_marker: String.t option ; + next_version_id_marker: String.t option ; + versions: ObjectVersionList.t ; + delete_markers: DeleteMarkers.t ; + name: String.t option ; + prefix: String.t option ; + delimiter: String.t option ; + max_keys: Integer.t option ; + common_prefixes: CommonPrefixList.t ; + encoding_type: EncodingType.t option } + let make ?is_truncated ?key_marker ?version_id_marker ?next_key_marker + ?next_version_id_marker ?(versions= []) ?(delete_markers= []) ?name + ?prefix ?delimiter ?max_keys ?(common_prefixes= []) ?encoding_type + () = + { + is_truncated; + key_marker; + version_id_marker; + next_key_marker; + next_version_id_marker; + versions; + delete_markers; + name; + prefix; + delimiter; + max_keys; + common_prefixes; + encoding_type + } + let parse xml = + Some + { + is_truncated = + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); + key_marker = + (Util.option_bind (Xml.member "KeyMarker" xml) String.parse); + version_id_marker = + (Util.option_bind (Xml.member "VersionIdMarker" xml) String.parse); + next_key_marker = + (Util.option_bind (Xml.member "NextKeyMarker" xml) String.parse); + next_version_id_marker = + (Util.option_bind (Xml.member "NextVersionIdMarker" xml) + String.parse); + versions = (Util.of_option [] (ObjectVersionList.parse xml)); + delete_markers = (Util.of_option [] (DeleteMarkers.parse xml)); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse); + delimiter = + (Util.option_bind (Xml.member "Delimiter" xml) String.parse); + max_keys = + (Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); + encoding_type = + (Util.option_bind (Xml.member "EncodingType" xml) + EncodingType.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> + Query.Pair ("EncodingType", (EncodingType.to_query f))); + Some (Query.Pair - ( "NotificationConfiguration" - , NotificationConfigurationDeprecated.to_query - v.notification_configuration )) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "notification_configuration" - , NotificationConfigurationDeprecated.to_json v.notification_configuration ) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; notification_configuration = - NotificationConfigurationDeprecated.of_json - (Util.of_option_exn (Json.lookup j "notification_configuration")) - } -end - -module PutObjectOutput = struct - type t = - { expiration : String.t option - ; e_tag : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; version_id : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?expiration - ?e_tag - ?server_side_encryption - ?version_id - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { expiration - ; e_tag - ; server_side_encryption - ; version_id - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { expiration = Util.option_bind (Xml.member "x-amz-expiration" xml) String.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; version_id = Util.option_bind (Xml.member "x-amz-version-id" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("x-amz-version-id", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("x-amz-expiration", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.expiration (fun f -> "expiration", String.to_json f) - ]) - - let of_json j = - { expiration = Util.option_map (Json.lookup j "expiration") String.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module GetBucketTaggingOutput = struct - type t = { tag_set : TagSet.t } - - let make ~tag_set () = { tag_set } - - let parse xml = - Some - { tag_set = - Xml.required "TagSet" (Util.option_bind (Xml.member "TagSet" xml) TagSet.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("TagSet.member", TagSet.to_query v.tag_set)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("tag_set", TagSet.to_json v.tag_set) ]) - - let of_json j = - { tag_set = TagSet.of_json (Util.of_option_exn (Json.lookup j "tag_set")) } -end - -module ListObjectVersionsOutput = struct - type t = - { is_truncated : Boolean.t option - ; key_marker : String.t option - ; version_id_marker : String.t option - ; next_key_marker : String.t option - ; next_version_id_marker : String.t option - ; versions : ObjectVersionList.t - ; delete_markers : DeleteMarkers.t - ; name : String.t option - ; prefix : String.t option - ; delimiter : String.t option - ; max_keys : Integer.t option - ; common_prefixes : CommonPrefixList.t - ; encoding_type : EncodingType.t option - } - - let make - ?is_truncated - ?key_marker - ?version_id_marker - ?next_key_marker - ?next_version_id_marker - ?(versions = []) - ?(delete_markers = []) - ?name - ?prefix - ?delimiter - ?max_keys - ?(common_prefixes = []) - ?encoding_type - () = - { is_truncated - ; key_marker - ; version_id_marker - ; next_key_marker - ; next_version_id_marker - ; versions - ; delete_markers - ; name - ; prefix - ; delimiter - ; max_keys - ; common_prefixes - ; encoding_type - } - - let parse xml = - Some - { is_truncated = Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse - ; key_marker = Util.option_bind (Xml.member "KeyMarker" xml) String.parse - ; version_id_marker = - Util.option_bind (Xml.member "VersionIdMarker" xml) String.parse - ; next_key_marker = Util.option_bind (Xml.member "NextKeyMarker" xml) String.parse - ; next_version_id_marker = - Util.option_bind (Xml.member "NextVersionIdMarker" xml) String.parse - ; versions = Util.of_option [] (ObjectVersionList.parse xml) - ; delete_markers = Util.of_option [] (DeleteMarkers.parse xml) - ; name = Util.option_bind (Xml.member "Name" xml) String.parse - ; prefix = Util.option_bind (Xml.member "Prefix" xml) String.parse - ; delimiter = Util.option_bind (Xml.member "Delimiter" xml) String.parse - ; max_keys = Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse - ; common_prefixes = Util.of_option [] (CommonPrefixList.parse xml) - ; encoding_type = - Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - Query.Pair ("EncodingType", EncodingType.to_query f)) - ; Some + ("CommonPrefixes.member", + (CommonPrefixList.to_query v.common_prefixes))); + Util.option_map v.max_keys + (fun f -> Query.Pair ("MaxKeys", (Integer.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("Delimiter", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Some (Query.Pair - ("CommonPrefixes.member", CommonPrefixList.to_query v.common_prefixes)) - ; Util.option_map v.max_keys (fun f -> - Query.Pair ("MaxKeys", Integer.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("Delimiter", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ; Some (Query.Pair ("DeleteMarker", DeleteMarkers.to_query v.delete_markers)) - ; Some (Query.Pair ("Version", ObjectVersionList.to_query v.versions)) - ; Util.option_map v.next_version_id_marker (fun f -> - Query.Pair ("NextVersionIdMarker", String.to_query f)) - ; Util.option_map v.next_key_marker (fun f -> - Query.Pair ("NextKeyMarker", String.to_query f)) - ; Util.option_map v.version_id_marker (fun f -> - Query.Pair ("VersionIdMarker", String.to_query f)) - ; Util.option_map v.key_marker (fun f -> - Query.Pair ("KeyMarker", String.to_query f)) - ; Util.option_map v.is_truncated (fun f -> - Query.Pair ("IsTruncated", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Some ("common_prefixes", CommonPrefixList.to_json v.common_prefixes) - ; Util.option_map v.max_keys (fun f -> "max_keys", Integer.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ; Some ("delete_markers", DeleteMarkers.to_json v.delete_markers) - ; Some ("versions", ObjectVersionList.to_json v.versions) - ; Util.option_map v.next_version_id_marker (fun f -> - "next_version_id_marker", String.to_json f) - ; Util.option_map v.next_key_marker (fun f -> - "next_key_marker", String.to_json f) - ; Util.option_map v.version_id_marker (fun f -> - "version_id_marker", String.to_json f) - ; Util.option_map v.key_marker (fun f -> "key_marker", String.to_json f) - ; Util.option_map v.is_truncated (fun f -> "is_truncated", Boolean.to_json f) - ]) - - let of_json j = - { is_truncated = Util.option_map (Json.lookup j "is_truncated") Boolean.of_json - ; key_marker = Util.option_map (Json.lookup j "key_marker") String.of_json - ; version_id_marker = - Util.option_map (Json.lookup j "version_id_marker") String.of_json - ; next_key_marker = Util.option_map (Json.lookup j "next_key_marker") String.of_json - ; next_version_id_marker = - Util.option_map (Json.lookup j "next_version_id_marker") String.of_json - ; versions = ObjectVersionList.of_json (Util.of_option_exn (Json.lookup j "versions")) - ; delete_markers = - DeleteMarkers.of_json (Util.of_option_exn (Json.lookup j "delete_markers")) - ; name = Util.option_map (Json.lookup j "name") String.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; max_keys = Util.option_map (Json.lookup j "max_keys") Integer.of_json - ; common_prefixes = - CommonPrefixList.of_json (Util.of_option_exn (Json.lookup j "common_prefixes")) - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - } -end - -module ObjectNotInActiveTierError = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module PutBucketVersioningRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; m_f_a : String.t option - ; versioning_configuration : VersioningConfiguration.t - } - - let make ~bucket ?content_m_d5 ?m_f_a ~versioning_configuration () = - { bucket; content_m_d5; m_f_a; versioning_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; m_f_a = Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse - ; versioning_configuration = - Xml.required - "VersioningConfiguration" - (Util.option_bind - (Xml.member "VersioningConfiguration" xml) - VersioningConfiguration.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + ("DeleteMarker", (DeleteMarkers.to_query v.delete_markers))); + Some + (Query.Pair ("Version", (ObjectVersionList.to_query v.versions))); + Util.option_map v.next_version_id_marker + (fun f -> + Query.Pair ("NextVersionIdMarker", (String.to_query f))); + Util.option_map v.next_key_marker + (fun f -> Query.Pair ("NextKeyMarker", (String.to_query f))); + Util.option_map v.version_id_marker + (fun f -> Query.Pair ("VersionIdMarker", (String.to_query f))); + Util.option_map v.key_marker + (fun f -> Query.Pair ("KeyMarker", (String.to_query f))); + Util.option_map v.is_truncated + (fun f -> Query.Pair ("IsTruncated", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Some + ("common_prefixes", + (CommonPrefixList.to_json v.common_prefixes)); + Util.option_map v.max_keys + (fun f -> ("max_keys", (Integer.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Some ("delete_markers", (DeleteMarkers.to_json v.delete_markers)); + Some ("versions", (ObjectVersionList.to_json v.versions)); + Util.option_map v.next_version_id_marker + (fun f -> ("next_version_id_marker", (String.to_json f))); + Util.option_map v.next_key_marker + (fun f -> ("next_key_marker", (String.to_json f))); + Util.option_map v.version_id_marker + (fun f -> ("version_id_marker", (String.to_json f))); + Util.option_map v.key_marker + (fun f -> ("key_marker", (String.to_json f))); + Util.option_map v.is_truncated + (fun f -> ("is_truncated", (Boolean.to_json f)))]) + let of_json j = + { + is_truncated = + (Util.option_map (Json.lookup j "is_truncated") Boolean.of_json); + key_marker = + (Util.option_map (Json.lookup j "key_marker") String.of_json); + version_id_marker = + (Util.option_map (Json.lookup j "version_id_marker") String.of_json); + next_key_marker = + (Util.option_map (Json.lookup j "next_key_marker") String.of_json); + next_version_id_marker = + (Util.option_map (Json.lookup j "next_version_id_marker") + String.of_json); + versions = + (ObjectVersionList.of_json + (Util.of_option_exn (Json.lookup j "versions"))); + delete_markers = + (DeleteMarkers.of_json + (Util.of_option_exn (Json.lookup j "delete_markers"))); + name = (Util.option_map (Json.lookup j "name") String.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + max_keys = + (Util.option_map (Json.lookup j "max_keys") Integer.of_json); + common_prefixes = + (CommonPrefixList.of_json + (Util.of_option_exn (Json.lookup j "common_prefixes"))); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json) + } + end +module ObjectNotInActiveTierError = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module PutBucketVersioningRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + m_f_a: String.t option ; + versioning_configuration: VersioningConfiguration.t } + let make ~bucket ?content_m_d5 ?m_f_a ~versioning_configuration () = + { bucket; content_m_d5; m_f_a; versioning_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + m_f_a = + (Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse); + versioning_configuration = + (Xml.required "VersioningConfiguration" + (Util.option_bind (Xml.member "VersioningConfiguration" xml) + VersioningConfiguration.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VersioningConfiguration", + (VersioningConfiguration.to_query + v.versioning_configuration))); + Util.option_map v.m_f_a + (fun f -> Query.Pair ("x-amz-mfa", (String.to_query f))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("versioning_configuration", + (VersioningConfiguration.to_json v.versioning_configuration)); + Util.option_map v.m_f_a (fun f -> ("m_f_a", (String.to_json f))); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + m_f_a = (Util.option_map (Json.lookup j "m_f_a") String.of_json); + versioning_configuration = + (VersioningConfiguration.of_json + (Util.of_option_exn (Json.lookup j "versioning_configuration"))) + } + end +module PutBucketRequestPaymentRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + request_payment_configuration: RequestPaymentConfiguration.t } + let make ~bucket ?content_m_d5 ~request_payment_configuration () = + { bucket; content_m_d5; request_payment_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + request_payment_configuration = + (Xml.required "RequestPaymentConfiguration" + (Util.option_bind + (Xml.member "RequestPaymentConfiguration" xml) + RequestPaymentConfiguration.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("RequestPaymentConfiguration", + (RequestPaymentConfiguration.to_query + v.request_payment_configuration))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("request_payment_configuration", + (RequestPaymentConfiguration.to_json + v.request_payment_configuration)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + request_payment_configuration = + (RequestPaymentConfiguration.of_json + (Util.of_option_exn + (Json.lookup j "request_payment_configuration"))) + } + end +module NoSuchKey = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteObjectsOutput = + struct + type t = + { + deleted: DeletedObjects.t ; + request_charged: RequestCharged.t option ; + errors: Errors.t } + let make ?(deleted= []) ?request_charged ?(errors= []) () = + { deleted; request_charged; errors } + let parse xml = + Some + { + deleted = (Util.of_option [] (DeletedObjects.parse xml)); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse); + errors = (Util.of_option [] (Errors.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Error", (Errors.to_query v.errors))); + Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Some (Query.Pair - ( "VersioningConfiguration" - , VersioningConfiguration.to_query v.versioning_configuration )) - ; Util.option_map v.m_f_a (fun f -> Query.Pair ("x-amz-mfa", String.to_query f)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "versioning_configuration" - , VersioningConfiguration.to_json v.versioning_configuration ) - ; Util.option_map v.m_f_a (fun f -> "m_f_a", String.to_json f) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; m_f_a = Util.option_map (Json.lookup j "m_f_a") String.of_json - ; versioning_configuration = - VersioningConfiguration.of_json - (Util.of_option_exn (Json.lookup j "versioning_configuration")) - } -end - -module PutBucketRequestPaymentRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; request_payment_configuration : RequestPaymentConfiguration.t - } - - let make ~bucket ?content_m_d5 ~request_payment_configuration () = - { bucket; content_m_d5; request_payment_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; request_payment_configuration = - Xml.required - "RequestPaymentConfiguration" + ("Deleted.member", (DeletedObjects.to_query v.deleted)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("errors", (Errors.to_json v.errors)); + Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Some ("deleted", (DeletedObjects.to_json v.deleted))]) + let of_json j = + { + deleted = + (DeletedObjects.of_json + (Util.of_option_exn (Json.lookup j "deleted"))); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json); + errors = + (Errors.of_json (Util.of_option_exn (Json.lookup j "errors"))) + } + end +module DeleteObjectOutput = + struct + type t = + { + delete_marker: Boolean.t option ; + version_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?delete_marker ?version_id ?request_charged () = + { delete_marker; version_id; request_charged } + let parse xml = + Some + { + delete_marker = + (Util.option_bind (Xml.member "x-amz-delete-marker" xml) + Boolean.parse); + version_id = + (Util.option_bind (Xml.member "x-amz-version-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("x-amz-version-id", (String.to_query f))); + Util.option_map v.delete_marker + (fun f -> + Query.Pair ("x-amz-delete-marker", (Boolean.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.delete_marker + (fun f -> ("delete_marker", (Boolean.to_json f)))]) + let of_json j = + { + delete_marker = + (Util.option_map (Json.lookup j "delete_marker") Boolean.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module DeleteBucketReplicationRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module UploadPartCopyOutput = + struct + type t = + { + copy_source_version_id: String.t option ; + copy_part_result: CopyPartResult.t option ; + server_side_encryption: ServerSideEncryption.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?copy_source_version_id ?copy_part_result + ?server_side_encryption ?s_s_e_customer_algorithm + ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id ?request_charged () = + { + copy_source_version_id; + copy_part_result; + server_side_encryption; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + copy_source_version_id = + (Util.option_bind (Xml.member "x-amz-copy-source-version-id" xml) + String.parse); + copy_part_result = + (Util.option_bind (Xml.member "CopyPartResult" xml) + CopyPartResult.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.copy_part_result + (fun f -> + Query.Pair ("CopyPartResult", (CopyPartResult.to_query f))); + Util.option_map v.copy_source_version_id + (fun f -> + Query.Pair + ("x-amz-copy-source-version-id", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.copy_part_result + (fun f -> ("copy_part_result", (CopyPartResult.to_json f))); + Util.option_map v.copy_source_version_id + (fun f -> ("copy_source_version_id", (String.to_json f)))]) + let of_json j = + { + copy_source_version_id = + (Util.option_map (Json.lookup j "copy_source_version_id") + String.of_json); + copy_part_result = + (Util.option_map (Json.lookup j "copy_part_result") + CopyPartResult.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module ListObjectsRequest = + struct + type t = + { + bucket: String.t ; + delimiter: String.t option ; + encoding_type: EncodingType.t option ; + marker: String.t option ; + max_keys: Integer.t option ; + prefix: String.t option } + let make ~bucket ?delimiter ?encoding_type ?marker ?max_keys ?prefix + () = { bucket; delimiter; encoding_type; marker; max_keys; prefix } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + delimiter = + (Util.option_bind (Xml.member "delimiter" xml) String.parse); + encoding_type = + (Util.option_bind (Xml.member "encoding-type" xml) + EncodingType.parse); + marker = (Util.option_bind (Xml.member "marker" xml) String.parse); + max_keys = + (Util.option_bind (Xml.member "max-keys" xml) Integer.parse); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> Query.Pair ("prefix", (String.to_query f))); + Util.option_map v.max_keys + (fun f -> Query.Pair ("max-keys", (Integer.to_query f))); + Util.option_map v.marker + (fun f -> Query.Pair ("marker", (String.to_query f))); + Util.option_map v.encoding_type + (fun f -> + Query.Pair ("encoding-type", (EncodingType.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("delimiter", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.prefix + (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.max_keys + (fun f -> ("max_keys", (Integer.to_json f))); + Util.option_map v.marker (fun f -> ("marker", (String.to_json f))); + Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json); + marker = (Util.option_map (Json.lookup j "marker") String.of_json); + max_keys = + (Util.option_map (Json.lookup j "max_keys") Integer.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json) + } + end +module CompleteMultipartUploadOutput = + struct + type t = + { + location: String.t option ; + bucket: String.t option ; + key: String.t option ; + expiration: String.t option ; + e_tag: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + version_id: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?location ?bucket ?key ?expiration ?e_tag + ?server_side_encryption ?version_id ?s_s_e_k_m_s_key_id + ?request_charged () = + { + location; + bucket; + key; + expiration; + e_tag; + server_side_encryption; + version_id; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + location = + (Util.option_bind (Xml.member "Location" xml) String.parse); + bucket = (Util.option_bind (Xml.member "Bucket" xml) String.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + expiration = + (Util.option_bind (Xml.member "x-amz-expiration" xml) + String.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + version_id = + (Util.option_bind (Xml.member "x-amz-version-id" xml) + String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("x-amz-version-id", (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.expiration + (fun f -> Query.Pair ("x-amz-expiration", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f))); + Util.option_map v.location + (fun f -> Query.Pair ("Location", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f))); + Util.option_map v.location + (fun f -> ("location", (String.to_json f)))]) + let of_json j = + { + location = + (Util.option_map (Json.lookup j "location") String.of_json); + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + expiration = + (Util.option_map (Json.lookup j "expiration") String.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module PutObjectRequest = + struct + type t = + { + a_c_l: ObjectCannedACL.t option ; + body: Blob.t option ; + bucket: String.t ; + cache_control: String.t option ; + content_disposition: String.t option ; + content_encoding: String.t option ; + content_language: String.t option ; + content_length: Integer.t option ; + content_m_d5: String.t option ; + content_type: String.t option ; + expires: DateTime.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write_a_c_p: String.t option ; + key: String.t ; + metadata: Metadata.t option ; + server_side_encryption: ServerSideEncryption.t option ; + storage_class: StorageClass.t option ; + website_redirect_location: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_payer: RequestPayer.t option } + let make ?a_c_l ?body ~bucket ?cache_control ?content_disposition + ?content_encoding ?content_language ?content_length ?content_m_d5 + ?content_type ?expires ?grant_full_control ?grant_read + ?grant_read_a_c_p ?grant_write_a_c_p ~key ?metadata + ?server_side_encryption ?storage_class ?website_redirect_location + ?s_s_e_customer_algorithm ?s_s_e_customer_key + ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id ?request_payer () = + { + a_c_l; + body; + bucket; + cache_control; + content_disposition; + content_encoding; + content_language; + content_length; + content_m_d5; + content_type; + expires; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write_a_c_p; + key; + metadata; + server_side_encryption; + storage_class; + website_redirect_location; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_payer + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + ObjectCannedACL.parse); + body = (Util.option_bind (Xml.member "Body" xml) Blob.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + cache_control = + (Util.option_bind (Xml.member "Cache-Control" xml) String.parse); + content_disposition = + (Util.option_bind (Xml.member "Content-Disposition" xml) + String.parse); + content_encoding = + (Util.option_bind (Xml.member "Content-Encoding" xml) + String.parse); + content_language = + (Util.option_bind (Xml.member "Content-Language" xml) + String.parse); + content_length = + (Util.option_bind (Xml.member "Content-Length" xml) Integer.parse); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + content_type = + (Util.option_bind (Xml.member "Content-Type" xml) String.parse); + expires = + (Util.option_bind (Xml.member "Expires" xml) DateTime.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + metadata = + (Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + storage_class = + (Util.option_bind (Xml.member "x-amz-storage-class" xml) + StorageClass.parse); + website_redirect_location = + (Util.option_bind + (Xml.member "x-amz-website-redirect-location" xml) + String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.website_redirect_location + (fun f -> + Query.Pair + ("x-amz-website-redirect-location", (String.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair ("x-amz-storage-class", (StorageClass.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.metadata + (fun f -> Query.Pair ("x-amz-meta-", (Metadata.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.expires + (fun f -> Query.Pair ("Expires", (DateTime.to_query f))); + Util.option_map v.content_type + (fun f -> Query.Pair ("Content-Type", (String.to_query f))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Util.option_map v.content_length + (fun f -> Query.Pair ("Content-Length", (Integer.to_query f))); + Util.option_map v.content_language + (fun f -> Query.Pair ("Content-Language", (String.to_query f))); + Util.option_map v.content_encoding + (fun f -> Query.Pair ("Content-Encoding", (String.to_query f))); + Util.option_map v.content_disposition + (fun f -> + Query.Pair ("Content-Disposition", (String.to_query f))); + Util.option_map v.cache_control + (fun f -> Query.Pair ("Cache-Control", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (Blob.to_query f))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (ObjectCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.website_redirect_location + (fun f -> ("website_redirect_location", (String.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.metadata + (fun f -> ("metadata", (Metadata.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.expires + (fun f -> ("expires", (DateTime.to_json f))); + Util.option_map v.content_type + (fun f -> ("content_type", (String.to_json f))); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Util.option_map v.content_length + (fun f -> ("content_length", (Integer.to_json f))); + Util.option_map v.content_language + (fun f -> ("content_language", (String.to_json f))); + Util.option_map v.content_encoding + (fun f -> ("content_encoding", (String.to_json f))); + Util.option_map v.content_disposition + (fun f -> ("content_disposition", (String.to_json f))); + Util.option_map v.cache_control + (fun f -> ("cache_control", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.body (fun f -> ("body", (Blob.to_json f))); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (ObjectCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json); + body = (Util.option_map (Json.lookup j "body") Blob.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + cache_control = + (Util.option_map (Json.lookup j "cache_control") String.of_json); + content_disposition = + (Util.option_map (Json.lookup j "content_disposition") + String.of_json); + content_encoding = + (Util.option_map (Json.lookup j "content_encoding") String.of_json); + content_language = + (Util.option_map (Json.lookup j "content_language") String.of_json); + content_length = + (Util.option_map (Json.lookup j "content_length") Integer.of_json); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + content_type = + (Util.option_map (Json.lookup j "content_type") String.of_json); + expires = + (Util.option_map (Json.lookup j "expires") DateTime.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + metadata = + (Util.option_map (Json.lookup j "metadata") Metadata.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + website_redirect_location = + (Util.option_map (Json.lookup j "website_redirect_location") + String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module PutBucketAclRequest = + struct + type t = + { + a_c_l: BucketCannedACL.t option ; + access_control_policy: AccessControlPolicy.t option ; + bucket: String.t ; + content_m_d5: String.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write: String.t option ; + grant_write_a_c_p: String.t option } + let make ?a_c_l ?access_control_policy ~bucket ?content_m_d5 + ?grant_full_control ?grant_read ?grant_read_a_c_p ?grant_write + ?grant_write_a_c_p () = + { + a_c_l; + access_control_policy; + bucket; + content_m_d5; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write; + grant_write_a_c_p + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + BucketCannedACL.parse); + access_control_policy = + (Util.option_bind (Xml.member "AccessControlPolicy" xml) + AccessControlPolicy.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write = + (Util.option_bind (Xml.member "x-amz-grant-write" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_write + (fun f -> Query.Pair ("x-amz-grant-write", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.access_control_policy + (fun f -> + Query.Pair + ("AccessControlPolicy", (AccessControlPolicy.to_query f))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (BucketCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_write + (fun f -> ("grant_write", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.access_control_policy + (fun f -> + ("access_control_policy", (AccessControlPolicy.to_json f))); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (BucketCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") BucketCannedACL.of_json); + access_control_policy = + (Util.option_map (Json.lookup j "access_control_policy") + AccessControlPolicy.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write = + (Util.option_map (Json.lookup j "grant_write") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json) + } + end +module GetObjectAclRequest = + struct + type t = + { + bucket: String.t ; + key: String.t ; + version_id: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ~key ?version_id ?request_payer () = + { bucket; key; version_id; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + version_id = + (Util.option_bind (Xml.member "versionId" xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("versionId", (String.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Some ("key", (String.to_json v.key)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module GetBucketAclOutput = + struct + type t = { + owner: Owner.t option ; + grants: Grants.t } + let make ?owner ?(grants= []) () = { owner; grants } + let parse xml = + Some + { + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); + grants = + (Util.of_option [] + (Util.option_bind (Xml.member "AccessControlList" xml) + Grants.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("AccessControlList", (Grants.to_query v.grants))); + Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("grants", (Grants.to_json v.grants)); + Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f)))]) + let of_json j = + { + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json); + grants = + (Grants.of_json (Util.of_option_exn (Json.lookup j "grants"))) + } + end +module GetObjectAclOutput = + struct + type t = + { + owner: Owner.t option ; + grants: Grants.t ; + request_charged: RequestCharged.t option } + let make ?owner ?(grants= []) ?request_charged () = + { owner; grants; request_charged } + let parse xml = + Some + { + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); + grants = + (Util.of_option [] + (Util.option_bind (Xml.member "AccessControlList" xml) + Grants.parse)); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Some + (Query.Pair ("AccessControlList", (Grants.to_query v.grants))); + Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Some ("grants", (Grants.to_json v.grants)); + Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f)))]) + let of_json j = + { + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json); + grants = + (Grants.of_json (Util.of_option_exn (Json.lookup j "grants"))); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module GetBucketRequestPaymentRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module DeleteObjectsRequest = + struct + type t = + { + bucket: String.t ; + delete: Delete.t ; + m_f_a: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ~delete ?m_f_a ?request_payer () = + { bucket; delete; m_f_a; request_payer } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + delete = + (Xml.required "Delete" + (Util.option_bind (Xml.member "Delete" xml) Delete.parse)); + m_f_a = + (Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.m_f_a + (fun f -> Query.Pair ("x-amz-mfa", (String.to_query f))); + Some (Query.Pair ("Delete", (Delete.to_query v.delete))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.m_f_a (fun f -> ("m_f_a", (String.to_json f))); + Some ("delete", (Delete.to_json v.delete)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + delete = + (Delete.of_json (Util.of_option_exn (Json.lookup j "delete"))); + m_f_a = (Util.option_map (Json.lookup j "m_f_a") String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module UploadPartOutput = + struct + type t = + { + server_side_encryption: ServerSideEncryption.t option ; + e_tag: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?server_side_encryption ?e_tag ?s_s_e_customer_algorithm + ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id ?request_charged () = + { + server_side_encryption; + e_tag; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = (Util.option_bind - (Xml.member "RequestPaymentConfiguration" xml) - RequestPaymentConfiguration.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f)))]) + let of_json j = + { + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module ListPartsOutput = + struct + type t = + { + bucket: String.t option ; + key: String.t option ; + upload_id: String.t option ; + part_number_marker: Integer.t option ; + next_part_number_marker: Integer.t option ; + max_parts: Integer.t option ; + is_truncated: Boolean.t option ; + parts: Parts.t ; + initiator: Initiator.t option ; + owner: Owner.t option ; + storage_class: StorageClass.t option ; + request_charged: RequestCharged.t option } + let make ?bucket ?key ?upload_id ?part_number_marker + ?next_part_number_marker ?max_parts ?is_truncated ?(parts= []) + ?initiator ?owner ?storage_class ?request_charged () = + { + bucket; + key; + upload_id; + part_number_marker; + next_part_number_marker; + max_parts; + is_truncated; + parts; + initiator; + owner; + storage_class; + request_charged + } + let parse xml = + Some + { + bucket = (Util.option_bind (Xml.member "Bucket" xml) String.parse); + key = (Util.option_bind (Xml.member "Key" xml) String.parse); + upload_id = + (Util.option_bind (Xml.member "UploadId" xml) String.parse); + part_number_marker = + (Util.option_bind (Xml.member "PartNumberMarker" xml) + Integer.parse); + next_part_number_marker = + (Util.option_bind (Xml.member "NextPartNumberMarker" xml) + Integer.parse); + max_parts = + (Util.option_bind (Xml.member "MaxParts" xml) Integer.parse); + is_truncated = + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); + parts = (Util.of_option [] (Parts.parse xml)); + initiator = + (Util.option_bind (Xml.member "Initiator" xml) Initiator.parse); + owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); + storage_class = + (Util.option_bind (Xml.member "StorageClass" xml) + StorageClass.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.storage_class + (fun f -> Query.Pair ("StorageClass", (StorageClass.to_query f))); + Util.option_map v.owner + (fun f -> Query.Pair ("Owner", (Owner.to_query f))); + Util.option_map v.initiator + (fun f -> Query.Pair ("Initiator", (Initiator.to_query f))); + Some (Query.Pair ("Part", (Parts.to_query v.parts))); + Util.option_map v.is_truncated + (fun f -> Query.Pair ("IsTruncated", (Boolean.to_query f))); + Util.option_map v.max_parts + (fun f -> Query.Pair ("MaxParts", (Integer.to_query f))); + Util.option_map v.next_part_number_marker + (fun f -> + Query.Pair ("NextPartNumberMarker", (Integer.to_query f))); + Util.option_map v.part_number_marker + (fun f -> Query.Pair ("PartNumberMarker", (Integer.to_query f))); + Util.option_map v.upload_id + (fun f -> Query.Pair ("UploadId", (String.to_query f))); + Util.option_map v.key + (fun f -> Query.Pair ("Key", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.owner (fun f -> ("owner", (Owner.to_json f))); + Util.option_map v.initiator + (fun f -> ("initiator", (Initiator.to_json f))); + Some ("parts", (Parts.to_json v.parts)); + Util.option_map v.is_truncated + (fun f -> ("is_truncated", (Boolean.to_json f))); + Util.option_map v.max_parts + (fun f -> ("max_parts", (Integer.to_json f))); + Util.option_map v.next_part_number_marker + (fun f -> ("next_part_number_marker", (Integer.to_json f))); + Util.option_map v.part_number_marker + (fun f -> ("part_number_marker", (Integer.to_json f))); + Util.option_map v.upload_id + (fun f -> ("upload_id", (String.to_json f))); + Util.option_map v.key (fun f -> ("key", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f)))]) + let of_json j = + { + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + key = (Util.option_map (Json.lookup j "key") String.of_json); + upload_id = + (Util.option_map (Json.lookup j "upload_id") String.of_json); + part_number_marker = + (Util.option_map (Json.lookup j "part_number_marker") + Integer.of_json); + next_part_number_marker = + (Util.option_map (Json.lookup j "next_part_number_marker") + Integer.of_json); + max_parts = + (Util.option_map (Json.lookup j "max_parts") Integer.of_json); + is_truncated = + (Util.option_map (Json.lookup j "is_truncated") Boolean.of_json); + parts = (Parts.of_json (Util.of_option_exn (Json.lookup j "parts"))); + initiator = + (Util.option_map (Json.lookup j "initiator") Initiator.of_json); + owner = (Util.option_map (Json.lookup j "owner") Owner.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module UploadPartCopyRequest = + struct + type t = + { + bucket: String.t ; + copy_source: String.t ; + copy_source_if_match: String.t option ; + copy_source_if_modified_since: DateTime.t option ; + copy_source_if_none_match: String.t option ; + copy_source_if_unmodified_since: DateTime.t option ; + copy_source_range: String.t option ; + key: String.t ; + part_number: Integer.t ; + upload_id: String.t ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + copy_source_s_s_e_customer_algorithm: String.t option ; + copy_source_s_s_e_customer_key: String.t option ; + copy_source_s_s_e_customer_key_m_d5: String.t option ; + request_payer: RequestPayer.t option } + let make ~bucket ~copy_source ?copy_source_if_match + ?copy_source_if_modified_since ?copy_source_if_none_match + ?copy_source_if_unmodified_since ?copy_source_range ~key + ~part_number ~upload_id ?s_s_e_customer_algorithm + ?s_s_e_customer_key ?s_s_e_customer_key_m_d5 + ?copy_source_s_s_e_customer_algorithm ?copy_source_s_s_e_customer_key + ?copy_source_s_s_e_customer_key_m_d5 ?request_payer () = + { + bucket; + copy_source; + copy_source_if_match; + copy_source_if_modified_since; + copy_source_if_none_match; + copy_source_if_unmodified_since; + copy_source_range; + key; + part_number; + upload_id; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + copy_source_s_s_e_customer_algorithm; + copy_source_s_s_e_customer_key; + copy_source_s_s_e_customer_key_m_d5; + request_payer + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + copy_source = + (Xml.required "x-amz-copy-source" + (Util.option_bind (Xml.member "x-amz-copy-source" xml) + String.parse)); + copy_source_if_match = + (Util.option_bind (Xml.member "x-amz-copy-source-if-match" xml) + String.parse); + copy_source_if_modified_since = + (Util.option_bind + (Xml.member "x-amz-copy-source-if-modified-since" xml) + DateTime.parse); + copy_source_if_none_match = + (Util.option_bind + (Xml.member "x-amz-copy-source-if-none-match" xml) + String.parse); + copy_source_if_unmodified_since = + (Util.option_bind + (Xml.member "x-amz-copy-source-if-unmodified-since" xml) + DateTime.parse); + copy_source_range = + (Util.option_bind (Xml.member "x-amz-copy-source-range" xml) + String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + part_number = + (Xml.required "partNumber" + (Util.option_bind (Xml.member "partNumber" xml) Integer.parse)); + upload_id = + (Xml.required "uploadId" + (Util.option_bind (Xml.member "uploadId" xml) String.parse)); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + copy_source_s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-algorithm" + xml) String.parse); + copy_source_s_s_e_customer_key = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-key" xml) + String.parse); + copy_source_s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-key-MD5" + xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Some (Query.Pair ("uploadId", (String.to_query v.upload_id))); + Some (Query.Pair ("partNumber", (Integer.to_query v.part_number))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.copy_source_range + (fun f -> + Query.Pair ("x-amz-copy-source-range", (String.to_query f))); + Util.option_map v.copy_source_if_unmodified_since + (fun f -> + Query.Pair + ("x-amz-copy-source-if-unmodified-since", + (DateTime.to_query f))); + Util.option_map v.copy_source_if_none_match + (fun f -> + Query.Pair + ("x-amz-copy-source-if-none-match", (String.to_query f))); + Util.option_map v.copy_source_if_modified_since + (fun f -> + Query.Pair + ("x-amz-copy-source-if-modified-since", + (DateTime.to_query f))); + Util.option_map v.copy_source_if_match + (fun f -> + Query.Pair + ("x-amz-copy-source-if-match", (String.to_query f))); + Some (Query.Pair - ( "RequestPaymentConfiguration" - , RequestPaymentConfiguration.to_query v.request_payment_configuration )) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "request_payment_configuration" - , RequestPaymentConfiguration.to_json v.request_payment_configuration ) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; request_payment_configuration = - RequestPaymentConfiguration.of_json - (Util.of_option_exn (Json.lookup j "request_payment_configuration")) - } -end - -module NoSuchKey = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteObjectsOutput = struct - type t = - { deleted : DeletedObjects.t - ; request_charged : RequestCharged.t option - ; errors : Errors.t - } - - let make ?(deleted = []) ?request_charged ?(errors = []) () = - { deleted; request_charged; errors } - - let parse xml = - Some - { deleted = Util.of_option [] (DeletedObjects.parse xml) - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - ; errors = Util.of_option [] (Errors.parse xml) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Error", Errors.to_query v.errors)) - ; Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Some (Query.Pair ("Deleted.member", DeletedObjects.to_query v.deleted)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("errors", Errors.to_json v.errors) - ; Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Some ("deleted", DeletedObjects.to_json v.deleted) - ]) - - let of_json j = - { deleted = DeletedObjects.of_json (Util.of_option_exn (Json.lookup j "deleted")) - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - ; errors = Errors.of_json (Util.of_option_exn (Json.lookup j "errors")) - } -end - -module DeleteObjectOutput = struct - type t = - { delete_marker : Boolean.t option - ; version_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make ?delete_marker ?version_id ?request_charged () = - { delete_marker; version_id; request_charged } - - let parse xml = - Some - { delete_marker = - Util.option_bind (Xml.member "x-amz-delete-marker" xml) Boolean.parse - ; version_id = Util.option_bind (Xml.member "x-amz-version-id" xml) String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("x-amz-version-id", String.to_query f)) - ; Util.option_map v.delete_marker (fun f -> - Query.Pair ("x-amz-delete-marker", Boolean.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.delete_marker (fun f -> "delete_marker", Boolean.to_json f) - ]) - - let of_json j = - { delete_marker = Util.option_map (Json.lookup j "delete_marker") Boolean.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module DeleteBucketReplicationRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module UploadPartCopyOutput = struct - type t = - { copy_source_version_id : String.t option - ; copy_part_result : CopyPartResult.t option - ; server_side_encryption : ServerSideEncryption.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?copy_source_version_id - ?copy_part_result - ?server_side_encryption - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { copy_source_version_id - ; copy_part_result - ; server_side_encryption - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { copy_source_version_id = - Util.option_bind (Xml.member "x-amz-copy-source-version-id" xml) String.parse - ; copy_part_result = - Util.option_bind (Xml.member "CopyPartResult" xml) CopyPartResult.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.copy_part_result (fun f -> - Query.Pair ("CopyPartResult", CopyPartResult.to_query f)) - ; Util.option_map v.copy_source_version_id (fun f -> - Query.Pair ("x-amz-copy-source-version-id", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.copy_part_result (fun f -> - "copy_part_result", CopyPartResult.to_json f) - ; Util.option_map v.copy_source_version_id (fun f -> - "copy_source_version_id", String.to_json f) - ]) - - let of_json j = - { copy_source_version_id = - Util.option_map (Json.lookup j "copy_source_version_id") String.of_json - ; copy_part_result = - Util.option_map (Json.lookup j "copy_part_result") CopyPartResult.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module ListObjectsRequest = struct - type t = - { bucket : String.t - ; delimiter : String.t option - ; encoding_type : EncodingType.t option - ; marker : String.t option - ; max_keys : Integer.t option - ; prefix : String.t option - } - - let make ~bucket ?delimiter ?encoding_type ?marker ?max_keys ?prefix () = - { bucket; delimiter; encoding_type; marker; max_keys; prefix } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; delimiter = Util.option_bind (Xml.member "delimiter" xml) String.parse - ; encoding_type = - Util.option_bind (Xml.member "encoding-type" xml) EncodingType.parse - ; marker = Util.option_bind (Xml.member "marker" xml) String.parse - ; max_keys = Util.option_bind (Xml.member "max-keys" xml) Integer.parse - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> Query.Pair ("prefix", String.to_query f)) - ; Util.option_map v.max_keys (fun f -> - Query.Pair ("max-keys", Integer.to_query f)) - ; Util.option_map v.marker (fun f -> Query.Pair ("marker", String.to_query f)) - ; Util.option_map v.encoding_type (fun f -> - Query.Pair ("encoding-type", EncodingType.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("delimiter", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.max_keys (fun f -> "max_keys", Integer.to_json f) - ; Util.option_map v.marker (fun f -> "marker", String.to_json f) - ; Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - ; marker = Util.option_map (Json.lookup j "marker") String.of_json - ; max_keys = Util.option_map (Json.lookup j "max_keys") Integer.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - } -end - -module CompleteMultipartUploadOutput = struct - type t = - { location : String.t option - ; bucket : String.t option - ; key : String.t option - ; expiration : String.t option - ; e_tag : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; version_id : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?location - ?bucket - ?key - ?expiration - ?e_tag - ?server_side_encryption - ?version_id - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { location - ; bucket - ; key - ; expiration - ; e_tag - ; server_side_encryption - ; version_id - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { location = Util.option_bind (Xml.member "Location" xml) String.parse - ; bucket = Util.option_bind (Xml.member "Bucket" xml) String.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; expiration = Util.option_bind (Xml.member "x-amz-expiration" xml) String.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; version_id = Util.option_bind (Xml.member "x-amz-version-id" xml) String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("x-amz-version-id", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("x-amz-expiration", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ; Util.option_map v.location (fun f -> - Query.Pair ("Location", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.expiration (fun f -> "expiration", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ; Util.option_map v.location (fun f -> "location", String.to_json f) - ]) - - let of_json j = - { location = Util.option_map (Json.lookup j "location") String.of_json - ; bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; expiration = Util.option_map (Json.lookup j "expiration") String.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module PutObjectRequest = struct - type t = - { a_c_l : ObjectCannedACL.t option - ; body : Blob.t option - ; bucket : String.t - ; cache_control : String.t option - ; content_disposition : String.t option - ; content_encoding : String.t option - ; content_language : String.t option - ; content_length : Integer.t option - ; content_m_d5 : String.t option - ; content_type : String.t option - ; expires : DateTime.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write_a_c_p : String.t option - ; key : String.t - ; metadata : Metadata.t option - ; server_side_encryption : ServerSideEncryption.t option - ; storage_class : StorageClass.t option - ; website_redirect_location : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ?a_c_l - ?body - ~bucket - ?cache_control - ?content_disposition - ?content_encoding - ?content_language - ?content_length - ?content_m_d5 - ?content_type - ?expires - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write_a_c_p - ~key - ?metadata - ?server_side_encryption - ?storage_class - ?website_redirect_location - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_payer - () = - { a_c_l - ; body - ; bucket - ; cache_control - ; content_disposition - ; content_encoding - ; content_language - ; content_length - ; content_m_d5 - ; content_type - ; expires - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write_a_c_p - ; key - ; metadata - ; server_side_encryption - ; storage_class - ; website_redirect_location - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_payer - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) ObjectCannedACL.parse - ; body = Util.option_bind (Xml.member "Body" xml) Blob.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; cache_control = Util.option_bind (Xml.member "Cache-Control" xml) String.parse - ; content_disposition = - Util.option_bind (Xml.member "Content-Disposition" xml) String.parse - ; content_encoding = - Util.option_bind (Xml.member "Content-Encoding" xml) String.parse - ; content_language = - Util.option_bind (Xml.member "Content-Language" xml) String.parse - ; content_length = Util.option_bind (Xml.member "Content-Length" xml) Integer.parse - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; content_type = Util.option_bind (Xml.member "Content-Type" xml) String.parse - ; expires = Util.option_bind (Xml.member "Expires" xml) DateTime.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; metadata = Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; storage_class = - Util.option_bind (Xml.member "x-amz-storage-class" xml) StorageClass.parse - ; website_redirect_location = - Util.option_bind (Xml.member "x-amz-website-redirect-location" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.website_redirect_location (fun f -> - Query.Pair ("x-amz-website-redirect-location", String.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("x-amz-storage-class", StorageClass.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.metadata (fun f -> - Query.Pair ("x-amz-meta-", Metadata.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.expires (fun f -> - Query.Pair ("Expires", DateTime.to_query f)) - ; Util.option_map v.content_type (fun f -> - Query.Pair ("Content-Type", String.to_query f)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Util.option_map v.content_length (fun f -> - Query.Pair ("Content-Length", Integer.to_query f)) - ; Util.option_map v.content_language (fun f -> - Query.Pair ("Content-Language", String.to_query f)) - ; Util.option_map v.content_encoding (fun f -> - Query.Pair ("Content-Encoding", String.to_query f)) - ; Util.option_map v.content_disposition (fun f -> - Query.Pair ("Content-Disposition", String.to_query f)) - ; Util.option_map v.cache_control (fun f -> - Query.Pair ("Cache-Control", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.body (fun f -> Query.Pair ("Body", Blob.to_query f)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", ObjectCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.website_redirect_location (fun f -> - "website_redirect_location", String.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.metadata (fun f -> "metadata", Metadata.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.expires (fun f -> "expires", DateTime.to_json f) - ; Util.option_map v.content_type (fun f -> "content_type", String.to_json f) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Util.option_map v.content_length (fun f -> "content_length", Integer.to_json f) - ; Util.option_map v.content_language (fun f -> - "content_language", String.to_json f) - ; Util.option_map v.content_encoding (fun f -> - "content_encoding", String.to_json f) - ; Util.option_map v.content_disposition (fun f -> - "content_disposition", String.to_json f) - ; Util.option_map v.cache_control (fun f -> "cache_control", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.body (fun f -> "body", Blob.to_json f) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", ObjectCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json - ; body = Util.option_map (Json.lookup j "body") Blob.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; cache_control = Util.option_map (Json.lookup j "cache_control") String.of_json - ; content_disposition = - Util.option_map (Json.lookup j "content_disposition") String.of_json - ; content_encoding = Util.option_map (Json.lookup j "content_encoding") String.of_json - ; content_language = Util.option_map (Json.lookup j "content_language") String.of_json - ; content_length = Util.option_map (Json.lookup j "content_length") Integer.of_json - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; content_type = Util.option_map (Json.lookup j "content_type") String.of_json - ; expires = Util.option_map (Json.lookup j "expires") DateTime.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; metadata = Util.option_map (Json.lookup j "metadata") Metadata.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; website_redirect_location = - Util.option_map (Json.lookup j "website_redirect_location") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module PutBucketAclRequest = struct - type t = - { a_c_l : BucketCannedACL.t option - ; access_control_policy : AccessControlPolicy.t option - ; bucket : String.t - ; content_m_d5 : String.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write : String.t option - ; grant_write_a_c_p : String.t option - } - - let make - ?a_c_l - ?access_control_policy - ~bucket - ?content_m_d5 - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write - ?grant_write_a_c_p + ("x-amz-copy-source", (String.to_query v.copy_source))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_key_m_d5 + (fun f -> + ("copy_source_s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_key + (fun f -> ("copy_source_s_s_e_customer_key", (String.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_algorithm + (fun f -> + ("copy_source_s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Some ("upload_id", (String.to_json v.upload_id)); + Some ("part_number", (Integer.to_json v.part_number)); + Some ("key", (String.to_json v.key)); + Util.option_map v.copy_source_range + (fun f -> ("copy_source_range", (String.to_json f))); + Util.option_map v.copy_source_if_unmodified_since + (fun f -> + ("copy_source_if_unmodified_since", (DateTime.to_json f))); + Util.option_map v.copy_source_if_none_match + (fun f -> ("copy_source_if_none_match", (String.to_json f))); + Util.option_map v.copy_source_if_modified_since + (fun f -> + ("copy_source_if_modified_since", (DateTime.to_json f))); + Util.option_map v.copy_source_if_match + (fun f -> ("copy_source_if_match", (String.to_json f))); + Some ("copy_source", (String.to_json v.copy_source)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + copy_source = + (String.of_json (Util.of_option_exn (Json.lookup j "copy_source"))); + copy_source_if_match = + (Util.option_map (Json.lookup j "copy_source_if_match") + String.of_json); + copy_source_if_modified_since = + (Util.option_map (Json.lookup j "copy_source_if_modified_since") + DateTime.of_json); + copy_source_if_none_match = + (Util.option_map (Json.lookup j "copy_source_if_none_match") + String.of_json); + copy_source_if_unmodified_since = + (Util.option_map (Json.lookup j "copy_source_if_unmodified_since") + DateTime.of_json); + copy_source_range = + (Util.option_map (Json.lookup j "copy_source_range") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + part_number = + (Integer.of_json (Util.of_option_exn (Json.lookup j "part_number"))); + upload_id = + (String.of_json (Util.of_option_exn (Json.lookup j "upload_id"))); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + copy_source_s_s_e_customer_algorithm = + (Util.option_map + (Json.lookup j "copy_source_s_s_e_customer_algorithm") + String.of_json); + copy_source_s_s_e_customer_key = + (Util.option_map (Json.lookup j "copy_source_s_s_e_customer_key") + String.of_json); + copy_source_s_s_e_customer_key_m_d5 = + (Util.option_map + (Json.lookup j "copy_source_s_s_e_customer_key_m_d5") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module ListMultipartUploadsOutput = + struct + type t = + { + bucket: String.t option ; + key_marker: String.t option ; + upload_id_marker: String.t option ; + next_key_marker: String.t option ; + prefix: String.t option ; + delimiter: String.t option ; + next_upload_id_marker: String.t option ; + max_uploads: Integer.t option ; + is_truncated: Boolean.t option ; + uploads: MultipartUploadList.t ; + common_prefixes: CommonPrefixList.t ; + encoding_type: EncodingType.t option } + let make ?bucket ?key_marker ?upload_id_marker ?next_key_marker + ?prefix ?delimiter ?next_upload_id_marker ?max_uploads + ?is_truncated ?(uploads= []) ?(common_prefixes= []) ?encoding_type () = - { a_c_l - ; access_control_policy - ; bucket - ; content_m_d5 - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write - ; grant_write_a_c_p - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) BucketCannedACL.parse - ; access_control_policy = - Util.option_bind - (Xml.member "AccessControlPolicy" xml) - AccessControlPolicy.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write = Util.option_bind (Xml.member "x-amz-grant-write" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_write (fun f -> - Query.Pair ("x-amz-grant-write", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.access_control_policy (fun f -> - Query.Pair ("AccessControlPolicy", AccessControlPolicy.to_query f)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", BucketCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_write (fun f -> "grant_write", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.access_control_policy (fun f -> - "access_control_policy", AccessControlPolicy.to_json f) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", BucketCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") BucketCannedACL.of_json - ; access_control_policy = - Util.option_map - (Json.lookup j "access_control_policy") - AccessControlPolicy.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write = Util.option_map (Json.lookup j "grant_write") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - } -end - -module GetObjectAclRequest = struct - type t = - { bucket : String.t - ; key : String.t - ; version_id : String.t option - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~key ?version_id ?request_payer () = - { bucket; key; version_id; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; version_id = Util.option_bind (Xml.member "versionId" xml) String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("versionId", String.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Some ("key", String.to_json v.key) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module GetBucketAclOutput = struct - type t = - { owner : Owner.t option - ; grants : Grants.t - } - - let make ?owner ?(grants = []) () = { owner; grants } - - let parse xml = - Some - { owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - ; grants = - Util.of_option - [] - (Util.option_bind (Xml.member "AccessControlList" xml) Grants.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("AccessControlList", Grants.to_query v.grants)) - ; Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("grants", Grants.to_json v.grants) - ; Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ]) - - let of_json j = - { owner = Util.option_map (Json.lookup j "owner") Owner.of_json - ; grants = Grants.of_json (Util.of_option_exn (Json.lookup j "grants")) - } -end - -module GetObjectAclOutput = struct - type t = - { owner : Owner.t option - ; grants : Grants.t - ; request_charged : RequestCharged.t option - } - - let make ?owner ?(grants = []) ?request_charged () = { owner; grants; request_charged } - - let parse xml = - Some - { owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - ; grants = - Util.of_option - [] - (Util.option_bind (Xml.member "AccessControlList" xml) Grants.parse) - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Some (Query.Pair ("AccessControlList", Grants.to_query v.grants)) - ; Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Some ("grants", Grants.to_json v.grants) - ; Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ]) - - let of_json j = - { owner = Util.option_map (Json.lookup j "owner") Owner.of_json - ; grants = Grants.of_json (Util.of_option_exn (Json.lookup j "grants")) - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module GetBucketRequestPaymentRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module DeleteObjectsRequest = struct - type t = - { bucket : String.t - ; delete : Delete.t - ; m_f_a : String.t option - ; request_payer : RequestPayer.t option - } - - let make ~bucket ~delete ?m_f_a ?request_payer () = - { bucket; delete; m_f_a; request_payer } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; delete = - Xml.required "Delete" (Util.option_bind (Xml.member "Delete" xml) Delete.parse) - ; m_f_a = Util.option_bind (Xml.member "x-amz-mfa" xml) String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.m_f_a (fun f -> Query.Pair ("x-amz-mfa", String.to_query f)) - ; Some (Query.Pair ("Delete", Delete.to_query v.delete)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.m_f_a (fun f -> "m_f_a", String.to_json f) - ; Some ("delete", Delete.to_json v.delete) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; delete = Delete.of_json (Util.of_option_exn (Json.lookup j "delete")) - ; m_f_a = Util.option_map (Json.lookup j "m_f_a") String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module UploadPartOutput = struct - type t = - { server_side_encryption : ServerSideEncryption.t option - ; e_tag : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?server_side_encryption - ?e_tag - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { server_side_encryption - ; e_tag - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ]) - - let of_json j = - { server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module ListPartsOutput = struct - type t = - { bucket : String.t option - ; key : String.t option - ; upload_id : String.t option - ; part_number_marker : Integer.t option - ; next_part_number_marker : Integer.t option - ; max_parts : Integer.t option - ; is_truncated : Boolean.t option - ; parts : Parts.t - ; initiator : Initiator.t option - ; owner : Owner.t option - ; storage_class : StorageClass.t option - ; request_charged : RequestCharged.t option - } - - let make - ?bucket - ?key - ?upload_id - ?part_number_marker - ?next_part_number_marker - ?max_parts - ?is_truncated - ?(parts = []) - ?initiator - ?owner - ?storage_class - ?request_charged - () = - { bucket - ; key - ; upload_id - ; part_number_marker - ; next_part_number_marker - ; max_parts - ; is_truncated - ; parts - ; initiator - ; owner - ; storage_class - ; request_charged - } - - let parse xml = - Some - { bucket = Util.option_bind (Xml.member "Bucket" xml) String.parse - ; key = Util.option_bind (Xml.member "Key" xml) String.parse - ; upload_id = Util.option_bind (Xml.member "UploadId" xml) String.parse - ; part_number_marker = - Util.option_bind (Xml.member "PartNumberMarker" xml) Integer.parse - ; next_part_number_marker = - Util.option_bind (Xml.member "NextPartNumberMarker" xml) Integer.parse - ; max_parts = Util.option_bind (Xml.member "MaxParts" xml) Integer.parse - ; is_truncated = Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse - ; parts = Util.of_option [] (Parts.parse xml) - ; initiator = Util.option_bind (Xml.member "Initiator" xml) Initiator.parse - ; owner = Util.option_bind (Xml.member "Owner" xml) Owner.parse - ; storage_class = - Util.option_bind (Xml.member "StorageClass" xml) StorageClass.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("StorageClass", StorageClass.to_query f)) - ; Util.option_map v.owner (fun f -> Query.Pair ("Owner", Owner.to_query f)) - ; Util.option_map v.initiator (fun f -> - Query.Pair ("Initiator", Initiator.to_query f)) - ; Some (Query.Pair ("Part", Parts.to_query v.parts)) - ; Util.option_map v.is_truncated (fun f -> - Query.Pair ("IsTruncated", Boolean.to_query f)) - ; Util.option_map v.max_parts (fun f -> - Query.Pair ("MaxParts", Integer.to_query f)) - ; Util.option_map v.next_part_number_marker (fun f -> - Query.Pair ("NextPartNumberMarker", Integer.to_query f)) - ; Util.option_map v.part_number_marker (fun f -> - Query.Pair ("PartNumberMarker", Integer.to_query f)) - ; Util.option_map v.upload_id (fun f -> - Query.Pair ("UploadId", String.to_query f)) - ; Util.option_map v.key (fun f -> Query.Pair ("Key", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.owner (fun f -> "owner", Owner.to_json f) - ; Util.option_map v.initiator (fun f -> "initiator", Initiator.to_json f) - ; Some ("parts", Parts.to_json v.parts) - ; Util.option_map v.is_truncated (fun f -> "is_truncated", Boolean.to_json f) - ; Util.option_map v.max_parts (fun f -> "max_parts", Integer.to_json f) - ; Util.option_map v.next_part_number_marker (fun f -> - "next_part_number_marker", Integer.to_json f) - ; Util.option_map v.part_number_marker (fun f -> - "part_number_marker", Integer.to_json f) - ; Util.option_map v.upload_id (fun f -> "upload_id", String.to_json f) - ; Util.option_map v.key (fun f -> "key", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ]) - - let of_json j = - { bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; key = Util.option_map (Json.lookup j "key") String.of_json - ; upload_id = Util.option_map (Json.lookup j "upload_id") String.of_json - ; part_number_marker = - Util.option_map (Json.lookup j "part_number_marker") Integer.of_json - ; next_part_number_marker = - Util.option_map (Json.lookup j "next_part_number_marker") Integer.of_json - ; max_parts = Util.option_map (Json.lookup j "max_parts") Integer.of_json - ; is_truncated = Util.option_map (Json.lookup j "is_truncated") Boolean.of_json - ; parts = Parts.of_json (Util.of_option_exn (Json.lookup j "parts")) - ; initiator = Util.option_map (Json.lookup j "initiator") Initiator.of_json - ; owner = Util.option_map (Json.lookup j "owner") Owner.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module UploadPartCopyRequest = struct - type t = - { bucket : String.t - ; copy_source : String.t - ; copy_source_if_match : String.t option - ; copy_source_if_modified_since : DateTime.t option - ; copy_source_if_none_match : String.t option - ; copy_source_if_unmodified_since : DateTime.t option - ; copy_source_range : String.t option - ; key : String.t - ; part_number : Integer.t - ; upload_id : String.t - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; copy_source_s_s_e_customer_algorithm : String.t option - ; copy_source_s_s_e_customer_key : String.t option - ; copy_source_s_s_e_customer_key_m_d5 : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ~bucket - ~copy_source - ?copy_source_if_match - ?copy_source_if_modified_since - ?copy_source_if_none_match - ?copy_source_if_unmodified_since - ?copy_source_range - ~key - ~part_number - ~upload_id - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?copy_source_s_s_e_customer_algorithm - ?copy_source_s_s_e_customer_key - ?copy_source_s_s_e_customer_key_m_d5 - ?request_payer - () = - { bucket - ; copy_source - ; copy_source_if_match - ; copy_source_if_modified_since - ; copy_source_if_none_match - ; copy_source_if_unmodified_since - ; copy_source_range - ; key - ; part_number - ; upload_id - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; copy_source_s_s_e_customer_algorithm - ; copy_source_s_s_e_customer_key - ; copy_source_s_s_e_customer_key_m_d5 - ; request_payer - } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; copy_source = - Xml.required - "x-amz-copy-source" - (Util.option_bind (Xml.member "x-amz-copy-source" xml) String.parse) - ; copy_source_if_match = - Util.option_bind (Xml.member "x-amz-copy-source-if-match" xml) String.parse - ; copy_source_if_modified_since = - Util.option_bind - (Xml.member "x-amz-copy-source-if-modified-since" xml) - DateTime.parse - ; copy_source_if_none_match = - Util.option_bind (Xml.member "x-amz-copy-source-if-none-match" xml) String.parse - ; copy_source_if_unmodified_since = - Util.option_bind - (Xml.member "x-amz-copy-source-if-unmodified-since" xml) - DateTime.parse - ; copy_source_range = - Util.option_bind (Xml.member "x-amz-copy-source-range" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; part_number = - Xml.required - "partNumber" - (Util.option_bind (Xml.member "partNumber" xml) Integer.parse) - ; upload_id = - Xml.required - "uploadId" - (Util.option_bind (Xml.member "uploadId" xml) String.parse) - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; copy_source_s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-algorithm" xml) - String.parse - ; copy_source_s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-key" xml) - String.parse - ; copy_source_s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-key-MD5" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.copy_source_s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-key-MD5" - , String.to_query f )) - ; Util.option_map v.copy_source_s_s_e_customer_key (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-key" - , String.to_query f )) - ; Util.option_map v.copy_source_s_s_e_customer_algorithm (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-algorithm" - , String.to_query f )) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Some (Query.Pair ("uploadId", String.to_query v.upload_id)) - ; Some (Query.Pair ("partNumber", Integer.to_query v.part_number)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.copy_source_range (fun f -> - Query.Pair ("x-amz-copy-source-range", String.to_query f)) - ; Util.option_map v.copy_source_if_unmodified_since (fun f -> - Query.Pair ("x-amz-copy-source-if-unmodified-since", DateTime.to_query f)) - ; Util.option_map v.copy_source_if_none_match (fun f -> - Query.Pair ("x-amz-copy-source-if-none-match", String.to_query f)) - ; Util.option_map v.copy_source_if_modified_since (fun f -> - Query.Pair ("x-amz-copy-source-if-modified-since", DateTime.to_query f)) - ; Util.option_map v.copy_source_if_match (fun f -> - Query.Pair ("x-amz-copy-source-if-match", String.to_query f)) - ; Some (Query.Pair ("x-amz-copy-source", String.to_query v.copy_source)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_key_m_d5 (fun f -> - "copy_source_s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_key (fun f -> - "copy_source_s_s_e_customer_key", String.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_algorithm (fun f -> - "copy_source_s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Some ("upload_id", String.to_json v.upload_id) - ; Some ("part_number", Integer.to_json v.part_number) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.copy_source_range (fun f -> - "copy_source_range", String.to_json f) - ; Util.option_map v.copy_source_if_unmodified_since (fun f -> - "copy_source_if_unmodified_since", DateTime.to_json f) - ; Util.option_map v.copy_source_if_none_match (fun f -> - "copy_source_if_none_match", String.to_json f) - ; Util.option_map v.copy_source_if_modified_since (fun f -> - "copy_source_if_modified_since", DateTime.to_json f) - ; Util.option_map v.copy_source_if_match (fun f -> - "copy_source_if_match", String.to_json f) - ; Some ("copy_source", String.to_json v.copy_source) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; copy_source = String.of_json (Util.of_option_exn (Json.lookup j "copy_source")) - ; copy_source_if_match = - Util.option_map (Json.lookup j "copy_source_if_match") String.of_json - ; copy_source_if_modified_since = - Util.option_map (Json.lookup j "copy_source_if_modified_since") DateTime.of_json - ; copy_source_if_none_match = - Util.option_map (Json.lookup j "copy_source_if_none_match") String.of_json - ; copy_source_if_unmodified_since = - Util.option_map (Json.lookup j "copy_source_if_unmodified_since") DateTime.of_json - ; copy_source_range = - Util.option_map (Json.lookup j "copy_source_range") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; part_number = Integer.of_json (Util.of_option_exn (Json.lookup j "part_number")) - ; upload_id = String.of_json (Util.of_option_exn (Json.lookup j "upload_id")) - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; copy_source_s_s_e_customer_algorithm = - Util.option_map - (Json.lookup j "copy_source_s_s_e_customer_algorithm") - String.of_json - ; copy_source_s_s_e_customer_key = - Util.option_map (Json.lookup j "copy_source_s_s_e_customer_key") String.of_json - ; copy_source_s_s_e_customer_key_m_d5 = - Util.option_map - (Json.lookup j "copy_source_s_s_e_customer_key_m_d5") - String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module ListMultipartUploadsOutput = struct - type t = - { bucket : String.t option - ; key_marker : String.t option - ; upload_id_marker : String.t option - ; next_key_marker : String.t option - ; prefix : String.t option - ; delimiter : String.t option - ; next_upload_id_marker : String.t option - ; max_uploads : Integer.t option - ; is_truncated : Boolean.t option - ; uploads : MultipartUploadList.t - ; common_prefixes : CommonPrefixList.t - ; encoding_type : EncodingType.t option - } - - let make - ?bucket - ?key_marker - ?upload_id_marker - ?next_key_marker - ?prefix - ?delimiter - ?next_upload_id_marker - ?max_uploads - ?is_truncated - ?(uploads = []) - ?(common_prefixes = []) - ?encoding_type - () = - { bucket - ; key_marker - ; upload_id_marker - ; next_key_marker - ; prefix - ; delimiter - ; next_upload_id_marker - ; max_uploads - ; is_truncated - ; uploads - ; common_prefixes - ; encoding_type - } - - let parse xml = - Some - { bucket = Util.option_bind (Xml.member "Bucket" xml) String.parse - ; key_marker = Util.option_bind (Xml.member "KeyMarker" xml) String.parse - ; upload_id_marker = Util.option_bind (Xml.member "UploadIdMarker" xml) String.parse - ; next_key_marker = Util.option_bind (Xml.member "NextKeyMarker" xml) String.parse - ; prefix = Util.option_bind (Xml.member "Prefix" xml) String.parse - ; delimiter = Util.option_bind (Xml.member "Delimiter" xml) String.parse - ; next_upload_id_marker = - Util.option_bind (Xml.member "NextUploadIdMarker" xml) String.parse - ; max_uploads = Util.option_bind (Xml.member "MaxUploads" xml) Integer.parse - ; is_truncated = Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse - ; uploads = Util.of_option [] (MultipartUploadList.parse xml) - ; common_prefixes = Util.of_option [] (CommonPrefixList.parse xml) - ; encoding_type = - Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - Query.Pair ("EncodingType", EncodingType.to_query f)) - ; Some + { + bucket; + key_marker; + upload_id_marker; + next_key_marker; + prefix; + delimiter; + next_upload_id_marker; + max_uploads; + is_truncated; + uploads; + common_prefixes; + encoding_type + } + let parse xml = + Some + { + bucket = (Util.option_bind (Xml.member "Bucket" xml) String.parse); + key_marker = + (Util.option_bind (Xml.member "KeyMarker" xml) String.parse); + upload_id_marker = + (Util.option_bind (Xml.member "UploadIdMarker" xml) String.parse); + next_key_marker = + (Util.option_bind (Xml.member "NextKeyMarker" xml) String.parse); + prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse); + delimiter = + (Util.option_bind (Xml.member "Delimiter" xml) String.parse); + next_upload_id_marker = + (Util.option_bind (Xml.member "NextUploadIdMarker" xml) + String.parse); + max_uploads = + (Util.option_bind (Xml.member "MaxUploads" xml) Integer.parse); + is_truncated = + (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); + uploads = (Util.of_option [] (MultipartUploadList.parse xml)); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); + encoding_type = + (Util.option_bind (Xml.member "EncodingType" xml) + EncodingType.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> + Query.Pair ("EncodingType", (EncodingType.to_query f))); + Some (Query.Pair - ("CommonPrefixes.member", CommonPrefixList.to_query v.common_prefixes)) - ; Some (Query.Pair ("Upload", MultipartUploadList.to_query v.uploads)) - ; Util.option_map v.is_truncated (fun f -> - Query.Pair ("IsTruncated", Boolean.to_query f)) - ; Util.option_map v.max_uploads (fun f -> - Query.Pair ("MaxUploads", Integer.to_query f)) - ; Util.option_map v.next_upload_id_marker (fun f -> - Query.Pair ("NextUploadIdMarker", String.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("Delimiter", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("Prefix", String.to_query f)) - ; Util.option_map v.next_key_marker (fun f -> - Query.Pair ("NextKeyMarker", String.to_query f)) - ; Util.option_map v.upload_id_marker (fun f -> - Query.Pair ("UploadIdMarker", String.to_query f)) - ; Util.option_map v.key_marker (fun f -> - Query.Pair ("KeyMarker", String.to_query f)) - ; Util.option_map v.bucket (fun f -> Query.Pair ("Bucket", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Some ("common_prefixes", CommonPrefixList.to_json v.common_prefixes) - ; Some ("uploads", MultipartUploadList.to_json v.uploads) - ; Util.option_map v.is_truncated (fun f -> "is_truncated", Boolean.to_json f) - ; Util.option_map v.max_uploads (fun f -> "max_uploads", Integer.to_json f) - ; Util.option_map v.next_upload_id_marker (fun f -> - "next_upload_id_marker", String.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.next_key_marker (fun f -> - "next_key_marker", String.to_json f) - ; Util.option_map v.upload_id_marker (fun f -> - "upload_id_marker", String.to_json f) - ; Util.option_map v.key_marker (fun f -> "key_marker", String.to_json f) - ; Util.option_map v.bucket (fun f -> "bucket", String.to_json f) - ]) - - let of_json j = - { bucket = Util.option_map (Json.lookup j "bucket") String.of_json - ; key_marker = Util.option_map (Json.lookup j "key_marker") String.of_json - ; upload_id_marker = Util.option_map (Json.lookup j "upload_id_marker") String.of_json - ; next_key_marker = Util.option_map (Json.lookup j "next_key_marker") String.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; next_upload_id_marker = - Util.option_map (Json.lookup j "next_upload_id_marker") String.of_json - ; max_uploads = Util.option_map (Json.lookup j "max_uploads") Integer.of_json - ; is_truncated = Util.option_map (Json.lookup j "is_truncated") Boolean.of_json - ; uploads = MultipartUploadList.of_json (Util.of_option_exn (Json.lookup j "uploads")) - ; common_prefixes = - CommonPrefixList.of_json (Util.of_option_exn (Json.lookup j "common_prefixes")) - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - } -end - -module GetBucketLoggingOutput = struct - type t = { logging_enabled : LoggingEnabled.t option } - - let make ?logging_enabled () = { logging_enabled } - - let parse xml = - Some - { logging_enabled = - Util.option_bind (Xml.member "LoggingEnabled" xml) LoggingEnabled.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.logging_enabled (fun f -> - Query.Pair ("LoggingEnabled", LoggingEnabled.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.logging_enabled (fun f -> - "logging_enabled", LoggingEnabled.to_json f) - ]) - - let of_json j = - { logging_enabled = - Util.option_map (Json.lookup j "logging_enabled") LoggingEnabled.of_json - } -end - -module ListObjectVersionsRequest = struct - type t = - { bucket : String.t - ; delimiter : String.t option - ; encoding_type : EncodingType.t option - ; key_marker : String.t option - ; max_keys : Integer.t option - ; prefix : String.t option - ; version_id_marker : String.t option - } - - let make - ~bucket - ?delimiter - ?encoding_type - ?key_marker - ?max_keys - ?prefix - ?version_id_marker - () = - { bucket; delimiter; encoding_type; key_marker; max_keys; prefix; version_id_marker } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; delimiter = Util.option_bind (Xml.member "delimiter" xml) String.parse - ; encoding_type = - Util.option_bind (Xml.member "encoding-type" xml) EncodingType.parse - ; key_marker = Util.option_bind (Xml.member "key-marker" xml) String.parse - ; max_keys = Util.option_bind (Xml.member "max-keys" xml) Integer.parse - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - ; version_id_marker = - Util.option_bind (Xml.member "version-id-marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.version_id_marker (fun f -> - Query.Pair ("version-id-marker", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("prefix", String.to_query f)) - ; Util.option_map v.max_keys (fun f -> - Query.Pair ("max-keys", Integer.to_query f)) - ; Util.option_map v.key_marker (fun f -> - Query.Pair ("key-marker", String.to_query f)) - ; Util.option_map v.encoding_type (fun f -> - Query.Pair ("encoding-type", EncodingType.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("delimiter", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.version_id_marker (fun f -> - "version_id_marker", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.max_keys (fun f -> "max_keys", Integer.to_json f) - ; Util.option_map v.key_marker (fun f -> "key_marker", String.to_json f) - ; Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - ; key_marker = Util.option_map (Json.lookup j "key_marker") String.of_json - ; max_keys = Util.option_map (Json.lookup j "max_keys") Integer.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; version_id_marker = - Util.option_map (Json.lookup j "version_id_marker") String.of_json - } -end - -module NoSuchUpload = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetBucketVersioningOutput = struct - type t = - { status : BucketVersioningStatus.t option - ; m_f_a_delete : MFADeleteStatus.t option - } - - let make ?status ?m_f_a_delete () = { status; m_f_a_delete } - - let parse xml = - Some - { status = Util.option_bind (Xml.member "Status" xml) BucketVersioningStatus.parse - ; m_f_a_delete = Util.option_bind (Xml.member "MfaDelete" xml) MFADeleteStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.m_f_a_delete (fun f -> - Query.Pair ("MfaDelete", MFADeleteStatus.to_query f)) - ; Util.option_map v.status (fun f -> - Query.Pair ("Status", BucketVersioningStatus.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.m_f_a_delete (fun f -> - "m_f_a_delete", MFADeleteStatus.to_json f) - ; Util.option_map v.status (fun f -> "status", BucketVersioningStatus.to_json f) - ]) - - let of_json j = - { status = Util.option_map (Json.lookup j "status") BucketVersioningStatus.of_json - ; m_f_a_delete = - Util.option_map (Json.lookup j "m_f_a_delete") MFADeleteStatus.of_json - } -end - -module CopyObjectRequest = struct - type t = - { a_c_l : ObjectCannedACL.t option - ; bucket : String.t - ; cache_control : String.t option - ; content_disposition : String.t option - ; content_encoding : String.t option - ; content_language : String.t option - ; content_type : String.t option - ; copy_source : String.t - ; copy_source_if_match : String.t option - ; copy_source_if_modified_since : DateTime.t option - ; copy_source_if_none_match : String.t option - ; copy_source_if_unmodified_since : DateTime.t option - ; expires : DateTime.t option - ; grant_full_control : String.t option - ; grant_read : String.t option - ; grant_read_a_c_p : String.t option - ; grant_write_a_c_p : String.t option - ; key : String.t - ; metadata : Metadata.t option - ; metadata_directive : MetadataDirective.t option - ; server_side_encryption : ServerSideEncryption.t option - ; storage_class : StorageClass.t option - ; website_redirect_location : String.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; copy_source_s_s_e_customer_algorithm : String.t option - ; copy_source_s_s_e_customer_key : String.t option - ; copy_source_s_s_e_customer_key_m_d5 : String.t option - ; request_payer : RequestPayer.t option - } - - let make - ?a_c_l - ~bucket - ?cache_control - ?content_disposition - ?content_encoding - ?content_language - ?content_type - ~copy_source - ?copy_source_if_match - ?copy_source_if_modified_since - ?copy_source_if_none_match - ?copy_source_if_unmodified_since - ?expires - ?grant_full_control - ?grant_read - ?grant_read_a_c_p - ?grant_write_a_c_p - ~key - ?metadata - ?metadata_directive - ?server_side_encryption - ?storage_class - ?website_redirect_location - ?s_s_e_customer_algorithm - ?s_s_e_customer_key - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?copy_source_s_s_e_customer_algorithm - ?copy_source_s_s_e_customer_key - ?copy_source_s_s_e_customer_key_m_d5 - ?request_payer - () = - { a_c_l - ; bucket - ; cache_control - ; content_disposition - ; content_encoding - ; content_language - ; content_type - ; copy_source - ; copy_source_if_match - ; copy_source_if_modified_since - ; copy_source_if_none_match - ; copy_source_if_unmodified_since - ; expires - ; grant_full_control - ; grant_read - ; grant_read_a_c_p - ; grant_write_a_c_p - ; key - ; metadata - ; metadata_directive - ; server_side_encryption - ; storage_class - ; website_redirect_location - ; s_s_e_customer_algorithm - ; s_s_e_customer_key - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; copy_source_s_s_e_customer_algorithm - ; copy_source_s_s_e_customer_key - ; copy_source_s_s_e_customer_key_m_d5 - ; request_payer - } - - let parse xml = - Some - { a_c_l = Util.option_bind (Xml.member "x-amz-acl" xml) ObjectCannedACL.parse - ; bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; cache_control = Util.option_bind (Xml.member "Cache-Control" xml) String.parse - ; content_disposition = - Util.option_bind (Xml.member "Content-Disposition" xml) String.parse - ; content_encoding = - Util.option_bind (Xml.member "Content-Encoding" xml) String.parse - ; content_language = - Util.option_bind (Xml.member "Content-Language" xml) String.parse - ; content_type = Util.option_bind (Xml.member "Content-Type" xml) String.parse - ; copy_source = - Xml.required - "x-amz-copy-source" - (Util.option_bind (Xml.member "x-amz-copy-source" xml) String.parse) - ; copy_source_if_match = - Util.option_bind (Xml.member "x-amz-copy-source-if-match" xml) String.parse - ; copy_source_if_modified_since = - Util.option_bind - (Xml.member "x-amz-copy-source-if-modified-since" xml) - DateTime.parse - ; copy_source_if_none_match = - Util.option_bind (Xml.member "x-amz-copy-source-if-none-match" xml) String.parse - ; copy_source_if_unmodified_since = - Util.option_bind - (Xml.member "x-amz-copy-source-if-unmodified-since" xml) - DateTime.parse - ; expires = Util.option_bind (Xml.member "Expires" xml) DateTime.parse - ; grant_full_control = - Util.option_bind (Xml.member "x-amz-grant-full-control" xml) String.parse - ; grant_read = Util.option_bind (Xml.member "x-amz-grant-read" xml) String.parse - ; grant_read_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) String.parse - ; grant_write_a_c_p = - Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) String.parse - ; key = Xml.required "Key" (Util.option_bind (Xml.member "Key" xml) String.parse) - ; metadata = Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse - ; metadata_directive = - Util.option_bind - (Xml.member "x-amz-metadata-directive" xml) - MetadataDirective.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; storage_class = - Util.option_bind (Xml.member "x-amz-storage-class" xml) StorageClass.parse - ; website_redirect_location = - Util.option_bind (Xml.member "x-amz-website-redirect-location" xml) String.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; copy_source_s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-algorithm" xml) - String.parse - ; copy_source_s_s_e_customer_key = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-key" xml) - String.parse - ; copy_source_s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-copy-source-server-side-encryption-customer-key-MD5" xml) - String.parse - ; request_payer = - Util.option_bind (Xml.member "x-amz-request-payer" xml) RequestPayer.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - Query.Pair ("x-amz-request-payer", RequestPayer.to_query f)) - ; Util.option_map v.copy_source_s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-key-MD5" - , String.to_query f )) - ; Util.option_map v.copy_source_s_s_e_customer_key (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-key" - , String.to_query f )) - ; Util.option_map v.copy_source_s_s_e_customer_algorithm (fun f -> - Query.Pair - ( "x-amz-copy-source-server-side-encryption-customer-algorithm" - , String.to_query f )) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key (fun f -> - Query.Pair ("x-amz-server-side-encryption-customer-key", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.website_redirect_location (fun f -> - Query.Pair ("x-amz-website-redirect-location", String.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("x-amz-storage-class", StorageClass.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.metadata_directive (fun f -> - Query.Pair ("x-amz-metadata-directive", MetadataDirective.to_query f)) - ; Util.option_map v.metadata (fun f -> - Query.Pair ("x-amz-meta-", Metadata.to_query f)) - ; Some (Query.Pair ("Key", String.to_query v.key)) - ; Util.option_map v.grant_write_a_c_p (fun f -> - Query.Pair ("x-amz-grant-write-acp", String.to_query f)) - ; Util.option_map v.grant_read_a_c_p (fun f -> - Query.Pair ("x-amz-grant-read-acp", String.to_query f)) - ; Util.option_map v.grant_read (fun f -> - Query.Pair ("x-amz-grant-read", String.to_query f)) - ; Util.option_map v.grant_full_control (fun f -> - Query.Pair ("x-amz-grant-full-control", String.to_query f)) - ; Util.option_map v.expires (fun f -> - Query.Pair ("Expires", DateTime.to_query f)) - ; Util.option_map v.copy_source_if_unmodified_since (fun f -> - Query.Pair ("x-amz-copy-source-if-unmodified-since", DateTime.to_query f)) - ; Util.option_map v.copy_source_if_none_match (fun f -> - Query.Pair ("x-amz-copy-source-if-none-match", String.to_query f)) - ; Util.option_map v.copy_source_if_modified_since (fun f -> - Query.Pair ("x-amz-copy-source-if-modified-since", DateTime.to_query f)) - ; Util.option_map v.copy_source_if_match (fun f -> - Query.Pair ("x-amz-copy-source-if-match", String.to_query f)) - ; Some (Query.Pair ("x-amz-copy-source", String.to_query v.copy_source)) - ; Util.option_map v.content_type (fun f -> - Query.Pair ("Content-Type", String.to_query f)) - ; Util.option_map v.content_language (fun f -> - Query.Pair ("Content-Language", String.to_query f)) - ; Util.option_map v.content_encoding (fun f -> - Query.Pair ("Content-Encoding", String.to_query f)) - ; Util.option_map v.content_disposition (fun f -> - Query.Pair ("Content-Disposition", String.to_query f)) - ; Util.option_map v.cache_control (fun f -> - Query.Pair ("Cache-Control", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ; Util.option_map v.a_c_l (fun f -> - Query.Pair ("x-amz-acl", ObjectCannedACL.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_payer (fun f -> - "request_payer", RequestPayer.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_key_m_d5 (fun f -> - "copy_source_s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_key (fun f -> - "copy_source_s_s_e_customer_key", String.to_json f) - ; Util.option_map v.copy_source_s_s_e_customer_algorithm (fun f -> - "copy_source_s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_key (fun f -> - "s_s_e_customer_key", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.website_redirect_location (fun f -> - "website_redirect_location", String.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.metadata_directive (fun f -> - "metadata_directive", MetadataDirective.to_json f) - ; Util.option_map v.metadata (fun f -> "metadata", Metadata.to_json f) - ; Some ("key", String.to_json v.key) - ; Util.option_map v.grant_write_a_c_p (fun f -> - "grant_write_a_c_p", String.to_json f) - ; Util.option_map v.grant_read_a_c_p (fun f -> - "grant_read_a_c_p", String.to_json f) - ; Util.option_map v.grant_read (fun f -> "grant_read", String.to_json f) - ; Util.option_map v.grant_full_control (fun f -> - "grant_full_control", String.to_json f) - ; Util.option_map v.expires (fun f -> "expires", DateTime.to_json f) - ; Util.option_map v.copy_source_if_unmodified_since (fun f -> - "copy_source_if_unmodified_since", DateTime.to_json f) - ; Util.option_map v.copy_source_if_none_match (fun f -> - "copy_source_if_none_match", String.to_json f) - ; Util.option_map v.copy_source_if_modified_since (fun f -> - "copy_source_if_modified_since", DateTime.to_json f) - ; Util.option_map v.copy_source_if_match (fun f -> - "copy_source_if_match", String.to_json f) - ; Some ("copy_source", String.to_json v.copy_source) - ; Util.option_map v.content_type (fun f -> "content_type", String.to_json f) - ; Util.option_map v.content_language (fun f -> - "content_language", String.to_json f) - ; Util.option_map v.content_encoding (fun f -> - "content_encoding", String.to_json f) - ; Util.option_map v.content_disposition (fun f -> - "content_disposition", String.to_json f) - ; Util.option_map v.cache_control (fun f -> "cache_control", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ; Util.option_map v.a_c_l (fun f -> "a_c_l", ObjectCannedACL.to_json f) - ]) - - let of_json j = - { a_c_l = Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json - ; bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; cache_control = Util.option_map (Json.lookup j "cache_control") String.of_json - ; content_disposition = - Util.option_map (Json.lookup j "content_disposition") String.of_json - ; content_encoding = Util.option_map (Json.lookup j "content_encoding") String.of_json - ; content_language = Util.option_map (Json.lookup j "content_language") String.of_json - ; content_type = Util.option_map (Json.lookup j "content_type") String.of_json - ; copy_source = String.of_json (Util.of_option_exn (Json.lookup j "copy_source")) - ; copy_source_if_match = - Util.option_map (Json.lookup j "copy_source_if_match") String.of_json - ; copy_source_if_modified_since = - Util.option_map (Json.lookup j "copy_source_if_modified_since") DateTime.of_json - ; copy_source_if_none_match = - Util.option_map (Json.lookup j "copy_source_if_none_match") String.of_json - ; copy_source_if_unmodified_since = - Util.option_map (Json.lookup j "copy_source_if_unmodified_since") DateTime.of_json - ; expires = Util.option_map (Json.lookup j "expires") DateTime.of_json - ; grant_full_control = - Util.option_map (Json.lookup j "grant_full_control") String.of_json - ; grant_read = Util.option_map (Json.lookup j "grant_read") String.of_json - ; grant_read_a_c_p = Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json - ; grant_write_a_c_p = - Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json - ; key = String.of_json (Util.of_option_exn (Json.lookup j "key")) - ; metadata = Util.option_map (Json.lookup j "metadata") Metadata.of_json - ; metadata_directive = - Util.option_map (Json.lookup j "metadata_directive") MetadataDirective.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; website_redirect_location = - Util.option_map (Json.lookup j "website_redirect_location") String.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key = - Util.option_map (Json.lookup j "s_s_e_customer_key") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; copy_source_s_s_e_customer_algorithm = - Util.option_map - (Json.lookup j "copy_source_s_s_e_customer_algorithm") - String.of_json - ; copy_source_s_s_e_customer_key = - Util.option_map (Json.lookup j "copy_source_s_s_e_customer_key") String.of_json - ; copy_source_s_s_e_customer_key_m_d5 = - Util.option_map - (Json.lookup j "copy_source_s_s_e_customer_key_m_d5") - String.of_json - ; request_payer = Util.option_map (Json.lookup j "request_payer") RequestPayer.of_json - } -end - -module DeleteBucketCorsRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module CopyObjectOutput = struct - type t = - { copy_object_result : CopyObjectResult.t option - ; expiration : String.t option - ; copy_source_version_id : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; request_charged : RequestCharged.t option - } - - let make - ?copy_object_result - ?expiration - ?copy_source_version_id - ?server_side_encryption - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?request_charged - () = - { copy_object_result - ; expiration - ; copy_source_version_id - ; server_side_encryption - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; request_charged - } - - let parse xml = - Some - { copy_object_result = - Util.option_bind (Xml.member "CopyObjectResult" xml) CopyObjectResult.parse - ; expiration = Util.option_bind (Xml.member "x-amz-expiration" xml) String.parse - ; copy_source_version_id = - Util.option_bind (Xml.member "x-amz-copy-source-version-id" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.copy_source_version_id (fun f -> - Query.Pair ("x-amz-copy-source-version-id", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("x-amz-expiration", String.to_query f)) - ; Util.option_map v.copy_object_result (fun f -> - Query.Pair ("CopyObjectResult", CopyObjectResult.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.copy_source_version_id (fun f -> - "copy_source_version_id", String.to_json f) - ; Util.option_map v.expiration (fun f -> "expiration", String.to_json f) - ; Util.option_map v.copy_object_result (fun f -> - "copy_object_result", CopyObjectResult.to_json f) - ]) - - let of_json j = - { copy_object_result = - Util.option_map (Json.lookup j "copy_object_result") CopyObjectResult.of_json - ; expiration = Util.option_map (Json.lookup j "expiration") String.of_json - ; copy_source_version_id = - Util.option_map (Json.lookup j "copy_source_version_id") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - } -end - -module PutBucketTaggingRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; tagging : Tagging.t - } - - let make ~bucket ?content_m_d5 ~tagging () = { bucket; content_m_d5; tagging } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; tagging = - Xml.required - "Tagging" - (Util.option_bind (Xml.member "Tagging" xml) Tagging.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Tagging", Tagging.to_query v.tagging)) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("tagging", Tagging.to_json v.tagging) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; tagging = Tagging.of_json (Util.of_option_exn (Json.lookup j "tagging")) - } -end - -module DeleteBucketWebsiteRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module PutBucketWebsiteRequest = struct - type t = - { bucket : String.t - ; content_m_d5 : String.t option - ; website_configuration : WebsiteConfiguration.t - } - - let make ~bucket ?content_m_d5 ~website_configuration () = - { bucket; content_m_d5; website_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - ; website_configuration = - Xml.required - "WebsiteConfiguration" + ("CommonPrefixes.member", + (CommonPrefixList.to_query v.common_prefixes))); + Some + (Query.Pair ("Upload", (MultipartUploadList.to_query v.uploads))); + Util.option_map v.is_truncated + (fun f -> Query.Pair ("IsTruncated", (Boolean.to_query f))); + Util.option_map v.max_uploads + (fun f -> Query.Pair ("MaxUploads", (Integer.to_query f))); + Util.option_map v.next_upload_id_marker + (fun f -> Query.Pair ("NextUploadIdMarker", (String.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("Delimiter", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("Prefix", (String.to_query f))); + Util.option_map v.next_key_marker + (fun f -> Query.Pair ("NextKeyMarker", (String.to_query f))); + Util.option_map v.upload_id_marker + (fun f -> Query.Pair ("UploadIdMarker", (String.to_query f))); + Util.option_map v.key_marker + (fun f -> Query.Pair ("KeyMarker", (String.to_query f))); + Util.option_map v.bucket + (fun f -> Query.Pair ("Bucket", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Some + ("common_prefixes", + (CommonPrefixList.to_json v.common_prefixes)); + Some ("uploads", (MultipartUploadList.to_json v.uploads)); + Util.option_map v.is_truncated + (fun f -> ("is_truncated", (Boolean.to_json f))); + Util.option_map v.max_uploads + (fun f -> ("max_uploads", (Integer.to_json f))); + Util.option_map v.next_upload_id_marker + (fun f -> ("next_upload_id_marker", (String.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.next_key_marker + (fun f -> ("next_key_marker", (String.to_json f))); + Util.option_map v.upload_id_marker + (fun f -> ("upload_id_marker", (String.to_json f))); + Util.option_map v.key_marker + (fun f -> ("key_marker", (String.to_json f))); + Util.option_map v.bucket (fun f -> ("bucket", (String.to_json f)))]) + let of_json j = + { + bucket = (Util.option_map (Json.lookup j "bucket") String.of_json); + key_marker = + (Util.option_map (Json.lookup j "key_marker") String.of_json); + upload_id_marker = + (Util.option_map (Json.lookup j "upload_id_marker") String.of_json); + next_key_marker = + (Util.option_map (Json.lookup j "next_key_marker") String.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + next_upload_id_marker = + (Util.option_map (Json.lookup j "next_upload_id_marker") + String.of_json); + max_uploads = + (Util.option_map (Json.lookup j "max_uploads") Integer.of_json); + is_truncated = + (Util.option_map (Json.lookup j "is_truncated") Boolean.of_json); + uploads = + (MultipartUploadList.of_json + (Util.of_option_exn (Json.lookup j "uploads"))); + common_prefixes = + (CommonPrefixList.of_json + (Util.of_option_exn (Json.lookup j "common_prefixes"))); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json) + } + end +module GetBucketLoggingOutput = + struct + type t = { + logging_enabled: LoggingEnabled.t option } + let make ?logging_enabled () = { logging_enabled } + let parse xml = + Some + { + logging_enabled = + (Util.option_bind (Xml.member "LoggingEnabled" xml) + LoggingEnabled.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.logging_enabled + (fun f -> + Query.Pair ("LoggingEnabled", (LoggingEnabled.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.logging_enabled + (fun f -> ("logging_enabled", (LoggingEnabled.to_json f)))]) + let of_json j = + { + logging_enabled = + (Util.option_map (Json.lookup j "logging_enabled") + LoggingEnabled.of_json) + } + end +module ListObjectVersionsRequest = + struct + type t = + { + bucket: String.t ; + delimiter: String.t option ; + encoding_type: EncodingType.t option ; + key_marker: String.t option ; + max_keys: Integer.t option ; + prefix: String.t option ; + version_id_marker: String.t option } + let make ~bucket ?delimiter ?encoding_type ?key_marker ?max_keys + ?prefix ?version_id_marker () = + { + bucket; + delimiter; + encoding_type; + key_marker; + max_keys; + prefix; + version_id_marker + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + delimiter = + (Util.option_bind (Xml.member "delimiter" xml) String.parse); + encoding_type = + (Util.option_bind (Xml.member "encoding-type" xml) + EncodingType.parse); + key_marker = + (Util.option_bind (Xml.member "key-marker" xml) String.parse); + max_keys = + (Util.option_bind (Xml.member "max-keys" xml) Integer.parse); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse); + version_id_marker = + (Util.option_bind (Xml.member "version-id-marker" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.version_id_marker + (fun f -> Query.Pair ("version-id-marker", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("prefix", (String.to_query f))); + Util.option_map v.max_keys + (fun f -> Query.Pair ("max-keys", (Integer.to_query f))); + Util.option_map v.key_marker + (fun f -> Query.Pair ("key-marker", (String.to_query f))); + Util.option_map v.encoding_type + (fun f -> + Query.Pair ("encoding-type", (EncodingType.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("delimiter", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.version_id_marker + (fun f -> ("version_id_marker", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.max_keys + (fun f -> ("max_keys", (Integer.to_json f))); + Util.option_map v.key_marker + (fun f -> ("key_marker", (String.to_json f))); + Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json); + key_marker = + (Util.option_map (Json.lookup j "key_marker") String.of_json); + max_keys = + (Util.option_map (Json.lookup j "max_keys") Integer.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + version_id_marker = + (Util.option_map (Json.lookup j "version_id_marker") String.of_json) + } + end +module NoSuchUpload = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetBucketVersioningOutput = + struct + type t = + { + status: BucketVersioningStatus.t option ; + m_f_a_delete: MFADeleteStatus.t option } + let make ?status ?m_f_a_delete () = { status; m_f_a_delete } + let parse xml = + Some + { + status = + (Util.option_bind (Xml.member "Status" xml) + BucketVersioningStatus.parse); + m_f_a_delete = + (Util.option_bind (Xml.member "MfaDelete" xml) + MFADeleteStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.m_f_a_delete + (fun f -> + Query.Pair ("MfaDelete", (MFADeleteStatus.to_query f))); + Util.option_map v.status + (fun f -> + Query.Pair ("Status", (BucketVersioningStatus.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.m_f_a_delete + (fun f -> ("m_f_a_delete", (MFADeleteStatus.to_json f))); + Util.option_map v.status + (fun f -> ("status", (BucketVersioningStatus.to_json f)))]) + let of_json j = + { + status = + (Util.option_map (Json.lookup j "status") + BucketVersioningStatus.of_json); + m_f_a_delete = + (Util.option_map (Json.lookup j "m_f_a_delete") + MFADeleteStatus.of_json) + } + end +module CopyObjectRequest = + struct + type t = + { + a_c_l: ObjectCannedACL.t option ; + bucket: String.t ; + cache_control: String.t option ; + content_disposition: String.t option ; + content_encoding: String.t option ; + content_language: String.t option ; + content_type: String.t option ; + copy_source: String.t ; + copy_source_if_match: String.t option ; + copy_source_if_modified_since: DateTime.t option ; + copy_source_if_none_match: String.t option ; + copy_source_if_unmodified_since: DateTime.t option ; + expires: DateTime.t option ; + grant_full_control: String.t option ; + grant_read: String.t option ; + grant_read_a_c_p: String.t option ; + grant_write_a_c_p: String.t option ; + key: String.t ; + metadata: Metadata.t option ; + metadata_directive: MetadataDirective.t option ; + server_side_encryption: ServerSideEncryption.t option ; + storage_class: StorageClass.t option ; + website_redirect_location: String.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + copy_source_s_s_e_customer_algorithm: String.t option ; + copy_source_s_s_e_customer_key: String.t option ; + copy_source_s_s_e_customer_key_m_d5: String.t option ; + request_payer: RequestPayer.t option } + let make ?a_c_l ~bucket ?cache_control ?content_disposition + ?content_encoding ?content_language ?content_type ~copy_source + ?copy_source_if_match ?copy_source_if_modified_since + ?copy_source_if_none_match ?copy_source_if_unmodified_since ?expires + ?grant_full_control ?grant_read ?grant_read_a_c_p ?grant_write_a_c_p + ~key ?metadata ?metadata_directive ?server_side_encryption + ?storage_class ?website_redirect_location ?s_s_e_customer_algorithm + ?s_s_e_customer_key ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id + ?copy_source_s_s_e_customer_algorithm ?copy_source_s_s_e_customer_key + ?copy_source_s_s_e_customer_key_m_d5 ?request_payer () = + { + a_c_l; + bucket; + cache_control; + content_disposition; + content_encoding; + content_language; + content_type; + copy_source; + copy_source_if_match; + copy_source_if_modified_since; + copy_source_if_none_match; + copy_source_if_unmodified_since; + expires; + grant_full_control; + grant_read; + grant_read_a_c_p; + grant_write_a_c_p; + key; + metadata; + metadata_directive; + server_side_encryption; + storage_class; + website_redirect_location; + s_s_e_customer_algorithm; + s_s_e_customer_key; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + copy_source_s_s_e_customer_algorithm; + copy_source_s_s_e_customer_key; + copy_source_s_s_e_customer_key_m_d5; + request_payer + } + let parse xml = + Some + { + a_c_l = + (Util.option_bind (Xml.member "x-amz-acl" xml) + ObjectCannedACL.parse); + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + cache_control = + (Util.option_bind (Xml.member "Cache-Control" xml) String.parse); + content_disposition = + (Util.option_bind (Xml.member "Content-Disposition" xml) + String.parse); + content_encoding = + (Util.option_bind (Xml.member "Content-Encoding" xml) + String.parse); + content_language = + (Util.option_bind (Xml.member "Content-Language" xml) + String.parse); + content_type = + (Util.option_bind (Xml.member "Content-Type" xml) String.parse); + copy_source = + (Xml.required "x-amz-copy-source" + (Util.option_bind (Xml.member "x-amz-copy-source" xml) + String.parse)); + copy_source_if_match = + (Util.option_bind (Xml.member "x-amz-copy-source-if-match" xml) + String.parse); + copy_source_if_modified_since = (Util.option_bind - (Xml.member "WebsiteConfiguration" xml) - WebsiteConfiguration.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "WebsiteConfiguration" - , WebsiteConfiguration.to_query v.website_configuration )) - ; Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "website_configuration" - , WebsiteConfiguration.to_json v.website_configuration ) - ; Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - ; website_configuration = - WebsiteConfiguration.of_json - (Util.of_option_exn (Json.lookup j "website_configuration")) - } -end - -module GetBucketLifecycleRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetBucketWebsiteRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module ListMultipartUploadsRequest = struct - type t = - { bucket : String.t - ; delimiter : String.t option - ; encoding_type : EncodingType.t option - ; key_marker : String.t option - ; max_uploads : Integer.t option - ; prefix : String.t option - ; upload_id_marker : String.t option - } - - let make - ~bucket - ?delimiter - ?encoding_type - ?key_marker - ?max_uploads - ?prefix - ?upload_id_marker - () = - { bucket - ; delimiter - ; encoding_type - ; key_marker - ; max_uploads - ; prefix - ; upload_id_marker - } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; delimiter = Util.option_bind (Xml.member "delimiter" xml) String.parse - ; encoding_type = - Util.option_bind (Xml.member "encoding-type" xml) EncodingType.parse - ; key_marker = Util.option_bind (Xml.member "key-marker" xml) String.parse - ; max_uploads = Util.option_bind (Xml.member "max-uploads" xml) Integer.parse - ; prefix = Util.option_bind (Xml.member "prefix" xml) String.parse - ; upload_id_marker = - Util.option_bind (Xml.member "upload-id-marker" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.upload_id_marker (fun f -> - Query.Pair ("upload-id-marker", String.to_query f)) - ; Util.option_map v.prefix (fun f -> Query.Pair ("prefix", String.to_query f)) - ; Util.option_map v.max_uploads (fun f -> - Query.Pair ("max-uploads", Integer.to_query f)) - ; Util.option_map v.key_marker (fun f -> - Query.Pair ("key-marker", String.to_query f)) - ; Util.option_map v.encoding_type (fun f -> - Query.Pair ("encoding-type", EncodingType.to_query f)) - ; Util.option_map v.delimiter (fun f -> - Query.Pair ("delimiter", String.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.upload_id_marker (fun f -> - "upload_id_marker", String.to_json f) - ; Util.option_map v.prefix (fun f -> "prefix", String.to_json f) - ; Util.option_map v.max_uploads (fun f -> "max_uploads", Integer.to_json f) - ; Util.option_map v.key_marker (fun f -> "key_marker", String.to_json f) - ; Util.option_map v.encoding_type (fun f -> - "encoding_type", EncodingType.to_json f) - ; Util.option_map v.delimiter (fun f -> "delimiter", String.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; delimiter = Util.option_map (Json.lookup j "delimiter") String.of_json - ; encoding_type = Util.option_map (Json.lookup j "encoding_type") EncodingType.of_json - ; key_marker = Util.option_map (Json.lookup j "key_marker") String.of_json - ; max_uploads = Util.option_map (Json.lookup j "max_uploads") Integer.of_json - ; prefix = Util.option_map (Json.lookup j "prefix") String.of_json - ; upload_id_marker = Util.option_map (Json.lookup j "upload_id_marker") String.of_json - } -end - -module GetBucketNotificationConfigurationRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetObjectOutput = struct - type t = - { body : Blob.t option - ; delete_marker : Boolean.t option - ; accept_ranges : String.t option - ; expiration : String.t option - ; restore : String.t option - ; last_modified : DateTime.t option - ; content_length : Integer.t option - ; e_tag : String.t option - ; missing_meta : Integer.t option - ; version_id : String.t option - ; cache_control : String.t option - ; content_disposition : String.t option - ; content_encoding : String.t option - ; content_language : String.t option - ; content_range : String.t option - ; content_type : String.t option - ; expires : DateTime.t option - ; website_redirect_location : String.t option - ; server_side_encryption : ServerSideEncryption.t option - ; metadata : Metadata.t option - ; s_s_e_customer_algorithm : String.t option - ; s_s_e_customer_key_m_d5 : String.t option - ; s_s_e_k_m_s_key_id : String.t option - ; storage_class : StorageClass.t option - ; request_charged : RequestCharged.t option - ; replication_status : ReplicationStatus.t option - } - - let make - ?body - ?delete_marker - ?accept_ranges - ?expiration - ?restore - ?last_modified - ?content_length - ?e_tag - ?missing_meta - ?version_id - ?cache_control - ?content_disposition - ?content_encoding - ?content_language - ?content_range - ?content_type - ?expires - ?website_redirect_location - ?server_side_encryption - ?metadata - ?s_s_e_customer_algorithm - ?s_s_e_customer_key_m_d5 - ?s_s_e_k_m_s_key_id - ?storage_class - ?request_charged - ?replication_status - () = - { body - ; delete_marker - ; accept_ranges - ; expiration - ; restore - ; last_modified - ; content_length - ; e_tag - ; missing_meta - ; version_id - ; cache_control - ; content_disposition - ; content_encoding - ; content_language - ; content_range - ; content_type - ; expires - ; website_redirect_location - ; server_side_encryption - ; metadata - ; s_s_e_customer_algorithm - ; s_s_e_customer_key_m_d5 - ; s_s_e_k_m_s_key_id - ; storage_class - ; request_charged - ; replication_status - } - - let parse xml = - Some - { body = Util.option_bind (Xml.member "Body" xml) Blob.parse - ; delete_marker = - Util.option_bind (Xml.member "x-amz-delete-marker" xml) Boolean.parse - ; accept_ranges = Util.option_bind (Xml.member "accept-ranges" xml) String.parse - ; expiration = Util.option_bind (Xml.member "x-amz-expiration" xml) String.parse - ; restore = Util.option_bind (Xml.member "x-amz-restore" xml) String.parse - ; last_modified = Util.option_bind (Xml.member "Last-Modified" xml) DateTime.parse - ; content_length = Util.option_bind (Xml.member "Content-Length" xml) Integer.parse - ; e_tag = Util.option_bind (Xml.member "ETag" xml) String.parse - ; missing_meta = - Util.option_bind (Xml.member "x-amz-missing-meta" xml) Integer.parse - ; version_id = Util.option_bind (Xml.member "x-amz-version-id" xml) String.parse - ; cache_control = Util.option_bind (Xml.member "Cache-Control" xml) String.parse - ; content_disposition = - Util.option_bind (Xml.member "Content-Disposition" xml) String.parse - ; content_encoding = - Util.option_bind (Xml.member "Content-Encoding" xml) String.parse - ; content_language = - Util.option_bind (Xml.member "Content-Language" xml) String.parse - ; content_range = Util.option_bind (Xml.member "Content-Range" xml) String.parse - ; content_type = Util.option_bind (Xml.member "Content-Type" xml) String.parse - ; expires = Util.option_bind (Xml.member "Expires" xml) DateTime.parse - ; website_redirect_location = - Util.option_bind (Xml.member "x-amz-website-redirect-location" xml) String.parse - ; server_side_encryption = - Util.option_bind - (Xml.member "x-amz-server-side-encryption" xml) - ServerSideEncryption.parse - ; metadata = Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse - ; s_s_e_customer_algorithm = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-algorithm" xml) - String.parse - ; s_s_e_customer_key_m_d5 = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-customer-key-MD5" xml) - String.parse - ; s_s_e_k_m_s_key_id = - Util.option_bind - (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) - String.parse - ; storage_class = - Util.option_bind (Xml.member "x-amz-storage-class" xml) StorageClass.parse - ; request_charged = - Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse - ; replication_status = - Util.option_bind - (Xml.member "x-amz-replication-status" xml) - ReplicationStatus.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replication_status (fun f -> - Query.Pair ("x-amz-replication-status", ReplicationStatus.to_query f)) - ; Util.option_map v.request_charged (fun f -> - Query.Pair ("x-amz-request-charged", RequestCharged.to_query f)) - ; Util.option_map v.storage_class (fun f -> - Query.Pair ("x-amz-storage-class", StorageClass.to_query f)) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - Query.Pair - ("x-amz-server-side-encryption-aws-kms-key-id", String.to_query f)) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-key-MD5", String.to_query f)) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - Query.Pair - ("x-amz-server-side-encryption-customer-algorithm", String.to_query f)) - ; Util.option_map v.metadata (fun f -> - Query.Pair ("x-amz-meta-", Metadata.to_query f)) - ; Util.option_map v.server_side_encryption (fun f -> - Query.Pair ("x-amz-server-side-encryption", ServerSideEncryption.to_query f)) - ; Util.option_map v.website_redirect_location (fun f -> - Query.Pair ("x-amz-website-redirect-location", String.to_query f)) - ; Util.option_map v.expires (fun f -> - Query.Pair ("Expires", DateTime.to_query f)) - ; Util.option_map v.content_type (fun f -> - Query.Pair ("Content-Type", String.to_query f)) - ; Util.option_map v.content_range (fun f -> - Query.Pair ("Content-Range", String.to_query f)) - ; Util.option_map v.content_language (fun f -> - Query.Pair ("Content-Language", String.to_query f)) - ; Util.option_map v.content_encoding (fun f -> - Query.Pair ("Content-Encoding", String.to_query f)) - ; Util.option_map v.content_disposition (fun f -> - Query.Pair ("Content-Disposition", String.to_query f)) - ; Util.option_map v.cache_control (fun f -> - Query.Pair ("Cache-Control", String.to_query f)) - ; Util.option_map v.version_id (fun f -> - Query.Pair ("x-amz-version-id", String.to_query f)) - ; Util.option_map v.missing_meta (fun f -> - Query.Pair ("x-amz-missing-meta", Integer.to_query f)) - ; Util.option_map v.e_tag (fun f -> Query.Pair ("ETag", String.to_query f)) - ; Util.option_map v.content_length (fun f -> - Query.Pair ("Content-Length", Integer.to_query f)) - ; Util.option_map v.last_modified (fun f -> - Query.Pair ("Last-Modified", DateTime.to_query f)) - ; Util.option_map v.restore (fun f -> - Query.Pair ("x-amz-restore", String.to_query f)) - ; Util.option_map v.expiration (fun f -> - Query.Pair ("x-amz-expiration", String.to_query f)) - ; Util.option_map v.accept_ranges (fun f -> - Query.Pair ("accept-ranges", String.to_query f)) - ; Util.option_map v.delete_marker (fun f -> - Query.Pair ("x-amz-delete-marker", Boolean.to_query f)) - ; Util.option_map v.body (fun f -> Query.Pair ("Body", Blob.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replication_status (fun f -> - "replication_status", ReplicationStatus.to_json f) - ; Util.option_map v.request_charged (fun f -> - "request_charged", RequestCharged.to_json f) - ; Util.option_map v.storage_class (fun f -> - "storage_class", StorageClass.to_json f) - ; Util.option_map v.s_s_e_k_m_s_key_id (fun f -> - "s_s_e_k_m_s_key_id", String.to_json f) - ; Util.option_map v.s_s_e_customer_key_m_d5 (fun f -> - "s_s_e_customer_key_m_d5", String.to_json f) - ; Util.option_map v.s_s_e_customer_algorithm (fun f -> - "s_s_e_customer_algorithm", String.to_json f) - ; Util.option_map v.metadata (fun f -> "metadata", Metadata.to_json f) - ; Util.option_map v.server_side_encryption (fun f -> - "server_side_encryption", ServerSideEncryption.to_json f) - ; Util.option_map v.website_redirect_location (fun f -> - "website_redirect_location", String.to_json f) - ; Util.option_map v.expires (fun f -> "expires", DateTime.to_json f) - ; Util.option_map v.content_type (fun f -> "content_type", String.to_json f) - ; Util.option_map v.content_range (fun f -> "content_range", String.to_json f) - ; Util.option_map v.content_language (fun f -> - "content_language", String.to_json f) - ; Util.option_map v.content_encoding (fun f -> - "content_encoding", String.to_json f) - ; Util.option_map v.content_disposition (fun f -> - "content_disposition", String.to_json f) - ; Util.option_map v.cache_control (fun f -> "cache_control", String.to_json f) - ; Util.option_map v.version_id (fun f -> "version_id", String.to_json f) - ; Util.option_map v.missing_meta (fun f -> "missing_meta", Integer.to_json f) - ; Util.option_map v.e_tag (fun f -> "e_tag", String.to_json f) - ; Util.option_map v.content_length (fun f -> "content_length", Integer.to_json f) - ; Util.option_map v.last_modified (fun f -> "last_modified", DateTime.to_json f) - ; Util.option_map v.restore (fun f -> "restore", String.to_json f) - ; Util.option_map v.expiration (fun f -> "expiration", String.to_json f) - ; Util.option_map v.accept_ranges (fun f -> "accept_ranges", String.to_json f) - ; Util.option_map v.delete_marker (fun f -> "delete_marker", Boolean.to_json f) - ; Util.option_map v.body (fun f -> "body", Blob.to_json f) - ]) - - let of_json j = - { body = Util.option_map (Json.lookup j "body") Blob.of_json - ; delete_marker = Util.option_map (Json.lookup j "delete_marker") Boolean.of_json - ; accept_ranges = Util.option_map (Json.lookup j "accept_ranges") String.of_json - ; expiration = Util.option_map (Json.lookup j "expiration") String.of_json - ; restore = Util.option_map (Json.lookup j "restore") String.of_json - ; last_modified = Util.option_map (Json.lookup j "last_modified") DateTime.of_json - ; content_length = Util.option_map (Json.lookup j "content_length") Integer.of_json - ; e_tag = Util.option_map (Json.lookup j "e_tag") String.of_json - ; missing_meta = Util.option_map (Json.lookup j "missing_meta") Integer.of_json - ; version_id = Util.option_map (Json.lookup j "version_id") String.of_json - ; cache_control = Util.option_map (Json.lookup j "cache_control") String.of_json - ; content_disposition = - Util.option_map (Json.lookup j "content_disposition") String.of_json - ; content_encoding = Util.option_map (Json.lookup j "content_encoding") String.of_json - ; content_language = Util.option_map (Json.lookup j "content_language") String.of_json - ; content_range = Util.option_map (Json.lookup j "content_range") String.of_json - ; content_type = Util.option_map (Json.lookup j "content_type") String.of_json - ; expires = Util.option_map (Json.lookup j "expires") DateTime.of_json - ; website_redirect_location = - Util.option_map (Json.lookup j "website_redirect_location") String.of_json - ; server_side_encryption = - Util.option_map - (Json.lookup j "server_side_encryption") - ServerSideEncryption.of_json - ; metadata = Util.option_map (Json.lookup j "metadata") Metadata.of_json - ; s_s_e_customer_algorithm = - Util.option_map (Json.lookup j "s_s_e_customer_algorithm") String.of_json - ; s_s_e_customer_key_m_d5 = - Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") String.of_json - ; s_s_e_k_m_s_key_id = - Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") String.of_json - ; storage_class = Util.option_map (Json.lookup j "storage_class") StorageClass.of_json - ; request_charged = - Util.option_map (Json.lookup j "request_charged") RequestCharged.of_json - ; replication_status = - Util.option_map (Json.lookup j "replication_status") ReplicationStatus.of_json - } -end - -module PutBucketNotificationConfigurationRequest = struct - type t = - { bucket : String.t - ; notification_configuration : NotificationConfiguration.t - } - - let make ~bucket ~notification_configuration () = { bucket; notification_configuration } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; notification_configuration = - Xml.required - "NotificationConfiguration" + (Xml.member "x-amz-copy-source-if-modified-since" xml) + DateTime.parse); + copy_source_if_none_match = + (Util.option_bind + (Xml.member "x-amz-copy-source-if-none-match" xml) + String.parse); + copy_source_if_unmodified_since = + (Util.option_bind + (Xml.member "x-amz-copy-source-if-unmodified-since" xml) + DateTime.parse); + expires = + (Util.option_bind (Xml.member "Expires" xml) DateTime.parse); + grant_full_control = + (Util.option_bind (Xml.member "x-amz-grant-full-control" xml) + String.parse); + grant_read = + (Util.option_bind (Xml.member "x-amz-grant-read" xml) + String.parse); + grant_read_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-read-acp" xml) + String.parse); + grant_write_a_c_p = + (Util.option_bind (Xml.member "x-amz-grant-write-acp" xml) + String.parse); + key = + (Xml.required "Key" + (Util.option_bind (Xml.member "Key" xml) String.parse)); + metadata = + (Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse); + metadata_directive = + (Util.option_bind (Xml.member "x-amz-metadata-directive" xml) + MetadataDirective.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + storage_class = + (Util.option_bind (Xml.member "x-amz-storage-class" xml) + StorageClass.parse); + website_redirect_location = + (Util.option_bind + (Xml.member "x-amz-website-redirect-location" xml) + String.parse); + s_s_e_customer_algorithm = (Util.option_bind - (Xml.member "NotificationConfiguration" xml) - NotificationConfiguration.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key" xml) + String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + copy_source_s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-algorithm" + xml) String.parse); + copy_source_s_s_e_customer_key = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-key" xml) + String.parse); + copy_source_s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member + "x-amz-copy-source-server-side-encryption-customer-key-MD5" + xml) String.parse); + request_payer = + (Util.option_bind (Xml.member "x-amz-request-payer" xml) + RequestPayer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> + Query.Pair + ("x-amz-request-payer", (RequestPayer.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.copy_source_s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-copy-source-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.website_redirect_location + (fun f -> + Query.Pair + ("x-amz-website-redirect-location", (String.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair ("x-amz-storage-class", (StorageClass.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.metadata_directive + (fun f -> + Query.Pair + ("x-amz-metadata-directive", + (MetadataDirective.to_query f))); + Util.option_map v.metadata + (fun f -> Query.Pair ("x-amz-meta-", (Metadata.to_query f))); + Some (Query.Pair ("Key", (String.to_query v.key))); + Util.option_map v.grant_write_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-write-acp", (String.to_query f))); + Util.option_map v.grant_read_a_c_p + (fun f -> + Query.Pair ("x-amz-grant-read-acp", (String.to_query f))); + Util.option_map v.grant_read + (fun f -> Query.Pair ("x-amz-grant-read", (String.to_query f))); + Util.option_map v.grant_full_control + (fun f -> + Query.Pair ("x-amz-grant-full-control", (String.to_query f))); + Util.option_map v.expires + (fun f -> Query.Pair ("Expires", (DateTime.to_query f))); + Util.option_map v.copy_source_if_unmodified_since + (fun f -> + Query.Pair + ("x-amz-copy-source-if-unmodified-since", + (DateTime.to_query f))); + Util.option_map v.copy_source_if_none_match + (fun f -> + Query.Pair + ("x-amz-copy-source-if-none-match", (String.to_query f))); + Util.option_map v.copy_source_if_modified_since + (fun f -> + Query.Pair + ("x-amz-copy-source-if-modified-since", + (DateTime.to_query f))); + Util.option_map v.copy_source_if_match + (fun f -> + Query.Pair + ("x-amz-copy-source-if-match", (String.to_query f))); + Some (Query.Pair - ( "NotificationConfiguration" - , NotificationConfiguration.to_query v.notification_configuration )) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some - ( "notification_configuration" - , NotificationConfiguration.to_json v.notification_configuration ) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; notification_configuration = - NotificationConfiguration.of_json - (Util.of_option_exn (Json.lookup j "notification_configuration")) - } -end - -module GetBucketCorsRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module CreateBucketOutput = struct - type t = { location : String.t option } - - let make ?location () = { location } - - let parse xml = - Some { location = Util.option_bind (Xml.member "Location" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.location (fun f -> - Query.Pair ("Location", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.location (fun f -> "location", String.to_json f) ]) - - let of_json j = { location = Util.option_map (Json.lookup j "location") String.of_json } -end - -module PutBucketCorsRequest = struct - type t = - { bucket : String.t - ; c_o_r_s_configuration : CORSConfiguration.t option - ; content_m_d5 : String.t option - } - - let make ~bucket ?c_o_r_s_configuration ?content_m_d5 () = - { bucket; c_o_r_s_configuration; content_m_d5 } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - ; c_o_r_s_configuration = - Util.option_bind (Xml.member "CORSConfiguration" xml) CORSConfiguration.parse - ; content_m_d5 = Util.option_bind (Xml.member "Content-MD5" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.content_m_d5 (fun f -> - Query.Pair ("Content-MD5", String.to_query f)) - ; Util.option_map v.c_o_r_s_configuration (fun f -> - Query.Pair ("CORSConfiguration", CORSConfiguration.to_query f)) - ; Some (Query.Pair ("Bucket", String.to_query v.bucket)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.content_m_d5 (fun f -> "content_m_d5", String.to_json f) - ; Util.option_map v.c_o_r_s_configuration (fun f -> - "c_o_r_s_configuration", CORSConfiguration.to_json f) - ; Some ("bucket", String.to_json v.bucket) - ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) - ; c_o_r_s_configuration = - Util.option_map (Json.lookup j "c_o_r_s_configuration") CORSConfiguration.of_json - ; content_m_d5 = Util.option_map (Json.lookup j "content_m_d5") String.of_json - } -end - -module DeleteBucketLifecycleRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetBucketAclRequest = struct - type t = { bucket : String.t } - - let make ~bucket () = { bucket } - - let parse xml = - Some - { bucket = - Xml.required "Bucket" (Util.option_bind (Xml.member "Bucket" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Bucket", String.to_query v.bucket)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("bucket", String.to_json v.bucket) ]) - - let of_json j = - { bucket = String.of_json (Util.of_option_exn (Json.lookup j "bucket")) } -end - -module GetBucketRequestPaymentOutput = struct - type t = { payer : Payer.t option } - - let make ?payer () = { payer } - - let parse xml = Some { payer = Util.option_bind (Xml.member "Payer" xml) Payer.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.payer (fun f -> Query.Pair ("Payer", Payer.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.payer (fun f -> "payer", Payer.to_json f) ]) - - let of_json j = { payer = Util.option_map (Json.lookup j "payer") Payer.of_json } -end + ("x-amz-copy-source", (String.to_query v.copy_source))); + Util.option_map v.content_type + (fun f -> Query.Pair ("Content-Type", (String.to_query f))); + Util.option_map v.content_language + (fun f -> Query.Pair ("Content-Language", (String.to_query f))); + Util.option_map v.content_encoding + (fun f -> Query.Pair ("Content-Encoding", (String.to_query f))); + Util.option_map v.content_disposition + (fun f -> + Query.Pair ("Content-Disposition", (String.to_query f))); + Util.option_map v.cache_control + (fun f -> Query.Pair ("Cache-Control", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket))); + Util.option_map v.a_c_l + (fun f -> Query.Pair ("x-amz-acl", (ObjectCannedACL.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_payer + (fun f -> ("request_payer", (RequestPayer.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_key_m_d5 + (fun f -> + ("copy_source_s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_key + (fun f -> ("copy_source_s_s_e_customer_key", (String.to_json f))); + Util.option_map v.copy_source_s_s_e_customer_algorithm + (fun f -> + ("copy_source_s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_key + (fun f -> ("s_s_e_customer_key", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.website_redirect_location + (fun f -> ("website_redirect_location", (String.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.metadata_directive + (fun f -> ("metadata_directive", (MetadataDirective.to_json f))); + Util.option_map v.metadata + (fun f -> ("metadata", (Metadata.to_json f))); + Some ("key", (String.to_json v.key)); + Util.option_map v.grant_write_a_c_p + (fun f -> ("grant_write_a_c_p", (String.to_json f))); + Util.option_map v.grant_read_a_c_p + (fun f -> ("grant_read_a_c_p", (String.to_json f))); + Util.option_map v.grant_read + (fun f -> ("grant_read", (String.to_json f))); + Util.option_map v.grant_full_control + (fun f -> ("grant_full_control", (String.to_json f))); + Util.option_map v.expires + (fun f -> ("expires", (DateTime.to_json f))); + Util.option_map v.copy_source_if_unmodified_since + (fun f -> + ("copy_source_if_unmodified_since", (DateTime.to_json f))); + Util.option_map v.copy_source_if_none_match + (fun f -> ("copy_source_if_none_match", (String.to_json f))); + Util.option_map v.copy_source_if_modified_since + (fun f -> + ("copy_source_if_modified_since", (DateTime.to_json f))); + Util.option_map v.copy_source_if_match + (fun f -> ("copy_source_if_match", (String.to_json f))); + Some ("copy_source", (String.to_json v.copy_source)); + Util.option_map v.content_type + (fun f -> ("content_type", (String.to_json f))); + Util.option_map v.content_language + (fun f -> ("content_language", (String.to_json f))); + Util.option_map v.content_encoding + (fun f -> ("content_encoding", (String.to_json f))); + Util.option_map v.content_disposition + (fun f -> ("content_disposition", (String.to_json f))); + Util.option_map v.cache_control + (fun f -> ("cache_control", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket)); + Util.option_map v.a_c_l + (fun f -> ("a_c_l", (ObjectCannedACL.to_json f)))]) + let of_json j = + { + a_c_l = + (Util.option_map (Json.lookup j "a_c_l") ObjectCannedACL.of_json); + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + cache_control = + (Util.option_map (Json.lookup j "cache_control") String.of_json); + content_disposition = + (Util.option_map (Json.lookup j "content_disposition") + String.of_json); + content_encoding = + (Util.option_map (Json.lookup j "content_encoding") String.of_json); + content_language = + (Util.option_map (Json.lookup j "content_language") String.of_json); + content_type = + (Util.option_map (Json.lookup j "content_type") String.of_json); + copy_source = + (String.of_json (Util.of_option_exn (Json.lookup j "copy_source"))); + copy_source_if_match = + (Util.option_map (Json.lookup j "copy_source_if_match") + String.of_json); + copy_source_if_modified_since = + (Util.option_map (Json.lookup j "copy_source_if_modified_since") + DateTime.of_json); + copy_source_if_none_match = + (Util.option_map (Json.lookup j "copy_source_if_none_match") + String.of_json); + copy_source_if_unmodified_since = + (Util.option_map (Json.lookup j "copy_source_if_unmodified_since") + DateTime.of_json); + expires = + (Util.option_map (Json.lookup j "expires") DateTime.of_json); + grant_full_control = + (Util.option_map (Json.lookup j "grant_full_control") + String.of_json); + grant_read = + (Util.option_map (Json.lookup j "grant_read") String.of_json); + grant_read_a_c_p = + (Util.option_map (Json.lookup j "grant_read_a_c_p") String.of_json); + grant_write_a_c_p = + (Util.option_map (Json.lookup j "grant_write_a_c_p") String.of_json); + key = (String.of_json (Util.of_option_exn (Json.lookup j "key"))); + metadata = + (Util.option_map (Json.lookup j "metadata") Metadata.of_json); + metadata_directive = + (Util.option_map (Json.lookup j "metadata_directive") + MetadataDirective.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + website_redirect_location = + (Util.option_map (Json.lookup j "website_redirect_location") + String.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key = + (Util.option_map (Json.lookup j "s_s_e_customer_key") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + copy_source_s_s_e_customer_algorithm = + (Util.option_map + (Json.lookup j "copy_source_s_s_e_customer_algorithm") + String.of_json); + copy_source_s_s_e_customer_key = + (Util.option_map (Json.lookup j "copy_source_s_s_e_customer_key") + String.of_json); + copy_source_s_s_e_customer_key_m_d5 = + (Util.option_map + (Json.lookup j "copy_source_s_s_e_customer_key_m_d5") + String.of_json); + request_payer = + (Util.option_map (Json.lookup j "request_payer") + RequestPayer.of_json) + } + end +module DeleteBucketCorsRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module CopyObjectOutput = + struct + type t = + { + copy_object_result: CopyObjectResult.t option ; + expiration: String.t option ; + copy_source_version_id: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + request_charged: RequestCharged.t option } + let make ?copy_object_result ?expiration ?copy_source_version_id + ?server_side_encryption ?s_s_e_customer_algorithm + ?s_s_e_customer_key_m_d5 ?s_s_e_k_m_s_key_id ?request_charged () = + { + copy_object_result; + expiration; + copy_source_version_id; + server_side_encryption; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + request_charged + } + let parse xml = + Some + { + copy_object_result = + (Util.option_bind (Xml.member "CopyObjectResult" xml) + CopyObjectResult.parse); + expiration = + (Util.option_bind (Xml.member "x-amz-expiration" xml) + String.parse); + copy_source_version_id = + (Util.option_bind (Xml.member "x-amz-copy-source-version-id" xml) + String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.copy_source_version_id + (fun f -> + Query.Pair + ("x-amz-copy-source-version-id", (String.to_query f))); + Util.option_map v.expiration + (fun f -> Query.Pair ("x-amz-expiration", (String.to_query f))); + Util.option_map v.copy_object_result + (fun f -> + Query.Pair + ("CopyObjectResult", (CopyObjectResult.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.copy_source_version_id + (fun f -> ("copy_source_version_id", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (String.to_json f))); + Util.option_map v.copy_object_result + (fun f -> ("copy_object_result", (CopyObjectResult.to_json f)))]) + let of_json j = + { + copy_object_result = + (Util.option_map (Json.lookup j "copy_object_result") + CopyObjectResult.of_json); + expiration = + (Util.option_map (Json.lookup j "expiration") String.of_json); + copy_source_version_id = + (Util.option_map (Json.lookup j "copy_source_version_id") + String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json) + } + end +module PutBucketTaggingRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + tagging: Tagging.t } + let make ~bucket ?content_m_d5 ~tagging () = + { bucket; content_m_d5; tagging } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + tagging = + (Xml.required "Tagging" + (Util.option_bind (Xml.member "Tagging" xml) Tagging.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Tagging", (Tagging.to_query v.tagging))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("tagging", (Tagging.to_json v.tagging)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + tagging = + (Tagging.of_json (Util.of_option_exn (Json.lookup j "tagging"))) + } + end +module DeleteBucketWebsiteRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module PutBucketWebsiteRequest = + struct + type t = + { + bucket: String.t ; + content_m_d5: String.t option ; + website_configuration: WebsiteConfiguration.t } + let make ~bucket ?content_m_d5 ~website_configuration () = + { bucket; content_m_d5; website_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse); + website_configuration = + (Xml.required "WebsiteConfiguration" + (Util.option_bind (Xml.member "WebsiteConfiguration" xml) + WebsiteConfiguration.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("WebsiteConfiguration", + (WebsiteConfiguration.to_query v.website_configuration))); + Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("website_configuration", + (WebsiteConfiguration.to_json v.website_configuration)); + Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json); + website_configuration = + (WebsiteConfiguration.of_json + (Util.of_option_exn (Json.lookup j "website_configuration"))) + } + end +module GetBucketLifecycleRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetBucketWebsiteRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module ListMultipartUploadsRequest = + struct + type t = + { + bucket: String.t ; + delimiter: String.t option ; + encoding_type: EncodingType.t option ; + key_marker: String.t option ; + max_uploads: Integer.t option ; + prefix: String.t option ; + upload_id_marker: String.t option } + let make ~bucket ?delimiter ?encoding_type ?key_marker ?max_uploads + ?prefix ?upload_id_marker () = + { + bucket; + delimiter; + encoding_type; + key_marker; + max_uploads; + prefix; + upload_id_marker + } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + delimiter = + (Util.option_bind (Xml.member "delimiter" xml) String.parse); + encoding_type = + (Util.option_bind (Xml.member "encoding-type" xml) + EncodingType.parse); + key_marker = + (Util.option_bind (Xml.member "key-marker" xml) String.parse); + max_uploads = + (Util.option_bind (Xml.member "max-uploads" xml) Integer.parse); + prefix = (Util.option_bind (Xml.member "prefix" xml) String.parse); + upload_id_marker = + (Util.option_bind (Xml.member "upload-id-marker" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.upload_id_marker + (fun f -> Query.Pair ("upload-id-marker", (String.to_query f))); + Util.option_map v.prefix + (fun f -> Query.Pair ("prefix", (String.to_query f))); + Util.option_map v.max_uploads + (fun f -> Query.Pair ("max-uploads", (Integer.to_query f))); + Util.option_map v.key_marker + (fun f -> Query.Pair ("key-marker", (String.to_query f))); + Util.option_map v.encoding_type + (fun f -> + Query.Pair ("encoding-type", (EncodingType.to_query f))); + Util.option_map v.delimiter + (fun f -> Query.Pair ("delimiter", (String.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.upload_id_marker + (fun f -> ("upload_id_marker", (String.to_json f))); + Util.option_map v.prefix (fun f -> ("prefix", (String.to_json f))); + Util.option_map v.max_uploads + (fun f -> ("max_uploads", (Integer.to_json f))); + Util.option_map v.key_marker + (fun f -> ("key_marker", (String.to_json f))); + Util.option_map v.encoding_type + (fun f -> ("encoding_type", (EncodingType.to_json f))); + Util.option_map v.delimiter + (fun f -> ("delimiter", (String.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + delimiter = + (Util.option_map (Json.lookup j "delimiter") String.of_json); + encoding_type = + (Util.option_map (Json.lookup j "encoding_type") + EncodingType.of_json); + key_marker = + (Util.option_map (Json.lookup j "key_marker") String.of_json); + max_uploads = + (Util.option_map (Json.lookup j "max_uploads") Integer.of_json); + prefix = (Util.option_map (Json.lookup j "prefix") String.of_json); + upload_id_marker = + (Util.option_map (Json.lookup j "upload_id_marker") String.of_json) + } + end +module GetBucketNotificationConfigurationRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetObjectOutput = + struct + type t = + { + body: Blob.t option ; + delete_marker: Boolean.t option ; + accept_ranges: String.t option ; + expiration: String.t option ; + restore: String.t option ; + last_modified: DateTime.t option ; + content_length: Integer.t option ; + e_tag: String.t option ; + missing_meta: Integer.t option ; + version_id: String.t option ; + cache_control: String.t option ; + content_disposition: String.t option ; + content_encoding: String.t option ; + content_language: String.t option ; + content_range: String.t option ; + content_type: String.t option ; + expires: DateTime.t option ; + website_redirect_location: String.t option ; + server_side_encryption: ServerSideEncryption.t option ; + metadata: Metadata.t option ; + s_s_e_customer_algorithm: String.t option ; + s_s_e_customer_key_m_d5: String.t option ; + s_s_e_k_m_s_key_id: String.t option ; + storage_class: StorageClass.t option ; + request_charged: RequestCharged.t option ; + replication_status: ReplicationStatus.t option } + let make ?body ?delete_marker ?accept_ranges ?expiration ?restore + ?last_modified ?content_length ?e_tag ?missing_meta ?version_id + ?cache_control ?content_disposition ?content_encoding + ?content_language ?content_range ?content_type ?expires + ?website_redirect_location ?server_side_encryption ?metadata + ?s_s_e_customer_algorithm ?s_s_e_customer_key_m_d5 + ?s_s_e_k_m_s_key_id ?storage_class ?request_charged + ?replication_status () = + { + body; + delete_marker; + accept_ranges; + expiration; + restore; + last_modified; + content_length; + e_tag; + missing_meta; + version_id; + cache_control; + content_disposition; + content_encoding; + content_language; + content_range; + content_type; + expires; + website_redirect_location; + server_side_encryption; + metadata; + s_s_e_customer_algorithm; + s_s_e_customer_key_m_d5; + s_s_e_k_m_s_key_id; + storage_class; + request_charged; + replication_status + } + let parse xml = + Some + { + body = (Util.option_bind (Xml.member "Body" xml) Blob.parse); + delete_marker = + (Util.option_bind (Xml.member "x-amz-delete-marker" xml) + Boolean.parse); + accept_ranges = + (Util.option_bind (Xml.member "accept-ranges" xml) String.parse); + expiration = + (Util.option_bind (Xml.member "x-amz-expiration" xml) + String.parse); + restore = + (Util.option_bind (Xml.member "x-amz-restore" xml) String.parse); + last_modified = + (Util.option_bind (Xml.member "Last-Modified" xml) DateTime.parse); + content_length = + (Util.option_bind (Xml.member "Content-Length" xml) Integer.parse); + e_tag = (Util.option_bind (Xml.member "ETag" xml) String.parse); + missing_meta = + (Util.option_bind (Xml.member "x-amz-missing-meta" xml) + Integer.parse); + version_id = + (Util.option_bind (Xml.member "x-amz-version-id" xml) + String.parse); + cache_control = + (Util.option_bind (Xml.member "Cache-Control" xml) String.parse); + content_disposition = + (Util.option_bind (Xml.member "Content-Disposition" xml) + String.parse); + content_encoding = + (Util.option_bind (Xml.member "Content-Encoding" xml) + String.parse); + content_language = + (Util.option_bind (Xml.member "Content-Language" xml) + String.parse); + content_range = + (Util.option_bind (Xml.member "Content-Range" xml) String.parse); + content_type = + (Util.option_bind (Xml.member "Content-Type" xml) String.parse); + expires = + (Util.option_bind (Xml.member "Expires" xml) DateTime.parse); + website_redirect_location = + (Util.option_bind + (Xml.member "x-amz-website-redirect-location" xml) + String.parse); + server_side_encryption = + (Util.option_bind (Xml.member "x-amz-server-side-encryption" xml) + ServerSideEncryption.parse); + metadata = + (Util.option_bind (Xml.member "x-amz-meta-" xml) Metadata.parse); + s_s_e_customer_algorithm = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-algorithm" + xml) String.parse); + s_s_e_customer_key_m_d5 = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-customer-key-MD5" + xml) String.parse); + s_s_e_k_m_s_key_id = + (Util.option_bind + (Xml.member "x-amz-server-side-encryption-aws-kms-key-id" xml) + String.parse); + storage_class = + (Util.option_bind (Xml.member "x-amz-storage-class" xml) + StorageClass.parse); + request_charged = + (Util.option_bind (Xml.member "x-amz-request-charged" xml) + RequestCharged.parse); + replication_status = + (Util.option_bind (Xml.member "x-amz-replication-status" xml) + ReplicationStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replication_status + (fun f -> + Query.Pair + ("x-amz-replication-status", + (ReplicationStatus.to_query f))); + Util.option_map v.request_charged + (fun f -> + Query.Pair + ("x-amz-request-charged", (RequestCharged.to_query f))); + Util.option_map v.storage_class + (fun f -> + Query.Pair ("x-amz-storage-class", (StorageClass.to_query f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-aws-kms-key-id", + (String.to_query f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-key-MD5", + (String.to_query f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> + Query.Pair + ("x-amz-server-side-encryption-customer-algorithm", + (String.to_query f))); + Util.option_map v.metadata + (fun f -> Query.Pair ("x-amz-meta-", (Metadata.to_query f))); + Util.option_map v.server_side_encryption + (fun f -> + Query.Pair + ("x-amz-server-side-encryption", + (ServerSideEncryption.to_query f))); + Util.option_map v.website_redirect_location + (fun f -> + Query.Pair + ("x-amz-website-redirect-location", (String.to_query f))); + Util.option_map v.expires + (fun f -> Query.Pair ("Expires", (DateTime.to_query f))); + Util.option_map v.content_type + (fun f -> Query.Pair ("Content-Type", (String.to_query f))); + Util.option_map v.content_range + (fun f -> Query.Pair ("Content-Range", (String.to_query f))); + Util.option_map v.content_language + (fun f -> Query.Pair ("Content-Language", (String.to_query f))); + Util.option_map v.content_encoding + (fun f -> Query.Pair ("Content-Encoding", (String.to_query f))); + Util.option_map v.content_disposition + (fun f -> + Query.Pair ("Content-Disposition", (String.to_query f))); + Util.option_map v.cache_control + (fun f -> Query.Pair ("Cache-Control", (String.to_query f))); + Util.option_map v.version_id + (fun f -> Query.Pair ("x-amz-version-id", (String.to_query f))); + Util.option_map v.missing_meta + (fun f -> + Query.Pair ("x-amz-missing-meta", (Integer.to_query f))); + Util.option_map v.e_tag + (fun f -> Query.Pair ("ETag", (String.to_query f))); + Util.option_map v.content_length + (fun f -> Query.Pair ("Content-Length", (Integer.to_query f))); + Util.option_map v.last_modified + (fun f -> Query.Pair ("Last-Modified", (DateTime.to_query f))); + Util.option_map v.restore + (fun f -> Query.Pair ("x-amz-restore", (String.to_query f))); + Util.option_map v.expiration + (fun f -> Query.Pair ("x-amz-expiration", (String.to_query f))); + Util.option_map v.accept_ranges + (fun f -> Query.Pair ("accept-ranges", (String.to_query f))); + Util.option_map v.delete_marker + (fun f -> + Query.Pair ("x-amz-delete-marker", (Boolean.to_query f))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (Blob.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replication_status + (fun f -> ("replication_status", (ReplicationStatus.to_json f))); + Util.option_map v.request_charged + (fun f -> ("request_charged", (RequestCharged.to_json f))); + Util.option_map v.storage_class + (fun f -> ("storage_class", (StorageClass.to_json f))); + Util.option_map v.s_s_e_k_m_s_key_id + (fun f -> ("s_s_e_k_m_s_key_id", (String.to_json f))); + Util.option_map v.s_s_e_customer_key_m_d5 + (fun f -> ("s_s_e_customer_key_m_d5", (String.to_json f))); + Util.option_map v.s_s_e_customer_algorithm + (fun f -> ("s_s_e_customer_algorithm", (String.to_json f))); + Util.option_map v.metadata + (fun f -> ("metadata", (Metadata.to_json f))); + Util.option_map v.server_side_encryption + (fun f -> + ("server_side_encryption", (ServerSideEncryption.to_json f))); + Util.option_map v.website_redirect_location + (fun f -> ("website_redirect_location", (String.to_json f))); + Util.option_map v.expires + (fun f -> ("expires", (DateTime.to_json f))); + Util.option_map v.content_type + (fun f -> ("content_type", (String.to_json f))); + Util.option_map v.content_range + (fun f -> ("content_range", (String.to_json f))); + Util.option_map v.content_language + (fun f -> ("content_language", (String.to_json f))); + Util.option_map v.content_encoding + (fun f -> ("content_encoding", (String.to_json f))); + Util.option_map v.content_disposition + (fun f -> ("content_disposition", (String.to_json f))); + Util.option_map v.cache_control + (fun f -> ("cache_control", (String.to_json f))); + Util.option_map v.version_id + (fun f -> ("version_id", (String.to_json f))); + Util.option_map v.missing_meta + (fun f -> ("missing_meta", (Integer.to_json f))); + Util.option_map v.e_tag (fun f -> ("e_tag", (String.to_json f))); + Util.option_map v.content_length + (fun f -> ("content_length", (Integer.to_json f))); + Util.option_map v.last_modified + (fun f -> ("last_modified", (DateTime.to_json f))); + Util.option_map v.restore + (fun f -> ("restore", (String.to_json f))); + Util.option_map v.expiration + (fun f -> ("expiration", (String.to_json f))); + Util.option_map v.accept_ranges + (fun f -> ("accept_ranges", (String.to_json f))); + Util.option_map v.delete_marker + (fun f -> ("delete_marker", (Boolean.to_json f))); + Util.option_map v.body (fun f -> ("body", (Blob.to_json f)))]) + let of_json j = + { + body = (Util.option_map (Json.lookup j "body") Blob.of_json); + delete_marker = + (Util.option_map (Json.lookup j "delete_marker") Boolean.of_json); + accept_ranges = + (Util.option_map (Json.lookup j "accept_ranges") String.of_json); + expiration = + (Util.option_map (Json.lookup j "expiration") String.of_json); + restore = (Util.option_map (Json.lookup j "restore") String.of_json); + last_modified = + (Util.option_map (Json.lookup j "last_modified") DateTime.of_json); + content_length = + (Util.option_map (Json.lookup j "content_length") Integer.of_json); + e_tag = (Util.option_map (Json.lookup j "e_tag") String.of_json); + missing_meta = + (Util.option_map (Json.lookup j "missing_meta") Integer.of_json); + version_id = + (Util.option_map (Json.lookup j "version_id") String.of_json); + cache_control = + (Util.option_map (Json.lookup j "cache_control") String.of_json); + content_disposition = + (Util.option_map (Json.lookup j "content_disposition") + String.of_json); + content_encoding = + (Util.option_map (Json.lookup j "content_encoding") String.of_json); + content_language = + (Util.option_map (Json.lookup j "content_language") String.of_json); + content_range = + (Util.option_map (Json.lookup j "content_range") String.of_json); + content_type = + (Util.option_map (Json.lookup j "content_type") String.of_json); + expires = + (Util.option_map (Json.lookup j "expires") DateTime.of_json); + website_redirect_location = + (Util.option_map (Json.lookup j "website_redirect_location") + String.of_json); + server_side_encryption = + (Util.option_map (Json.lookup j "server_side_encryption") + ServerSideEncryption.of_json); + metadata = + (Util.option_map (Json.lookup j "metadata") Metadata.of_json); + s_s_e_customer_algorithm = + (Util.option_map (Json.lookup j "s_s_e_customer_algorithm") + String.of_json); + s_s_e_customer_key_m_d5 = + (Util.option_map (Json.lookup j "s_s_e_customer_key_m_d5") + String.of_json); + s_s_e_k_m_s_key_id = + (Util.option_map (Json.lookup j "s_s_e_k_m_s_key_id") + String.of_json); + storage_class = + (Util.option_map (Json.lookup j "storage_class") + StorageClass.of_json); + request_charged = + (Util.option_map (Json.lookup j "request_charged") + RequestCharged.of_json); + replication_status = + (Util.option_map (Json.lookup j "replication_status") + ReplicationStatus.of_json) + } + end +module PutBucketNotificationConfigurationRequest = + struct + type t = + { + bucket: String.t ; + notification_configuration: NotificationConfiguration.t } + let make ~bucket ~notification_configuration () = + { bucket; notification_configuration } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + notification_configuration = + (Xml.required "NotificationConfiguration" + (Util.option_bind (Xml.member "NotificationConfiguration" xml) + NotificationConfiguration.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("NotificationConfiguration", + (NotificationConfiguration.to_query + v.notification_configuration))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("notification_configuration", + (NotificationConfiguration.to_json + v.notification_configuration)); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + notification_configuration = + (NotificationConfiguration.of_json + (Util.of_option_exn (Json.lookup j "notification_configuration"))) + } + end +module GetBucketCorsRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module CreateBucketOutput = + struct + type t = { + location: String.t option } + let make ?location () = { location } + let parse xml = + Some + { + location = + (Util.option_bind (Xml.member "Location" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.location + (fun f -> Query.Pair ("Location", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.location + (fun f -> ("location", (String.to_json f)))]) + let of_json j = + { + location = + (Util.option_map (Json.lookup j "location") String.of_json) + } + end +module PutBucketCorsRequest = + struct + type t = + { + bucket: String.t ; + c_o_r_s_configuration: CORSConfiguration.t option ; + content_m_d5: String.t option } + let make ~bucket ?c_o_r_s_configuration ?content_m_d5 () = + { bucket; c_o_r_s_configuration; content_m_d5 } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)); + c_o_r_s_configuration = + (Util.option_bind (Xml.member "CORSConfiguration" xml) + CORSConfiguration.parse); + content_m_d5 = + (Util.option_bind (Xml.member "Content-MD5" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.content_m_d5 + (fun f -> Query.Pair ("Content-MD5", (String.to_query f))); + Util.option_map v.c_o_r_s_configuration + (fun f -> + Query.Pair + ("CORSConfiguration", (CORSConfiguration.to_query f))); + Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.content_m_d5 + (fun f -> ("content_m_d5", (String.to_json f))); + Util.option_map v.c_o_r_s_configuration + (fun f -> + ("c_o_r_s_configuration", (CORSConfiguration.to_json f))); + Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))); + c_o_r_s_configuration = + (Util.option_map (Json.lookup j "c_o_r_s_configuration") + CORSConfiguration.of_json); + content_m_d5 = + (Util.option_map (Json.lookup j "content_m_d5") String.of_json) + } + end +module DeleteBucketLifecycleRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetBucketAclRequest = + struct + type t = { + bucket: String.t } + let make ~bucket () = { bucket } + let parse xml = + Some + { + bucket = + (Xml.required "Bucket" + (Util.option_bind (Xml.member "Bucket" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Bucket", (String.to_query v.bucket)))]) + let to_json v = + `Assoc + (Util.list_filter_opt [Some ("bucket", (String.to_json v.bucket))]) + let of_json j = + { + bucket = + (String.of_json (Util.of_option_exn (Json.lookup j "bucket"))) + } + end +module GetBucketRequestPaymentOutput = + struct + type t = { + payer: Payer.t option } + let make ?payer () = { payer } + let parse xml = + Some + { payer = (Util.option_bind (Xml.member "Payer" xml) Payer.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.payer + (fun f -> Query.Pair ("Payer", (Payer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.payer (fun f -> ("payer", (Payer.to_json f)))]) + let of_json j = + { payer = (Util.option_map (Json.lookup j "payer") Payer.of_json) } + end \ No newline at end of file diff --git a/libraries/s3/lib/uploadPart.ml b/libraries/s3/lib/uploadPart.ml index 2ae63b95d..cd71f52ed 100644 --- a/libraries/s3/lib/uploadPart.ml +++ b/libraries/s3/lib/uploadPart.ml @@ -1,57 +1,54 @@ open Types open Aws - type input = UploadPartRequest.t - type output = UploadPartOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "UploadPart" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2006-03-01"]); ("Action", ["UploadPart"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UploadPartRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (UploadPartRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "UploadPartResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp UploadPartOutput.parse) + Util.or_error (Util.option_bind resp UploadPartOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed UploadPartOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed UploadPartOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UploadPartOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UploadPartOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/uploadPart.mli b/libraries/s3/lib/uploadPart.mli index 0c81a6bc9..ace91f5a3 100644 --- a/libraries/s3/lib/uploadPart.mli +++ b/libraries/s3/lib/uploadPart.mli @@ -1,10 +1,7 @@ open Types - type input = UploadPartRequest.t - type output = UploadPartOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib/uploadPartCopy.ml b/libraries/s3/lib/uploadPartCopy.ml index eb9ba14f6..1bb5ad2c9 100644 --- a/libraries/s3/lib/uploadPartCopy.ml +++ b/libraries/s3/lib/uploadPartCopy.ml @@ -1,57 +1,57 @@ open Types open Aws - type input = UploadPartCopyRequest.t - type output = UploadPartCopyOutput.t - type error = Errors_internal.t - let service = "s3" - 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", [ "2006-03-01" ]; "Action", [ "UploadPartCopy" ] ] + [("Version", ["2006-03-01"]); ("Action", ["UploadPartCopy"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (UploadPartCopyRequest.to_query req))))) - in - `PUT, uri, [] - + (Uri.query_of_encoded + (Query.render (UploadPartCopyRequest.to_query req))))) in + (`PUT, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "UploadPartCopyResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp UploadPartCopyOutput.parse) + Util.or_error (Util.option_bind resp UploadPartCopyOutput.parse) (let open Error in - BadResponse { body; message = "Could not find well formed UploadPartCopyOutput." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed UploadPartCopyOutput." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UploadPartCopyOutput - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UploadPartCopyOutput - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/s3/lib/uploadPartCopy.mli b/libraries/s3/lib/uploadPartCopy.mli index 4216fde82..67396e29c 100644 --- a/libraries/s3/lib/uploadPartCopy.mli +++ b/libraries/s3/lib/uploadPartCopy.mli @@ -1,10 +1,7 @@ open Types - type input = UploadPartCopyRequest.t - type output = UploadPartCopyOutput.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 \ No newline at end of file diff --git a/libraries/s3/lib_test/dune b/libraries/s3/lib_test/dune index c2cee3195..826597fd5 100644 --- a/libraries/s3/lib_test/dune +++ b/libraries/s3/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_s3_test) - (libraries aws aws_s3 aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_s3 aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/s3/lib_test/test_async.ml b/libraries/s3/lib_test/test_async.ml index 5445b7c0e..43fcfdbba 100644 --- a/libraries/s3/lib_test/test_async.ml +++ b/libraries/s3/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_s3_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/s3/lib_test/test_lwt.ml b/libraries/s3/lib_test/test_lwt.ml index 1ea21bc02..cc0b8df4e 100644 --- a/libraries/s3/lib_test/test_lwt.ml +++ b/libraries/s3/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_s3_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/sdb/lib/batchDeleteAttributes.ml b/libraries/sdb/lib/batchDeleteAttributes.ml index 48614c6a1..d36cb1d75 100644 --- a/libraries/sdb/lib/batchDeleteAttributes.ml +++ b/libraries/sdb/lib/batchDeleteAttributes.ml @@ -1,37 +1,30 @@ open Types open Aws - type input = BatchDeleteAttributesRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "BatchDeleteAttributes" ] ] + [("Version", ["2009-04-15"]); ("Action", ["BatchDeleteAttributes"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (BatchDeleteAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (BatchDeleteAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/batchDeleteAttributes.mli b/libraries/sdb/lib/batchDeleteAttributes.mli index ff2d62cbb..091f75d4f 100644 --- a/libraries/sdb/lib/batchDeleteAttributes.mli +++ b/libraries/sdb/lib/batchDeleteAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = BatchDeleteAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/batchPutAttributes.ml b/libraries/sdb/lib/batchPutAttributes.ml index ead1c11fc..63242e8ff 100644 --- a/libraries/sdb/lib/batchPutAttributes.ml +++ b/libraries/sdb/lib/batchPutAttributes.ml @@ -1,48 +1,39 @@ open Types open Aws - type input = BatchPutAttributesRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "BatchPutAttributes" ] ] + [("Version", ["2009-04-15"]); ("Action", ["BatchPutAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (BatchPutAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (BatchPutAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.NumberSubmittedAttributesExceeded - ; Errors_internal.NumberSubmittedItemsExceeded - ; Errors_internal.NumberDomainBytesExceeded - ; Errors_internal.NumberDomainAttributesExceeded - ; Errors_internal.NumberItemAttributesExceeded - ; Errors_internal.NoSuchDomain - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ; Errors_internal.DuplicateItemName - ] - @ Errors_internal.common - in + [Errors_internal.NumberSubmittedAttributesExceeded; + Errors_internal.NumberSubmittedItemsExceeded; + Errors_internal.NumberDomainBytesExceeded; + Errors_internal.NumberDomainAttributesExceeded; + Errors_internal.NumberItemAttributesExceeded; + Errors_internal.NoSuchDomain; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue; + Errors_internal.DuplicateItemName] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/batchPutAttributes.mli b/libraries/sdb/lib/batchPutAttributes.mli index fdf898b45..bce7243ff 100644 --- a/libraries/sdb/lib/batchPutAttributes.mli +++ b/libraries/sdb/lib/batchPutAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = BatchPutAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/createDomain.ml b/libraries/sdb/lib/createDomain.ml index c56c4caa6..74facbbf8 100644 --- a/libraries/sdb/lib/createDomain.ml +++ b/libraries/sdb/lib/createDomain.ml @@ -1,42 +1,33 @@ open Types open Aws - type input = CreateDomainRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "CreateDomain" ] ] + [("Version", ["2009-04-15"]); ("Action", ["CreateDomain"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDomainRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDomainRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.NumberDomainsExceeded - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.NumberDomainsExceeded; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/createDomain.mli b/libraries/sdb/lib/createDomain.mli index 837e51e5c..67d186222 100644 --- a/libraries/sdb/lib/createDomain.mli +++ b/libraries/sdb/lib/createDomain.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDomainRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/deleteAttributes.ml b/libraries/sdb/lib/deleteAttributes.ml index c8e7461bb..d69fe1f01 100644 --- a/libraries/sdb/lib/deleteAttributes.ml +++ b/libraries/sdb/lib/deleteAttributes.ml @@ -1,43 +1,34 @@ open Types open Aws - type input = DeleteAttributesRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "DeleteAttributes" ] ] + [("Version", ["2009-04-15"]); ("Action", ["DeleteAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.AttributeDoesNotExist - ; Errors_internal.NoSuchDomain - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.AttributeDoesNotExist; + Errors_internal.NoSuchDomain; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/deleteAttributes.mli b/libraries/sdb/lib/deleteAttributes.mli index 653a26f47..b42770c44 100644 --- a/libraries/sdb/lib/deleteAttributes.mli +++ b/libraries/sdb/lib/deleteAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/deleteDomain.ml b/libraries/sdb/lib/deleteDomain.ml index 53ce8881b..2113d7795 100644 --- a/libraries/sdb/lib/deleteDomain.ml +++ b/libraries/sdb/lib/deleteDomain.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteDomainRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "DeleteDomain" ] ] + [("Version", ["2009-04-15"]); ("Action", ["DeleteDomain"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDomainRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDomainRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.MissingParameter ] @ Errors_internal.common in + let errors = [Errors_internal.MissingParameter] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/deleteDomain.mli b/libraries/sdb/lib/deleteDomain.mli index 14482e061..a7ea499ef 100644 --- a/libraries/sdb/lib/deleteDomain.mli +++ b/libraries/sdb/lib/deleteDomain.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDomainRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/domainMetadata.ml b/libraries/sdb/lib/domainMetadata.ml index d3549833c..e169e9b6e 100644 --- a/libraries/sdb/lib/domainMetadata.ml +++ b/libraries/sdb/lib/domainMetadata.ml @@ -1,64 +1,61 @@ open Types open Aws - type input = DomainMetadataRequest.t - type output = DomainMetadataResult.t - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "DomainMetadata" ] ] + [("Version", ["2009-04-15"]); ("Action", ["DomainMetadata"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DomainMetadataRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DomainMetadataRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DomainMetadataResponse" (snd xml)) - (Xml.member "DomainMetadataResult") - in + Util.option_bind (Xml.member "DomainMetadataResponse" (snd xml)) + (Xml.member "DomainMetadataResult") in try - Util.or_error - (Util.option_bind resp DomainMetadataResult.parse) + Util.or_error (Util.option_bind resp DomainMetadataResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed DomainMetadataResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DomainMetadataResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DomainMetadataResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DomainMetadataResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.NoSuchDomain; Errors_internal.MissingParameter ] - @ Errors_internal.common - in + [Errors_internal.NoSuchDomain; Errors_internal.MissingParameter] @ + 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 \ No newline at end of file diff --git a/libraries/sdb/lib/domainMetadata.mli b/libraries/sdb/lib/domainMetadata.mli index b3a83a0d9..aa2c6b013 100644 --- a/libraries/sdb/lib/domainMetadata.mli +++ b/libraries/sdb/lib/domainMetadata.mli @@ -1,10 +1,7 @@ open Types - type input = DomainMetadataRequest.t - type output = DomainMetadataResult.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 \ No newline at end of file diff --git a/libraries/sdb/lib/dune b/libraries/sdb/lib/dune index 0e4606b67..31eab5052 100644 --- a/libraries/sdb/lib/dune +++ b/libraries/sdb/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_sdb) + (name aws_sdb) (public_name aws-sdb) (synopsis "aws-Amazon SimpleDB") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/sdb/lib/errors_internal.ml b/libraries/sdb/lib/errors_internal.ml index a9f9c442f..14db38c31 100644 --- a/libraries/sdb/lib/errors_internal.ml +++ b/libraries/sdb/lib/errors_internal.ml @@ -1,76 +1,73 @@ type t = - | AttributeDoesNotExist - | AuthFailure - | Blocked - | DryRunOperation - | DuplicateItemName - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidClientTokenId - | InvalidNextToken - | InvalidNumberPredicates - | InvalidNumberValueTests - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryExpression - | InvalidQueryParameter - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | NoSuchDomain - | NumberDomainAttributesExceeded - | NumberDomainBytesExceeded - | NumberDomainsExceeded - | NumberItemAttributesExceeded - | NumberSubmittedAttributesExceeded - | NumberSubmittedItemsExceeded - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | RequestTimeout - | ServiceUnavailable - | Throttling - | TooManyRequestedAttributes - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AttributeDoesNotExist + | AuthFailure + | Blocked + | DryRunOperation + | DuplicateItemName + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidClientTokenId + | InvalidNextToken + | InvalidNumberPredicates + | InvalidNumberValueTests + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryExpression + | InvalidQueryParameter + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | NoSuchDomain + | NumberDomainAttributesExceeded + | NumberDomainBytesExceeded + | NumberDomainsExceeded + | NumberItemAttributesExceeded + | NumberSubmittedAttributesExceeded + | NumberSubmittedItemsExceeded + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | RequestTimeout + | ServiceUnavailable + | Throttling + | TooManyRequestedAttributes + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AttributeDoesNotExist -> Some 404 @@ -115,7 +112,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AttributeDoesNotExist -> "AttributeDoesNotExist" @@ -160,7 +156,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AttributeDoesNotExist" -> Some AttributeDoesNotExist @@ -190,7 +185,8 @@ let of_string e = | "NumberDomainBytesExceeded" -> Some NumberDomainBytesExceeded | "NumberDomainsExceeded" -> Some NumberDomainsExceeded | "NumberItemAttributesExceeded" -> Some NumberItemAttributesExceeded - | "NumberSubmittedAttributesExceeded" -> Some NumberSubmittedAttributesExceeded + | "NumberSubmittedAttributesExceeded" -> + Some NumberSubmittedAttributesExceeded | "NumberSubmittedItemsExceeded" -> Some NumberSubmittedItemsExceeded | "OptInRequired" -> Some OptInRequired | "PendingVerification" -> Some PendingVerification @@ -205,4 +201,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/sdb/lib/getAttributes.ml b/libraries/sdb/lib/getAttributes.ml index 2391fe014..7d55afe7e 100644 --- a/libraries/sdb/lib/getAttributes.ml +++ b/libraries/sdb/lib/getAttributes.ml @@ -1,67 +1,62 @@ open Types open Aws - type input = GetAttributesRequest.t - type output = GetAttributesResult.t - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "GetAttributes" ] ] + [("Version", ["2009-04-15"]); ("Action", ["GetAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetAttributesResponse" (snd xml)) - (Xml.member "GetAttributesResult") - in + Util.option_bind (Xml.member "GetAttributesResponse" (snd xml)) + (Xml.member "GetAttributesResult") in try - Util.or_error - (Util.option_bind resp GetAttributesResult.parse) + Util.or_error (Util.option_bind resp GetAttributesResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetAttributesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetAttributesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetAttributesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetAttributesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.NoSuchDomain - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.NoSuchDomain; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/getAttributes.mli b/libraries/sdb/lib/getAttributes.mli index 4c87400d8..82160b93d 100644 --- a/libraries/sdb/lib/getAttributes.mli +++ b/libraries/sdb/lib/getAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = GetAttributesRequest.t - type output = GetAttributesResult.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 \ No newline at end of file diff --git a/libraries/sdb/lib/listDomains.ml b/libraries/sdb/lib/listDomains.ml index e1205cc6c..e5ea70c3a 100644 --- a/libraries/sdb/lib/listDomains.ml +++ b/libraries/sdb/lib/listDomains.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = ListDomainsRequest.t - type output = ListDomainsResult.t - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "ListDomains" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-04-15"]); ("Action", ["ListDomains"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListDomainsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListDomainsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListDomainsResponse" (snd xml)) - (Xml.member "ListDomainsResult") - in + Util.option_bind (Xml.member "ListDomainsResponse" (snd xml)) + (Xml.member "ListDomainsResult") in try - Util.or_error - (Util.option_bind resp ListDomainsResult.parse) + Util.or_error (Util.option_bind resp ListDomainsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListDomainsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListDomainsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListDomainsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListDomainsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidNextToken; Errors_internal.InvalidParameterValue ] - @ Errors_internal.common - in + [Errors_internal.InvalidNextToken; Errors_internal.InvalidParameterValue] + @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/listDomains.mli b/libraries/sdb/lib/listDomains.mli index 9b0022108..04fcfab2b 100644 --- a/libraries/sdb/lib/listDomains.mli +++ b/libraries/sdb/lib/listDomains.mli @@ -1,10 +1,7 @@ open Types - type input = ListDomainsRequest.t - type output = ListDomainsResult.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 \ No newline at end of file diff --git a/libraries/sdb/lib/putAttributes.ml b/libraries/sdb/lib/putAttributes.ml index 6ebd3d20f..921bf4ce9 100644 --- a/libraries/sdb/lib/putAttributes.ml +++ b/libraries/sdb/lib/putAttributes.ml @@ -1,46 +1,37 @@ open Types open Aws - type input = PutAttributesRequest.t - type output = unit - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "PutAttributes" ] ] + [("Version", ["2009-04-15"]); ("Action", ["PutAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PutAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PutAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.AttributeDoesNotExist - ; Errors_internal.NumberItemAttributesExceeded - ; Errors_internal.NumberDomainBytesExceeded - ; Errors_internal.NumberDomainAttributesExceeded - ; Errors_internal.NoSuchDomain - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.AttributeDoesNotExist; + Errors_internal.NumberItemAttributesExceeded; + Errors_internal.NumberDomainBytesExceeded; + Errors_internal.NumberDomainAttributesExceeded; + Errors_internal.NoSuchDomain; + Errors_internal.MissingParameter; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/putAttributes.mli b/libraries/sdb/lib/putAttributes.mli index 47b462dfc..de46d9fbf 100644 --- a/libraries/sdb/lib/putAttributes.mli +++ b/libraries/sdb/lib/putAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = PutAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sdb/lib/select.ml b/libraries/sdb/lib/select.ml index d1c9877a6..e2291a3b4 100644 --- a/libraries/sdb/lib/select.ml +++ b/libraries/sdb/lib/select.ml @@ -1,70 +1,63 @@ open Types open Aws - type input = SelectRequest.t - type output = SelectResult.t - type error = Errors_internal.t - let service = "sdb" - 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-04-15" ]; "Action", [ "Select" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2009-04-15"]); ("Action", ["Select"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SelectRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded (Query.render (SelectRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind (Xml.member "SelectResponse" (snd xml)) (Xml.member "SelectResult") - in + Util.option_bind (Xml.member "SelectResponse" (snd xml)) + (Xml.member "SelectResult") in try - Util.or_error - (Util.option_bind resp SelectResult.parse) + Util.or_error (Util.option_bind resp SelectResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed SelectResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed SelectResult." }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing SelectResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing SelectResult - missing field in body or children: " ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.TooManyRequestedAttributes - ; Errors_internal.RequestTimeout - ; Errors_internal.NoSuchDomain - ; Errors_internal.MissingParameter - ; Errors_internal.InvalidQueryExpression - ; Errors_internal.InvalidNumberValueTests - ; Errors_internal.InvalidNumberPredicates - ; Errors_internal.InvalidNextToken - ; Errors_internal.InvalidParameterValue - ] - @ Errors_internal.common - in + [Errors_internal.TooManyRequestedAttributes; + Errors_internal.RequestTimeout; + Errors_internal.NoSuchDomain; + Errors_internal.MissingParameter; + Errors_internal.InvalidQueryExpression; + Errors_internal.InvalidNumberValueTests; + Errors_internal.InvalidNumberPredicates; + Errors_internal.InvalidNextToken; + Errors_internal.InvalidParameterValue] @ 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 \ No newline at end of file diff --git a/libraries/sdb/lib/select.mli b/libraries/sdb/lib/select.mli index 9b764596a..ec0a24e7a 100644 --- a/libraries/sdb/lib/select.mli +++ b/libraries/sdb/lib/select.mli @@ -1,10 +1,7 @@ open Types - type input = SelectRequest.t - type output = SelectResult.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 \ No newline at end of file diff --git a/libraries/sdb/lib/types.ml b/libraries/sdb/lib/types.ml index f93151e13..cec2d0371 100644 --- a/libraries/sdb/lib/types.ml +++ b/libraries/sdb/lib/types.ml @@ -1,1356 +1,1405 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module ReplaceableAttribute = struct - type t = - { name : String.t - ; value : String.t - ; replace : Boolean.t option - } - - let make ~name ~value ?replace () = { name; value; replace } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) - ; replace = Util.option_bind (Xml.member "Replace" xml) Boolean.parse +module ReplaceableAttribute = + struct + type t = { + name: String.t ; + value: String.t ; + replace: Boolean.t option } + let make ~name ~value ?replace () = { name; value; replace } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)); + replace = + (Util.option_bind (Xml.member "Replace" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.replace + (fun f -> Query.Pair ("Replace", (Boolean.to_query f))); + Some (Query.Pair ("Value", (String.to_query v.value))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.replace + (fun f -> ("replace", (Boolean.to_json f))); + Some ("value", (String.to_json v.value)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))); + replace = (Util.option_map (Json.lookup j "replace") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.replace (fun f -> Query.Pair ("Replace", Boolean.to_query f)) - ; Some (Query.Pair ("Value", String.to_query v.value)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.replace (fun f -> "replace", Boolean.to_json f) - ; Some ("value", String.to_json v.value) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - ; replace = Util.option_map (Json.lookup j "replace") Boolean.of_json - } -end - -module Attribute = struct - type t = - { name : String.t - ; alternate_name_encoding : String.t option - ; value : String.t - ; alternate_value_encoding : String.t option - } - - let make ~name ?alternate_name_encoding ~value ?alternate_value_encoding () = - { name; alternate_name_encoding; value; alternate_value_encoding } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; alternate_name_encoding = - Util.option_bind (Xml.member "AlternateNameEncoding" xml) String.parse - ; value = - Xml.required "Value" (Util.option_bind (Xml.member "Value" xml) String.parse) - ; alternate_value_encoding = - Util.option_bind (Xml.member "AlternateValueEncoding" xml) String.parse + end +module Attribute = + struct + type t = + { + name: String.t ; + alternate_name_encoding: String.t option ; + value: String.t ; + alternate_value_encoding: String.t option } + let make ~name ?alternate_name_encoding ~value + ?alternate_value_encoding () = + { name; alternate_name_encoding; value; alternate_value_encoding } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + alternate_name_encoding = + (Util.option_bind (Xml.member "AlternateNameEncoding" xml) + String.parse); + value = + (Xml.required "Value" + (Util.option_bind (Xml.member "Value" xml) String.parse)); + alternate_value_encoding = + (Util.option_bind (Xml.member "AlternateValueEncoding" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.alternate_value_encoding + (fun f -> + Query.Pair ("AlternateValueEncoding", (String.to_query f))); + Some (Query.Pair ("Value", (String.to_query v.value))); + Util.option_map v.alternate_name_encoding + (fun f -> + Query.Pair ("AlternateNameEncoding", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.alternate_value_encoding + (fun f -> ("alternate_value_encoding", (String.to_json f))); + Some ("value", (String.to_json v.value)); + Util.option_map v.alternate_name_encoding + (fun f -> ("alternate_name_encoding", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + alternate_name_encoding = + (Util.option_map (Json.lookup j "alternate_name_encoding") + String.of_json); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))); + alternate_value_encoding = + (Util.option_map (Json.lookup j "alternate_value_encoding") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.alternate_value_encoding (fun f -> - Query.Pair ("AlternateValueEncoding", String.to_query f)) - ; Some (Query.Pair ("Value", String.to_query v.value)) - ; Util.option_map v.alternate_name_encoding (fun f -> - Query.Pair ("AlternateNameEncoding", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.alternate_value_encoding (fun f -> - "alternate_value_encoding", String.to_json f) - ; Some ("value", String.to_json v.value) - ; Util.option_map v.alternate_name_encoding (fun f -> - "alternate_name_encoding", String.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; alternate_name_encoding = - Util.option_map (Json.lookup j "alternate_name_encoding") String.of_json - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - ; alternate_value_encoding = - Util.option_map (Json.lookup j "alternate_value_encoding") String.of_json - } -end - -module ReplaceableAttributeList = struct - type t = ReplaceableAttribute.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReplaceableAttribute.parse (Xml.members "Attribute" xml)) - - let to_query v = Query.to_query_list ReplaceableAttribute.to_query v - - let to_json v = `List (List.map ReplaceableAttribute.to_json v) - - let of_json j = Json.to_list ReplaceableAttribute.of_json j -end - -module AttributeList = struct - type t = Attribute.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Attribute.parse (Xml.members "Attribute" xml)) - - let to_query v = Query.to_query_list Attribute.to_query v - - let to_json v = `List (List.map Attribute.to_json v) - - let of_json j = Json.to_list Attribute.of_json j -end - -module ReplaceableItem = struct - type t = - { name : String.t - ; attributes : ReplaceableAttributeList.t - } - - let make ~name ~attributes () = { name; attributes } - - let parse xml = - Some - { name = - Xml.required - "ItemName" - (Util.option_bind (Xml.member "ItemName" xml) String.parse) - ; attributes = Xml.required "Attributes" (ReplaceableAttributeList.parse xml) + end +module ReplaceableAttributeList = + struct + type t = ReplaceableAttribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReplaceableAttribute.parse (Xml.members "Attribute" xml)) + let to_query v = Query.to_query_list ReplaceableAttribute.to_query v + let to_json v = `List (List.map ReplaceableAttribute.to_json v) + let of_json j = Json.to_list ReplaceableAttribute.of_json j + end +module AttributeList = + struct + type t = Attribute.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Attribute.parse (Xml.members "Attribute" xml)) + let to_query v = Query.to_query_list Attribute.to_query v + let to_json v = `List (List.map Attribute.to_json v) + let of_json j = Json.to_list Attribute.of_json j + end +module ReplaceableItem = + struct + type t = { + name: String.t ; + attributes: ReplaceableAttributeList.t } + let make ~name ~attributes () = { name; attributes } + let parse xml = + Some + { + name = + (Xml.required "ItemName" + (Util.option_bind (Xml.member "ItemName" xml) String.parse)); + attributes = + (Xml.required "Attributes" (ReplaceableAttributeList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attributes.member", + (ReplaceableAttributeList.to_query v.attributes))); + Some (Query.Pair ("ItemName", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("attributes", (ReplaceableAttributeList.to_json v.attributes)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + attributes = + (ReplaceableAttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("Attributes.member", ReplaceableAttributeList.to_query v.attributes)) - ; Some (Query.Pair ("ItemName", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attributes", ReplaceableAttributeList.to_json v.attributes) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; attributes = - ReplaceableAttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - } -end - -module DeletableItem = struct - type t = - { name : String.t - ; attributes : AttributeList.t - } - - let make ~name ?(attributes = []) () = { name; attributes } - - let parse xml = - Some - { name = - Xml.required - "ItemName" - (Util.option_bind (Xml.member "ItemName" xml) String.parse) - ; attributes = Util.of_option [] (AttributeList.parse xml) + end +module DeletableItem = + struct + type t = { + name: String.t ; + attributes: AttributeList.t } + let make ~name ?(attributes= []) () = { name; attributes } + let parse xml = + Some + { + name = + (Xml.required "ItemName" + (Util.option_bind (Xml.member "ItemName" xml) String.parse)); + attributes = (Util.of_option [] (AttributeList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attributes.member", (AttributeList.to_query v.attributes))); + Some (Query.Pair ("ItemName", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attributes", (AttributeList.to_json v.attributes)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + attributes = + (AttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attributes.member", AttributeList.to_query v.attributes)) - ; Some (Query.Pair ("ItemName", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attributes", AttributeList.to_json v.attributes) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; attributes = AttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - } -end - -module Item = struct - type t = - { name : String.t - ; alternate_name_encoding : String.t option - ; attributes : AttributeList.t - } - - let make ~name ?alternate_name_encoding ~attributes () = - { name; alternate_name_encoding; attributes } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; alternate_name_encoding = - Util.option_bind (Xml.member "AlternateNameEncoding" xml) String.parse - ; attributes = Xml.required "Attributes" (AttributeList.parse xml) + end +module Item = + struct + type t = + { + name: String.t ; + alternate_name_encoding: String.t option ; + attributes: AttributeList.t } + let make ~name ?alternate_name_encoding ~attributes () = + { name; alternate_name_encoding; attributes } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + alternate_name_encoding = + (Util.option_bind (Xml.member "AlternateNameEncoding" xml) + String.parse); + attributes = (Xml.required "Attributes" (AttributeList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attributes.member", (AttributeList.to_query v.attributes))); + Util.option_map v.alternate_name_encoding + (fun f -> + Query.Pair ("AlternateNameEncoding", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attributes", (AttributeList.to_json v.attributes)); + Util.option_map v.alternate_name_encoding + (fun f -> ("alternate_name_encoding", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + alternate_name_encoding = + (Util.option_map (Json.lookup j "alternate_name_encoding") + String.of_json); + attributes = + (AttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attributes.member", AttributeList.to_query v.attributes)) - ; Util.option_map v.alternate_name_encoding (fun f -> - Query.Pair ("AlternateNameEncoding", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attributes", AttributeList.to_json v.attributes) - ; Util.option_map v.alternate_name_encoding (fun f -> - "alternate_name_encoding", String.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; alternate_name_encoding = - Util.option_map (Json.lookup j "alternate_name_encoding") String.of_json - ; attributes = AttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - } -end - -module UpdateCondition = struct - type t = - { name : String.t option - ; value : String.t option - ; exists : Boolean.t option - } - - let make ?name ?value ?exists () = { name; value; exists } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; value = Util.option_bind (Xml.member "Value" xml) String.parse - ; exists = Util.option_bind (Xml.member "Exists" xml) Boolean.parse + end +module UpdateCondition = + struct + type t = + { + name: String.t option ; + value: String.t option ; + exists: Boolean.t option } + let make ?name ?value ?exists () = { name; value; exists } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + value = (Util.option_bind (Xml.member "Value" xml) String.parse); + exists = (Util.option_bind (Xml.member "Exists" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.exists + (fun f -> Query.Pair ("Exists", (Boolean.to_query f))); + Util.option_map v.value + (fun f -> Query.Pair ("Value", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.exists + (fun f -> ("exists", (Boolean.to_json f))); + Util.option_map v.value (fun f -> ("value", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + value = (Util.option_map (Json.lookup j "value") String.of_json); + exists = (Util.option_map (Json.lookup j "exists") Boolean.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.exists (fun f -> Query.Pair ("Exists", Boolean.to_query f)) - ; Util.option_map v.value (fun f -> Query.Pair ("Value", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.exists (fun f -> "exists", Boolean.to_json f) - ; Util.option_map v.value (fun f -> "value", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; value = Util.option_map (Json.lookup j "value") String.of_json - ; exists = Util.option_map (Json.lookup j "exists") Boolean.of_json - } -end - -module ReplaceableItemList = struct - type t = ReplaceableItem.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map ReplaceableItem.parse (Xml.members "Item" xml)) - - let to_query v = Query.to_query_list ReplaceableItem.to_query v - - let to_json v = `List (List.map ReplaceableItem.to_json v) - - let of_json j = Json.to_list ReplaceableItem.of_json j -end - -module AttributeNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "AttributeName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DeletableItemList = struct - type t = DeletableItem.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map DeletableItem.parse (Xml.members "Item" xml)) - - let to_query v = Query.to_query_list DeletableItem.to_query v - - let to_json v = `List (List.map DeletableItem.to_json v) - - let of_json j = Json.to_list DeletableItem.of_json j -end - -module ItemList = struct - type t = Item.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Item.parse (Xml.members "Item" xml)) - - let to_query v = Query.to_query_list Item.to_query v - - let to_json v = `List (List.map Item.to_json v) - - let of_json j = Json.to_list Item.of_json j -end - -module DomainNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "DomainName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module DeleteAttributesRequest = struct - type t = - { domain_name : String.t - ; item_name : String.t - ; attributes : AttributeList.t - ; expected : UpdateCondition.t option - } - - let make ~domain_name ~item_name ?(attributes = []) ?expected () = - { domain_name; item_name; attributes; expected } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) - ; item_name = - Xml.required - "ItemName" - (Util.option_bind (Xml.member "ItemName" xml) String.parse) - ; attributes = Util.of_option [] (AttributeList.parse xml) - ; expected = Util.option_bind (Xml.member "Expected" xml) UpdateCondition.parse + end +module ReplaceableItemList = + struct + type t = ReplaceableItem.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ReplaceableItem.parse (Xml.members "Item" xml)) + let to_query v = Query.to_query_list ReplaceableItem.to_query v + let to_json v = `List (List.map ReplaceableItem.to_json v) + let of_json j = Json.to_list ReplaceableItem.of_json j + end +module AttributeNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AttributeName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DeletableItemList = + struct + type t = DeletableItem.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map DeletableItem.parse (Xml.members "Item" xml)) + let to_query v = Query.to_query_list DeletableItem.to_query v + let to_json v = `List (List.map DeletableItem.to_json v) + let of_json j = Json.to_list DeletableItem.of_json j + end +module ItemList = + struct + type t = Item.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Item.parse (Xml.members "Item" xml)) + let to_query v = Query.to_query_list Item.to_query v + let to_json v = `List (List.map Item.to_json v) + let of_json j = Json.to_list Item.of_json j + end +module DomainNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "DomainName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module DeleteAttributesRequest = + struct + type t = + { + domain_name: String.t ; + item_name: String.t ; + attributes: AttributeList.t ; + expected: UpdateCondition.t option } + let make ~domain_name ~item_name ?(attributes= []) ?expected () = + { domain_name; item_name; attributes; expected } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)); + item_name = + (Xml.required "ItemName" + (Util.option_bind (Xml.member "ItemName" xml) String.parse)); + attributes = (Util.of_option [] (AttributeList.parse xml)); + expected = + (Util.option_bind (Xml.member "Expected" xml) + UpdateCondition.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.expected + (fun f -> Query.Pair ("Expected", (UpdateCondition.to_query f))); + Some + (Query.Pair + ("Attributes.member", (AttributeList.to_query v.attributes))); + Some (Query.Pair ("ItemName", (String.to_query v.item_name))); + Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.expected + (fun f -> ("expected", (UpdateCondition.to_json f))); + Some ("attributes", (AttributeList.to_json v.attributes)); + Some ("item_name", (String.to_json v.item_name)); + Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))); + item_name = + (String.of_json (Util.of_option_exn (Json.lookup j "item_name"))); + attributes = + (AttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))); + expected = + (Util.option_map (Json.lookup j "expected") UpdateCondition.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.expected (fun f -> - Query.Pair ("Expected", UpdateCondition.to_query f)) - ; Some (Query.Pair ("Attributes.member", AttributeList.to_query v.attributes)) - ; Some (Query.Pair ("ItemName", String.to_query v.item_name)) - ; Some (Query.Pair ("DomainName", String.to_query v.domain_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.expected (fun f -> "expected", UpdateCondition.to_json f) - ; Some ("attributes", AttributeList.to_json v.attributes) - ; Some ("item_name", String.to_json v.item_name) - ; Some ("domain_name", String.to_json v.domain_name) - ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) - ; item_name = String.of_json (Util.of_option_exn (Json.lookup j "item_name")) - ; attributes = AttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - ; expected = Util.option_map (Json.lookup j "expected") UpdateCondition.of_json - } -end - -module NumberDomainBytesExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module BatchPutAttributesRequest = struct - type t = - { domain_name : String.t - ; items : ReplaceableItemList.t - } - - let make ~domain_name ~items () = { domain_name; items } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) - ; items = Xml.required "Items" (ReplaceableItemList.parse xml) + end +module NumberDomainBytesExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Items.member", ReplaceableItemList.to_query v.items)) - ; Some (Query.Pair ("DomainName", String.to_query v.domain_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("items", ReplaceableItemList.to_json v.items) - ; Some ("domain_name", String.to_json v.domain_name) - ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) - ; items = ReplaceableItemList.of_json (Util.of_option_exn (Json.lookup j "items")) - } -end - -module GetAttributesRequest = struct - type t = - { domain_name : String.t - ; item_name : String.t - ; attribute_names : AttributeNameList.t - ; consistent_read : Boolean.t option - } - - let make ~domain_name ~item_name ?(attribute_names = []) ?consistent_read () = - { domain_name; item_name; attribute_names; consistent_read } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) - ; item_name = - Xml.required - "ItemName" - (Util.option_bind (Xml.member "ItemName" xml) String.parse) - ; attribute_names = Util.of_option [] (AttributeNameList.parse xml) - ; consistent_read = Util.option_bind (Xml.member "ConsistentRead" xml) Boolean.parse + end +module BatchPutAttributesRequest = + struct + type t = { + domain_name: String.t ; + items: ReplaceableItemList.t } + let make ~domain_name ~items () = { domain_name; items } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)); + items = (Xml.required "Items" (ReplaceableItemList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Items.member", (ReplaceableItemList.to_query v.items))); + Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("items", (ReplaceableItemList.to_json v.items)); + Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))); + items = + (ReplaceableItemList.of_json + (Util.of_option_exn (Json.lookup j "items"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.consistent_read (fun f -> - Query.Pair ("ConsistentRead", Boolean.to_query f)) - ; Some + end +module GetAttributesRequest = + struct + type t = + { + domain_name: String.t ; + item_name: String.t ; + attribute_names: AttributeNameList.t ; + consistent_read: Boolean.t option } + let make ~domain_name ~item_name ?(attribute_names= []) + ?consistent_read () = + { domain_name; item_name; attribute_names; consistent_read } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)); + item_name = + (Xml.required "ItemName" + (Util.option_bind (Xml.member "ItemName" xml) String.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)); + consistent_read = + (Util.option_bind (Xml.member "ConsistentRead" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.consistent_read + (fun f -> Query.Pair ("ConsistentRead", (Boolean.to_query f))); + Some (Query.Pair - ("AttributeNames.member", AttributeNameList.to_query v.attribute_names)) - ; Some (Query.Pair ("ItemName", String.to_query v.item_name)) - ; Some (Query.Pair ("DomainName", String.to_query v.domain_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.consistent_read (fun f -> - "consistent_read", Boolean.to_json f) - ; Some ("attribute_names", AttributeNameList.to_json v.attribute_names) - ; Some ("item_name", String.to_json v.item_name) - ; Some ("domain_name", String.to_json v.domain_name) - ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) - ; item_name = String.of_json (Util.of_option_exn (Json.lookup j "item_name")) - ; attribute_names = - AttributeNameList.of_json (Util.of_option_exn (Json.lookup j "attribute_names")) - ; consistent_read = Util.option_map (Json.lookup j "consistent_read") Boolean.of_json - } -end - -module GetAttributesResult = struct - type t = { attributes : AttributeList.t } - - let make ?(attributes = []) () = { attributes } - - let parse xml = Some { attributes = Util.of_option [] (AttributeList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attributes.member", AttributeList.to_query v.attributes)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("attributes", AttributeList.to_json v.attributes) ]) - - let of_json j = - { attributes = AttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - } -end - -module PutAttributesRequest = struct - type t = - { domain_name : String.t - ; item_name : String.t - ; attributes : ReplaceableAttributeList.t - ; expected : UpdateCondition.t option - } - - let make ~domain_name ~item_name ~attributes ?expected () = - { domain_name; item_name; attributes; expected } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) - ; item_name = - Xml.required - "ItemName" - (Util.option_bind (Xml.member "ItemName" xml) String.parse) - ; attributes = Xml.required "Attributes" (ReplaceableAttributeList.parse xml) - ; expected = Util.option_bind (Xml.member "Expected" xml) UpdateCondition.parse + ("AttributeNames.member", + (AttributeNameList.to_query v.attribute_names))); + Some (Query.Pair ("ItemName", (String.to_query v.item_name))); + Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.consistent_read + (fun f -> ("consistent_read", (Boolean.to_json f))); + Some + ("attribute_names", + (AttributeNameList.to_json v.attribute_names)); + Some ("item_name", (String.to_json v.item_name)); + Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))); + item_name = + (String.of_json (Util.of_option_exn (Json.lookup j "item_name"))); + attribute_names = + (AttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))); + consistent_read = + (Util.option_map (Json.lookup j "consistent_read") Boolean.of_json) + } + end +module GetAttributesResult = + struct + type t = { + attributes: AttributeList.t } + let make ?(attributes= []) () = { attributes } + let parse xml = + Some { attributes = (Util.of_option [] (AttributeList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Attributes.member", (AttributeList.to_query v.attributes)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attributes", (AttributeList.to_json v.attributes))]) + let of_json j = + { + attributes = + (AttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.expected (fun f -> - Query.Pair ("Expected", UpdateCondition.to_query f)) - ; Some + end +module PutAttributesRequest = + struct + type t = + { + domain_name: String.t ; + item_name: String.t ; + attributes: ReplaceableAttributeList.t ; + expected: UpdateCondition.t option } + let make ~domain_name ~item_name ~attributes ?expected () = + { domain_name; item_name; attributes; expected } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)); + item_name = + (Xml.required "ItemName" + (Util.option_bind (Xml.member "ItemName" xml) String.parse)); + attributes = + (Xml.required "Attributes" (ReplaceableAttributeList.parse xml)); + expected = + (Util.option_bind (Xml.member "Expected" xml) + UpdateCondition.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.expected + (fun f -> Query.Pair ("Expected", (UpdateCondition.to_query f))); + Some (Query.Pair - ("Attributes.member", ReplaceableAttributeList.to_query v.attributes)) - ; Some (Query.Pair ("ItemName", String.to_query v.item_name)) - ; Some (Query.Pair ("DomainName", String.to_query v.domain_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.expected (fun f -> "expected", UpdateCondition.to_json f) - ; Some ("attributes", ReplaceableAttributeList.to_json v.attributes) - ; Some ("item_name", String.to_json v.item_name) - ; Some ("domain_name", String.to_json v.domain_name) - ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) - ; item_name = String.of_json (Util.of_option_exn (Json.lookup j "item_name")) - ; attributes = - ReplaceableAttributeList.of_json (Util.of_option_exn (Json.lookup j "attributes")) - ; expected = Util.option_map (Json.lookup j "expected") UpdateCondition.of_json - } -end - -module InvalidParameterValue = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module MissingParameter = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module DuplicateItemName = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module NumberSubmittedAttributesExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module BatchDeleteAttributesRequest = struct - type t = - { domain_name : String.t - ; items : DeletableItemList.t - } - - let make ~domain_name ~items () = { domain_name; items } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) - ; items = Xml.required "Items" (DeletableItemList.parse xml) + ("Attributes.member", + (ReplaceableAttributeList.to_query v.attributes))); + Some (Query.Pair ("ItemName", (String.to_query v.item_name))); + Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.expected + (fun f -> ("expected", (UpdateCondition.to_json f))); + Some + ("attributes", (ReplaceableAttributeList.to_json v.attributes)); + Some ("item_name", (String.to_json v.item_name)); + Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))); + item_name = + (String.of_json (Util.of_option_exn (Json.lookup j "item_name"))); + attributes = + (ReplaceableAttributeList.of_json + (Util.of_option_exn (Json.lookup j "attributes"))); + expected = + (Util.option_map (Json.lookup j "expected") UpdateCondition.of_json) + } + end +module InvalidParameterValue = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module MissingParameter = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module DuplicateItemName = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module NumberSubmittedAttributesExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module BatchDeleteAttributesRequest = + struct + type t = { + domain_name: String.t ; + items: DeletableItemList.t } + let make ~domain_name ~items () = { domain_name; items } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)); + items = (Xml.required "Items" (DeletableItemList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Items.member", (DeletableItemList.to_query v.items))); + Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("items", (DeletableItemList.to_json v.items)); + Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))); + items = + (DeletableItemList.of_json + (Util.of_option_exn (Json.lookup j "items"))) + } + end +module NumberDomainsExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module NoSuchDomain = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module DomainMetadataRequest = + struct + type t = { + domain_name: String.t } + let make ~domain_name () = { domain_name } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))) + } + end +module SelectResult = + struct + type t = { + items: ItemList.t ; + next_token: String.t option } + let make ?(items= []) ?next_token () = { items; next_token } + let parse xml = + Some + { + items = (Util.of_option [] (ItemList.parse xml)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair ("Items.member", (ItemList.to_query v.items)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("items", (ItemList.to_json v.items))]) + let of_json j = + { + items = + (ItemList.of_json (Util.of_option_exn (Json.lookup j "items"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Items.member", DeletableItemList.to_query v.items)) - ; Some (Query.Pair ("DomainName", String.to_query v.domain_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("items", DeletableItemList.to_json v.items) - ; Some ("domain_name", String.to_json v.domain_name) - ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) - ; items = DeletableItemList.of_json (Util.of_option_exn (Json.lookup j "items")) - } -end - -module NumberDomainsExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module NoSuchDomain = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module DomainMetadataRequest = struct - type t = { domain_name : String.t } - - let make ~domain_name () = { domain_name } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) + end +module ListDomainsRequest = + struct + type t = + { + max_number_of_domains: Integer.t option ; + next_token: String.t option } + let make ?max_number_of_domains ?next_token () = + { max_number_of_domains; next_token } + let parse xml = + Some + { + max_number_of_domains = + (Util.option_bind (Xml.member "MaxNumberOfDomains" xml) + Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_number_of_domains + (fun f -> + Query.Pair ("MaxNumberOfDomains", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_number_of_domains + (fun f -> ("max_number_of_domains", (Integer.to_json f)))]) + let of_json j = + { + max_number_of_domains = + (Util.option_map (Json.lookup j "max_number_of_domains") + Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DomainName", String.to_query v.domain_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("domain_name", String.to_json v.domain_name) ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) } -end - -module SelectResult = struct - type t = - { items : ItemList.t - ; next_token : String.t option - } - - let make ?(items = []) ?next_token () = { items; next_token } - - let parse xml = - Some - { items = Util.of_option [] (ItemList.parse xml) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module SelectRequest = + struct + type t = + { + select_expression: String.t ; + next_token: String.t option ; + consistent_read: Boolean.t option } + let make ~select_expression ?next_token ?consistent_read () = + { select_expression; next_token; consistent_read } + let parse xml = + Some + { + select_expression = + (Xml.required "SelectExpression" + (Util.option_bind (Xml.member "SelectExpression" xml) + String.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse); + consistent_read = + (Util.option_bind (Xml.member "ConsistentRead" xml) Boolean.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.consistent_read + (fun f -> Query.Pair ("ConsistentRead", (Boolean.to_query f))); + Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("SelectExpression", (String.to_query v.select_expression)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.consistent_read + (fun f -> ("consistent_read", (Boolean.to_json f))); + Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("select_expression", (String.to_json v.select_expression))]) + let of_json j = + { + select_expression = + (String.of_json + (Util.of_option_exn (Json.lookup j "select_expression"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json); + consistent_read = + (Util.option_map (Json.lookup j "consistent_read") Boolean.of_json) + } + end +module DomainMetadataResult = + struct + type t = + { + item_count: Integer.t option ; + item_names_size_bytes: Long.t option ; + attribute_name_count: Integer.t option ; + attribute_names_size_bytes: Long.t option ; + attribute_value_count: Integer.t option ; + attribute_values_size_bytes: Long.t option ; + timestamp: Integer.t option } + let make ?item_count ?item_names_size_bytes ?attribute_name_count + ?attribute_names_size_bytes ?attribute_value_count + ?attribute_values_size_bytes ?timestamp () = + { + item_count; + item_names_size_bytes; + attribute_name_count; + attribute_names_size_bytes; + attribute_value_count; + attribute_values_size_bytes; + timestamp + } + let parse xml = + Some + { + item_count = + (Util.option_bind (Xml.member "ItemCount" xml) Integer.parse); + item_names_size_bytes = + (Util.option_bind (Xml.member "ItemNamesSizeBytes" xml) + Long.parse); + attribute_name_count = + (Util.option_bind (Xml.member "AttributeNameCount" xml) + Integer.parse); + attribute_names_size_bytes = + (Util.option_bind (Xml.member "AttributeNamesSizeBytes" xml) + Long.parse); + attribute_value_count = + (Util.option_bind (Xml.member "AttributeValueCount" xml) + Integer.parse); + attribute_values_size_bytes = + (Util.option_bind (Xml.member "AttributeValuesSizeBytes" xml) + Long.parse); + timestamp = + (Util.option_bind (Xml.member "Timestamp" xml) Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.timestamp + (fun f -> Query.Pair ("Timestamp", (Integer.to_query f))); + Util.option_map v.attribute_values_size_bytes + (fun f -> + Query.Pair ("AttributeValuesSizeBytes", (Long.to_query f))); + Util.option_map v.attribute_value_count + (fun f -> + Query.Pair ("AttributeValueCount", (Integer.to_query f))); + Util.option_map v.attribute_names_size_bytes + (fun f -> + Query.Pair ("AttributeNamesSizeBytes", (Long.to_query f))); + Util.option_map v.attribute_name_count + (fun f -> + Query.Pair ("AttributeNameCount", (Integer.to_query f))); + Util.option_map v.item_names_size_bytes + (fun f -> Query.Pair ("ItemNamesSizeBytes", (Long.to_query f))); + Util.option_map v.item_count + (fun f -> Query.Pair ("ItemCount", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.timestamp + (fun f -> ("timestamp", (Integer.to_json f))); + Util.option_map v.attribute_values_size_bytes + (fun f -> ("attribute_values_size_bytes", (Long.to_json f))); + Util.option_map v.attribute_value_count + (fun f -> ("attribute_value_count", (Integer.to_json f))); + Util.option_map v.attribute_names_size_bytes + (fun f -> ("attribute_names_size_bytes", (Long.to_json f))); + Util.option_map v.attribute_name_count + (fun f -> ("attribute_name_count", (Integer.to_json f))); + Util.option_map v.item_names_size_bytes + (fun f -> ("item_names_size_bytes", (Long.to_json f))); + Util.option_map v.item_count + (fun f -> ("item_count", (Integer.to_json f)))]) + let of_json j = + { + item_count = + (Util.option_map (Json.lookup j "item_count") Integer.of_json); + item_names_size_bytes = + (Util.option_map (Json.lookup j "item_names_size_bytes") + Long.of_json); + attribute_name_count = + (Util.option_map (Json.lookup j "attribute_name_count") + Integer.of_json); + attribute_names_size_bytes = + (Util.option_map (Json.lookup j "attribute_names_size_bytes") + Long.of_json); + attribute_value_count = + (Util.option_map (Json.lookup j "attribute_value_count") + Integer.of_json); + attribute_values_size_bytes = + (Util.option_map (Json.lookup j "attribute_values_size_bytes") + Long.of_json); + timestamp = + (Util.option_map (Json.lookup j "timestamp") Integer.of_json) + } + end +module RequestTimeout = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module InvalidNextToken = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module CreateDomainRequest = + struct + type t = { + domain_name: String.t } + let make ~domain_name () = { domain_name } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))) + } + end +module AttributeDoesNotExist = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module InvalidNumberValueTests = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module InvalidNumberPredicates = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) + } + end +module ListDomainsResult = + struct + type t = { + domain_names: DomainNameList.t ; + next_token: String.t option } + let make ?(domain_names= []) ?next_token () = + { domain_names; next_token } + let parse xml = + Some + { + domain_names = (Util.of_option [] (DomainNameList.parse xml)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("DomainNames.member", + (DomainNameList.to_query v.domain_names)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("domain_names", (DomainNameList.to_json v.domain_names))]) + let of_json j = + { + domain_names = + (DomainNameList.of_json + (Util.of_option_exn (Json.lookup j "domain_names"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("Items.member", ItemList.to_query v.items)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("items", ItemList.to_json v.items) - ]) - - let of_json j = - { items = ItemList.of_json (Util.of_option_exn (Json.lookup j "items")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module ListDomainsRequest = struct - type t = - { max_number_of_domains : Integer.t option - ; next_token : String.t option - } - - let make ?max_number_of_domains ?next_token () = { max_number_of_domains; next_token } - - let parse xml = - Some - { max_number_of_domains = - Util.option_bind (Xml.member "MaxNumberOfDomains" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module InvalidQueryExpression = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_number_of_domains (fun f -> - Query.Pair ("MaxNumberOfDomains", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_number_of_domains (fun f -> - "max_number_of_domains", Integer.to_json f) - ]) - - let of_json j = - { max_number_of_domains = - Util.option_map (Json.lookup j "max_number_of_domains") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module SelectRequest = struct - type t = - { select_expression : String.t - ; next_token : String.t option - ; consistent_read : Boolean.t option - } - - let make ~select_expression ?next_token ?consistent_read () = - { select_expression; next_token; consistent_read } - - let parse xml = - Some - { select_expression = - Xml.required - "SelectExpression" - (Util.option_bind (Xml.member "SelectExpression" xml) String.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - ; consistent_read = Util.option_bind (Xml.member "ConsistentRead" xml) Boolean.parse + end +module TooManyRequestedAttributes = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.consistent_read (fun f -> - Query.Pair ("ConsistentRead", Boolean.to_query f)) - ; Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some (Query.Pair ("SelectExpression", String.to_query v.select_expression)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.consistent_read (fun f -> - "consistent_read", Boolean.to_json f) - ; Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("select_expression", String.to_json v.select_expression) - ]) - - let of_json j = - { select_expression = - String.of_json (Util.of_option_exn (Json.lookup j "select_expression")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - ; consistent_read = Util.option_map (Json.lookup j "consistent_read") Boolean.of_json - } -end - -module DomainMetadataResult = struct - type t = - { item_count : Integer.t option - ; item_names_size_bytes : Long.t option - ; attribute_name_count : Integer.t option - ; attribute_names_size_bytes : Long.t option - ; attribute_value_count : Integer.t option - ; attribute_values_size_bytes : Long.t option - ; timestamp : Integer.t option - } - - let make - ?item_count - ?item_names_size_bytes - ?attribute_name_count - ?attribute_names_size_bytes - ?attribute_value_count - ?attribute_values_size_bytes - ?timestamp - () = - { item_count - ; item_names_size_bytes - ; attribute_name_count - ; attribute_names_size_bytes - ; attribute_value_count - ; attribute_values_size_bytes - ; timestamp - } - - let parse xml = - Some - { item_count = Util.option_bind (Xml.member "ItemCount" xml) Integer.parse - ; item_names_size_bytes = - Util.option_bind (Xml.member "ItemNamesSizeBytes" xml) Long.parse - ; attribute_name_count = - Util.option_bind (Xml.member "AttributeNameCount" xml) Integer.parse - ; attribute_names_size_bytes = - Util.option_bind (Xml.member "AttributeNamesSizeBytes" xml) Long.parse - ; attribute_value_count = - Util.option_bind (Xml.member "AttributeValueCount" xml) Integer.parse - ; attribute_values_size_bytes = - Util.option_bind (Xml.member "AttributeValuesSizeBytes" xml) Long.parse - ; timestamp = Util.option_bind (Xml.member "Timestamp" xml) Integer.parse + end +module NumberItemAttributesExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.timestamp (fun f -> - Query.Pair ("Timestamp", Integer.to_query f)) - ; Util.option_map v.attribute_values_size_bytes (fun f -> - Query.Pair ("AttributeValuesSizeBytes", Long.to_query f)) - ; Util.option_map v.attribute_value_count (fun f -> - Query.Pair ("AttributeValueCount", Integer.to_query f)) - ; Util.option_map v.attribute_names_size_bytes (fun f -> - Query.Pair ("AttributeNamesSizeBytes", Long.to_query f)) - ; Util.option_map v.attribute_name_count (fun f -> - Query.Pair ("AttributeNameCount", Integer.to_query f)) - ; Util.option_map v.item_names_size_bytes (fun f -> - Query.Pair ("ItemNamesSizeBytes", Long.to_query f)) - ; Util.option_map v.item_count (fun f -> - Query.Pair ("ItemCount", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.timestamp (fun f -> "timestamp", Integer.to_json f) - ; Util.option_map v.attribute_values_size_bytes (fun f -> - "attribute_values_size_bytes", Long.to_json f) - ; Util.option_map v.attribute_value_count (fun f -> - "attribute_value_count", Integer.to_json f) - ; Util.option_map v.attribute_names_size_bytes (fun f -> - "attribute_names_size_bytes", Long.to_json f) - ; Util.option_map v.attribute_name_count (fun f -> - "attribute_name_count", Integer.to_json f) - ; Util.option_map v.item_names_size_bytes (fun f -> - "item_names_size_bytes", Long.to_json f) - ; Util.option_map v.item_count (fun f -> "item_count", Integer.to_json f) - ]) - - let of_json j = - { item_count = Util.option_map (Json.lookup j "item_count") Integer.of_json - ; item_names_size_bytes = - Util.option_map (Json.lookup j "item_names_size_bytes") Long.of_json - ; attribute_name_count = - Util.option_map (Json.lookup j "attribute_name_count") Integer.of_json - ; attribute_names_size_bytes = - Util.option_map (Json.lookup j "attribute_names_size_bytes") Long.of_json - ; attribute_value_count = - Util.option_map (Json.lookup j "attribute_value_count") Integer.of_json - ; attribute_values_size_bytes = - Util.option_map (Json.lookup j "attribute_values_size_bytes") Long.of_json - ; timestamp = Util.option_map (Json.lookup j "timestamp") Integer.of_json - } -end - -module RequestTimeout = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module InvalidNextToken = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module CreateDomainRequest = struct - type t = { domain_name : String.t } - - let make ~domain_name () = { domain_name } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) + end +module DeleteDomainRequest = + struct + type t = { + domain_name: String.t } + let make ~domain_name () = { domain_name } + let parse xml = + Some + { + domain_name = + (Xml.required "DomainName" + (Util.option_bind (Xml.member "DomainName" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("DomainName", (String.to_query v.domain_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("domain_name", (String.to_json v.domain_name))]) + let of_json j = + { + domain_name = + (String.of_json (Util.of_option_exn (Json.lookup j "domain_name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DomainName", String.to_query v.domain_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("domain_name", String.to_json v.domain_name) ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) } -end - -module AttributeDoesNotExist = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module InvalidNumberValueTests = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module InvalidNumberPredicates = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module ListDomainsResult = struct - type t = - { domain_names : DomainNameList.t - ; next_token : String.t option - } - - let make ?(domain_names = []) ?next_token () = { domain_names; next_token } - - let parse xml = - Some - { domain_names = Util.of_option [] (DomainNameList.parse xml) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module NumberSubmittedItemsExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("DomainNames.member", DomainNameList.to_query v.domain_names)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("domain_names", DomainNameList.to_json v.domain_names) - ]) - - let of_json j = - { domain_names = - DomainNameList.of_json (Util.of_option_exn (Json.lookup j "domain_names")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InvalidQueryExpression = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module TooManyRequestedAttributes = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module NumberItemAttributesExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module DeleteDomainRequest = struct - type t = { domain_name : String.t } - - let make ~domain_name () = { domain_name } - - let parse xml = - Some - { domain_name = - Xml.required - "DomainName" - (Util.option_bind (Xml.member "DomainName" xml) String.parse) + end +module NumberDomainAttributesExceeded = + struct + type t = { + box_usage: Float.t option } + let make ?box_usage () = { box_usage } + let parse xml = + Some + { + box_usage = + (Util.option_bind (Xml.member "BoxUsage" xml) Float.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> Query.Pair ("BoxUsage", (Float.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.box_usage + (fun f -> ("box_usage", (Float.to_json f)))]) + let of_json j = + { + box_usage = + (Util.option_map (Json.lookup j "box_usage") Float.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DomainName", String.to_query v.domain_name)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("domain_name", String.to_json v.domain_name) ]) - - let of_json j = - { domain_name = String.of_json (Util.of_option_exn (Json.lookup j "domain_name")) } -end - -module NumberSubmittedItemsExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end - -module NumberDomainAttributesExceeded = struct - type t = { box_usage : Float.t option } - - let make ?box_usage () = { box_usage } - - let parse xml = - Some { box_usage = Util.option_bind (Xml.member "BoxUsage" xml) Float.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> - Query.Pair ("BoxUsage", Float.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.box_usage (fun f -> "box_usage", Float.to_json f) ]) - - let of_json j = - { box_usage = Util.option_map (Json.lookup j "box_usage") Float.of_json } -end + end \ No newline at end of file diff --git a/libraries/sdb/lib_test/dune b/libraries/sdb/lib_test/dune index 2f76d80cd..322e3d5f1 100644 --- a/libraries/sdb/lib_test/dune +++ b/libraries/sdb/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_sdb_test) - (libraries aws aws_sdb aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_sdb aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/sdb/lib_test/test_async.ml b/libraries/sdb/lib_test/test_async.ml index 3c8e2b767..fb0ba3e5c 100644 --- a/libraries/sdb/lib_test/test_async.ml +++ b/libraries/sdb/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_sdb_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/sdb/lib_test/test_lwt.ml b/libraries/sdb/lib_test/test_lwt.ml index 9d3ca355c..4e1f990f8 100644 --- a/libraries/sdb/lib_test/test_lwt.ml +++ b/libraries/sdb/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_sdb_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/sqs/lib/addPermission.ml b/libraries/sqs/lib/addPermission.ml index ba3b75755..c57b7ef5b 100644 --- a/libraries/sqs/lib/addPermission.ml +++ b/libraries/sqs/lib/addPermission.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = AddPermissionRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "AddPermission" ] ] + [("Version", ["2012-11-05"]); ("Action", ["AddPermission"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AddPermissionRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AddPermissionRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = - let errors = [ Errors_internal.OverLimit ] @ Errors_internal.common in + let errors = [Errors_internal.OverLimit] @ 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 \ No newline at end of file diff --git a/libraries/sqs/lib/addPermission.mli b/libraries/sqs/lib/addPermission.mli index 1df5cbd1a..695cc855b 100644 --- a/libraries/sqs/lib/addPermission.mli +++ b/libraries/sqs/lib/addPermission.mli @@ -1,10 +1,7 @@ open Types - type input = AddPermissionRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibility.ml b/libraries/sqs/lib/changeMessageVisibility.ml index 9e2d8a91b..ea3205e36 100644 --- a/libraries/sqs/lib/changeMessageVisibility.ml +++ b/libraries/sqs/lib/changeMessageVisibility.ml @@ -1,39 +1,33 @@ open Types open Aws - type input = ChangeMessageVisibilityRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "ChangeMessageVisibility" ] ] + [("Version", ["2012-11-05"]); + ("Action", ["ChangeMessageVisibility"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ChangeMessageVisibilityRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ChangeMessageVisibilityRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_MessageNotInflight ] @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_MessageNotInflight] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibility.mli b/libraries/sqs/lib/changeMessageVisibility.mli index 24f1e2ea6..20c2c1611 100644 --- a/libraries/sqs/lib/changeMessageVisibility.mli +++ b/libraries/sqs/lib/changeMessageVisibility.mli @@ -1,10 +1,7 @@ open Types - type input = ChangeMessageVisibilityRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibilityBatch.ml b/libraries/sqs/lib/changeMessageVisibilityBatch.ml index a006e16e8..70820c374 100644 --- a/libraries/sqs/lib/changeMessageVisibilityBatch.ml +++ b/libraries/sqs/lib/changeMessageVisibilityBatch.ml @@ -1,73 +1,69 @@ open Types open Aws - type input = ChangeMessageVisibilityBatchRequest.t - type output = ChangeMessageVisibilityBatchResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "ChangeMessageVisibilityBatch" ] ] + [("Version", ["2012-11-05"]); + ("Action", ["ChangeMessageVisibilityBatch"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ChangeMessageVisibilityBatchRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render + (ChangeMessageVisibilityBatchRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ChangeMessageVisibilityBatchResponse" (snd xml)) - (Xml.member "ChangeMessageVisibilityBatchResult") - in + (Xml.member "ChangeMessageVisibilityBatchResult") in try Util.or_error (Util.option_bind resp ChangeMessageVisibilityBatchResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ChangeMessageVisibilityBatchResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ChangeMessageVisibilityBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ChangeMessageVisibilityBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ChangeMessageVisibilityBatchResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId - ; Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct - ; Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest - ; Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest - ] - @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibilityBatch.mli b/libraries/sqs/lib/changeMessageVisibilityBatch.mli index 7fc98ede8..7a2fb7205 100644 --- a/libraries/sqs/lib/changeMessageVisibilityBatch.mli +++ b/libraries/sqs/lib/changeMessageVisibilityBatch.mli @@ -1,10 +1,7 @@ open Types - type input = ChangeMessageVisibilityBatchRequest.t - type output = ChangeMessageVisibilityBatchResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/createQueue.ml b/libraries/sqs/lib/createQueue.ml index 3884142fe..d0c2d117e 100644 --- a/libraries/sqs/lib/createQueue.ml +++ b/libraries/sqs/lib/createQueue.ml @@ -1,66 +1,61 @@ open Types open Aws - type input = CreateQueueRequest.t - type output = CreateQueueResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "CreateQueue" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["CreateQueue"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateQueueRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateQueueRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "CreateQueueResponse" (snd xml)) - (Xml.member "CreateQueueResult") - in + Util.option_bind (Xml.member "CreateQueueResponse" (snd xml)) + (Xml.member "CreateQueueResult") in try - Util.or_error - (Util.option_bind resp CreateQueueResult.parse) + Util.or_error (Util.option_bind resp CreateQueueResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateQueueResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateQueueResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateQueueResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateQueueResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.QueueAlreadyExists - ; Errors_internal.AWS_SimpleQueueService_QueueDeletedRecently - ] - @ Errors_internal.common - in + [Errors_internal.QueueAlreadyExists; + Errors_internal.AWS_SimpleQueueService_QueueDeletedRecently] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/createQueue.mli b/libraries/sqs/lib/createQueue.mli index 8b7d7fc2e..c4891dea9 100644 --- a/libraries/sqs/lib/createQueue.mli +++ b/libraries/sqs/lib/createQueue.mli @@ -1,10 +1,7 @@ open Types - type input = CreateQueueRequest.t - type output = CreateQueueResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessage.ml b/libraries/sqs/lib/deleteMessage.ml index e6b96399c..966bf79bc 100644 --- a/libraries/sqs/lib/deleteMessage.ml +++ b/libraries/sqs/lib/deleteMessage.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = DeleteMessageRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "DeleteMessage" ] ] + [("Version", ["2012-11-05"]); ("Action", ["DeleteMessage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteMessageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteMessageRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessage.mli b/libraries/sqs/lib/deleteMessage.mli index 02915f354..4b9c6d2cd 100644 --- a/libraries/sqs/lib/deleteMessage.mli +++ b/libraries/sqs/lib/deleteMessage.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteMessageRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessageBatch.ml b/libraries/sqs/lib/deleteMessageBatch.ml index 5b6585f70..eeceee11c 100644 --- a/libraries/sqs/lib/deleteMessageBatch.ml +++ b/libraries/sqs/lib/deleteMessageBatch.ml @@ -1,70 +1,65 @@ open Types open Aws - type input = DeleteMessageBatchRequest.t - type output = DeleteMessageBatchResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "DeleteMessageBatch" ] ] + [("Version", ["2012-11-05"]); ("Action", ["DeleteMessageBatch"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteMessageBatchRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteMessageBatchRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "DeleteMessageBatchResponse" (snd xml)) - (Xml.member "DeleteMessageBatchResult") - in + Util.option_bind (Xml.member "DeleteMessageBatchResponse" (snd xml)) + (Xml.member "DeleteMessageBatchResult") in try - Util.or_error - (Util.option_bind resp DeleteMessageBatchResult.parse) + Util.or_error (Util.option_bind resp DeleteMessageBatchResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DeleteMessageBatchResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteMessageBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteMessageBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DeleteMessageBatchResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId - ; Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct - ; Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest - ; Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest - ] - @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessageBatch.mli b/libraries/sqs/lib/deleteMessageBatch.mli index 157b05db3..80aa04e74 100644 --- a/libraries/sqs/lib/deleteMessageBatch.mli +++ b/libraries/sqs/lib/deleteMessageBatch.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteMessageBatchRequest.t - type output = DeleteMessageBatchResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteQueue.ml b/libraries/sqs/lib/deleteQueue.ml index 0903028de..a19550d8e 100644 --- a/libraries/sqs/lib/deleteQueue.ml +++ b/libraries/sqs/lib/deleteQueue.ml @@ -1,36 +1,29 @@ open Types open Aws - type input = DeleteQueueRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "DeleteQueue" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["DeleteQueue"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteQueueRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteQueueRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/deleteQueue.mli b/libraries/sqs/lib/deleteQueue.mli index d46e51ff5..4dde8ff44 100644 --- a/libraries/sqs/lib/deleteQueue.mli +++ b/libraries/sqs/lib/deleteQueue.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteQueueRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/dune b/libraries/sqs/lib/dune index 8b4f3011c..606be9337 100644 --- a/libraries/sqs/lib/dune +++ b/libraries/sqs/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_sqs) + (name aws_sqs) (public_name aws-sqs) (synopsis "aws-Amazon Simple Queue Service") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/sqs/lib/errors_internal.ml b/libraries/sqs/lib/errors_internal.ml index fbbabcc45..b708166f1 100644 --- a/libraries/sqs/lib/errors_internal.ml +++ b/libraries/sqs/lib/errors_internal.ml @@ -1,77 +1,74 @@ type t = - | AWS_SimpleQueueService_BatchEntryIdsNotDistinct - | AWS_SimpleQueueService_BatchRequestTooLong - | AWS_SimpleQueueService_EmptyBatchRequest - | AWS_SimpleQueueService_InvalidBatchEntryId - | AWS_SimpleQueueService_MessageNotInflight - | AWS_SimpleQueueService_NonExistentQueue - | AWS_SimpleQueueService_PurgeQueueInProgress - | AWS_SimpleQueueService_QueueDeletedRecently - | AWS_SimpleQueueService_TooManyEntriesInBatchRequest - | AWS_SimpleQueueService_UnsupportedOperation - | AuthFailure - | Blocked - | DryRunOperation - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidAttributeName - | InvalidClientTokenId - | InvalidIdFormat - | InvalidMessageContents - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | OverLimit - | PendingVerification - | QueueAlreadyExists - | ReceiptHandleIsInvalid - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AWS_SimpleQueueService_BatchEntryIdsNotDistinct + | AWS_SimpleQueueService_BatchRequestTooLong + | AWS_SimpleQueueService_EmptyBatchRequest + | AWS_SimpleQueueService_InvalidBatchEntryId + | AWS_SimpleQueueService_MessageNotInflight + | AWS_SimpleQueueService_NonExistentQueue + | AWS_SimpleQueueService_PurgeQueueInProgress + | AWS_SimpleQueueService_QueueDeletedRecently + | AWS_SimpleQueueService_TooManyEntriesInBatchRequest + | AWS_SimpleQueueService_UnsupportedOperation + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidAttributeName + | InvalidClientTokenId + | InvalidIdFormat + | InvalidMessageContents + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | OverLimit + | PendingVerification + | QueueAlreadyExists + | ReceiptHandleIsInvalid + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AWS_SimpleQueueService_BatchEntryIdsNotDistinct -> Some 400 @@ -117,19 +114,20 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AWS_SimpleQueueService_BatchEntryIdsNotDistinct -> "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" | AWS_SimpleQueueService_BatchRequestTooLong -> "AWS.SimpleQueueService.BatchRequestTooLong" - | AWS_SimpleQueueService_EmptyBatchRequest -> "AWS.SimpleQueueService.EmptyBatchRequest" + | AWS_SimpleQueueService_EmptyBatchRequest -> + "AWS.SimpleQueueService.EmptyBatchRequest" | AWS_SimpleQueueService_InvalidBatchEntryId -> "AWS.SimpleQueueService.InvalidBatchEntryId" | AWS_SimpleQueueService_MessageNotInflight -> "AWS.SimpleQueueService.MessageNotInflight" - | AWS_SimpleQueueService_NonExistentQueue -> "AWS.SimpleQueueService.NonExistentQueue" + | AWS_SimpleQueueService_NonExistentQueue -> + "AWS.SimpleQueueService.NonExistentQueue" | AWS_SimpleQueueService_PurgeQueueInProgress -> "AWS.SimpleQueueService.PurgeQueueInProgress" | AWS_SimpleQueueService_QueueDeletedRecently -> @@ -171,7 +169,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" -> @@ -227,4 +224,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueAttributes.ml b/libraries/sqs/lib/getQueueAttributes.ml index 1829f436c..ccd01be40 100644 --- a/libraries/sqs/lib/getQueueAttributes.ml +++ b/libraries/sqs/lib/getQueueAttributes.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = GetQueueAttributesRequest.t - type output = GetQueueAttributesResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "GetQueueAttributes" ] ] + [("Version", ["2012-11-05"]); ("Action", ["GetQueueAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetQueueAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetQueueAttributesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetQueueAttributesResponse" (snd xml)) - (Xml.member "GetQueueAttributesResult") - in + Util.option_bind (Xml.member "GetQueueAttributesResponse" (snd xml)) + (Xml.member "GetQueueAttributesResult") in try - Util.or_error - (Util.option_bind resp GetQueueAttributesResult.parse) + Util.or_error (Util.option_bind resp GetQueueAttributesResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetQueueAttributesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetQueueAttributesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetQueueAttributesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetQueueAttributesResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueAttributes.mli b/libraries/sqs/lib/getQueueAttributes.mli index a5e75d179..8286fc94e 100644 --- a/libraries/sqs/lib/getQueueAttributes.mli +++ b/libraries/sqs/lib/getQueueAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = GetQueueAttributesRequest.t - type output = GetQueueAttributesResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueUrl.ml b/libraries/sqs/lib/getQueueUrl.ml index e94550531..84441c6a3 100644 --- a/libraries/sqs/lib/getQueueUrl.ml +++ b/libraries/sqs/lib/getQueueUrl.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = GetQueueUrlRequest.t - type output = GetQueueUrlResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "GetQueueUrl" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["GetQueueUrl"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetQueueUrlRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetQueueUrlRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetQueueUrlResponse" (snd xml)) - (Xml.member "GetQueueUrlResult") - in + Util.option_bind (Xml.member "GetQueueUrlResponse" (snd xml)) + (Xml.member "GetQueueUrlResult") in try - Util.or_error - (Util.option_bind resp GetQueueUrlResult.parse) + Util.or_error (Util.option_bind resp GetQueueUrlResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetQueueUrlResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetQueueUrlResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetQueueUrlResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetQueueUrlResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_NonExistentQueue ] @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueUrl.mli b/libraries/sqs/lib/getQueueUrl.mli index 74539d56c..5c2fe1e96 100644 --- a/libraries/sqs/lib/getQueueUrl.mli +++ b/libraries/sqs/lib/getQueueUrl.mli @@ -1,10 +1,7 @@ open Types - type input = GetQueueUrlRequest.t - type output = GetQueueUrlResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/listDeadLetterSourceQueues.ml b/libraries/sqs/lib/listDeadLetterSourceQueues.ml index 5c6dcad87..d3b130264 100644 --- a/libraries/sqs/lib/listDeadLetterSourceQueues.ml +++ b/libraries/sqs/lib/listDeadLetterSourceQueues.ml @@ -1,68 +1,65 @@ open Types open Aws - type input = ListDeadLetterSourceQueuesRequest.t - type output = ListDeadLetterSourceQueuesResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "ListDeadLetterSourceQueues" ] ] + [("Version", ["2012-11-05"]); + ("Action", ["ListDeadLetterSourceQueues"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (ListDeadLetterSourceQueuesRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (ListDeadLetterSourceQueuesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "ListDeadLetterSourceQueuesResponse" (snd xml)) - (Xml.member "ListDeadLetterSourceQueuesResult") - in + (Xml.member "ListDeadLetterSourceQueuesResult") in try Util.or_error (Util.option_bind resp ListDeadLetterSourceQueuesResult.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed ListDeadLetterSourceQueuesResult." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListDeadLetterSourceQueuesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListDeadLetterSourceQueuesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListDeadLetterSourceQueuesResult - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_NonExistentQueue ] @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/listDeadLetterSourceQueues.mli b/libraries/sqs/lib/listDeadLetterSourceQueues.mli index f453539d2..2ea5a741a 100644 --- a/libraries/sqs/lib/listDeadLetterSourceQueues.mli +++ b/libraries/sqs/lib/listDeadLetterSourceQueues.mli @@ -1,10 +1,7 @@ open Types - type input = ListDeadLetterSourceQueuesRequest.t - type output = ListDeadLetterSourceQueuesResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/listQueues.ml b/libraries/sqs/lib/listQueues.ml index d620852e5..306d233e8 100644 --- a/libraries/sqs/lib/listQueues.ml +++ b/libraries/sqs/lib/listQueues.ml @@ -1,61 +1,56 @@ open Types open Aws - type input = ListQueuesRequest.t - type output = ListQueuesResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "ListQueues" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["ListQueues"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListQueuesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListQueuesRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ListQueuesResponse" (snd xml)) - (Xml.member "ListQueuesResult") - in + Util.option_bind (Xml.member "ListQueuesResponse" (snd xml)) + (Xml.member "ListQueuesResult") in try - Util.or_error - (Util.option_bind resp ListQueuesResult.parse) + Util.or_error (Util.option_bind resp ListQueuesResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListQueuesResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { body; message = "Could not find well formed ListQueuesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListQueuesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListQueuesResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/listQueues.mli b/libraries/sqs/lib/listQueues.mli index 52d82f190..47a55dde4 100644 --- a/libraries/sqs/lib/listQueues.mli +++ b/libraries/sqs/lib/listQueues.mli @@ -1,10 +1,7 @@ open Types - type input = ListQueuesRequest.t - type output = ListQueuesResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/purgeQueue.ml b/libraries/sqs/lib/purgeQueue.ml index b5759051b..88af9e94a 100644 --- a/libraries/sqs/lib/purgeQueue.ml +++ b/libraries/sqs/lib/purgeQueue.ml @@ -1,41 +1,32 @@ open Types open Aws - type input = PurgeQueueRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "PurgeQueue" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["PurgeQueue"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (PurgeQueueRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (PurgeQueueRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_PurgeQueueInProgress - ; Errors_internal.AWS_SimpleQueueService_NonExistentQueue - ] - @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_PurgeQueueInProgress; + Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/purgeQueue.mli b/libraries/sqs/lib/purgeQueue.mli index 49b79ba85..b3b37a5ca 100644 --- a/libraries/sqs/lib/purgeQueue.mli +++ b/libraries/sqs/lib/purgeQueue.mli @@ -1,10 +1,7 @@ open Types - type input = PurgeQueueRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/receiveMessage.ml b/libraries/sqs/lib/receiveMessage.ml index 8d20727cf..23bdb5370 100644 --- a/libraries/sqs/lib/receiveMessage.ml +++ b/libraries/sqs/lib/receiveMessage.ml @@ -1,61 +1,59 @@ open Types open Aws - type input = ReceiveMessageRequest.t - type output = ReceiveMessageResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "ReceiveMessage" ] ] + [("Version", ["2012-11-05"]); ("Action", ["ReceiveMessage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ReceiveMessageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ReceiveMessageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "ReceiveMessageResponse" (snd xml)) - (Xml.member "ReceiveMessageResult") - in + Util.option_bind (Xml.member "ReceiveMessageResponse" (snd xml)) + (Xml.member "ReceiveMessageResult") in try - Util.or_error - (Util.option_bind resp ReceiveMessageResult.parse) + Util.or_error (Util.option_bind resp ReceiveMessageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ReceiveMessageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ReceiveMessageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReceiveMessageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ReceiveMessageResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = - let errors = [ Errors_internal.OverLimit ] @ Errors_internal.common in + let errors = [Errors_internal.OverLimit] @ 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 \ No newline at end of file diff --git a/libraries/sqs/lib/receiveMessage.mli b/libraries/sqs/lib/receiveMessage.mli index 0b924f742..5950b8a53 100644 --- a/libraries/sqs/lib/receiveMessage.mli +++ b/libraries/sqs/lib/receiveMessage.mli @@ -1,10 +1,7 @@ open Types - type input = ReceiveMessageRequest.t - type output = ReceiveMessageResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/removePermission.ml b/libraries/sqs/lib/removePermission.ml index 67d273b04..e5ad20977 100644 --- a/libraries/sqs/lib/removePermission.ml +++ b/libraries/sqs/lib/removePermission.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = RemovePermissionRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "RemovePermission" ] ] + [("Version", ["2012-11-05"]); ("Action", ["RemovePermission"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (RemovePermissionRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (RemovePermissionRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/removePermission.mli b/libraries/sqs/lib/removePermission.mli index afa46d91f..acd610d93 100644 --- a/libraries/sqs/lib/removePermission.mli +++ b/libraries/sqs/lib/removePermission.mli @@ -1,10 +1,7 @@ open Types - type input = RemovePermissionRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessage.ml b/libraries/sqs/lib/sendMessage.ml index 2fa55818f..07eb83f79 100644 --- a/libraries/sqs/lib/sendMessage.ml +++ b/libraries/sqs/lib/sendMessage.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = SendMessageRequest.t - type output = SendMessageResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "SendMessage" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["SendMessage"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SendMessageRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SendMessageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "SendMessageResponse" (snd xml)) - (Xml.member "SendMessageResult") - in + Util.option_bind (Xml.member "SendMessageResponse" (snd xml)) + (Xml.member "SendMessageResult") in try - Util.or_error - (Util.option_bind resp SendMessageResult.parse) + Util.or_error (Util.option_bind resp SendMessageResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed SendMessageResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed SendMessageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing SendMessageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing SendMessageResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_UnsupportedOperation ] - @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_UnsupportedOperation] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessage.mli b/libraries/sqs/lib/sendMessage.mli index a5d84a756..3a5f863de 100644 --- a/libraries/sqs/lib/sendMessage.mli +++ b/libraries/sqs/lib/sendMessage.mli @@ -1,10 +1,7 @@ open Types - type input = SendMessageRequest.t - type output = SendMessageResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessageBatch.ml b/libraries/sqs/lib/sendMessageBatch.ml index fb1d468d5..aa6e97e31 100644 --- a/libraries/sqs/lib/sendMessageBatch.ml +++ b/libraries/sqs/lib/sendMessageBatch.ml @@ -1,72 +1,66 @@ open Types open Aws - type input = SendMessageBatchRequest.t - type output = SendMessageBatchResult.t - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "SendMessageBatch" ] ] + [("Version", ["2012-11-05"]); ("Action", ["SendMessageBatch"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SendMessageBatchRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SendMessageBatchRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "SendMessageBatchResponse" (snd xml)) - (Xml.member "SendMessageBatchResult") - in + Util.option_bind (Xml.member "SendMessageBatchResponse" (snd xml)) + (Xml.member "SendMessageBatchResult") in try - Util.or_error - (Util.option_bind resp SendMessageBatchResult.parse) + Util.or_error (Util.option_bind resp SendMessageBatchResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed SendMessageBatchResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed SendMessageBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing SendMessageBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing SendMessageBatchResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AWS_SimpleQueueService_UnsupportedOperation - ; Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId - ; Errors_internal.AWS_SimpleQueueService_BatchRequestTooLong - ; Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct - ; Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest - ; Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest - ] - @ Errors_internal.common - in + [Errors_internal.AWS_SimpleQueueService_UnsupportedOperation; + Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchRequestTooLong; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + 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 \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessageBatch.mli b/libraries/sqs/lib/sendMessageBatch.mli index c81e0349d..6d84e662d 100644 --- a/libraries/sqs/lib/sendMessageBatch.mli +++ b/libraries/sqs/lib/sendMessageBatch.mli @@ -1,10 +1,7 @@ open Types - type input = SendMessageBatchRequest.t - type output = SendMessageBatchResult.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 \ No newline at end of file diff --git a/libraries/sqs/lib/setQueueAttributes.ml b/libraries/sqs/lib/setQueueAttributes.ml index 134adb8c8..5a8c3875f 100644 --- a/libraries/sqs/lib/setQueueAttributes.ml +++ b/libraries/sqs/lib/setQueueAttributes.ml @@ -1,36 +1,30 @@ open Types open Aws - type input = SetQueueAttributesRequest.t - type output = unit - type error = Errors_internal.t - let service = "sqs" - 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", [ "2012-11-05" ]; "Action", [ "SetQueueAttributes" ] ] + [("Version", ["2012-11-05"]); ("Action", ["SetQueueAttributes"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (SetQueueAttributesRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (SetQueueAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/setQueueAttributes.mli b/libraries/sqs/lib/setQueueAttributes.mli index e45234744..f72efbf6c 100644 --- a/libraries/sqs/lib/setQueueAttributes.mli +++ b/libraries/sqs/lib/setQueueAttributes.mli @@ -1,10 +1,7 @@ open Types - type input = SetQueueAttributesRequest.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 \ No newline at end of file diff --git a/libraries/sqs/lib/types.ml b/libraries/sqs/lib/types.ml index 49a466071..569d238d9 100644 --- a/libraries/sqs/lib/types.ml +++ b/libraries/sqs/lib/types.ml @@ -1,2035 +1,1968 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module BinaryList = struct - type t = Blob.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map Blob.parse (Xml.members "BinaryListValue" xml)) - - let to_query v = Query.to_query_list Blob.to_query v - - let to_json v = `List (List.map Blob.to_json v) - - let of_json j = Json.to_list Blob.of_json j -end - -module StringList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "StringListValue" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module MessageAttributeValue = struct - type t = - { string_value : String.t option - ; binary_value : Blob.t option - ; string_list_values : StringList.t - ; binary_list_values : BinaryList.t - ; data_type : String.t - } - - let make - ?string_value - ?binary_value - ?(string_list_values = []) - ?(binary_list_values = []) - ~data_type - () = - { string_value; binary_value; string_list_values; binary_list_values; data_type } - - let parse xml = - Some - { string_value = Util.option_bind (Xml.member "StringValue" xml) String.parse - ; binary_value = Util.option_bind (Xml.member "BinaryValue" xml) Blob.parse - ; string_list_values = - Util.of_option - [] - (Util.option_bind (Xml.member "StringListValue" xml) StringList.parse) - ; binary_list_values = - Util.of_option - [] - (Util.option_bind (Xml.member "BinaryListValue" xml) BinaryList.parse) - ; data_type = - Xml.required - "DataType" - (Util.option_bind (Xml.member "DataType" xml) String.parse) +module BinaryList = + struct + type t = Blob.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Blob.parse (Xml.members "BinaryListValue" xml)) + let to_query v = Query.to_query_list Blob.to_query v + let to_json v = `List (List.map Blob.to_json v) + let of_json j = Json.to_list Blob.of_json j + end +module StringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "StringListValue" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MessageAttributeValue = + struct + type t = + { + string_value: String.t option ; + binary_value: Blob.t option ; + string_list_values: StringList.t ; + binary_list_values: BinaryList.t ; + data_type: String.t } + let make ?string_value ?binary_value ?(string_list_values= []) + ?(binary_list_values= []) ~data_type () = + { + string_value; + binary_value; + string_list_values; + binary_list_values; + data_type } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("DataType", String.to_query v.data_type)) - ; Some (Query.Pair ("BinaryListValue", BinaryList.to_query v.binary_list_values)) - ; Some (Query.Pair ("StringListValue", StringList.to_query v.string_list_values)) - ; Util.option_map v.binary_value (fun f -> - Query.Pair ("BinaryValue", Blob.to_query f)) - ; Util.option_map v.string_value (fun f -> - Query.Pair ("StringValue", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("data_type", String.to_json v.data_type) - ; Some ("binary_list_values", BinaryList.to_json v.binary_list_values) - ; Some ("string_list_values", StringList.to_json v.string_list_values) - ; Util.option_map v.binary_value (fun f -> "binary_value", Blob.to_json f) - ; Util.option_map v.string_value (fun f -> "string_value", String.to_json f) - ]) - - let of_json j = - { string_value = Util.option_map (Json.lookup j "string_value") String.of_json - ; binary_value = Util.option_map (Json.lookup j "binary_value") Blob.of_json - ; string_list_values = - StringList.of_json (Util.of_option_exn (Json.lookup j "string_list_values")) - ; binary_list_values = - BinaryList.of_json (Util.of_option_exn (Json.lookup j "binary_list_values")) - ; data_type = String.of_json (Util.of_option_exn (Json.lookup j "data_type")) - } -end - -module QueueAttributeName = struct - type t = - | Policy - | VisibilityTimeout - | MaximumMessageSize - | MessageRetentionPeriod - | ApproximateNumberOfMessages - | ApproximateNumberOfMessagesNotVisible - | CreatedTimestamp - | LastModifiedTimestamp - | QueueArn - | ApproximateNumberOfMessagesDelayed - | DelaySeconds - | ReceiveMessageWaitTimeSeconds - | RedrivePolicy - - let str_to_t = - [ "RedrivePolicy", RedrivePolicy - ; "ReceiveMessageWaitTimeSeconds", ReceiveMessageWaitTimeSeconds - ; "DelaySeconds", DelaySeconds - ; "ApproximateNumberOfMessagesDelayed", ApproximateNumberOfMessagesDelayed - ; "QueueArn", QueueArn - ; "LastModifiedTimestamp", LastModifiedTimestamp - ; "CreatedTimestamp", CreatedTimestamp - ; "ApproximateNumberOfMessagesNotVisible", ApproximateNumberOfMessagesNotVisible - ; "ApproximateNumberOfMessages", ApproximateNumberOfMessages - ; "MessageRetentionPeriod", MessageRetentionPeriod - ; "MaximumMessageSize", MaximumMessageSize - ; "VisibilityTimeout", VisibilityTimeout - ; "Policy", Policy - ] - - let t_to_str = - [ RedrivePolicy, "RedrivePolicy" - ; ReceiveMessageWaitTimeSeconds, "ReceiveMessageWaitTimeSeconds" - ; DelaySeconds, "DelaySeconds" - ; ApproximateNumberOfMessagesDelayed, "ApproximateNumberOfMessagesDelayed" - ; QueueArn, "QueueArn" - ; LastModifiedTimestamp, "LastModifiedTimestamp" - ; CreatedTimestamp, "CreatedTimestamp" - ; ApproximateNumberOfMessagesNotVisible, "ApproximateNumberOfMessagesNotVisible" - ; ApproximateNumberOfMessages, "ApproximateNumberOfMessages" - ; MessageRetentionPeriod, "MessageRetentionPeriod" - ; MaximumMessageSize, "MaximumMessageSize" - ; VisibilityTimeout, "VisibilityTimeout" - ; Policy, "Policy" - ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module MessageAttributeMap = struct - type t = (String.t, MessageAttributeValue.t) Hashtbl.t - - let make elems () = elems - - let parse xml = None - - let to_query v = - Query.to_query_hashtbl String.to_string MessageAttributeValue.to_query v - - let to_json v = - `Assoc - (Hashtbl.fold - (fun k v acc -> (String.to_string k, MessageAttributeValue.to_json v) :: acc) - v - []) - - let of_json j = Json.to_hashtbl String.of_string MessageAttributeValue.of_json j -end - -module AttributeMap = struct - type t = (QueueAttributeName.t, String.t) Hashtbl.t - - let make elems () = elems - - let parse xml = None - - let to_query v = Query.to_query_hashtbl QueueAttributeName.to_string String.to_query v - - let to_json v = - `Assoc - (Hashtbl.fold - (fun k v acc -> (QueueAttributeName.to_string k, String.to_json v) :: acc) - v - []) - - let of_json j = Json.to_hashtbl QueueAttributeName.of_string String.of_json j -end - -module ChangeMessageVisibilityBatchRequestEntry = struct - type t = - { id : String.t - ; receipt_handle : String.t - ; visibility_timeout : Integer.t option - } - - let make ~id ~receipt_handle ?visibility_timeout () = - { id; receipt_handle; visibility_timeout } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; receipt_handle = - Xml.required - "ReceiptHandle" - (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse) - ; visibility_timeout = - Util.option_bind (Xml.member "VisibilityTimeout" xml) Integer.parse + let parse xml = + Some + { + string_value = + (Util.option_bind (Xml.member "StringValue" xml) String.parse); + binary_value = + (Util.option_bind (Xml.member "BinaryValue" xml) Blob.parse); + string_list_values = + (Util.of_option [] + (Util.option_bind (Xml.member "StringListValue" xml) + StringList.parse)); + binary_list_values = + (Util.of_option [] + (Util.option_bind (Xml.member "BinaryListValue" xml) + BinaryList.parse)); + data_type = + (Xml.required "DataType" + (Util.option_bind (Xml.member "DataType" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("DataType", (String.to_query v.data_type))); + Some + (Query.Pair + ("BinaryListValue", + (BinaryList.to_query v.binary_list_values))); + Some + (Query.Pair + ("StringListValue", + (StringList.to_query v.string_list_values))); + Util.option_map v.binary_value + (fun f -> Query.Pair ("BinaryValue", (Blob.to_query f))); + Util.option_map v.string_value + (fun f -> Query.Pair ("StringValue", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("data_type", (String.to_json v.data_type)); + Some + ("binary_list_values", + (BinaryList.to_json v.binary_list_values)); + Some + ("string_list_values", + (StringList.to_json v.string_list_values)); + Util.option_map v.binary_value + (fun f -> ("binary_value", (Blob.to_json f))); + Util.option_map v.string_value + (fun f -> ("string_value", (String.to_json f)))]) + let of_json j = + { + string_value = + (Util.option_map (Json.lookup j "string_value") String.of_json); + binary_value = + (Util.option_map (Json.lookup j "binary_value") Blob.of_json); + string_list_values = + (StringList.of_json + (Util.of_option_exn (Json.lookup j "string_list_values"))); + binary_list_values = + (BinaryList.of_json + (Util.of_option_exn (Json.lookup j "binary_list_values"))); + data_type = + (String.of_json (Util.of_option_exn (Json.lookup j "data_type"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.visibility_timeout (fun f -> - Query.Pair ("VisibilityTimeout", Integer.to_query f)) - ; Some (Query.Pair ("ReceiptHandle", String.to_query v.receipt_handle)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.visibility_timeout (fun f -> - "visibility_timeout", Integer.to_json f) - ; Some ("receipt_handle", String.to_json v.receipt_handle) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; receipt_handle = - String.of_json (Util.of_option_exn (Json.lookup j "receipt_handle")) - ; visibility_timeout = - Util.option_map (Json.lookup j "visibility_timeout") Integer.of_json - } -end - -module SendMessageBatchRequestEntry = struct - type t = - { id : String.t - ; message_body : String.t - ; delay_seconds : Integer.t option - ; message_attributes : MessageAttributeMap.t option - } - - let make ~id ~message_body ?delay_seconds ?message_attributes () = - { id; message_body; delay_seconds; message_attributes } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; message_body = - Xml.required - "MessageBody" - (Util.option_bind (Xml.member "MessageBody" xml) String.parse) - ; delay_seconds = Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse - ; message_attributes = - Util.option_bind (Xml.member "MessageAttribute" xml) MessageAttributeMap.parse + end +module QueueAttributeName = + struct + type t = + | Policy + | VisibilityTimeout + | MaximumMessageSize + | MessageRetentionPeriod + | ApproximateNumberOfMessages + | ApproximateNumberOfMessagesNotVisible + | CreatedTimestamp + | LastModifiedTimestamp + | QueueArn + | ApproximateNumberOfMessagesDelayed + | DelaySeconds + | ReceiveMessageWaitTimeSeconds + | RedrivePolicy + let str_to_t = + [("RedrivePolicy", RedrivePolicy); + ("ReceiveMessageWaitTimeSeconds", ReceiveMessageWaitTimeSeconds); + ("DelaySeconds", DelaySeconds); + ("ApproximateNumberOfMessagesDelayed", + ApproximateNumberOfMessagesDelayed); + ("QueueArn", QueueArn); + ("LastModifiedTimestamp", LastModifiedTimestamp); + ("CreatedTimestamp", CreatedTimestamp); + ("ApproximateNumberOfMessagesNotVisible", + ApproximateNumberOfMessagesNotVisible); + ("ApproximateNumberOfMessages", ApproximateNumberOfMessages); + ("MessageRetentionPeriod", MessageRetentionPeriod); + ("MaximumMessageSize", MaximumMessageSize); + ("VisibilityTimeout", VisibilityTimeout); + ("Policy", Policy)] + let t_to_str = + [(RedrivePolicy, "RedrivePolicy"); + (ReceiveMessageWaitTimeSeconds, "ReceiveMessageWaitTimeSeconds"); + (DelaySeconds, "DelaySeconds"); + (ApproximateNumberOfMessagesDelayed, + "ApproximateNumberOfMessagesDelayed"); + (QueueArn, "QueueArn"); + (LastModifiedTimestamp, "LastModifiedTimestamp"); + (CreatedTimestamp, "CreatedTimestamp"); + (ApproximateNumberOfMessagesNotVisible, + "ApproximateNumberOfMessagesNotVisible"); + (ApproximateNumberOfMessages, "ApproximateNumberOfMessages"); + (MessageRetentionPeriod, "MessageRetentionPeriod"); + (MaximumMessageSize, "MaximumMessageSize"); + (VisibilityTimeout, "VisibilityTimeout"); + (Policy, "Policy")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MessageAttributeMap = + struct + type t = (String.t, MessageAttributeValue.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl String.to_string MessageAttributeValue.to_query + v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> + ((String.to_string k), (MessageAttributeValue.to_json v)) + :: acc) v []) + let of_json j = + Json.to_hashtbl String.of_string MessageAttributeValue.of_json j + end +module AttributeMap = + struct + type t = (QueueAttributeName.t, String.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl QueueAttributeName.to_string String.to_query v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> + ((QueueAttributeName.to_string k), (String.to_json v)) :: + acc) v []) + let of_json j = + Json.to_hashtbl QueueAttributeName.of_string String.of_json j + end +module ChangeMessageVisibilityBatchRequestEntry = + struct + type t = + { + id: String.t ; + receipt_handle: String.t ; + visibility_timeout: Integer.t option } + let make ~id ~receipt_handle ?visibility_timeout () = + { id; receipt_handle; visibility_timeout } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)); + visibility_timeout = + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.visibility_timeout + (fun f -> + Query.Pair ("VisibilityTimeout", (Integer.to_query f))); + Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.visibility_timeout + (fun f -> ("visibility_timeout", (Integer.to_json f))); + Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))); + visibility_timeout = + (Util.option_map (Json.lookup j "visibility_timeout") + Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - Query.Pair ("MessageAttribute", MessageAttributeMap.to_query f)) - ; Util.option_map v.delay_seconds (fun f -> - Query.Pair ("DelaySeconds", Integer.to_query f)) - ; Some (Query.Pair ("MessageBody", String.to_query v.message_body)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - "message_attributes", MessageAttributeMap.to_json f) - ; Util.option_map v.delay_seconds (fun f -> "delay_seconds", Integer.to_json f) - ; Some ("message_body", String.to_json v.message_body) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; message_body = String.of_json (Util.of_option_exn (Json.lookup j "message_body")) - ; delay_seconds = Util.option_map (Json.lookup j "delay_seconds") Integer.of_json - ; message_attributes = - Util.option_map (Json.lookup j "message_attributes") MessageAttributeMap.of_json - } -end - -module DeleteMessageBatchRequestEntry = struct - type t = - { id : String.t - ; receipt_handle : String.t - } - - let make ~id ~receipt_handle () = { id; receipt_handle } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; receipt_handle = - Xml.required - "ReceiptHandle" - (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse) + end +module SendMessageBatchRequestEntry = + struct + type t = + { + id: String.t ; + message_body: String.t ; + delay_seconds: Integer.t option ; + message_attributes: MessageAttributeMap.t option } + let make ~id ~message_body ?delay_seconds ?message_attributes () = + { id; message_body; delay_seconds; message_attributes } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + message_body = + (Xml.required "MessageBody" + (Util.option_bind (Xml.member "MessageBody" xml) String.parse)); + delay_seconds = + (Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.delay_seconds + (fun f -> Query.Pair ("DelaySeconds", (Integer.to_query f))); + Some + (Query.Pair ("MessageBody", (String.to_query v.message_body))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.delay_seconds + (fun f -> ("delay_seconds", (Integer.to_json f))); + Some ("message_body", (String.to_json v.message_body)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + message_body = + (String.of_json (Util.of_option_exn (Json.lookup j "message_body"))); + delay_seconds = + (Util.option_map (Json.lookup j "delay_seconds") Integer.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ReceiptHandle", String.to_query v.receipt_handle)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("receipt_handle", String.to_json v.receipt_handle) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; receipt_handle = - String.of_json (Util.of_option_exn (Json.lookup j "receipt_handle")) - } -end - -module BatchResultErrorEntry = struct - type t = - { id : String.t - ; sender_fault : Boolean.t - ; code : String.t - ; message : String.t option - } - - let make ~id ~sender_fault ~code ?message () = { id; sender_fault; code; message } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; sender_fault = - Xml.required - "SenderFault" - (Util.option_bind (Xml.member "SenderFault" xml) Boolean.parse) - ; code = Xml.required "Code" (Util.option_bind (Xml.member "Code" xml) String.parse) - ; message = Util.option_bind (Xml.member "Message" xml) String.parse + end +module DeleteMessageBatchRequestEntry = + struct + type t = { + id: String.t ; + receipt_handle: String.t } + let make ~id ~receipt_handle () = { id; receipt_handle } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Some (Query.Pair ("Code", String.to_query v.code)) - ; Some (Query.Pair ("SenderFault", Boolean.to_query v.sender_fault)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) - ; Some ("code", String.to_json v.code) - ; Some ("sender_fault", Boolean.to_json v.sender_fault) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; sender_fault = Boolean.of_json (Util.of_option_exn (Json.lookup j "sender_fault")) - ; code = String.of_json (Util.of_option_exn (Json.lookup j "code")) - ; message = Util.option_map (Json.lookup j "message") String.of_json - } -end - -module ChangeMessageVisibilityBatchResultEntry = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module SendMessageBatchResultEntry = struct - type t = - { id : String.t - ; message_id : String.t - ; m_d5_of_message_body : String.t - ; m_d5_of_message_attributes : String.t option - } - - let make ~id ~message_id ~m_d5_of_message_body ?m_d5_of_message_attributes () = - { id; message_id; m_d5_of_message_body; m_d5_of_message_attributes } - - let parse xml = - Some - { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) - ; message_id = - Xml.required - "MessageId" - (Util.option_bind (Xml.member "MessageId" xml) String.parse) - ; m_d5_of_message_body = - Xml.required - "MD5OfMessageBody" - (Util.option_bind (Xml.member "MD5OfMessageBody" xml) String.parse) - ; m_d5_of_message_attributes = - Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) String.parse + end +module BatchResultErrorEntry = + struct + type t = + { + id: String.t ; + sender_fault: Boolean.t ; + code: String.t ; + message: String.t option } + let make ~id ~sender_fault ~code ?message () = + { id; sender_fault; code; message } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + sender_fault = + (Xml.required "SenderFault" + (Util.option_bind (Xml.member "SenderFault" xml) Boolean.parse)); + code = + (Xml.required "Code" + (Util.option_bind (Xml.member "Code" xml) String.parse)); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Some (Query.Pair ("Code", (String.to_query v.code))); + Some + (Query.Pair ("SenderFault", (Boolean.to_query v.sender_fault))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Some ("code", (String.to_json v.code)); + Some ("sender_fault", (Boolean.to_json v.sender_fault)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + sender_fault = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "sender_fault"))); + code = (String.of_json (Util.of_option_exn (Json.lookup j "code"))); + message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.m_d5_of_message_attributes (fun f -> - Query.Pair ("MD5OfMessageAttributes", String.to_query f)) - ; Some (Query.Pair ("MD5OfMessageBody", String.to_query v.m_d5_of_message_body)) - ; Some (Query.Pair ("MessageId", String.to_query v.message_id)) - ; Some (Query.Pair ("Id", String.to_query v.id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.m_d5_of_message_attributes (fun f -> - "m_d5_of_message_attributes", String.to_json f) - ; Some ("m_d5_of_message_body", String.to_json v.m_d5_of_message_body) - ; Some ("message_id", String.to_json v.message_id) - ; Some ("id", String.to_json v.id) - ]) - - let of_json j = - { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) - ; message_id = String.of_json (Util.of_option_exn (Json.lookup j "message_id")) - ; m_d5_of_message_body = - String.of_json (Util.of_option_exn (Json.lookup j "m_d5_of_message_body")) - ; m_d5_of_message_attributes = - Util.option_map (Json.lookup j "m_d5_of_message_attributes") String.of_json - } -end - -module Message = struct - type t = - { message_id : String.t option - ; receipt_handle : String.t option - ; m_d5_of_body : String.t option - ; body : String.t option - ; attributes : AttributeMap.t option - ; m_d5_of_message_attributes : String.t option - ; message_attributes : MessageAttributeMap.t option - } - - let make - ?message_id - ?receipt_handle - ?m_d5_of_body - ?body - ?attributes - ?m_d5_of_message_attributes - ?message_attributes - () = - { message_id - ; receipt_handle - ; m_d5_of_body - ; body - ; attributes - ; m_d5_of_message_attributes - ; message_attributes - } - - let parse xml = - Some - { message_id = Util.option_bind (Xml.member "MessageId" xml) String.parse - ; receipt_handle = Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse - ; m_d5_of_body = Util.option_bind (Xml.member "MD5OfBody" xml) String.parse - ; body = Util.option_bind (Xml.member "Body" xml) String.parse - ; attributes = Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse - ; m_d5_of_message_attributes = - Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) String.parse - ; message_attributes = - Util.option_bind (Xml.member "MessageAttribute" xml) MessageAttributeMap.parse + end +module ChangeMessageVisibilityBatchResultEntry = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module SendMessageBatchResultEntry = + struct + type t = + { + id: String.t ; + message_id: String.t ; + m_d5_of_message_body: String.t ; + m_d5_of_message_attributes: String.t option } + let make ~id ~message_id ~m_d5_of_message_body + ?m_d5_of_message_attributes () = + { id; message_id; m_d5_of_message_body; m_d5_of_message_attributes } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + message_id = + (Xml.required "MessageId" + (Util.option_bind (Xml.member "MessageId" xml) String.parse)); + m_d5_of_message_body = + (Xml.required "MD5OfMessageBody" + (Util.option_bind (Xml.member "MD5OfMessageBody" xml) + String.parse)); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Some + (Query.Pair + ("MD5OfMessageBody", + (String.to_query v.m_d5_of_message_body))); + Some (Query.Pair ("MessageId", (String.to_query v.message_id))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Some + ("m_d5_of_message_body", + (String.to_json v.m_d5_of_message_body)); + Some ("message_id", (String.to_json v.message_id)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + message_id = + (String.of_json (Util.of_option_exn (Json.lookup j "message_id"))); + m_d5_of_message_body = + (String.of_json + (Util.of_option_exn (Json.lookup j "m_d5_of_message_body"))); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - Query.Pair ("MessageAttribute", MessageAttributeMap.to_query f)) - ; Util.option_map v.m_d5_of_message_attributes (fun f -> - Query.Pair ("MD5OfMessageAttributes", String.to_query f)) - ; Util.option_map v.attributes (fun f -> - Query.Pair ("Attribute", AttributeMap.to_query f)) - ; Util.option_map v.body (fun f -> Query.Pair ("Body", String.to_query f)) - ; Util.option_map v.m_d5_of_body (fun f -> - Query.Pair ("MD5OfBody", String.to_query f)) - ; Util.option_map v.receipt_handle (fun f -> - Query.Pair ("ReceiptHandle", String.to_query f)) - ; Util.option_map v.message_id (fun f -> - Query.Pair ("MessageId", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - "message_attributes", MessageAttributeMap.to_json f) - ; Util.option_map v.m_d5_of_message_attributes (fun f -> - "m_d5_of_message_attributes", String.to_json f) - ; Util.option_map v.attributes (fun f -> "attributes", AttributeMap.to_json f) - ; Util.option_map v.body (fun f -> "body", String.to_json f) - ; Util.option_map v.m_d5_of_body (fun f -> "m_d5_of_body", String.to_json f) - ; Util.option_map v.receipt_handle (fun f -> "receipt_handle", String.to_json f) - ; Util.option_map v.message_id (fun f -> "message_id", String.to_json f) - ]) - - let of_json j = - { message_id = Util.option_map (Json.lookup j "message_id") String.of_json - ; receipt_handle = Util.option_map (Json.lookup j "receipt_handle") String.of_json - ; m_d5_of_body = Util.option_map (Json.lookup j "m_d5_of_body") String.of_json - ; body = Util.option_map (Json.lookup j "body") String.of_json - ; attributes = Util.option_map (Json.lookup j "attributes") AttributeMap.of_json - ; m_d5_of_message_attributes = - Util.option_map (Json.lookup j "m_d5_of_message_attributes") String.of_json - ; message_attributes = - Util.option_map (Json.lookup j "message_attributes") MessageAttributeMap.of_json - } -end - -module DeleteMessageBatchResultEntry = struct - type t = { id : String.t } - - let make ~id () = { id } - - let parse xml = - Some { id = Xml.required "Id" (Util.option_bind (Xml.member "Id" xml) String.parse) } - - let to_query v = - Query.List (Util.list_filter_opt [ Some (Query.Pair ("Id", String.to_query v.id)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("id", String.to_json v.id) ]) - - let of_json j = { id = String.of_json (Util.of_option_exn (Json.lookup j "id")) } -end - -module ChangeMessageVisibilityBatchRequestEntryList = struct - type t = ChangeMessageVisibilityBatchRequestEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - ChangeMessageVisibilityBatchRequestEntry.parse - (Xml.members "ChangeMessageVisibilityBatchRequestEntry" xml)) - - let to_query v = Query.to_query_list ChangeMessageVisibilityBatchRequestEntry.to_query v - - let to_json v = `List (List.map ChangeMessageVisibilityBatchRequestEntry.to_json v) - - let of_json j = Json.to_list ChangeMessageVisibilityBatchRequestEntry.of_json j -end - -module SendMessageBatchRequestEntryList = struct - type t = SendMessageBatchRequestEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - SendMessageBatchRequestEntry.parse - (Xml.members "SendMessageBatchRequestEntry" xml)) - - let to_query v = Query.to_query_list SendMessageBatchRequestEntry.to_query v - - let to_json v = `List (List.map SendMessageBatchRequestEntry.to_json v) - - let of_json j = Json.to_list SendMessageBatchRequestEntry.of_json j -end - -module DeleteMessageBatchRequestEntryList = struct - type t = DeleteMessageBatchRequestEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - DeleteMessageBatchRequestEntry.parse - (Xml.members "DeleteMessageBatchRequestEntry" xml)) - - let to_query v = Query.to_query_list DeleteMessageBatchRequestEntry.to_query v - - let to_json v = `List (List.map DeleteMessageBatchRequestEntry.to_json v) - - let of_json j = Json.to_list DeleteMessageBatchRequestEntry.of_json j -end - -module BatchResultErrorEntryList = struct - type t = BatchResultErrorEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map BatchResultErrorEntry.parse (Xml.members "BatchResultErrorEntry" xml)) - - let to_query v = Query.to_query_list BatchResultErrorEntry.to_query v - - let to_json v = `List (List.map BatchResultErrorEntry.to_json v) - - let of_json j = Json.to_list BatchResultErrorEntry.of_json j -end - -module ChangeMessageVisibilityBatchResultEntryList = struct - type t = ChangeMessageVisibilityBatchResultEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - ChangeMessageVisibilityBatchResultEntry.parse - (Xml.members "ChangeMessageVisibilityBatchResultEntry" xml)) - - let to_query v = Query.to_query_list ChangeMessageVisibilityBatchResultEntry.to_query v - - let to_json v = `List (List.map ChangeMessageVisibilityBatchResultEntry.to_json v) - - let of_json j = Json.to_list ChangeMessageVisibilityBatchResultEntry.of_json j -end - -module SendMessageBatchResultEntryList = struct - type t = SendMessageBatchResultEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - SendMessageBatchResultEntry.parse - (Xml.members "SendMessageBatchResultEntry" xml)) - - let to_query v = Query.to_query_list SendMessageBatchResultEntry.to_query v - - let to_json v = `List (List.map SendMessageBatchResultEntry.to_json v) - - let of_json j = Json.to_list SendMessageBatchResultEntry.of_json j -end - -module AWSAccountIdList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "AWSAccountId" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module ActionNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "ActionName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module AttributeNameList = struct - type t = QueueAttributeName.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map QueueAttributeName.parse (Xml.members "AttributeName" xml)) - - let to_query v = Query.to_query_list QueueAttributeName.to_query v - - let to_json v = `List (List.map QueueAttributeName.to_json v) - - let of_json j = Json.to_list QueueAttributeName.of_json j -end - -module MessageAttributeNameList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map String.parse (Xml.members "MessageAttributeName" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module QueueUrlList = struct - type t = String.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map String.parse (Xml.members "QueueUrl" xml)) - - let to_query v = Query.to_query_list String.to_query v - - let to_json v = `List (List.map String.to_json v) - - let of_json j = Json.to_list String.of_json j -end - -module MessageList = struct - type t = Message.t list - - let make elems () = elems - - let parse xml = Util.option_all (List.map Message.parse (Xml.members "Message" xml)) - - let to_query v = Query.to_query_list Message.to_query v - - let to_json v = `List (List.map Message.to_json v) - - let of_json j = Json.to_list Message.of_json j -end - -module DeleteMessageBatchResultEntryList = struct - type t = DeleteMessageBatchResultEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - DeleteMessageBatchResultEntry.parse - (Xml.members "DeleteMessageBatchResultEntry" xml)) - - let to_query v = Query.to_query_list DeleteMessageBatchResultEntry.to_query v - - let to_json v = `List (List.map DeleteMessageBatchResultEntry.to_json v) - - let of_json j = Json.to_list DeleteMessageBatchResultEntry.of_json j -end - -module MessageNotInflight = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteQueueRequest = struct - type t = { queue_url : String.t } - - let make ~queue_url () = { queue_url } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) + end +module Message = + struct + type t = + { + message_id: String.t option ; + receipt_handle: String.t option ; + m_d5_of_body: String.t option ; + body: String.t option ; + attributes: AttributeMap.t option ; + m_d5_of_message_attributes: String.t option ; + message_attributes: MessageAttributeMap.t option } + let make ?message_id ?receipt_handle ?m_d5_of_body ?body ?attributes + ?m_d5_of_message_attributes ?message_attributes () = + { + message_id; + receipt_handle; + m_d5_of_body; + body; + attributes; + m_d5_of_message_attributes; + message_attributes } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("queue_url", String.to_json v.queue_url) ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) } -end - -module InvalidIdFormat = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetQueueUrlRequest = struct - type t = - { queue_name : String.t - ; queue_owner_a_w_s_account_id : String.t option - } - - let make ~queue_name ?queue_owner_a_w_s_account_id () = - { queue_name; queue_owner_a_w_s_account_id } - - let parse xml = - Some - { queue_name = - Xml.required - "QueueName" - (Util.option_bind (Xml.member "QueueName" xml) String.parse) - ; queue_owner_a_w_s_account_id = - Util.option_bind (Xml.member "QueueOwnerAWSAccountId" xml) String.parse + let parse xml = + Some + { + message_id = + (Util.option_bind (Xml.member "MessageId" xml) String.parse); + receipt_handle = + (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse); + m_d5_of_body = + (Util.option_bind (Xml.member "MD5OfBody" xml) String.parse); + body = (Util.option_bind (Xml.member "Body" xml) String.parse); + attributes = + (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (String.to_query f))); + Util.option_map v.m_d5_of_body + (fun f -> Query.Pair ("MD5OfBody", (String.to_query f))); + Util.option_map v.receipt_handle + (fun f -> Query.Pair ("ReceiptHandle", (String.to_query f))); + Util.option_map v.message_id + (fun f -> Query.Pair ("MessageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f))); + Util.option_map v.body (fun f -> ("body", (String.to_json f))); + Util.option_map v.m_d5_of_body + (fun f -> ("m_d5_of_body", (String.to_json f))); + Util.option_map v.receipt_handle + (fun f -> ("receipt_handle", (String.to_json f))); + Util.option_map v.message_id + (fun f -> ("message_id", (String.to_json f)))]) + let of_json j = + { + message_id = + (Util.option_map (Json.lookup j "message_id") String.of_json); + receipt_handle = + (Util.option_map (Json.lookup j "receipt_handle") String.of_json); + m_d5_of_body = + (Util.option_map (Json.lookup j "m_d5_of_body") String.of_json); + body = (Util.option_map (Json.lookup j "body") String.of_json); + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.queue_owner_a_w_s_account_id (fun f -> - Query.Pair ("QueueOwnerAWSAccountId", String.to_query f)) - ; Some (Query.Pair ("QueueName", String.to_query v.queue_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.queue_owner_a_w_s_account_id (fun f -> - "queue_owner_a_w_s_account_id", String.to_json f) - ; Some ("queue_name", String.to_json v.queue_name) - ]) - - let of_json j = - { queue_name = String.of_json (Util.of_option_exn (Json.lookup j "queue_name")) - ; queue_owner_a_w_s_account_id = - Util.option_map (Json.lookup j "queue_owner_a_w_s_account_id") String.of_json - } -end - -module GetQueueAttributesResult = struct - type t = { attributes : AttributeMap.t option } - - let make ?attributes () = { attributes } - - let parse xml = - Some { attributes = Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attributes (fun f -> - Query.Pair ("Attribute", AttributeMap.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attributes (fun f -> "attributes", AttributeMap.to_json f) ]) - - let of_json j = - { attributes = Util.option_map (Json.lookup j "attributes") AttributeMap.of_json } -end - -module PurgeQueueInProgress = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module EmptyBatchRequest = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ChangeMessageVisibilityBatchRequest = struct - type t = - { queue_url : String.t - ; entries : ChangeMessageVisibilityBatchRequestEntryList.t - } - - let make ~queue_url ~entries () = { queue_url; entries } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; entries = - Xml.required "Entries" (ChangeMessageVisibilityBatchRequestEntryList.parse xml) + end +module DeleteMessageBatchResultEntry = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module ChangeMessageVisibilityBatchRequestEntryList = + struct + type t = ChangeMessageVisibilityBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ChangeMessageVisibilityBatchRequestEntry.parse + (Xml.members "ChangeMessageVisibilityBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list ChangeMessageVisibilityBatchRequestEntry.to_query v + let to_json v = + `List (List.map ChangeMessageVisibilityBatchRequestEntry.to_json v) + let of_json j = + Json.to_list ChangeMessageVisibilityBatchRequestEntry.of_json j + end +module SendMessageBatchRequestEntryList = + struct + type t = SendMessageBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SendMessageBatchRequestEntry.parse + (Xml.members "SendMessageBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list SendMessageBatchRequestEntry.to_query v + let to_json v = `List (List.map SendMessageBatchRequestEntry.to_json v) + let of_json j = Json.to_list SendMessageBatchRequestEntry.of_json j + end +module DeleteMessageBatchRequestEntryList = + struct + type t = DeleteMessageBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeleteMessageBatchRequestEntry.parse + (Xml.members "DeleteMessageBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list DeleteMessageBatchRequestEntry.to_query v + let to_json v = `List (List.map DeleteMessageBatchRequestEntry.to_json v) + let of_json j = Json.to_list DeleteMessageBatchRequestEntry.of_json j + end +module BatchResultErrorEntryList = + struct + type t = BatchResultErrorEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BatchResultErrorEntry.parse + (Xml.members "BatchResultErrorEntry" xml)) + let to_query v = Query.to_query_list BatchResultErrorEntry.to_query v + let to_json v = `List (List.map BatchResultErrorEntry.to_json v) + let of_json j = Json.to_list BatchResultErrorEntry.of_json j + end +module ChangeMessageVisibilityBatchResultEntryList = + struct + type t = ChangeMessageVisibilityBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ChangeMessageVisibilityBatchResultEntry.parse + (Xml.members "ChangeMessageVisibilityBatchResultEntry" xml)) + let to_query v = + Query.to_query_list ChangeMessageVisibilityBatchResultEntry.to_query v + let to_json v = + `List (List.map ChangeMessageVisibilityBatchResultEntry.to_json v) + let of_json j = + Json.to_list ChangeMessageVisibilityBatchResultEntry.of_json j + end +module SendMessageBatchResultEntryList = + struct + type t = SendMessageBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SendMessageBatchResultEntry.parse + (Xml.members "SendMessageBatchResultEntry" xml)) + let to_query v = + Query.to_query_list SendMessageBatchResultEntry.to_query v + let to_json v = `List (List.map SendMessageBatchResultEntry.to_json v) + let of_json j = Json.to_list SendMessageBatchResultEntry.of_json j + end +module AWSAccountIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AWSAccountId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ActionNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ActionName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AttributeNameList = + struct + type t = QueueAttributeName.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map QueueAttributeName.parse (Xml.members "AttributeName" xml)) + let to_query v = Query.to_query_list QueueAttributeName.to_query v + let to_json v = `List (List.map QueueAttributeName.to_json v) + let of_json j = Json.to_list QueueAttributeName.of_json j + end +module MessageAttributeNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "MessageAttributeName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module QueueUrlList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "QueueUrl" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MessageList = + struct + type t = Message.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Message.parse (Xml.members "Message" xml)) + let to_query v = Query.to_query_list Message.to_query v + let to_json v = `List (List.map Message.to_json v) + let of_json j = Json.to_list Message.of_json j + end +module DeleteMessageBatchResultEntryList = + struct + type t = DeleteMessageBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeleteMessageBatchResultEntry.parse + (Xml.members "DeleteMessageBatchResultEntry" xml)) + let to_query v = + Query.to_query_list DeleteMessageBatchResultEntry.to_query v + let to_json v = `List (List.map DeleteMessageBatchResultEntry.to_json v) + let of_json j = Json.to_list DeleteMessageBatchResultEntry.of_json j + end +module MessageNotInflight = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteQueueRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ( "Entries.member" - , ChangeMessageVisibilityBatchRequestEntryList.to_query v.entries )) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("entries", ChangeMessageVisibilityBatchRequestEntryList.to_json v.entries) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; entries = - ChangeMessageVisibilityBatchRequestEntryList.of_json - (Util.of_option_exn (Json.lookup j "entries")) - } -end - -module SendMessageBatchRequest = struct - type t = - { queue_url : String.t - ; entries : SendMessageBatchRequestEntryList.t - } - - let make ~queue_url ~entries () = { queue_url; entries } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; entries = Xml.required "Entries" (SendMessageBatchRequestEntryList.parse xml) + end +module InvalidIdFormat = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetQueueUrlRequest = + struct + type t = + { + queue_name: String.t ; + queue_owner_a_w_s_account_id: String.t option } + let make ~queue_name ?queue_owner_a_w_s_account_id () = + { queue_name; queue_owner_a_w_s_account_id } + let parse xml = + Some + { + queue_name = + (Xml.required "QueueName" + (Util.option_bind (Xml.member "QueueName" xml) String.parse)); + queue_owner_a_w_s_account_id = + (Util.option_bind (Xml.member "QueueOwnerAWSAccountId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_owner_a_w_s_account_id + (fun f -> + Query.Pair ("QueueOwnerAWSAccountId", (String.to_query f))); + Some (Query.Pair ("QueueName", (String.to_query v.queue_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_owner_a_w_s_account_id + (fun f -> ("queue_owner_a_w_s_account_id", (String.to_json f))); + Some ("queue_name", (String.to_json v.queue_name))]) + let of_json j = + { + queue_name = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_name"))); + queue_owner_a_w_s_account_id = + (Util.option_map (Json.lookup j "queue_owner_a_w_s_account_id") + String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("Entries.member", SendMessageBatchRequestEntryList.to_query v.entries)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("entries", SendMessageBatchRequestEntryList.to_json v.entries) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; entries = - SendMessageBatchRequestEntryList.of_json - (Util.of_option_exn (Json.lookup j "entries")) - } -end - -module DeleteMessageBatchRequest = struct - type t = - { queue_url : String.t - ; entries : DeleteMessageBatchRequestEntryList.t - } - - let make ~queue_url ~entries () = { queue_url; entries } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; entries = Xml.required "Entries" (DeleteMessageBatchRequestEntryList.parse xml) + end +module GetQueueAttributesResult = + struct + type t = { + attributes: AttributeMap.t option } + let make ?attributes () = { attributes } + let parse xml = + Some + { + attributes = + (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f)))]) + let of_json j = + { + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("Entries.member", DeleteMessageBatchRequestEntryList.to_query v.entries)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("entries", DeleteMessageBatchRequestEntryList.to_json v.entries) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; entries = - DeleteMessageBatchRequestEntryList.of_json - (Util.of_option_exn (Json.lookup j "entries")) - } -end - -module ChangeMessageVisibilityBatchResult = struct - type t = - { successful : ChangeMessageVisibilityBatchResultEntryList.t - ; failed : BatchResultErrorEntryList.t - } - - let make ~successful ~failed () = { successful; failed } - - let parse xml = - Some - { successful = - Xml.required - "Successful" - (ChangeMessageVisibilityBatchResultEntryList.parse xml) - ; failed = Xml.required "Failed" (BatchResultErrorEntryList.parse xml) + end +module PurgeQueueInProgress = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module EmptyBatchRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ChangeMessageVisibilityBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: ChangeMessageVisibilityBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (ChangeMessageVisibilityBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (ChangeMessageVisibilityBatchRequestEntryList.to_query + v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (ChangeMessageVisibilityBatchRequestEntryList.to_json + v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (ChangeMessageVisibilityBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) + } + end +module SendMessageBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: SendMessageBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (SendMessageBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (SendMessageBatchRequestEntryList.to_query v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (SendMessageBatchRequestEntryList.to_json v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (SendMessageBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("Failed.member", BatchResultErrorEntryList.to_query v.failed)) - ; Some + end +module DeleteMessageBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: DeleteMessageBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (DeleteMessageBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (DeleteMessageBatchRequestEntryList.to_query v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (DeleteMessageBatchRequestEntryList.to_json v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (DeleteMessageBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) + } + end +module ChangeMessageVisibilityBatchResult = + struct + type t = + { + successful: ChangeMessageVisibilityBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (ChangeMessageVisibilityBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some (Query.Pair - ( "Successful.member" - , ChangeMessageVisibilityBatchResultEntryList.to_query v.successful )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("failed", BatchResultErrorEntryList.to_json v.failed) - ; Some - ( "successful" - , ChangeMessageVisibilityBatchResultEntryList.to_json v.successful ) - ]) - - let of_json j = - { successful = - ChangeMessageVisibilityBatchResultEntryList.of_json - (Util.of_option_exn (Json.lookup j "successful")) - ; failed = - BatchResultErrorEntryList.of_json (Util.of_option_exn (Json.lookup j "failed")) - } -end - -module RemovePermissionRequest = struct - type t = - { queue_url : String.t - ; label : String.t - } - - let make ~queue_url ~label () = { queue_url; label } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; label = - Xml.required "Label" (Util.option_bind (Xml.member "Label" xml) String.parse) + ("Successful.member", + (ChangeMessageVisibilityBatchResultEntryList.to_query + v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (ChangeMessageVisibilityBatchResultEntryList.to_json + v.successful))]) + let of_json j = + { + successful = + (ChangeMessageVisibilityBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Label", String.to_query v.label)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("label", String.to_json v.label) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; label = String.of_json (Util.of_option_exn (Json.lookup j "label")) - } -end - -module SendMessageBatchResult = struct - type t = - { successful : SendMessageBatchResultEntryList.t - ; failed : BatchResultErrorEntryList.t - } - - let make ~successful ~failed () = { successful; failed } - - let parse xml = - Some - { successful = Xml.required "Successful" (SendMessageBatchResultEntryList.parse xml) - ; failed = Xml.required "Failed" (BatchResultErrorEntryList.parse xml) + end +module RemovePermissionRequest = + struct + type t = { + queue_url: String.t ; + label: String.t } + let make ~queue_url ~label () = { queue_url; label } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + label = + (Xml.required "Label" + (Util.option_bind (Xml.member "Label" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Label", (String.to_query v.label))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("label", (String.to_json v.label)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + label = (String.of_json (Util.of_option_exn (Json.lookup j "label"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("Failed.member", BatchResultErrorEntryList.to_query v.failed)) - ; Some + end +module SendMessageBatchResult = + struct + type t = + { + successful: SendMessageBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (SendMessageBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some (Query.Pair - ( "Successful.member" - , SendMessageBatchResultEntryList.to_query v.successful )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("failed", BatchResultErrorEntryList.to_json v.failed) - ; Some ("successful", SendMessageBatchResultEntryList.to_json v.successful) - ]) - - let of_json j = - { successful = - SendMessageBatchResultEntryList.of_json - (Util.of_option_exn (Json.lookup j "successful")) - ; failed = - BatchResultErrorEntryList.of_json (Util.of_option_exn (Json.lookup j "failed")) - } -end - -module AddPermissionRequest = struct - type t = - { queue_url : String.t - ; label : String.t - ; a_w_s_account_ids : AWSAccountIdList.t - ; actions : ActionNameList.t - } - - let make ~queue_url ~label ~a_w_s_account_ids ~actions () = - { queue_url; label; a_w_s_account_ids; actions } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; label = - Xml.required "Label" (Util.option_bind (Xml.member "Label" xml) String.parse) - ; a_w_s_account_ids = Xml.required "AWSAccountIds" (AWSAccountIdList.parse xml) - ; actions = Xml.required "Actions" (ActionNameList.parse xml) + ("Successful.member", + (SendMessageBatchResultEntryList.to_query v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (SendMessageBatchResultEntryList.to_json v.successful))]) + let of_json j = + { + successful = + (SendMessageBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Actions.member", ActionNameList.to_query v.actions)) - ; Some + end +module AddPermissionRequest = + struct + type t = + { + queue_url: String.t ; + label: String.t ; + a_w_s_account_ids: AWSAccountIdList.t ; + actions: ActionNameList.t } + let make ~queue_url ~label ~a_w_s_account_ids ~actions () = + { queue_url; label; a_w_s_account_ids; actions } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + label = + (Xml.required "Label" + (Util.option_bind (Xml.member "Label" xml) String.parse)); + a_w_s_account_ids = + (Xml.required "AWSAccountIds" (AWSAccountIdList.parse xml)); + actions = (Xml.required "Actions" (ActionNameList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Actions.member", (ActionNameList.to_query v.actions))); + Some (Query.Pair - ("AWSAccountIds.member", AWSAccountIdList.to_query v.a_w_s_account_ids)) - ; Some (Query.Pair ("Label", String.to_query v.label)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("actions", ActionNameList.to_json v.actions) - ; Some ("a_w_s_account_ids", AWSAccountIdList.to_json v.a_w_s_account_ids) - ; Some ("label", String.to_json v.label) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; label = String.of_json (Util.of_option_exn (Json.lookup j "label")) - ; a_w_s_account_ids = - AWSAccountIdList.of_json (Util.of_option_exn (Json.lookup j "a_w_s_account_ids")) - ; actions = ActionNameList.of_json (Util.of_option_exn (Json.lookup j "actions")) - } -end - -module ChangeMessageVisibilityRequest = struct - type t = - { queue_url : String.t - ; receipt_handle : String.t - ; visibility_timeout : Integer.t - } - - let make ~queue_url ~receipt_handle ~visibility_timeout () = - { queue_url; receipt_handle; visibility_timeout } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; receipt_handle = - Xml.required - "ReceiptHandle" - (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse) - ; visibility_timeout = - Xml.required - "VisibilityTimeout" - (Util.option_bind (Xml.member "VisibilityTimeout" xml) Integer.parse) + ("AWSAccountIds.member", + (AWSAccountIdList.to_query v.a_w_s_account_ids))); + Some (Query.Pair ("Label", (String.to_query v.label))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("actions", (ActionNameList.to_json v.actions)); + Some + ("a_w_s_account_ids", + (AWSAccountIdList.to_json v.a_w_s_account_ids)); + Some ("label", (String.to_json v.label)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + label = (String.of_json (Util.of_option_exn (Json.lookup j "label"))); + a_w_s_account_ids = + (AWSAccountIdList.of_json + (Util.of_option_exn (Json.lookup j "a_w_s_account_ids"))); + actions = + (ActionNameList.of_json + (Util.of_option_exn (Json.lookup j "actions"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("VisibilityTimeout", Integer.to_query v.visibility_timeout)) - ; Some (Query.Pair ("ReceiptHandle", String.to_query v.receipt_handle)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("visibility_timeout", Integer.to_json v.visibility_timeout) - ; Some ("receipt_handle", String.to_json v.receipt_handle) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; receipt_handle = - String.of_json (Util.of_option_exn (Json.lookup j "receipt_handle")) - ; visibility_timeout = - Integer.of_json (Util.of_option_exn (Json.lookup j "visibility_timeout")) - } -end - -module ReceiptHandleIsInvalid = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ReceiveMessageRequest = struct - type t = - { queue_url : String.t - ; attribute_names : AttributeNameList.t - ; message_attribute_names : MessageAttributeNameList.t - ; max_number_of_messages : Integer.t option - ; visibility_timeout : Integer.t option - ; wait_time_seconds : Integer.t option - } - - let make - ~queue_url - ?(attribute_names = []) - ?(message_attribute_names = []) - ?max_number_of_messages - ?visibility_timeout - ?wait_time_seconds + end +module ChangeMessageVisibilityRequest = + struct + type t = + { + queue_url: String.t ; + receipt_handle: String.t ; + visibility_timeout: Integer.t } + let make ~queue_url ~receipt_handle ~visibility_timeout () = + { queue_url; receipt_handle; visibility_timeout } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)); + visibility_timeout = + (Xml.required "VisibilityTimeout" + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VisibilityTimeout", + (Integer.to_query v.visibility_timeout))); + Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("visibility_timeout", (Integer.to_json v.visibility_timeout)); + Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))); + visibility_timeout = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "visibility_timeout"))) + } + end +module ReceiptHandleIsInvalid = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReceiveMessageRequest = + struct + type t = + { + queue_url: String.t ; + attribute_names: AttributeNameList.t ; + message_attribute_names: MessageAttributeNameList.t ; + max_number_of_messages: Integer.t option ; + visibility_timeout: Integer.t option ; + wait_time_seconds: Integer.t option } + let make ~queue_url ?(attribute_names= []) ?(message_attribute_names= + []) ?max_number_of_messages ?visibility_timeout ?wait_time_seconds () = - { queue_url - ; attribute_names - ; message_attribute_names - ; max_number_of_messages - ; visibility_timeout - ; wait_time_seconds - } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; attribute_names = Util.of_option [] (AttributeNameList.parse xml) - ; message_attribute_names = Util.of_option [] (MessageAttributeNameList.parse xml) - ; max_number_of_messages = - Util.option_bind (Xml.member "MaxNumberOfMessages" xml) Integer.parse - ; visibility_timeout = - Util.option_bind (Xml.member "VisibilityTimeout" xml) Integer.parse - ; wait_time_seconds = - Util.option_bind (Xml.member "WaitTimeSeconds" xml) Integer.parse + { + queue_url; + attribute_names; + message_attribute_names; + max_number_of_messages; + visibility_timeout; + wait_time_seconds } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.wait_time_seconds (fun f -> - Query.Pair ("WaitTimeSeconds", Integer.to_query f)) - ; Util.option_map v.visibility_timeout (fun f -> - Query.Pair ("VisibilityTimeout", Integer.to_query f)) - ; Util.option_map v.max_number_of_messages (fun f -> - Query.Pair ("MaxNumberOfMessages", Integer.to_query f)) - ; Some + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)); + message_attribute_names = + (Util.of_option [] (MessageAttributeNameList.parse xml)); + max_number_of_messages = + (Util.option_bind (Xml.member "MaxNumberOfMessages" xml) + Integer.parse); + visibility_timeout = + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse); + wait_time_seconds = + (Util.option_bind (Xml.member "WaitTimeSeconds" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.wait_time_seconds + (fun f -> Query.Pair ("WaitTimeSeconds", (Integer.to_query f))); + Util.option_map v.visibility_timeout + (fun f -> Query.Pair ("VisibilityTimeout", (Integer.to_query f))); + Util.option_map v.max_number_of_messages + (fun f -> + Query.Pair ("MaxNumberOfMessages", (Integer.to_query f))); + Some (Query.Pair - ( "MessageAttributeNames.member" - , MessageAttributeNameList.to_query v.message_attribute_names )) - ; Some + ("MessageAttributeNames.member", + (MessageAttributeNameList.to_query + v.message_attribute_names))); + Some (Query.Pair - ("AttributeNames.member", AttributeNameList.to_query v.attribute_names)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.wait_time_seconds (fun f -> - "wait_time_seconds", Integer.to_json f) - ; Util.option_map v.visibility_timeout (fun f -> - "visibility_timeout", Integer.to_json f) - ; Util.option_map v.max_number_of_messages (fun f -> - "max_number_of_messages", Integer.to_json f) - ; Some - ( "message_attribute_names" - , MessageAttributeNameList.to_json v.message_attribute_names ) - ; Some ("attribute_names", AttributeNameList.to_json v.attribute_names) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; attribute_names = - AttributeNameList.of_json (Util.of_option_exn (Json.lookup j "attribute_names")) - ; message_attribute_names = - MessageAttributeNameList.of_json - (Util.of_option_exn (Json.lookup j "message_attribute_names")) - ; max_number_of_messages = - Util.option_map (Json.lookup j "max_number_of_messages") Integer.of_json - ; visibility_timeout = - Util.option_map (Json.lookup j "visibility_timeout") Integer.of_json - ; wait_time_seconds = - Util.option_map (Json.lookup j "wait_time_seconds") Integer.of_json - } -end - -module SendMessageResult = struct - type t = - { m_d5_of_message_body : String.t option - ; m_d5_of_message_attributes : String.t option - ; message_id : String.t option - } - - let make ?m_d5_of_message_body ?m_d5_of_message_attributes ?message_id () = - { m_d5_of_message_body; m_d5_of_message_attributes; message_id } - - let parse xml = - Some - { m_d5_of_message_body = - Util.option_bind (Xml.member "MD5OfMessageBody" xml) String.parse - ; m_d5_of_message_attributes = - Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) String.parse - ; message_id = Util.option_bind (Xml.member "MessageId" xml) String.parse + ("AttributeNames.member", + (AttributeNameList.to_query v.attribute_names))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.wait_time_seconds + (fun f -> ("wait_time_seconds", (Integer.to_json f))); + Util.option_map v.visibility_timeout + (fun f -> ("visibility_timeout", (Integer.to_json f))); + Util.option_map v.max_number_of_messages + (fun f -> ("max_number_of_messages", (Integer.to_json f))); + Some + ("message_attribute_names", + (MessageAttributeNameList.to_json v.message_attribute_names)); + Some + ("attribute_names", + (AttributeNameList.to_json v.attribute_names)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attribute_names = + (AttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))); + message_attribute_names = + (MessageAttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "message_attribute_names"))); + max_number_of_messages = + (Util.option_map (Json.lookup j "max_number_of_messages") + Integer.of_json); + visibility_timeout = + (Util.option_map (Json.lookup j "visibility_timeout") + Integer.of_json); + wait_time_seconds = + (Util.option_map (Json.lookup j "wait_time_seconds") + Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message_id (fun f -> - Query.Pair ("MessageId", String.to_query f)) - ; Util.option_map v.m_d5_of_message_attributes (fun f -> - Query.Pair ("MD5OfMessageAttributes", String.to_query f)) - ; Util.option_map v.m_d5_of_message_body (fun f -> - Query.Pair ("MD5OfMessageBody", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message_id (fun f -> "message_id", String.to_json f) - ; Util.option_map v.m_d5_of_message_attributes (fun f -> - "m_d5_of_message_attributes", String.to_json f) - ; Util.option_map v.m_d5_of_message_body (fun f -> - "m_d5_of_message_body", String.to_json f) - ]) - - let of_json j = - { m_d5_of_message_body = - Util.option_map (Json.lookup j "m_d5_of_message_body") String.of_json - ; m_d5_of_message_attributes = - Util.option_map (Json.lookup j "m_d5_of_message_attributes") String.of_json - ; message_id = Util.option_map (Json.lookup j "message_id") String.of_json - } -end - -module DeleteMessageRequest = struct - type t = - { queue_url : String.t - ; receipt_handle : String.t - } - - let make ~queue_url ~receipt_handle () = { queue_url; receipt_handle } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; receipt_handle = - Xml.required - "ReceiptHandle" - (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse) + end +module SendMessageResult = + struct + type t = + { + m_d5_of_message_body: String.t option ; + m_d5_of_message_attributes: String.t option ; + message_id: String.t option } + let make ?m_d5_of_message_body ?m_d5_of_message_attributes ?message_id + () = { m_d5_of_message_body; m_d5_of_message_attributes; message_id } + let parse xml = + Some + { + m_d5_of_message_body = + (Util.option_bind (Xml.member "MD5OfMessageBody" xml) + String.parse); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse); + message_id = + (Util.option_bind (Xml.member "MessageId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_id + (fun f -> Query.Pair ("MessageId", (String.to_query f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Util.option_map v.m_d5_of_message_body + (fun f -> Query.Pair ("MD5OfMessageBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_id + (fun f -> ("message_id", (String.to_json f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Util.option_map v.m_d5_of_message_body + (fun f -> ("m_d5_of_message_body", (String.to_json f)))]) + let of_json j = + { + m_d5_of_message_body = + (Util.option_map (Json.lookup j "m_d5_of_message_body") + String.of_json); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json); + message_id = + (Util.option_map (Json.lookup j "message_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("ReceiptHandle", String.to_query v.receipt_handle)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("receipt_handle", String.to_json v.receipt_handle) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; receipt_handle = - String.of_json (Util.of_option_exn (Json.lookup j "receipt_handle")) - } -end - -module ListDeadLetterSourceQueuesRequest = struct - type t = { queue_url : String.t } - - let make ~queue_url () = { queue_url } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) + end +module DeleteMessageRequest = + struct + type t = { + queue_url: String.t ; + receipt_handle: String.t } + let make ~queue_url ~receipt_handle () = { queue_url; receipt_handle } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("queue_url", String.to_json v.queue_url) ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) } -end - -module QueueDeletedRecently = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SendMessageRequest = struct - type t = - { queue_url : String.t - ; message_body : String.t - ; delay_seconds : Integer.t option - ; message_attributes : MessageAttributeMap.t option - } - - let make ~queue_url ~message_body ?delay_seconds ?message_attributes () = - { queue_url; message_body; delay_seconds; message_attributes } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; message_body = - Xml.required - "MessageBody" - (Util.option_bind (Xml.member "MessageBody" xml) String.parse) - ; delay_seconds = Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse - ; message_attributes = - Util.option_bind (Xml.member "MessageAttribute" xml) MessageAttributeMap.parse + end +module ListDeadLetterSourceQueuesRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - Query.Pair ("MessageAttribute", MessageAttributeMap.to_query f)) - ; Util.option_map v.delay_seconds (fun f -> - Query.Pair ("DelaySeconds", Integer.to_query f)) - ; Some (Query.Pair ("MessageBody", String.to_query v.message_body)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message_attributes (fun f -> - "message_attributes", MessageAttributeMap.to_json f) - ; Util.option_map v.delay_seconds (fun f -> "delay_seconds", Integer.to_json f) - ; Some ("message_body", String.to_json v.message_body) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; message_body = String.of_json (Util.of_option_exn (Json.lookup j "message_body")) - ; delay_seconds = Util.option_map (Json.lookup j "delay_seconds") Integer.of_json - ; message_attributes = - Util.option_map (Json.lookup j "message_attributes") MessageAttributeMap.of_json - } -end - -module BatchRequestTooLong = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListDeadLetterSourceQueuesResult = struct - type t = { queue_urls : QueueUrlList.t } - - let make ~queue_urls () = { queue_urls } - - let parse xml = Some { queue_urls = Xml.required "queueUrls" (QueueUrlList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("queueUrls.member", QueueUrlList.to_query v.queue_urls)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("queue_urls", QueueUrlList.to_json v.queue_urls) ]) - - let of_json j = - { queue_urls = QueueUrlList.of_json (Util.of_option_exn (Json.lookup j "queue_urls")) - } -end - -module QueueDoesNotExist = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListQueuesRequest = struct - type t = { queue_name_prefix : String.t option } - - let make ?queue_name_prefix () = { queue_name_prefix } - - let parse xml = - Some - { queue_name_prefix = - Util.option_bind (Xml.member "QueueNamePrefix" xml) String.parse + end +module QueueDeletedRecently = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SendMessageRequest = + struct + type t = + { + queue_url: String.t ; + message_body: String.t ; + delay_seconds: Integer.t option ; + message_attributes: MessageAttributeMap.t option } + let make ~queue_url ~message_body ?delay_seconds ?message_attributes + () = { queue_url; message_body; delay_seconds; message_attributes } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + message_body = + (Xml.required "MessageBody" + (Util.option_bind (Xml.member "MessageBody" xml) String.parse)); + delay_seconds = + (Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.delay_seconds + (fun f -> Query.Pair ("DelaySeconds", (Integer.to_query f))); + Some + (Query.Pair ("MessageBody", (String.to_query v.message_body))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.delay_seconds + (fun f -> ("delay_seconds", (Integer.to_json f))); + Some ("message_body", (String.to_json v.message_body)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + message_body = + (String.of_json (Util.of_option_exn (Json.lookup j "message_body"))); + delay_seconds = + (Util.option_map (Json.lookup j "delay_seconds") Integer.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.queue_name_prefix (fun f -> - Query.Pair ("QueueNamePrefix", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.queue_name_prefix (fun f -> - "queue_name_prefix", String.to_json f) - ]) - - let of_json j = - { queue_name_prefix = - Util.option_map (Json.lookup j "queue_name_prefix") String.of_json - } -end - -module UnsupportedOperation = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module BatchEntryIdsNotDistinct = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateQueueResult = struct - type t = { queue_url : String.t option } - - let make ?queue_url () = { queue_url } - - let parse xml = - Some { queue_url = Util.option_bind (Xml.member "QueueUrl" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.queue_url (fun f -> - Query.Pair ("QueueUrl", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.queue_url (fun f -> "queue_url", String.to_json f) ]) - - let of_json j = - { queue_url = Util.option_map (Json.lookup j "queue_url") String.of_json } -end - -module InvalidAttributeName = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module OverLimit = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ReceiveMessageResult = struct - type t = { messages : MessageList.t } - - let make ?(messages = []) () = { messages } - - let parse xml = Some { messages = Util.of_option [] (MessageList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Messages.member", MessageList.to_query v.messages)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("messages", MessageList.to_json v.messages) ]) - - let of_json j = - { messages = MessageList.of_json (Util.of_option_exn (Json.lookup j "messages")) } -end - -module GetQueueAttributesRequest = struct - type t = - { queue_url : String.t - ; attribute_names : AttributeNameList.t - } - - let make ~queue_url ?(attribute_names = []) () = { queue_url; attribute_names } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" + end +module BatchRequestTooLong = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListDeadLetterSourceQueuesResult = + struct + type t = { + queue_urls: QueueUrlList.t } + let make ~queue_urls () = { queue_urls } + let parse xml = + Some + { queue_urls = (Xml.required "queueUrls" (QueueUrlList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("queueUrls.member", (QueueUrlList.to_query v.queue_urls)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_urls", (QueueUrlList.to_json v.queue_urls))]) + let of_json j = + { + queue_urls = + (QueueUrlList.of_json + (Util.of_option_exn (Json.lookup j "queue_urls"))) + } + end +module QueueDoesNotExist = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListQueuesRequest = + struct + type t = { + queue_name_prefix: String.t option } + let make ?queue_name_prefix () = { queue_name_prefix } + let parse xml = + Some + { + queue_name_prefix = + (Util.option_bind (Xml.member "QueueNamePrefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_name_prefix + (fun f -> Query.Pair ("QueueNamePrefix", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_name_prefix + (fun f -> ("queue_name_prefix", (String.to_json f)))]) + let of_json j = + { + queue_name_prefix = + (Util.option_map (Json.lookup j "queue_name_prefix") String.of_json) + } + end +module UnsupportedOperation = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module BatchEntryIdsNotDistinct = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateQueueResult = + struct + type t = { + queue_url: String.t option } + let make ?queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; attribute_names = Util.of_option [] (AttributeNameList.parse xml) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_url + (fun f -> Query.Pair ("QueueUrl", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_url + (fun f -> ("queue_url", (String.to_json f)))]) + let of_json j = + { + queue_url = + (Util.option_map (Json.lookup j "queue_url") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("AttributeNames.member", AttributeNameList.to_query v.attribute_names)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attribute_names", AttributeNameList.to_json v.attribute_names) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; attribute_names = - AttributeNameList.of_json (Util.of_option_exn (Json.lookup j "attribute_names")) - } -end - -module InvalidBatchEntryId = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteMessageBatchResult = struct - type t = - { successful : DeleteMessageBatchResultEntryList.t - ; failed : BatchResultErrorEntryList.t - } - - let make ~successful ~failed () = { successful; failed } - - let parse xml = - Some - { successful = - Xml.required "Successful" (DeleteMessageBatchResultEntryList.parse xml) - ; failed = Xml.required "Failed" (BatchResultErrorEntryList.parse xml) + end +module InvalidAttributeName = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module OverLimit = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReceiveMessageResult = + struct + type t = { + messages: MessageList.t } + let make ?(messages= []) () = { messages } + let parse xml = + Some { messages = (Util.of_option [] (MessageList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Messages.member", (MessageList.to_query v.messages)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("messages", (MessageList.to_json v.messages))]) + let of_json j = + { + messages = + (MessageList.of_json + (Util.of_option_exn (Json.lookup j "messages"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("Failed.member", BatchResultErrorEntryList.to_query v.failed)) - ; Some + end +module GetQueueAttributesRequest = + struct + type t = { + queue_url: String.t ; + attribute_names: AttributeNameList.t } + let make ~queue_url ?(attribute_names= []) () = + { queue_url; attribute_names } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AttributeNames.member", + (AttributeNameList.to_query v.attribute_names))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("attribute_names", + (AttributeNameList.to_json v.attribute_names)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attribute_names = + (AttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))) + } + end +module InvalidBatchEntryId = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteMessageBatchResult = + struct + type t = + { + successful: DeleteMessageBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (DeleteMessageBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some (Query.Pair - ( "Successful.member" - , DeleteMessageBatchResultEntryList.to_query v.successful )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("failed", BatchResultErrorEntryList.to_json v.failed) - ; Some ("successful", DeleteMessageBatchResultEntryList.to_json v.successful) - ]) - - let of_json j = - { successful = - DeleteMessageBatchResultEntryList.of_json - (Util.of_option_exn (Json.lookup j "successful")) - ; failed = - BatchResultErrorEntryList.of_json (Util.of_option_exn (Json.lookup j "failed")) - } -end - -module TooManyEntriesInBatchRequest = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListQueuesResult = struct - type t = { queue_urls : QueueUrlList.t } - - let make ?(queue_urls = []) () = { queue_urls } - - let parse xml = Some { queue_urls = Util.of_option [] (QueueUrlList.parse xml) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("QueueUrls.member", QueueUrlList.to_query v.queue_urls)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt [ Some ("queue_urls", QueueUrlList.to_json v.queue_urls) ]) - - let of_json j = - { queue_urls = QueueUrlList.of_json (Util.of_option_exn (Json.lookup j "queue_urls")) - } -end - -module CreateQueueRequest = struct - type t = - { queue_name : String.t - ; attributes : AttributeMap.t option - } - - let make ~queue_name ?attributes () = { queue_name; attributes } - - let parse xml = - Some - { queue_name = - Xml.required - "QueueName" - (Util.option_bind (Xml.member "QueueName" xml) String.parse) - ; attributes = Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse + ("Successful.member", + (DeleteMessageBatchResultEntryList.to_query v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (DeleteMessageBatchResultEntryList.to_json v.successful))]) + let of_json j = + { + successful = + (DeleteMessageBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.attributes (fun f -> - Query.Pair ("Attribute", AttributeMap.to_query f)) - ; Some (Query.Pair ("QueueName", String.to_query v.queue_name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.attributes (fun f -> "attributes", AttributeMap.to_json f) - ; Some ("queue_name", String.to_json v.queue_name) - ]) - - let of_json j = - { queue_name = String.of_json (Util.of_option_exn (Json.lookup j "queue_name")) - ; attributes = Util.option_map (Json.lookup j "attributes") AttributeMap.of_json - } -end - -module InvalidMessageContents = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module SetQueueAttributesRequest = struct - type t = - { queue_url : String.t - ; attributes : AttributeMap.t - } - - let make ~queue_url ~attributes () = { queue_url; attributes } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) - ; attributes = - Xml.required - "Attribute" + end +module TooManyEntriesInBatchRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListQueuesResult = + struct + type t = { + queue_urls: QueueUrlList.t } + let make ?(queue_urls= []) () = { queue_urls } + let parse xml = + Some { queue_urls = (Util.of_option [] (QueueUrlList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("QueueUrls.member", (QueueUrlList.to_query v.queue_urls)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_urls", (QueueUrlList.to_json v.queue_urls))]) + let of_json j = + { + queue_urls = + (QueueUrlList.of_json + (Util.of_option_exn (Json.lookup j "queue_urls"))) + } + end +module CreateQueueRequest = + struct + type t = { + queue_name: String.t ; + attributes: AttributeMap.t option } + let make ~queue_name ?attributes () = { queue_name; attributes } + let parse xml = + Some + { + queue_name = + (Xml.required "QueueName" + (Util.option_bind (Xml.member "QueueName" xml) String.parse)); + attributes = (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f))); + Some (Query.Pair ("QueueName", (String.to_query v.queue_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f))); + Some ("queue_name", (String.to_json v.queue_name))]) + let of_json j = + { + queue_name = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_name"))); + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Attribute", AttributeMap.to_query v.attributes)) - ; Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("attributes", AttributeMap.to_json v.attributes) - ; Some ("queue_url", String.to_json v.queue_url) - ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) - ; attributes = AttributeMap.of_json (Util.of_option_exn (Json.lookup j "attributes")) - } -end - -module PurgeQueueRequest = struct - type t = { queue_url : String.t } - - let make ~queue_url () = { queue_url } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) + end +module InvalidMessageContents = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SetQueueAttributesRequest = + struct + type t = { + queue_url: String.t ; + attributes: AttributeMap.t } + let make ~queue_url ~attributes () = { queue_url; attributes } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attributes = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + AttributeMap.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Attribute", (AttributeMap.to_query v.attributes))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attributes", (AttributeMap.to_json v.attributes)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attributes = + (AttributeMap.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("queue_url", String.to_json v.queue_url) ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) } -end - -module QueueNameExists = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetQueueUrlResult = struct - type t = { queue_url : String.t } - - let make ~queue_url () = { queue_url } - - let parse xml = - Some - { queue_url = - Xml.required - "QueueUrl" - (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) + end +module PurgeQueueRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) + } + end +module QueueNameExists = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetQueueUrlResult = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("QueueUrl", String.to_query v.queue_url)) ]) - - let to_json v = - `Assoc (Util.list_filter_opt [ Some ("queue_url", String.to_json v.queue_url) ]) - - let of_json j = - { queue_url = String.of_json (Util.of_option_exn (Json.lookup j "queue_url")) } -end + end \ No newline at end of file diff --git a/libraries/sqs/lib_test/dune b/libraries/sqs/lib_test/dune index 9f436d59f..68b3961b1 100644 --- a/libraries/sqs/lib_test/dune +++ b/libraries/sqs/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_sqs_test) - (libraries aws aws_sqs aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_sqs aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/sqs/lib_test/test_async.ml b/libraries/sqs/lib_test/test_async.ml index df818e517..07393f66a 100644 --- a/libraries/sqs/lib_test/test_async.ml +++ b/libraries/sqs/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_sqs_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/sqs/lib_test/test_lwt.ml b/libraries/sqs/lib_test/test_lwt.ml index 4b747b439..969fadd8d 100644 --- a/libraries/sqs/lib_test/test_lwt.ml +++ b/libraries/sqs/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_sqs_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/ssm/lib/createAssociation.ml b/libraries/ssm/lib/createAssociation.ml index 41def8d47..bb6543ac6 100644 --- a/libraries/ssm/lib/createAssociation.ml +++ b/libraries/ssm/lib/createAssociation.ml @@ -1,67 +1,63 @@ open Types open Aws - type input = CreateAssociationRequest.t - type output = CreateAssociationResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "CreateAssociation" ] ] + [("Version", ["2014-11-06"]); ("Action", ["CreateAssociation"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateAssociationRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateAssociationRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateAssociationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateAssociationResult.parse) + Util.or_error (Util.option_bind resp CreateAssociationResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateAssociationResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateAssociationResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateAssociationResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateAssociationResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidInstanceId - ; Errors_internal.InvalidDocument - ; Errors_internal.InternalServerError - ; Errors_internal.AssociationLimitExceeded - ; Errors_internal.AssociationAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.InvalidInstanceId; + Errors_internal.InvalidDocument; + Errors_internal.InternalServerError; + Errors_internal.AssociationLimitExceeded; + Errors_internal.AssociationAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/createAssociation.mli b/libraries/ssm/lib/createAssociation.mli index d7cf5a14e..3bf410eb1 100644 --- a/libraries/ssm/lib/createAssociation.mli +++ b/libraries/ssm/lib/createAssociation.mli @@ -1,10 +1,7 @@ open Types - type input = CreateAssociationRequest.t - type output = CreateAssociationResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/createAssociationBatch.ml b/libraries/ssm/lib/createAssociationBatch.ml index ff19cc421..10f16ab4a 100644 --- a/libraries/ssm/lib/createAssociationBatch.ml +++ b/libraries/ssm/lib/createAssociationBatch.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = CreateAssociationBatchRequest.t - type output = CreateAssociationBatchResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "CreateAssociationBatch" ] ] + [("Version", ["2014-11-06"]); + ("Action", ["CreateAssociationBatch"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (CreateAssociationBatchRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (CreateAssociationBatchRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,40 +24,42 @@ let of_http body = Util.or_error (Util.option_bind resp CreateAssociationBatchResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed CreateAssociationBatchResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed CreateAssociationBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateAssociationBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateAssociationBatchResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.AssociationLimitExceeded - ; Errors_internal.DuplicateInstanceId - ; Errors_internal.InvalidInstanceId - ; Errors_internal.InvalidDocument - ; Errors_internal.InternalServerError - ] - @ Errors_internal.common - in + [Errors_internal.AssociationLimitExceeded; + Errors_internal.DuplicateInstanceId; + Errors_internal.InvalidInstanceId; + Errors_internal.InvalidDocument; + Errors_internal.InternalServerError] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/createAssociationBatch.mli b/libraries/ssm/lib/createAssociationBatch.mli index af48f190d..cc730a043 100644 --- a/libraries/ssm/lib/createAssociationBatch.mli +++ b/libraries/ssm/lib/createAssociationBatch.mli @@ -1,10 +1,7 @@ open Types - type input = CreateAssociationBatchRequest.t - type output = CreateAssociationBatchResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/createDocument.ml b/libraries/ssm/lib/createDocument.ml index 92f7cd969..ababa6044 100644 --- a/libraries/ssm/lib/createDocument.ml +++ b/libraries/ssm/lib/createDocument.ml @@ -1,65 +1,62 @@ open Types open Aws - type input = CreateDocumentRequest.t - type output = CreateDocumentResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "CreateDocument" ] ] + [("Version", ["2014-11-06"]); ("Action", ["CreateDocument"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (CreateDocumentRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (CreateDocumentRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "CreateDocumentResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp CreateDocumentResult.parse) + Util.or_error (Util.option_bind resp CreateDocumentResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed CreateDocumentResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateDocumentResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateDocumentResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing CreateDocumentResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.DocumentLimitExceeded - ; Errors_internal.InvalidDocumentContent - ; Errors_internal.InternalServerError - ; Errors_internal.MaxDocumentSizeExceeded - ; Errors_internal.DocumentAlreadyExists - ] - @ Errors_internal.common - in + [Errors_internal.DocumentLimitExceeded; + Errors_internal.InvalidDocumentContent; + Errors_internal.InternalServerError; + Errors_internal.MaxDocumentSizeExceeded; + Errors_internal.DocumentAlreadyExists] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/createDocument.mli b/libraries/ssm/lib/createDocument.mli index 64da71013..001853c98 100644 --- a/libraries/ssm/lib/createDocument.mli +++ b/libraries/ssm/lib/createDocument.mli @@ -1,10 +1,7 @@ open Types - type input = CreateDocumentRequest.t - type output = CreateDocumentResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/deleteAssociation.ml b/libraries/ssm/lib/deleteAssociation.ml index 481e7dc71..9b48c50cc 100644 --- a/libraries/ssm/lib/deleteAssociation.ml +++ b/libraries/ssm/lib/deleteAssociation.ml @@ -1,44 +1,35 @@ open Types open Aws - type input = DeleteAssociationRequest.t - type output = unit - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "DeleteAssociation" ] ] + [("Version", ["2014-11-06"]); ("Action", ["DeleteAssociation"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteAssociationRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteAssociationRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.TooManyUpdates - ; Errors_internal.InvalidInstanceId - ; Errors_internal.InvalidDocument - ; Errors_internal.InternalServerError - ; Errors_internal.AssociationDoesNotExist - ] - @ Errors_internal.common - in + [Errors_internal.TooManyUpdates; + Errors_internal.InvalidInstanceId; + Errors_internal.InvalidDocument; + Errors_internal.InternalServerError; + Errors_internal.AssociationDoesNotExist] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/deleteAssociation.mli b/libraries/ssm/lib/deleteAssociation.mli index d063091d4..189705120 100644 --- a/libraries/ssm/lib/deleteAssociation.mli +++ b/libraries/ssm/lib/deleteAssociation.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteAssociationRequest.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 \ No newline at end of file diff --git a/libraries/ssm/lib/deleteDocument.ml b/libraries/ssm/lib/deleteDocument.ml index 4d3fafcd9..223b8fe5b 100644 --- a/libraries/ssm/lib/deleteDocument.ml +++ b/libraries/ssm/lib/deleteDocument.ml @@ -1,42 +1,33 @@ open Types open Aws - type input = DeleteDocumentRequest.t - type output = unit - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "DeleteDocument" ] ] + [("Version", ["2014-11-06"]); ("Action", ["DeleteDocument"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DeleteDocumentRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DeleteDocumentRequest.to_query req))))) in + (`POST, uri, []) let of_http body = `Ok () - let parse_error code err = let errors = - [ Errors_internal.AssociatedInstances - ; Errors_internal.InvalidDocument - ; Errors_internal.InternalServerError - ] - @ Errors_internal.common - in + [Errors_internal.AssociatedInstances; + Errors_internal.InvalidDocument; + Errors_internal.InternalServerError] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/deleteDocument.mli b/libraries/ssm/lib/deleteDocument.mli index 08f9a1c32..c15643191 100644 --- a/libraries/ssm/lib/deleteDocument.mli +++ b/libraries/ssm/lib/deleteDocument.mli @@ -1,10 +1,7 @@ open Types - type input = DeleteDocumentRequest.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 \ No newline at end of file diff --git a/libraries/ssm/lib/describeAssociation.ml b/libraries/ssm/lib/describeAssociation.ml index e847b9fd9..18185d8f7 100644 --- a/libraries/ssm/lib/describeAssociation.ml +++ b/libraries/ssm/lib/describeAssociation.ml @@ -1,67 +1,62 @@ open Types open Aws - type input = DescribeAssociationRequest.t - type output = DescribeAssociationResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "DescribeAssociation" ] ] + [("Version", ["2014-11-06"]); ("Action", ["DescribeAssociation"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DescribeAssociationRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DescribeAssociationRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeAssociationResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeAssociationResult.parse) + Util.or_error (Util.option_bind resp DescribeAssociationResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeAssociationResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DescribeAssociationResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeAssociationResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeAssociationResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidInstanceId - ; Errors_internal.InvalidDocument - ; Errors_internal.InternalServerError - ; Errors_internal.AssociationDoesNotExist - ] - @ Errors_internal.common - in + [Errors_internal.InvalidInstanceId; + Errors_internal.InvalidDocument; + Errors_internal.InternalServerError; + Errors_internal.AssociationDoesNotExist] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/describeAssociation.mli b/libraries/ssm/lib/describeAssociation.mli index 1a4c984bd..0a4e1e1b2 100644 --- a/libraries/ssm/lib/describeAssociation.mli +++ b/libraries/ssm/lib/describeAssociation.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeAssociationRequest.t - type output = DescribeAssociationResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/describeDocument.ml b/libraries/ssm/lib/describeDocument.ml index 82225a49c..c48577992 100644 --- a/libraries/ssm/lib/describeDocument.ml +++ b/libraries/ssm/lib/describeDocument.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = DescribeDocumentRequest.t - type output = DescribeDocumentResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "DescribeDocument" ] ] + [("Version", ["2014-11-06"]); ("Action", ["DescribeDocument"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (DescribeDocumentRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (DescribeDocumentRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "DescribeDocumentResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp DescribeDocumentResult.parse) + Util.or_error (Util.option_bind resp DescribeDocumentResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed DescribeDocumentResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed DescribeDocumentResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DescribeDocumentResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DescribeDocumentResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDocument; Errors_internal.InternalServerError ] - @ Errors_internal.common - in + [Errors_internal.InvalidDocument; Errors_internal.InternalServerError] @ + 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 \ No newline at end of file diff --git a/libraries/ssm/lib/describeDocument.mli b/libraries/ssm/lib/describeDocument.mli index c4b3af099..d40f0bf7f 100644 --- a/libraries/ssm/lib/describeDocument.mli +++ b/libraries/ssm/lib/describeDocument.mli @@ -1,10 +1,7 @@ open Types - type input = DescribeDocumentRequest.t - type output = DescribeDocumentResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/dune b/libraries/ssm/lib/dune index a828cf41e..051d1cfe4 100644 --- a/libraries/ssm/lib/dune +++ b/libraries/ssm/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_ssm) + (name aws_ssm) (public_name aws-ssm) (synopsis "aws-Amazon Simple Systems Management Service") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/ssm/lib/errors_internal.ml b/libraries/ssm/lib/errors_internal.ml index 7ba943de7..39a08d938 100644 --- a/libraries/ssm/lib/errors_internal.ml +++ b/libraries/ssm/lib/errors_internal.ml @@ -1,76 +1,73 @@ type t = - | AssociatedInstances - | AssociationAlreadyExists - | AssociationDoesNotExist - | AssociationLimitExceeded - | AuthFailure - | Blocked - | DocumentAlreadyExists - | DocumentLimitExceeded - | DryRunOperation - | DuplicateInstanceId - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InternalServerError - | InvalidAction - | InvalidClientTokenId - | InvalidDocument - | InvalidDocumentContent - | InvalidInstanceId - | InvalidNextToken - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | MalformedQueryString - | MaxDocumentSizeExceeded - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | StatusUnchanged - | Throttling - | TooManyUpdates - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AssociatedInstances + | AssociationAlreadyExists + | AssociationDoesNotExist + | AssociationLimitExceeded + | AuthFailure + | Blocked + | DocumentAlreadyExists + | DocumentLimitExceeded + | DryRunOperation + | DuplicateInstanceId + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InternalServerError + | InvalidAction + | InvalidClientTokenId + | InvalidDocument + | InvalidDocumentContent + | InvalidInstanceId + | InvalidNextToken + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | MalformedQueryString + | MaxDocumentSizeExceeded + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | StatusUnchanged + | Throttling + | TooManyUpdates + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AssociatedInstances -> Some 400 @@ -115,7 +112,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AssociatedInstances -> "AssociatedInstances" @@ -160,7 +156,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AssociatedInstances" -> Some AssociatedInstances @@ -205,4 +200,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/ssm/lib/getDocument.ml b/libraries/ssm/lib/getDocument.ml index 51c2a3a51..8c3019b43 100644 --- a/libraries/ssm/lib/getDocument.ml +++ b/libraries/ssm/lib/getDocument.ml @@ -1,60 +1,58 @@ open Types open Aws - type input = GetDocumentRequest.t - type output = GetDocumentResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "GetDocument" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2014-11-06"]); ("Action", ["GetDocument"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetDocumentRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetDocumentRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "GetDocumentResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp GetDocumentResult.parse) + Util.or_error (Util.option_bind resp GetDocumentResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed GetDocumentResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed GetDocumentResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetDocumentResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetDocumentResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidDocument; Errors_internal.InternalServerError ] - @ Errors_internal.common - in + [Errors_internal.InvalidDocument; Errors_internal.InternalServerError] @ + 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 \ No newline at end of file diff --git a/libraries/ssm/lib/getDocument.mli b/libraries/ssm/lib/getDocument.mli index e42272941..f536a1697 100644 --- a/libraries/ssm/lib/getDocument.mli +++ b/libraries/ssm/lib/getDocument.mli @@ -1,10 +1,7 @@ open Types - type input = GetDocumentRequest.t - type output = GetDocumentResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/listAssociations.ml b/libraries/ssm/lib/listAssociations.ml index e9bb53dfc..b83d013ee 100644 --- a/libraries/ssm/lib/listAssociations.ml +++ b/libraries/ssm/lib/listAssociations.ml @@ -1,62 +1,59 @@ open Types open Aws - type input = ListAssociationsRequest.t - type output = ListAssociationsResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "ListAssociations" ] ] + [("Version", ["2014-11-06"]); ("Action", ["ListAssociations"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListAssociationsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListAssociationsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListAssociationsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListAssociationsResult.parse) + Util.or_error (Util.option_bind resp ListAssociationsResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed ListAssociationsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListAssociationsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListAssociationsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListAssociationsResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidNextToken; Errors_internal.InternalServerError ] - @ Errors_internal.common - in + [Errors_internal.InvalidNextToken; Errors_internal.InternalServerError] @ + 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 \ No newline at end of file diff --git a/libraries/ssm/lib/listAssociations.mli b/libraries/ssm/lib/listAssociations.mli index 45580c754..c88aff061 100644 --- a/libraries/ssm/lib/listAssociations.mli +++ b/libraries/ssm/lib/listAssociations.mli @@ -1,10 +1,7 @@ open Types - type input = ListAssociationsRequest.t - type output = ListAssociationsResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/listDocuments.ml b/libraries/ssm/lib/listDocuments.ml index 8daeb608e..2182d6be5 100644 --- a/libraries/ssm/lib/listDocuments.ml +++ b/libraries/ssm/lib/listDocuments.ml @@ -1,60 +1,59 @@ open Types open Aws - type input = ListDocumentsRequest.t - type output = ListDocumentsResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "ListDocuments" ] ] + [("Version", ["2014-11-06"]); ("Action", ["ListDocuments"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (ListDocumentsRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (ListDocumentsRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Xml.member "ListDocumentsResponse" (snd xml) in try - Util.or_error - (Util.option_bind resp ListDocumentsResult.parse) + Util.or_error (Util.option_bind resp ListDocumentsResult.parse) (let open Error in - BadResponse { body; message = "Could not find well formed ListDocumentsResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed ListDocumentsResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListDocumentsResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing ListDocumentsResult - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidNextToken; Errors_internal.InternalServerError ] - @ Errors_internal.common - in + [Errors_internal.InvalidNextToken; Errors_internal.InternalServerError] @ + 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 \ No newline at end of file diff --git a/libraries/ssm/lib/listDocuments.mli b/libraries/ssm/lib/listDocuments.mli index 4c743a28b..cef2d6dd0 100644 --- a/libraries/ssm/lib/listDocuments.mli +++ b/libraries/ssm/lib/listDocuments.mli @@ -1,10 +1,7 @@ open Types - type input = ListDocumentsRequest.t - type output = ListDocumentsResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib/types.ml b/libraries/ssm/lib/types.ml index f607bc1f2..2ca175bd3 100644 --- a/libraries/ssm/lib/types.ml +++ b/libraries/ssm/lib/types.ml @@ -1,1574 +1,1435 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module AssociationStatusName = struct - type t = - | Pending - | Success - | Failed - - let str_to_t = [ "Failed", Failed; "Success", Success; "Pending", Pending ] - - let t_to_str = [ Failed, "Failed"; Success, "Success"; Pending, "Pending" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AssociationFilterKey = struct - type t = - | InstanceId - | Name - - let str_to_t = [ "Name", Name; "InstanceId", InstanceId ] - - let t_to_str = [ Name, "Name"; InstanceId, "InstanceId" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module DocumentFilterKey = struct - type t = Name - - let str_to_t = [ "Name", Name ] - - let t_to_str = [ Name, "Name" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AssociationStatus = struct - type t = - { date : DateTime.t - ; name : AssociationStatusName.t - ; message : String.t - ; additional_info : String.t option - } - - let make ~date ~name ~message ?additional_info () = - { date; name; message; additional_info } - - let parse xml = - Some - { date = - Xml.required "Date" (Util.option_bind (Xml.member "Date" xml) DateTime.parse) - ; name = - Xml.required - "Name" - (Util.option_bind (Xml.member "Name" xml) AssociationStatusName.parse) - ; message = - Xml.required - "Message" - (Util.option_bind (Xml.member "Message" xml) String.parse) - ; additional_info = Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse +module AssociationStatusName = + struct + type t = + | Pending + | Success + | Failed + let str_to_t = + [("Failed", Failed); ("Success", Success); ("Pending", Pending)] + let t_to_str = + [(Failed, "Failed"); (Success, "Success"); (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AssociationFilterKey = + struct + type t = + | InstanceId + | Name + let str_to_t = [("Name", Name); ("InstanceId", InstanceId)] + let t_to_str = [(Name, "Name"); (InstanceId, "InstanceId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module DocumentFilterKey = + struct + type t = + | Name + let str_to_t = [("Name", Name)] + let t_to_str = [(Name, "Name")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AssociationStatus = + struct + type t = + { + date: DateTime.t ; + name: AssociationStatusName.t ; + message: String.t ; + additional_info: String.t option } + let make ~date ~name ~message ?additional_info () = + { date; name; message; additional_info } + let parse xml = + Some + { + date = + (Xml.required "Date" + (Util.option_bind (Xml.member "Date" xml) DateTime.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) + AssociationStatusName.parse)); + message = + (Xml.required "Message" + (Util.option_bind (Xml.member "Message" xml) String.parse)); + additional_info = + (Util.option_bind (Xml.member "AdditionalInfo" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.additional_info + (fun f -> Query.Pair ("AdditionalInfo", (String.to_query f))); + Some (Query.Pair ("Message", (String.to_query v.message))); + Some + (Query.Pair ("Name", (AssociationStatusName.to_query v.name))); + Some (Query.Pair ("Date", (DateTime.to_query v.date)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.additional_info + (fun f -> ("additional_info", (String.to_json f))); + Some ("message", (String.to_json v.message)); + Some ("name", (AssociationStatusName.to_json v.name)); + Some ("date", (DateTime.to_json v.date))]) + let of_json j = + { + date = (DateTime.of_json (Util.of_option_exn (Json.lookup j "date"))); + name = + (AssociationStatusName.of_json + (Util.of_option_exn (Json.lookup j "name"))); + message = + (String.of_json (Util.of_option_exn (Json.lookup j "message"))); + additional_info = + (Util.option_map (Json.lookup j "additional_info") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.additional_info (fun f -> - Query.Pair ("AdditionalInfo", String.to_query f)) - ; Some (Query.Pair ("Message", String.to_query v.message)) - ; Some (Query.Pair ("Name", AssociationStatusName.to_query v.name)) - ; Some (Query.Pair ("Date", DateTime.to_query v.date)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.additional_info (fun f -> - "additional_info", String.to_json f) - ; Some ("message", String.to_json v.message) - ; Some ("name", AssociationStatusName.to_json v.name) - ; Some ("date", DateTime.to_json v.date) - ]) - - let of_json j = - { date = DateTime.of_json (Util.of_option_exn (Json.lookup j "date")) - ; name = AssociationStatusName.of_json (Util.of_option_exn (Json.lookup j "name")) - ; message = String.of_json (Util.of_option_exn (Json.lookup j "message")) - ; additional_info = Util.option_map (Json.lookup j "additional_info") String.of_json - } -end - -module CreateAssociationBatchRequestEntry = struct - type t = - { name : String.t option - ; instance_id : String.t option - } - - let make ?name ?instance_id () = { name; instance_id } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - } -end - -module Fault = struct - type t = - | Client - | Server - | Unknown - - let str_to_t = [ "Unknown", Unknown; "Server", Server; "Client", Client ] - - let t_to_str = [ Unknown, "Unknown"; Server, "Server"; Client, "Client" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AssociationFilter = struct - type t = - { key : AssociationFilterKey.t - ; value : String.t - } - - let make ~key ~value () = { key; value } - - let parse xml = - Some - { key = - Xml.required - "key" - (Util.option_bind (Xml.member "key" xml) AssociationFilterKey.parse) - ; value = - Xml.required "value" (Util.option_bind (Xml.member "value" xml) String.parse) + end +module CreateAssociationBatchRequestEntry = + struct + type t = { + name: String.t option ; + instance_id: String.t option } + let make ?name ?instance_id () = { name; instance_id } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("value", String.to_query v.value)) - ; Some (Query.Pair ("key", AssociationFilterKey.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value) - ; Some ("key", AssociationFilterKey.to_json v.key) - ]) - - let of_json j = - { key = AssociationFilterKey.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module Association = struct - type t = - { name : String.t option - ; instance_id : String.t option - } - - let make ?name ?instance_id () = { name; instance_id } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse + end +module Fault = + struct + type t = + | Client + | Server + | Unknown + let str_to_t = + [("Unknown", Unknown); ("Server", Server); ("Client", Client)] + let t_to_str = + [(Unknown, "Unknown"); (Server, "Server"); (Client, "Client")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AssociationFilter = + struct + type t = { + key: AssociationFilterKey.t ; + value: String.t } + let make ~key ~value () = { key; value } + let parse xml = + Some + { + key = + (Xml.required "key" + (Util.option_bind (Xml.member "key" xml) + AssociationFilterKey.parse)); + value = + (Xml.required "value" + (Util.option_bind (Xml.member "value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("value", (String.to_query v.value))); + Some (Query.Pair ("key", (AssociationFilterKey.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("key", (AssociationFilterKey.to_json v.key))]) + let of_json j = + { + key = + (AssociationFilterKey.of_json + (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - } -end - -module DocumentIdentifier = struct - type t = { name : String.t option } - - let make ?name () = { name } - - let parse xml = Some { name = Util.option_bind (Xml.member "Name" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.name (fun f -> "name", String.to_json f) ]) - - let of_json j = { name = Util.option_map (Json.lookup j "name") String.of_json } -end - -module DocumentFilter = struct - type t = - { key : DocumentFilterKey.t - ; value : String.t - } - - let make ~key ~value () = { key; value } - - let parse xml = - Some - { key = - Xml.required - "key" - (Util.option_bind (Xml.member "key" xml) DocumentFilterKey.parse) - ; value = - Xml.required "value" (Util.option_bind (Xml.member "value" xml) String.parse) + end +module Association = + struct + type t = { + name: String.t option ; + instance_id: String.t option } + let make ?name ?instance_id () = { name; instance_id } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("value", String.to_query v.value)) - ; Some (Query.Pair ("key", DocumentFilterKey.to_query v.key)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("value", String.to_json v.value) - ; Some ("key", DocumentFilterKey.to_json v.key) - ]) - - let of_json j = - { key = DocumentFilterKey.of_json (Util.of_option_exn (Json.lookup j "key")) - ; value = String.of_json (Util.of_option_exn (Json.lookup j "value")) - } -end - -module DocumentStatus = struct - type t = - | Creating - | Active - | Deleting - - let str_to_t = [ "Deleting", Deleting; "Active", Active; "Creating", Creating ] - - let t_to_str = [ Deleting, "Deleting"; Active, "Active"; Creating, "Creating" ] - - let to_string e = Util.of_option_exn (Util.list_find t_to_str e) - - let of_string s = Util.of_option_exn (Util.list_find str_to_t s) - - let make v () = v - - let parse xml = Util.option_bind (String.parse xml) (fun s -> Util.list_find str_to_t s) - - let to_query v = Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) - - let to_json v = String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) - - let of_json j = Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) -end - -module AssociationDescription = struct - type t = - { name : String.t option - ; instance_id : String.t option - ; date : DateTime.t option - ; status : AssociationStatus.t option - } - - let make ?name ?instance_id ?date ?status () = { name; instance_id; date; status } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; instance_id = Util.option_bind (Xml.member "InstanceId" xml) String.parse - ; date = Util.option_bind (Xml.member "Date" xml) DateTime.parse - ; status = Util.option_bind (Xml.member "Status" xml) AssociationStatus.parse + end +module DocumentIdentifier = + struct + type t = { + name: String.t option } + let make ?name () = { name } + let parse xml = + Some { name = (Util.option_bind (Xml.member "Name" xml) String.parse) } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { name = (Util.option_map (Json.lookup j "name") String.of_json) } + end +module DocumentFilter = + struct + type t = { + key: DocumentFilterKey.t ; + value: String.t } + let make ~key ~value () = { key; value } + let parse xml = + Some + { + key = + (Xml.required "key" + (Util.option_bind (Xml.member "key" xml) + DocumentFilterKey.parse)); + value = + (Xml.required "value" + (Util.option_bind (Xml.member "value" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("value", (String.to_query v.value))); + Some (Query.Pair ("key", (DocumentFilterKey.to_query v.key)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("value", (String.to_json v.value)); + Some ("key", (DocumentFilterKey.to_json v.key))]) + let of_json j = + { + key = + (DocumentFilterKey.of_json + (Util.of_option_exn (Json.lookup j "key"))); + value = (String.of_json (Util.of_option_exn (Json.lookup j "value"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> - Query.Pair ("Status", AssociationStatus.to_query f)) - ; Util.option_map v.date (fun f -> Query.Pair ("Date", DateTime.to_query f)) - ; Util.option_map v.instance_id (fun f -> - Query.Pair ("InstanceId", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", AssociationStatus.to_json f) - ; Util.option_map v.date (fun f -> "date", DateTime.to_json f) - ; Util.option_map v.instance_id (fun f -> "instance_id", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; instance_id = Util.option_map (Json.lookup j "instance_id") String.of_json - ; date = Util.option_map (Json.lookup j "date") DateTime.of_json - ; status = Util.option_map (Json.lookup j "status") AssociationStatus.of_json - } -end - -module FailedCreateAssociation = struct - type t = - { entry : CreateAssociationBatchRequestEntry.t option - ; message : String.t option - ; fault : Fault.t option - } - - let make ?entry ?message ?fault () = { entry; message; fault } - - let parse xml = - Some - { entry = - Util.option_bind - (Xml.member "Entry" xml) - CreateAssociationBatchRequestEntry.parse - ; message = Util.option_bind (Xml.member "Message" xml) String.parse - ; fault = Util.option_bind (Xml.member "Fault" xml) Fault.parse + end +module DocumentStatus = + struct + type t = + | Creating + | Active + | Deleting + let str_to_t = + [("Deleting", Deleting); ("Active", Active); ("Creating", Creating)] + let t_to_str = + [(Deleting, "Deleting"); (Active, "Active"); (Creating, "Creating")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module AssociationDescription = + struct + type t = + { + name: String.t option ; + instance_id: String.t option ; + date: DateTime.t option ; + status: AssociationStatus.t option } + let make ?name ?instance_id ?date ?status () = + { name; instance_id; date; status } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + instance_id = + (Util.option_bind (Xml.member "InstanceId" xml) String.parse); + date = (Util.option_bind (Xml.member "Date" xml) DateTime.parse); + status = + (Util.option_bind (Xml.member "Status" xml) + AssociationStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (AssociationStatus.to_query f))); + Util.option_map v.date + (fun f -> Query.Pair ("Date", (DateTime.to_query f))); + Util.option_map v.instance_id + (fun f -> Query.Pair ("InstanceId", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (AssociationStatus.to_json f))); + Util.option_map v.date (fun f -> ("date", (DateTime.to_json f))); + Util.option_map v.instance_id + (fun f -> ("instance_id", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + instance_id = + (Util.option_map (Json.lookup j "instance_id") String.of_json); + date = (Util.option_map (Json.lookup j "date") DateTime.of_json); + status = + (Util.option_map (Json.lookup j "status") AssociationStatus.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.fault (fun f -> Query.Pair ("Fault", Fault.to_query f)) - ; Util.option_map v.message (fun f -> Query.Pair ("Message", String.to_query f)) - ; Util.option_map v.entry (fun f -> - Query.Pair ("Entry", CreateAssociationBatchRequestEntry.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.fault (fun f -> "fault", Fault.to_json f) - ; Util.option_map v.message (fun f -> "message", String.to_json f) - ; Util.option_map v.entry (fun f -> - "entry", CreateAssociationBatchRequestEntry.to_json f) - ]) - - let of_json j = - { entry = - Util.option_map (Json.lookup j "entry") CreateAssociationBatchRequestEntry.of_json - ; message = Util.option_map (Json.lookup j "message") String.of_json - ; fault = Util.option_map (Json.lookup j "fault") Fault.of_json - } -end - -module AssociationFilterList = struct - type t = AssociationFilter.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map AssociationFilter.parse (Xml.members "AssociationFilter" xml)) - - let to_query v = Query.to_query_list AssociationFilter.to_query v - - let to_json v = `List (List.map AssociationFilter.to_json v) - - let of_json j = Json.to_list AssociationFilter.of_json j -end - -module AssociationList = struct - type t = Association.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map Association.parse (Xml.members "Association" xml)) - - let to_query v = Query.to_query_list Association.to_query v - - let to_json v = `List (List.map Association.to_json v) - - let of_json j = Json.to_list Association.of_json j -end - -module DocumentIdentifierList = struct - type t = DocumentIdentifier.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map DocumentIdentifier.parse (Xml.members "DocumentIdentifier" xml)) - - let to_query v = Query.to_query_list DocumentIdentifier.to_query v - - let to_json v = `List (List.map DocumentIdentifier.to_json v) - - let of_json j = Json.to_list DocumentIdentifier.of_json j -end - -module DocumentFilterList = struct - type t = DocumentFilter.t list - - let make elems () = elems - - let parse xml = - Util.option_all (List.map DocumentFilter.parse (Xml.members "DocumentFilter" xml)) - - let to_query v = Query.to_query_list DocumentFilter.to_query v - - let to_json v = `List (List.map DocumentFilter.to_json v) - - let of_json j = Json.to_list DocumentFilter.of_json j -end - -module DocumentDescription = struct - type t = - { sha1 : String.t option - ; name : String.t option - ; created_date : DateTime.t option - ; status : DocumentStatus.t option - } - - let make ?sha1 ?name ?created_date ?status () = { sha1; name; created_date; status } - - let parse xml = - Some - { sha1 = Util.option_bind (Xml.member "Sha1" xml) String.parse - ; name = Util.option_bind (Xml.member "Name" xml) String.parse - ; created_date = Util.option_bind (Xml.member "CreatedDate" xml) DateTime.parse - ; status = Util.option_bind (Xml.member "Status" xml) DocumentStatus.parse + end +module FailedCreateAssociation = + struct + type t = + { + entry: CreateAssociationBatchRequestEntry.t option ; + message: String.t option ; + fault: Fault.t option } + let make ?entry ?message ?fault () = { entry; message; fault } + let parse xml = + Some + { + entry = + (Util.option_bind (Xml.member "Entry" xml) + CreateAssociationBatchRequestEntry.parse); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse); + fault = (Util.option_bind (Xml.member "Fault" xml) Fault.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.fault + (fun f -> Query.Pair ("Fault", (Fault.to_query f))); + Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Util.option_map v.entry + (fun f -> + Query.Pair + ("Entry", (CreateAssociationBatchRequestEntry.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.fault (fun f -> ("fault", (Fault.to_json f))); + Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Util.option_map v.entry + (fun f -> + ("entry", (CreateAssociationBatchRequestEntry.to_json f)))]) + let of_json j = + { + entry = + (Util.option_map (Json.lookup j "entry") + CreateAssociationBatchRequestEntry.of_json); + message = (Util.option_map (Json.lookup j "message") String.of_json); + fault = (Util.option_map (Json.lookup j "fault") Fault.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> - Query.Pair ("Status", DocumentStatus.to_query f)) - ; Util.option_map v.created_date (fun f -> - Query.Pair ("CreatedDate", DateTime.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ; Util.option_map v.sha1 (fun f -> Query.Pair ("Sha1", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.status (fun f -> "status", DocumentStatus.to_json f) - ; Util.option_map v.created_date (fun f -> "created_date", DateTime.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ; Util.option_map v.sha1 (fun f -> "sha1", String.to_json f) - ]) - - let of_json j = - { sha1 = Util.option_map (Json.lookup j "sha1") String.of_json - ; name = Util.option_map (Json.lookup j "name") String.of_json - ; created_date = Util.option_map (Json.lookup j "created_date") DateTime.of_json - ; status = Util.option_map (Json.lookup j "status") DocumentStatus.of_json - } -end - -module AssociationDescriptionList = struct - type t = AssociationDescription.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map AssociationDescription.parse (Xml.members "AssociationDescription" xml)) - - let to_query v = Query.to_query_list AssociationDescription.to_query v - - let to_json v = `List (List.map AssociationDescription.to_json v) - - let of_json j = Json.to_list AssociationDescription.of_json j -end - -module FailedCreateAssociationList = struct - type t = FailedCreateAssociation.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map - FailedCreateAssociation.parse - (Xml.members "FailedCreateAssociationEntry" xml)) - - let to_query v = Query.to_query_list FailedCreateAssociation.to_query v - - let to_json v = `List (List.map FailedCreateAssociation.to_json v) - - let of_json j = Json.to_list FailedCreateAssociation.of_json j -end - -module CreateAssociationBatchRequestEntries = struct - type t = CreateAssociationBatchRequestEntry.t list - - let make elems () = elems - - let parse xml = - Util.option_all - (List.map CreateAssociationBatchRequestEntry.parse (Xml.members "entries" xml)) - - let to_query v = Query.to_query_list CreateAssociationBatchRequestEntry.to_query v - - let to_json v = `List (List.map CreateAssociationBatchRequestEntry.to_json v) - - let of_json j = Json.to_list CreateAssociationBatchRequestEntry.of_json j -end - -module CreateDocumentRequest = struct - type t = - { content : String.t - ; name : String.t - } - - let make ~content ~name () = { content; name } - - let parse xml = - Some - { content = - Xml.required - "Content" - (Util.option_bind (Xml.member "Content" xml) String.parse) - ; name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module AssociationFilterList = + struct + type t = AssociationFilter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AssociationFilter.parse + (Xml.members "AssociationFilter" xml)) + let to_query v = Query.to_query_list AssociationFilter.to_query v + let to_json v = `List (List.map AssociationFilter.to_json v) + let of_json j = Json.to_list AssociationFilter.of_json j + end +module AssociationList = + struct + type t = Association.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Association.parse (Xml.members "Association" xml)) + let to_query v = Query.to_query_list Association.to_query v + let to_json v = `List (List.map Association.to_json v) + let of_json j = Json.to_list Association.of_json j + end +module DocumentIdentifierList = + struct + type t = DocumentIdentifier.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DocumentIdentifier.parse + (Xml.members "DocumentIdentifier" xml)) + let to_query v = Query.to_query_list DocumentIdentifier.to_query v + let to_json v = `List (List.map DocumentIdentifier.to_json v) + let of_json j = Json.to_list DocumentIdentifier.of_json j + end +module DocumentFilterList = + struct + type t = DocumentFilter.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DocumentFilter.parse (Xml.members "DocumentFilter" xml)) + let to_query v = Query.to_query_list DocumentFilter.to_query v + let to_json v = `List (List.map DocumentFilter.to_json v) + let of_json j = Json.to_list DocumentFilter.of_json j + end +module DocumentDescription = + struct + type t = + { + sha1: String.t option ; + name: String.t option ; + created_date: DateTime.t option ; + status: DocumentStatus.t option } + let make ?sha1 ?name ?created_date ?status () = + { sha1; name; created_date; status } + let parse xml = + Some + { + sha1 = (Util.option_bind (Xml.member "Sha1" xml) String.parse); + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + created_date = + (Util.option_bind (Xml.member "CreatedDate" xml) DateTime.parse); + status = + (Util.option_bind (Xml.member "Status" xml) DocumentStatus.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> Query.Pair ("Status", (DocumentStatus.to_query f))); + Util.option_map v.created_date + (fun f -> Query.Pair ("CreatedDate", (DateTime.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f))); + Util.option_map v.sha1 + (fun f -> Query.Pair ("Sha1", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.status + (fun f -> ("status", (DocumentStatus.to_json f))); + Util.option_map v.created_date + (fun f -> ("created_date", (DateTime.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f))); + Util.option_map v.sha1 (fun f -> ("sha1", (String.to_json f)))]) + let of_json j = + { + sha1 = (Util.option_map (Json.lookup j "sha1") String.of_json); + name = (Util.option_map (Json.lookup j "name") String.of_json); + created_date = + (Util.option_map (Json.lookup j "created_date") DateTime.of_json); + status = + (Util.option_map (Json.lookup j "status") DocumentStatus.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Name", String.to_query v.name)) - ; Some (Query.Pair ("Content", String.to_query v.content)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("name", String.to_json v.name) - ; Some ("content", String.to_json v.content) - ]) - - let of_json j = - { content = String.of_json (Util.of_option_exn (Json.lookup j "content")) - ; name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - } -end - -module ListAssociationsRequest = struct - type t = - { association_filter_list : AssociationFilterList.t - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ~association_filter_list ?max_results ?next_token () = - { association_filter_list; max_results; next_token } - - let parse xml = - Some - { association_filter_list = - Xml.required - "AssociationFilterList" - (Util.option_bind - (Xml.member "AssociationFilterList" xml) - AssociationFilterList.parse) - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module AssociationDescriptionList = + struct + type t = AssociationDescription.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map AssociationDescription.parse + (Xml.members "AssociationDescription" xml)) + let to_query v = Query.to_query_list AssociationDescription.to_query v + let to_json v = `List (List.map AssociationDescription.to_json v) + let of_json j = Json.to_list AssociationDescription.of_json j + end +module FailedCreateAssociationList = + struct + type t = FailedCreateAssociation.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map FailedCreateAssociation.parse + (Xml.members "FailedCreateAssociationEntry" xml)) + let to_query v = Query.to_query_list FailedCreateAssociation.to_query v + let to_json v = `List (List.map FailedCreateAssociation.to_json v) + let of_json j = Json.to_list FailedCreateAssociation.of_json j + end +module CreateAssociationBatchRequestEntries = + struct + type t = CreateAssociationBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map CreateAssociationBatchRequestEntry.parse + (Xml.members "entries" xml)) + let to_query v = + Query.to_query_list CreateAssociationBatchRequestEntry.to_query v + let to_json v = + `List (List.map CreateAssociationBatchRequestEntry.to_json v) + let of_json j = Json.to_list CreateAssociationBatchRequestEntry.of_json j + end +module CreateDocumentRequest = + struct + type t = { + content: String.t ; + name: String.t } + let make ~content ~name () = { content; name } + let parse xml = + Some + { + content = + (Xml.required "Content" + (Util.option_bind (Xml.member "Content" xml) String.parse)); + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name))); + Some (Query.Pair ("Content", (String.to_query v.content)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("name", (String.to_json v.name)); + Some ("content", (String.to_json v.content))]) + let of_json j = + { + content = + (String.of_json (Util.of_option_exn (Json.lookup j "content"))); + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some + end +module ListAssociationsRequest = + struct + type t = + { + association_filter_list: AssociationFilterList.t ; + max_results: Integer.t option ; + next_token: String.t option } + let make ~association_filter_list ?max_results ?next_token () = + { association_filter_list; max_results; next_token } + let parse xml = + Some + { + association_filter_list = + (Xml.required "AssociationFilterList" + (Util.option_bind (Xml.member "AssociationFilterList" xml) + AssociationFilterList.parse)); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair - ( "AssociationFilterList.member" - , AssociationFilterList.to_query v.association_filter_list )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some - ( "association_filter_list" - , AssociationFilterList.to_json v.association_filter_list ) - ]) - - let of_json j = - { association_filter_list = - AssociationFilterList.of_json - (Util.of_option_exn (Json.lookup j "association_filter_list")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module MaxDocumentSizeExceeded = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module UpdateAssociationStatusResult = struct - type t = { association_description : AssociationDescription.t option } - - let make ?association_description () = { association_description } - - let parse xml = - Some - { association_description = - Util.option_bind - (Xml.member "AssociationDescription" xml) - AssociationDescription.parse + ("AssociationFilterList.member", + (AssociationFilterList.to_query v.association_filter_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some + ("association_filter_list", + (AssociationFilterList.to_json v.association_filter_list))]) + let of_json j = + { + association_filter_list = + (AssociationFilterList.of_json + (Util.of_option_exn (Json.lookup j "association_filter_list"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - Query.Pair ("AssociationDescription", AssociationDescription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - "association_description", AssociationDescription.to_json f) - ]) - - let of_json j = - { association_description = - Util.option_map - (Json.lookup j "association_description") - AssociationDescription.of_json - } -end - -module InvalidInstanceId = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListAssociationsResult = struct - type t = - { associations : AssociationList.t - ; next_token : String.t option - } - - let make ?(associations = []) ?next_token () = { associations; next_token } - - let parse xml = - Some - { associations = - Util.of_option - [] - (Util.option_bind (Xml.member "Associations" xml) AssociationList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module MaxDocumentSizeExceeded = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module UpdateAssociationStatusResult = + struct + type t = { + association_description: AssociationDescription.t option } + let make ?association_description () = { association_description } + let parse xml = + Some + { + association_description = + (Util.option_bind (Xml.member "AssociationDescription" xml) + AssociationDescription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + Query.Pair + ("AssociationDescription", + (AssociationDescription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + ("association_description", + (AssociationDescription.to_json f)))]) + let of_json j = + { + association_description = + (Util.option_map (Json.lookup j "association_description") + AssociationDescription.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some - (Query.Pair ("Associations.member", AssociationList.to_query v.associations)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some ("associations", AssociationList.to_json v.associations) - ]) - - let of_json j = - { associations = - AssociationList.of_json (Util.of_option_exn (Json.lookup j "associations")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module AssociatedInstances = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDocumentRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module DocumentAlreadyExists = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeAssociationResult = struct - type t = { association_description : AssociationDescription.t option } - - let make ?association_description () = { association_description } - - let parse xml = - Some - { association_description = - Util.option_bind - (Xml.member "AssociationDescription" xml) - AssociationDescription.parse + end +module InvalidInstanceId = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListAssociationsResult = + struct + type t = { + associations: AssociationList.t ; + next_token: String.t option } + let make ?(associations= []) ?next_token () = + { associations; next_token } + let parse xml = + Some + { + associations = + (Util.of_option [] + (Util.option_bind (Xml.member "Associations" xml) + AssociationList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some + (Query.Pair + ("Associations.member", + (AssociationList.to_query v.associations)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some ("associations", (AssociationList.to_json v.associations))]) + let of_json j = + { + associations = + (AssociationList.of_json + (Util.of_option_exn (Json.lookup j "associations"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - Query.Pair ("AssociationDescription", AssociationDescription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - "association_description", AssociationDescription.to_json f) - ]) - - let of_json j = - { association_description = - Util.option_map - (Json.lookup j "association_description") - AssociationDescription.of_json - } -end - -module ListDocumentsResult = struct - type t = - { document_identifiers : DocumentIdentifierList.t - ; next_token : String.t option - } - - let make ?(document_identifiers = []) ?next_token () = - { document_identifiers; next_token } - - let parse xml = - Some - { document_identifiers = - Util.of_option - [] - (Util.option_bind - (Xml.member "DocumentIdentifiers" xml) - DocumentIdentifierList.parse) - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse + end +module AssociatedInstances = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDocumentRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module DocumentAlreadyExists = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeAssociationResult = + struct + type t = { + association_description: AssociationDescription.t option } + let make ?association_description () = { association_description } + let parse xml = + Some + { + association_description = + (Util.option_bind (Xml.member "AssociationDescription" xml) + AssociationDescription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + Query.Pair + ("AssociationDescription", + (AssociationDescription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + ("association_description", + (AssociationDescription.to_json f)))]) + let of_json j = + { + association_description = + (Util.option_map (Json.lookup j "association_description") + AssociationDescription.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Some + end +module ListDocumentsResult = + struct + type t = + { + document_identifiers: DocumentIdentifierList.t ; + next_token: String.t option } + let make ?(document_identifiers= []) ?next_token () = + { document_identifiers; next_token } + let parse xml = + Some + { + document_identifiers = + (Util.of_option [] + (Util.option_bind (Xml.member "DocumentIdentifiers" xml) + DocumentIdentifierList.parse)); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Some (Query.Pair - ( "DocumentIdentifiers.member" - , DocumentIdentifierList.to_query v.document_identifiers )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Some - ( "document_identifiers" - , DocumentIdentifierList.to_json v.document_identifiers ) - ]) - - let of_json j = - { document_identifiers = - DocumentIdentifierList.of_json - (Util.of_option_exn (Json.lookup j "document_identifiers")) - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module DescribeAssociationRequest = struct - type t = - { name : String.t - ; instance_id : String.t - } - - let make ~name ~instance_id () = { name; instance_id } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + ("DocumentIdentifiers.member", + (DocumentIdentifierList.to_query v.document_identifiers)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Some + ("document_identifiers", + (DocumentIdentifierList.to_json v.document_identifiers))]) + let of_json j = + { + document_identifiers = + (DocumentIdentifierList.of_json + (Util.of_option_exn (Json.lookup j "document_identifiers"))); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module AssociationDoesNotExist = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDocumentRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module DescribeAssociationRequest = + struct + type t = { + name: String.t ; + instance_id: String.t } + let make ~name ~instance_id () = { name; instance_id } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module CreateAssociationRequest = struct - type t = - { name : String.t - ; instance_id : String.t - } - - let make ~name ~instance_id () = { name; instance_id } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + end +module AssociationDoesNotExist = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDocumentRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module CreateAssociationRequest = + struct + type t = { + name: String.t ; + instance_id: String.t } + let make ~name ~instance_id () = { name; instance_id } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module DeleteAssociationResult = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module ListDocumentsRequest = struct - type t = - { document_filter_list : DocumentFilterList.t - ; max_results : Integer.t option - ; next_token : String.t option - } - - let make ?(document_filter_list = []) ?max_results ?next_token () = - { document_filter_list; max_results; next_token } - - let parse xml = - Some - { document_filter_list = - Util.of_option - [] - (Util.option_bind - (Xml.member "DocumentFilterList" xml) - DocumentFilterList.parse) - ; max_results = Util.option_bind (Xml.member "MaxResults" xml) Integer.parse - ; next_token = Util.option_bind (Xml.member "NextToken" xml) String.parse - } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> - Query.Pair ("NextToken", String.to_query f)) - ; Util.option_map v.max_results (fun f -> - Query.Pair ("MaxResults", Integer.to_query f)) - ; Some + end +module DeleteAssociationResult = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListDocumentsRequest = + struct + type t = + { + document_filter_list: DocumentFilterList.t ; + max_results: Integer.t option ; + next_token: String.t option } + let make ?(document_filter_list= []) ?max_results ?next_token () = + { document_filter_list; max_results; next_token } + let parse xml = + Some + { + document_filter_list = + (Util.of_option [] + (Util.option_bind (Xml.member "DocumentFilterList" xml) + DocumentFilterList.parse)); + max_results = + (Util.option_bind (Xml.member "MaxResults" xml) Integer.parse); + next_token = + (Util.option_bind (Xml.member "NextToken" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> Query.Pair ("NextToken", (String.to_query f))); + Util.option_map v.max_results + (fun f -> Query.Pair ("MaxResults", (Integer.to_query f))); + Some (Query.Pair - ( "DocumentFilterList.member" - , DocumentFilterList.to_query v.document_filter_list )) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.next_token (fun f -> "next_token", String.to_json f) - ; Util.option_map v.max_results (fun f -> "max_results", Integer.to_json f) - ; Some ("document_filter_list", DocumentFilterList.to_json v.document_filter_list) - ]) - - let of_json j = - { document_filter_list = - DocumentFilterList.of_json - (Util.of_option_exn (Json.lookup j "document_filter_list")) - ; max_results = Util.option_map (Json.lookup j "max_results") Integer.of_json - ; next_token = Util.option_map (Json.lookup j "next_token") String.of_json - } -end - -module InternalServerError = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AssociationLimitExceeded = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DescribeDocumentResult = struct - type t = { document : DocumentDescription.t option } - - let make ?document () = { document } - - let parse xml = - Some - { document = Util.option_bind (Xml.member "Document" xml) DocumentDescription.parse + ("DocumentFilterList.member", + (DocumentFilterList.to_query v.document_filter_list)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.next_token + (fun f -> ("next_token", (String.to_json f))); + Util.option_map v.max_results + (fun f -> ("max_results", (Integer.to_json f))); + Some + ("document_filter_list", + (DocumentFilterList.to_json v.document_filter_list))]) + let of_json j = + { + document_filter_list = + (DocumentFilterList.of_json + (Util.of_option_exn (Json.lookup j "document_filter_list"))); + max_results = + (Util.option_map (Json.lookup j "max_results") Integer.of_json); + next_token = + (Util.option_map (Json.lookup j "next_token") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.document (fun f -> - Query.Pair ("Document", DocumentDescription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.document (fun f -> "document", DocumentDescription.to_json f) - ]) - - let of_json j = - { document = Util.option_map (Json.lookup j "document") DocumentDescription.of_json } -end - -module UpdateAssociationStatusRequest = struct - type t = - { name : String.t - ; instance_id : String.t - ; association_status : AssociationStatus.t - } - - let make ~name ~instance_id ~association_status () = - { name; instance_id; association_status } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) - ; association_status = - Xml.required - "AssociationStatus" - (Util.option_bind - (Xml.member "AssociationStatus" xml) - AssociationStatus.parse) + end +module InternalServerError = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AssociationLimitExceeded = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DescribeDocumentResult = + struct + type t = { + document: DocumentDescription.t option } + let make ?document () = { document } + let parse xml = + Some + { + document = + (Util.option_bind (Xml.member "Document" xml) + DocumentDescription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.document + (fun f -> + Query.Pair ("Document", (DocumentDescription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.document + (fun f -> ("document", (DocumentDescription.to_json f)))]) + let of_json j = + { + document = + (Util.option_map (Json.lookup j "document") + DocumentDescription.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("AssociationStatus", AssociationStatus.to_query v.association_status)) - ; Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("association_status", AssociationStatus.to_json v.association_status) - ; Some ("instance_id", String.to_json v.instance_id) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - ; association_status = - AssociationStatus.of_json - (Util.of_option_exn (Json.lookup j "association_status")) - } -end - -module InvalidNextToken = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module InvalidDocument = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module AssociationAlreadyExists = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module GetDocumentResult = struct - type t = - { name : String.t option - ; content : String.t option - } - - let make ?name ?content () = { name; content } - - let parse xml = - Some - { name = Util.option_bind (Xml.member "Name" xml) String.parse - ; content = Util.option_bind (Xml.member "Content" xml) String.parse + end +module UpdateAssociationStatusRequest = + struct + type t = + { + name: String.t ; + instance_id: String.t ; + association_status: AssociationStatus.t } + let make ~name ~instance_id ~association_status () = + { name; instance_id; association_status } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)); + association_status = + (Xml.required "AssociationStatus" + (Util.option_bind (Xml.member "AssociationStatus" xml) + AssociationStatus.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AssociationStatus", + (AssociationStatus.to_query v.association_status))); + Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("association_status", + (AssociationStatus.to_json v.association_status)); + Some ("instance_id", (String.to_json v.instance_id)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))); + association_status = + (AssociationStatus.of_json + (Util.of_option_exn (Json.lookup j "association_status"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.content (fun f -> Query.Pair ("Content", String.to_query f)) - ; Util.option_map v.name (fun f -> Query.Pair ("Name", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.content (fun f -> "content", String.to_json f) - ; Util.option_map v.name (fun f -> "name", String.to_json f) - ]) - - let of_json j = - { name = Util.option_map (Json.lookup j "name") String.of_json - ; content = Util.option_map (Json.lookup j "content") String.of_json - } -end - -module TooManyUpdates = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateAssociationBatchResult = struct - type t = - { successful : AssociationDescriptionList.t - ; failed : FailedCreateAssociationList.t - } - - let make ?(successful = []) ?(failed = []) () = { successful; failed } - - let parse xml = - Some - { successful = - Util.of_option - [] - (Util.option_bind - (Xml.member "Successful" xml) - AssociationDescriptionList.parse) - ; failed = - Util.of_option - [] - (Util.option_bind (Xml.member "Failed" xml) FailedCreateAssociationList.parse) + end +module InvalidNextToken = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module InvalidDocument = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module AssociationAlreadyExists = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetDocumentResult = + struct + type t = { + name: String.t option ; + content: String.t option } + let make ?name ?content () = { name; content } + let parse xml = + Some + { + name = (Util.option_bind (Xml.member "Name" xml) String.parse); + content = + (Util.option_bind (Xml.member "Content" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.content + (fun f -> Query.Pair ("Content", (String.to_query f))); + Util.option_map v.name + (fun f -> Query.Pair ("Name", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.content + (fun f -> ("content", (String.to_json f))); + Util.option_map v.name (fun f -> ("name", (String.to_json f)))]) + let of_json j = + { + name = (Util.option_map (Json.lookup j "name") String.of_json); + content = (Util.option_map (Json.lookup j "content") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair ("Failed.member", FailedCreateAssociationList.to_query v.failed)) - ; Some + end +module TooManyUpdates = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateAssociationBatchResult = + struct + type t = + { + successful: AssociationDescriptionList.t ; + failed: FailedCreateAssociationList.t } + let make ?(successful= []) ?(failed= []) () = { successful; failed } + let parse xml = + Some + { + successful = + (Util.of_option [] + (Util.option_bind (Xml.member "Successful" xml) + AssociationDescriptionList.parse)); + failed = + (Util.of_option [] + (Util.option_bind (Xml.member "Failed" xml) + FailedCreateAssociationList.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (FailedCreateAssociationList.to_query v.failed))); + Some (Query.Pair - ("Successful.member", AssociationDescriptionList.to_query v.successful)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("failed", FailedCreateAssociationList.to_json v.failed) - ; Some ("successful", AssociationDescriptionList.to_json v.successful) - ]) - - let of_json j = - { successful = - AssociationDescriptionList.of_json - (Util.of_option_exn (Json.lookup j "successful")) - ; failed = - FailedCreateAssociationList.of_json (Util.of_option_exn (Json.lookup j "failed")) - } -end - -module CreateDocumentResult = struct - type t = { document_description : DocumentDescription.t option } - - let make ?document_description () = { document_description } - - let parse xml = - Some - { document_description = - Util.option_bind - (Xml.member "DocumentDescription" xml) - DocumentDescription.parse + ("Successful.member", + (AssociationDescriptionList.to_query v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (FailedCreateAssociationList.to_json v.failed)); + Some + ("successful", + (AssociationDescriptionList.to_json v.successful))]) + let of_json j = + { + successful = + (AssociationDescriptionList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (FailedCreateAssociationList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.document_description (fun f -> - Query.Pair ("DocumentDescription", DocumentDescription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.document_description (fun f -> - "document_description", DocumentDescription.to_json f) - ]) - - let of_json j = - { document_description = - Util.option_map (Json.lookup j "document_description") DocumentDescription.of_json - } -end - -module DocumentLimitExceeded = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module DeleteDocumentResult = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateAssociationBatchRequest = struct - type t = { entries : CreateAssociationBatchRequestEntries.t } - - let make ~entries () = { entries } - - let parse xml = - Some - { entries = - Xml.required - "Entries" - (Util.option_bind - (Xml.member "Entries" xml) - CreateAssociationBatchRequestEntries.parse) + end +module CreateDocumentResult = + struct + type t = { + document_description: DocumentDescription.t option } + let make ?document_description () = { document_description } + let parse xml = + Some + { + document_description = + (Util.option_bind (Xml.member "DocumentDescription" xml) + DocumentDescription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.document_description + (fun f -> + Query.Pair + ("DocumentDescription", (DocumentDescription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.document_description + (fun f -> + ("document_description", (DocumentDescription.to_json f)))]) + let of_json j = + { + document_description = + (Util.option_map (Json.lookup j "document_description") + DocumentDescription.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some - (Query.Pair - ("Entries.member", CreateAssociationBatchRequestEntries.to_query v.entries)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("entries", CreateAssociationBatchRequestEntries.to_json v.entries) ]) - - let of_json j = - { entries = - CreateAssociationBatchRequestEntries.of_json - (Util.of_option_exn (Json.lookup j "entries")) - } -end - -module GetDocumentRequest = struct - type t = { name : String.t } - - let make ~name () = { name } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) + end +module DocumentLimitExceeded = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteDocumentResult = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateAssociationBatchRequest = + struct + type t = { + entries: CreateAssociationBatchRequestEntries.t } + let make ~entries () = { entries } + let parse xml = + Some + { + entries = + (Xml.required "Entries" + (Util.option_bind (Xml.member "Entries" xml) + CreateAssociationBatchRequestEntries.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (CreateAssociationBatchRequestEntries.to_query v.entries)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (CreateAssociationBatchRequestEntries.to_json v.entries))]) + let of_json j = + { + entries = + (CreateAssociationBatchRequestEntries.of_json + (Util.of_option_exn (Json.lookup j "entries"))) } - - let to_query v = - Query.List - (Util.list_filter_opt [ Some (Query.Pair ("Name", String.to_query v.name)) ]) - - let to_json v = `Assoc (Util.list_filter_opt [ Some ("name", String.to_json v.name) ]) - - let of_json j = { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) } -end - -module StatusUnchanged = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end - -module CreateAssociationResult = struct - type t = { association_description : AssociationDescription.t option } - - let make ?association_description () = { association_description } - - let parse xml = - Some - { association_description = - Util.option_bind - (Xml.member "AssociationDescription" xml) - AssociationDescription.parse + end +module GetDocumentRequest = + struct + type t = { + name: String.t } + let make ~name () = { name } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("name", (String.to_json v.name))]) + let of_json j = + { name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))) } + end +module StatusUnchanged = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateAssociationResult = + struct + type t = { + association_description: AssociationDescription.t option } + let make ?association_description () = { association_description } + let parse xml = + Some + { + association_description = + (Util.option_bind (Xml.member "AssociationDescription" xml) + AssociationDescription.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + Query.Pair + ("AssociationDescription", + (AssociationDescription.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.association_description + (fun f -> + ("association_description", + (AssociationDescription.to_json f)))]) + let of_json j = + { + association_description = + (Util.option_map (Json.lookup j "association_description") + AssociationDescription.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - Query.Pair ("AssociationDescription", AssociationDescription.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.association_description (fun f -> - "association_description", AssociationDescription.to_json f) - ]) - - let of_json j = - { association_description = - Util.option_map - (Json.lookup j "association_description") - AssociationDescription.of_json - } -end - -module InvalidDocumentContent = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DeleteAssociationRequest = struct - type t = - { name : String.t - ; instance_id : String.t - } - - let make ~name ~instance_id () = { name; instance_id } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; instance_id = - Xml.required - "InstanceId" - (Util.option_bind (Xml.member "InstanceId" xml) String.parse) + end +module InvalidDocumentContent = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module DeleteAssociationRequest = + struct + type t = { + name: String.t ; + instance_id: String.t } + let make ~name ~instance_id () = { name; instance_id } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + instance_id = + (Xml.required "InstanceId" + (Util.option_bind (Xml.member "InstanceId" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("InstanceId", (String.to_query v.instance_id))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("instance_id", (String.to_json v.instance_id)); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + instance_id = + (String.of_json (Util.of_option_exn (Json.lookup j "instance_id"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("InstanceId", String.to_query v.instance_id)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("instance_id", String.to_json v.instance_id) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; instance_id = String.of_json (Util.of_option_exn (Json.lookup j "instance_id")) - } -end - -module DuplicateInstanceId = struct - type t = unit - - let make () = () - - let parse xml = Some () - - let to_query v = Query.List (Util.list_filter_opt []) - - let to_json v = `Assoc (Util.list_filter_opt []) - - let of_json j = () -end + end +module DuplicateInstanceId = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end \ No newline at end of file diff --git a/libraries/ssm/lib/updateAssociationStatus.ml b/libraries/ssm/lib/updateAssociationStatus.ml index 3b779d5c0..08f185345 100644 --- a/libraries/ssm/lib/updateAssociationStatus.ml +++ b/libraries/ssm/lib/updateAssociationStatus.ml @@ -1,26 +1,21 @@ open Types open Aws - type input = UpdateAssociationStatusRequest.t - type output = UpdateAssociationStatusResult.t - type error = Errors_internal.t - let service = "ssm" - 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", [ "2014-11-06" ]; "Action", [ "UpdateAssociationStatus" ] ] + [("Version", ["2014-11-06"]); + ("Action", ["UpdateAssociationStatus"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (UpdateAssociationStatusRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (UpdateAssociationStatusRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in @@ -29,41 +24,43 @@ let of_http body = Util.or_error (Util.option_bind resp UpdateAssociationStatusResult.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed UpdateAssociationStatusResult." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed UpdateAssociationStatusResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing UpdateAssociationStatusResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing UpdateAssociationStatusResult - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.TooManyUpdates - ; Errors_internal.StatusUnchanged - ; Errors_internal.AssociationDoesNotExist - ; Errors_internal.InvalidDocument - ; Errors_internal.InvalidInstanceId - ; Errors_internal.InternalServerError - ] - @ Errors_internal.common - in + [Errors_internal.TooManyUpdates; + Errors_internal.StatusUnchanged; + Errors_internal.AssociationDoesNotExist; + Errors_internal.InvalidDocument; + Errors_internal.InvalidInstanceId; + Errors_internal.InternalServerError] @ 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 \ No newline at end of file diff --git a/libraries/ssm/lib/updateAssociationStatus.mli b/libraries/ssm/lib/updateAssociationStatus.mli index 5d9fdc2cb..4f71420fe 100644 --- a/libraries/ssm/lib/updateAssociationStatus.mli +++ b/libraries/ssm/lib/updateAssociationStatus.mli @@ -1,10 +1,7 @@ open Types - type input = UpdateAssociationStatusRequest.t - type output = UpdateAssociationStatusResult.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 \ No newline at end of file diff --git a/libraries/ssm/lib_test/dune b/libraries/ssm/lib_test/dune index bacc1771a..bb88ae8da 100644 --- a/libraries/ssm/lib_test/dune +++ b/libraries/ssm/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_ssm_test) - (libraries aws aws_ssm aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_ssm aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/ssm/lib_test/test_async.ml b/libraries/ssm/lib_test/test_async.ml index f256e0f51..7318d9718 100644 --- a/libraries/ssm/lib_test/test_async.ml +++ b/libraries/ssm/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_ssm_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/ssm/lib_test/test_lwt.ml b/libraries/ssm/lib_test/test_lwt.ml index 59778c0f5..a5f01ae34 100644 --- a/libraries/ssm/lib_test/test_lwt.ml +++ b/libraries/ssm/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_ssm_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/sts/lib/assumeRole.ml b/libraries/sts/lib/assumeRole.ml index bb4ae8530..3f9295446 100644 --- a/libraries/sts/lib/assumeRole.ml +++ b/libraries/sts/lib/assumeRole.ml @@ -1,64 +1,60 @@ open Types open Aws - type input = AssumeRoleRequest.t - type output = AssumeRoleResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "AssumeRole" ] ] + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2011-06-15"]); ("Action", ["AssumeRole"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AssumeRoleRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AssumeRoleRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "AssumeRoleResponse" (snd xml)) - (Xml.member "AssumeRoleResult") - in + Util.option_bind (Xml.member "AssumeRoleResponse" (snd xml)) + (Xml.member "AssumeRoleResult") in try - Util.or_error - (Util.option_bind resp AssumeRoleResponse.parse) + Util.or_error (Util.option_bind resp AssumeRoleResponse.parse) (let open Error in - BadResponse { body; message = "Could not find well formed AssumeRoleResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = "Could not find well formed AssumeRoleResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssumeRoleResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssumeRoleResponse - missing field in body or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.PackedPolicyTooLarge; Errors_internal.MalformedPolicyDocument ] - @ Errors_internal.common - in + [Errors_internal.PackedPolicyTooLarge; + Errors_internal.MalformedPolicyDocument] @ 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 \ No newline at end of file diff --git a/libraries/sts/lib/assumeRole.mli b/libraries/sts/lib/assumeRole.mli index efa247ab8..2a5d8c680 100644 --- a/libraries/sts/lib/assumeRole.mli +++ b/libraries/sts/lib/assumeRole.mli @@ -1,10 +1,7 @@ open Types - type input = AssumeRoleRequest.t - type output = AssumeRoleResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/assumeRoleWithSAML.ml b/libraries/sts/lib/assumeRoleWithSAML.ml index 760f55008..15f24ea3c 100644 --- a/libraries/sts/lib/assumeRoleWithSAML.ml +++ b/libraries/sts/lib/assumeRoleWithSAML.ml @@ -1,71 +1,65 @@ open Types open Aws - type input = AssumeRoleWithSAMLRequest.t - type output = AssumeRoleWithSAMLResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "AssumeRoleWithSAML" ] ] + [("Version", ["2011-06-15"]); ("Action", ["AssumeRoleWithSAML"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (AssumeRoleWithSAMLRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (AssumeRoleWithSAMLRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "AssumeRoleWithSAMLResponse" (snd xml)) - (Xml.member "AssumeRoleWithSAMLResult") - in + Util.option_bind (Xml.member "AssumeRoleWithSAMLResponse" (snd xml)) + (Xml.member "AssumeRoleWithSAMLResult") in try - Util.or_error - (Util.option_bind resp AssumeRoleWithSAMLResponse.parse) + Util.or_error (Util.option_bind resp AssumeRoleWithSAMLResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed AssumeRoleWithSAMLResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AssumeRoleWithSAMLResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssumeRoleWithSAMLResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssumeRoleWithSAMLResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ExpiredTokenException - ; Errors_internal.InvalidIdentityToken - ; Errors_internal.IDPRejectedClaim - ; Errors_internal.PackedPolicyTooLarge - ; Errors_internal.MalformedPolicyDocument - ] - @ Errors_internal.common - in + [Errors_internal.ExpiredTokenException; + Errors_internal.InvalidIdentityToken; + Errors_internal.IDPRejectedClaim; + Errors_internal.PackedPolicyTooLarge; + Errors_internal.MalformedPolicyDocument] @ 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 \ No newline at end of file diff --git a/libraries/sts/lib/assumeRoleWithSAML.mli b/libraries/sts/lib/assumeRoleWithSAML.mli index 13cde49b3..ae65f48b0 100644 --- a/libraries/sts/lib/assumeRoleWithSAML.mli +++ b/libraries/sts/lib/assumeRoleWithSAML.mli @@ -1,10 +1,7 @@ open Types - type input = AssumeRoleWithSAMLRequest.t - type output = AssumeRoleWithSAMLResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/assumeRoleWithWebIdentity.ml b/libraries/sts/lib/assumeRoleWithWebIdentity.ml index 58f559bae..307e7df93 100644 --- a/libraries/sts/lib/assumeRoleWithWebIdentity.ml +++ b/libraries/sts/lib/assumeRoleWithWebIdentity.ml @@ -1,75 +1,69 @@ open Types open Aws - type input = AssumeRoleWithWebIdentityRequest.t - type output = AssumeRoleWithWebIdentityResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "AssumeRoleWithWebIdentity" ] ] + [("Version", ["2011-06-15"]); + ("Action", ["AssumeRoleWithWebIdentity"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (AssumeRoleWithWebIdentityRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (AssumeRoleWithWebIdentityRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "AssumeRoleWithWebIdentityResponse" (snd xml)) - (Xml.member "AssumeRoleWithWebIdentityResult") - in + (Xml.member "AssumeRoleWithWebIdentityResult") in try Util.or_error (Util.option_bind resp AssumeRoleWithWebIdentityResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed AssumeRoleWithWebIdentityResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed AssumeRoleWithWebIdentityResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing AssumeRoleWithWebIdentityResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing AssumeRoleWithWebIdentityResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.ExpiredTokenException - ; Errors_internal.InvalidIdentityToken - ; Errors_internal.IDPCommunicationError - ; Errors_internal.IDPRejectedClaim - ; Errors_internal.PackedPolicyTooLarge - ; Errors_internal.MalformedPolicyDocument - ] - @ Errors_internal.common - in + [Errors_internal.ExpiredTokenException; + Errors_internal.InvalidIdentityToken; + Errors_internal.IDPCommunicationError; + Errors_internal.IDPRejectedClaim; + Errors_internal.PackedPolicyTooLarge; + Errors_internal.MalformedPolicyDocument] @ 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 \ No newline at end of file diff --git a/libraries/sts/lib/assumeRoleWithWebIdentity.mli b/libraries/sts/lib/assumeRoleWithWebIdentity.mli index 8061114c8..59dd5d362 100644 --- a/libraries/sts/lib/assumeRoleWithWebIdentity.mli +++ b/libraries/sts/lib/assumeRoleWithWebIdentity.mli @@ -1,10 +1,7 @@ open Types - type input = AssumeRoleWithWebIdentityRequest.t - type output = AssumeRoleWithWebIdentityResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/decodeAuthorizationMessage.ml b/libraries/sts/lib/decodeAuthorizationMessage.ml index 8af30211f..fb5d07ebc 100644 --- a/libraries/sts/lib/decodeAuthorizationMessage.ml +++ b/libraries/sts/lib/decodeAuthorizationMessage.ml @@ -1,68 +1,65 @@ open Types open Aws - type input = DecodeAuthorizationMessageRequest.t - type output = DecodeAuthorizationMessageResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "DecodeAuthorizationMessage" ] ] + [("Version", ["2011-06-15"]); + ("Action", ["DecodeAuthorizationMessage"])] (Util.drop_empty (Uri.query_of_encoded - (Query.render (DecodeAuthorizationMessageRequest.to_query req))))) - in - `POST, uri, [] - + (Query.render (DecodeAuthorizationMessageRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = Util.option_bind (Xml.member "DecodeAuthorizationMessageResponse" (snd xml)) - (Xml.member "DecodeAuthorizationMessageResult") - in + (Xml.member "DecodeAuthorizationMessageResult") in try Util.or_error (Util.option_bind resp DecodeAuthorizationMessageResponse.parse) (let open Error in - BadResponse - { body - ; message = "Could not find well formed DecodeAuthorizationMessageResponse." - }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed DecodeAuthorizationMessageResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DecodeAuthorizationMessageResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing DecodeAuthorizationMessageResponse - missing field in body \ - or children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.InvalidAuthorizationMessageException ] @ Errors_internal.common - in + [Errors_internal.InvalidAuthorizationMessageException] @ + 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 \ No newline at end of file diff --git a/libraries/sts/lib/decodeAuthorizationMessage.mli b/libraries/sts/lib/decodeAuthorizationMessage.mli index ac87a62f1..135cf1f35 100644 --- a/libraries/sts/lib/decodeAuthorizationMessage.mli +++ b/libraries/sts/lib/decodeAuthorizationMessage.mli @@ -1,10 +1,7 @@ open Types - type input = DecodeAuthorizationMessageRequest.t - type output = DecodeAuthorizationMessageResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/dune b/libraries/sts/lib/dune index 524776c72..eb5e38f2d 100644 --- a/libraries/sts/lib/dune +++ b/libraries/sts/lib/dune @@ -1,7 +1,6 @@ (library - (name aws_sts) + (name aws_sts) (public_name aws-sts) (synopsis "aws-AWS Security Token Service") - (flags - (:standard -w -27)) + (flags (:standard -w -27)) (libraries aws)) diff --git a/libraries/sts/lib/errors_internal.ml b/libraries/sts/lib/errors_internal.ml index d494c7934..457727dab 100644 --- a/libraries/sts/lib/errors_internal.ml +++ b/libraries/sts/lib/errors_internal.ml @@ -1,68 +1,65 @@ type t = - | AuthFailure - | Blocked - | DryRunOperation - | ExpiredTokenException - | IDPCommunicationError - | IDPRejectedClaim - | IdempotentParameterMismatch - | IncompleteSignature - | InternalFailure - | InvalidAction - | InvalidAuthorizationMessageException - | InvalidClientTokenId - | InvalidIdentityToken - | InvalidParameter - | InvalidParameterCombination - | InvalidParameterValue - | InvalidQueryParameter - | MalformedPolicyDocument - | MalformedQueryString - | MissingAction - | MissingAuthenticationToken - | MissingParameter - | OptInRequired - | PackedPolicyTooLarge - | PendingVerification - | RequestExpired - | RequestLimitExceeded - | ServiceUnavailable - | Throttling - | UnauthorizedOperation - | UnknownParameter - | UnsupportedProtocol - | ValidationError - | Uninhabited - + | AuthFailure + | Blocked + | DryRunOperation + | ExpiredTokenException + | IDPCommunicationError + | IDPRejectedClaim + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidAuthorizationMessageException + | InvalidClientTokenId + | InvalidIdentityToken + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | MalformedPolicyDocument + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | PackedPolicyTooLarge + | PendingVerification + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited let common = - [ UnsupportedProtocol - ; UnknownParameter - ; UnauthorizedOperation - ; RequestLimitExceeded - ; PendingVerification - ; InvalidParameter - ; IdempotentParameterMismatch - ; DryRunOperation - ; Blocked - ; AuthFailure - ; ValidationError - ; Throttling - ; ServiceUnavailable - ; RequestExpired - ; OptInRequired - ; MissingParameter - ; MissingAuthenticationToken - ; MissingAction - ; MalformedQueryString - ; InvalidQueryParameter - ; InvalidParameterValue - ; InvalidParameterCombination - ; InvalidClientTokenId - ; InvalidAction - ; InternalFailure - ; IncompleteSignature - ] - + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] let to_http_code e = match e with | AuthFailure -> None @@ -99,7 +96,6 @@ let to_http_code e = | UnsupportedProtocol -> None | ValidationError -> Some 400 | Uninhabited -> None - let to_string e = match e with | AuthFailure -> "AuthFailure" @@ -112,7 +108,8 @@ let to_string e = | IncompleteSignature -> "IncompleteSignature" | InternalFailure -> "InternalFailure" | InvalidAction -> "InvalidAction" - | InvalidAuthorizationMessageException -> "InvalidAuthorizationMessageException" + | InvalidAuthorizationMessageException -> + "InvalidAuthorizationMessageException" | InvalidClientTokenId -> "InvalidClientTokenId" | InvalidIdentityToken -> "InvalidIdentityToken" | InvalidParameter -> "InvalidParameter" @@ -136,7 +133,6 @@ let to_string e = | UnsupportedProtocol -> "UnsupportedProtocol" | ValidationError -> "ValidationError" | Uninhabited -> "Uninhabited" - let of_string e = match e with | "AuthFailure" -> Some AuthFailure @@ -149,7 +145,8 @@ let of_string e = | "IncompleteSignature" -> Some IncompleteSignature | "InternalFailure" -> Some InternalFailure | "InvalidAction" -> Some InvalidAction - | "InvalidAuthorizationMessageException" -> Some InvalidAuthorizationMessageException + | "InvalidAuthorizationMessageException" -> + Some InvalidAuthorizationMessageException | "InvalidClientTokenId" -> Some InvalidClientTokenId | "InvalidIdentityToken" -> Some InvalidIdentityToken | "InvalidParameter" -> Some InvalidParameter @@ -173,4 +170,4 @@ let of_string e = | "UnsupportedProtocol" -> Some UnsupportedProtocol | "ValidationError" -> Some ValidationError | "Uninhabited" -> Some Uninhabited - | _ -> None + | _ -> None \ No newline at end of file diff --git a/libraries/sts/lib/getFederationToken.ml b/libraries/sts/lib/getFederationToken.ml index b0854febe..e980eec71 100644 --- a/libraries/sts/lib/getFederationToken.ml +++ b/libraries/sts/lib/getFederationToken.ml @@ -1,66 +1,62 @@ open Types open Aws - type input = GetFederationTokenRequest.t - type output = GetFederationTokenResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "GetFederationToken" ] ] + [("Version", ["2011-06-15"]); ("Action", ["GetFederationToken"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetFederationTokenRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetFederationTokenRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetFederationTokenResponse" (snd xml)) - (Xml.member "GetFederationTokenResult") - in + Util.option_bind (Xml.member "GetFederationTokenResponse" (snd xml)) + (Xml.member "GetFederationTokenResult") in try - Util.or_error - (Util.option_bind resp GetFederationTokenResponse.parse) + Util.or_error (Util.option_bind resp GetFederationTokenResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetFederationTokenResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetFederationTokenResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetFederationTokenResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetFederationTokenResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) let parse_error code err = let errors = - [ Errors_internal.PackedPolicyTooLarge; Errors_internal.MalformedPolicyDocument ] - @ Errors_internal.common - in + [Errors_internal.PackedPolicyTooLarge; + Errors_internal.MalformedPolicyDocument] @ 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 \ No newline at end of file diff --git a/libraries/sts/lib/getFederationToken.mli b/libraries/sts/lib/getFederationToken.mli index 3aa27ca7e..f97a31fbc 100644 --- a/libraries/sts/lib/getFederationToken.mli +++ b/libraries/sts/lib/getFederationToken.mli @@ -1,10 +1,7 @@ open Types - type input = GetFederationTokenRequest.t - type output = GetFederationTokenResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/getSessionToken.ml b/libraries/sts/lib/getSessionToken.ml index aac1712f5..bf427f1fe 100644 --- a/libraries/sts/lib/getSessionToken.ml +++ b/libraries/sts/lib/getSessionToken.ml @@ -1,63 +1,60 @@ open Types open Aws - type input = GetSessionTokenRequest.t - type output = GetSessionTokenResponse.t - type error = Errors_internal.t - let service = "sts" - 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", [ "2011-06-15" ]; "Action", [ "GetSessionToken" ] ] + [("Version", ["2011-06-15"]); ("Action", ["GetSessionToken"])] (Util.drop_empty - (Uri.query_of_encoded (Query.render (GetSessionTokenRequest.to_query req))))) - in - `POST, uri, [] - + (Uri.query_of_encoded + (Query.render (GetSessionTokenRequest.to_query req))))) in + (`POST, uri, []) let of_http body = try let xml = Ezxmlm.from_string body in let resp = - Util.option_bind - (Xml.member "GetSessionTokenResponse" (snd xml)) - (Xml.member "GetSessionTokenResult") - in + Util.option_bind (Xml.member "GetSessionTokenResponse" (snd xml)) + (Xml.member "GetSessionTokenResult") in try - Util.or_error - (Util.option_bind resp GetSessionTokenResponse.parse) + Util.or_error (Util.option_bind resp GetSessionTokenResponse.parse) (let open Error in - BadResponse - { body; message = "Could not find well formed GetSessionTokenResponse." }) - with Xml.RequiredFieldMissing msg -> - let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetSessionTokenResponse." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetSessionTokenResponse - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> `Error - (BadResponse - { body - ; message = - "Error parsing GetSessionTokenResponse - missing field in body or \ - children: " - ^ msg - }) - with Failure msg -> - `Error - (let open Error in - BadResponse { body; message = "Error parsing xml: " ^ msg }) - + (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 + 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 \ No newline at end of file diff --git a/libraries/sts/lib/getSessionToken.mli b/libraries/sts/lib/getSessionToken.mli index 732607b28..480545b7b 100644 --- a/libraries/sts/lib/getSessionToken.mli +++ b/libraries/sts/lib/getSessionToken.mli @@ -1,10 +1,7 @@ open Types - type input = GetSessionTokenRequest.t - type output = GetSessionTokenResponse.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 \ No newline at end of file diff --git a/libraries/sts/lib/types.ml b/libraries/sts/lib/types.ml index 04db16f89..3413cd9e1 100644 --- a/libraries/sts/lib/types.ml +++ b/libraries/sts/lib/types.ml @@ -1,976 +1,1038 @@ open Aws open Aws.BaseTypes open CalendarLib - type calendar = Calendar.t - -module Credentials = struct - type t = - { access_key_id : String.t - ; secret_access_key : String.t - ; session_token : String.t - ; expiration : DateTime.t - } - - let make ~access_key_id ~secret_access_key ~session_token ~expiration () = - { access_key_id; secret_access_key; session_token; expiration } - - let parse xml = - Some - { access_key_id = - Xml.required - "AccessKeyId" - (Util.option_bind (Xml.member "AccessKeyId" xml) String.parse) - ; secret_access_key = - Xml.required - "SecretAccessKey" - (Util.option_bind (Xml.member "SecretAccessKey" xml) String.parse) - ; session_token = - Xml.required - "SessionToken" - (Util.option_bind (Xml.member "SessionToken" xml) String.parse) - ; expiration = - Xml.required - "Expiration" - (Util.option_bind (Xml.member "Expiration" xml) DateTime.parse) +module Credentials = + struct + type t = + { + access_key_id: String.t ; + secret_access_key: String.t ; + session_token: String.t ; + expiration: DateTime.t } + let make ~access_key_id ~secret_access_key ~session_token ~expiration + () = { access_key_id; secret_access_key; session_token; expiration } + let parse xml = + Some + { + access_key_id = + (Xml.required "AccessKeyId" + (Util.option_bind (Xml.member "AccessKeyId" xml) String.parse)); + secret_access_key = + (Xml.required "SecretAccessKey" + (Util.option_bind (Xml.member "SecretAccessKey" xml) + String.parse)); + session_token = + (Xml.required "SessionToken" + (Util.option_bind (Xml.member "SessionToken" xml) String.parse)); + expiration = + (Xml.required "Expiration" + (Util.option_bind (Xml.member "Expiration" xml) DateTime.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Expiration", (DateTime.to_query v.expiration))); + Some + (Query.Pair ("SessionToken", (String.to_query v.session_token))); + Some + (Query.Pair + ("SecretAccessKey", (String.to_query v.secret_access_key))); + Some + (Query.Pair ("AccessKeyId", (String.to_query v.access_key_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("expiration", (DateTime.to_json v.expiration)); + Some ("session_token", (String.to_json v.session_token)); + Some ("secret_access_key", (String.to_json v.secret_access_key)); + Some ("access_key_id", (String.to_json v.access_key_id))]) + let of_json j = + { + access_key_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "access_key_id"))); + secret_access_key = + (String.of_json + (Util.of_option_exn (Json.lookup j "secret_access_key"))); + session_token = + (String.of_json + (Util.of_option_exn (Json.lookup j "session_token"))); + expiration = + (DateTime.of_json (Util.of_option_exn (Json.lookup j "expiration"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Expiration", DateTime.to_query v.expiration)) - ; Some (Query.Pair ("SessionToken", String.to_query v.session_token)) - ; Some (Query.Pair ("SecretAccessKey", String.to_query v.secret_access_key)) - ; Some (Query.Pair ("AccessKeyId", String.to_query v.access_key_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("expiration", DateTime.to_json v.expiration) - ; Some ("session_token", String.to_json v.session_token) - ; Some ("secret_access_key", String.to_json v.secret_access_key) - ; Some ("access_key_id", String.to_json v.access_key_id) - ]) - - let of_json j = - { access_key_id = String.of_json (Util.of_option_exn (Json.lookup j "access_key_id")) - ; secret_access_key = - String.of_json (Util.of_option_exn (Json.lookup j "secret_access_key")) - ; session_token = String.of_json (Util.of_option_exn (Json.lookup j "session_token")) - ; expiration = DateTime.of_json (Util.of_option_exn (Json.lookup j "expiration")) - } -end - -module FederatedUser = struct - type t = - { federated_user_id : String.t - ; arn : String.t - } - - let make ~federated_user_id ~arn () = { federated_user_id; arn } - - let parse xml = - Some - { federated_user_id = - Xml.required - "FederatedUserId" - (Util.option_bind (Xml.member "FederatedUserId" xml) String.parse) - ; arn = Xml.required "Arn" (Util.option_bind (Xml.member "Arn" xml) String.parse) + end +module FederatedUser = + struct + type t = { + federated_user_id: String.t ; + arn: String.t } + let make ~federated_user_id ~arn () = { federated_user_id; arn } + let parse xml = + Some + { + federated_user_id = + (Xml.required "FederatedUserId" + (Util.option_bind (Xml.member "FederatedUserId" xml) + String.parse)); + arn = + (Xml.required "Arn" + (Util.option_bind (Xml.member "Arn" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Arn", (String.to_query v.arn))); + Some + (Query.Pair + ("FederatedUserId", (String.to_query v.federated_user_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("arn", (String.to_json v.arn)); + Some ("federated_user_id", (String.to_json v.federated_user_id))]) + let of_json j = + { + federated_user_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "federated_user_id"))); + arn = (String.of_json (Util.of_option_exn (Json.lookup j "arn"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Arn", String.to_query v.arn)) - ; Some (Query.Pair ("FederatedUserId", String.to_query v.federated_user_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("arn", String.to_json v.arn) - ; Some ("federated_user_id", String.to_json v.federated_user_id) - ]) - - let of_json j = - { federated_user_id = - String.of_json (Util.of_option_exn (Json.lookup j "federated_user_id")) - ; arn = String.of_json (Util.of_option_exn (Json.lookup j "arn")) - } -end - -module AssumedRoleUser = struct - type t = - { assumed_role_id : String.t - ; arn : String.t - } - - let make ~assumed_role_id ~arn () = { assumed_role_id; arn } - - let parse xml = - Some - { assumed_role_id = - Xml.required - "AssumedRoleId" - (Util.option_bind (Xml.member "AssumedRoleId" xml) String.parse) - ; arn = Xml.required "Arn" (Util.option_bind (Xml.member "Arn" xml) String.parse) + end +module AssumedRoleUser = + struct + type t = { + assumed_role_id: String.t ; + arn: String.t } + let make ~assumed_role_id ~arn () = { assumed_role_id; arn } + let parse xml = + Some + { + assumed_role_id = + (Xml.required "AssumedRoleId" + (Util.option_bind (Xml.member "AssumedRoleId" xml) + String.parse)); + arn = + (Xml.required "Arn" + (Util.option_bind (Xml.member "Arn" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Arn", (String.to_query v.arn))); + Some + (Query.Pair + ("AssumedRoleId", (String.to_query v.assumed_role_id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("arn", (String.to_json v.arn)); + Some ("assumed_role_id", (String.to_json v.assumed_role_id))]) + let of_json j = + { + assumed_role_id = + (String.of_json + (Util.of_option_exn (Json.lookup j "assumed_role_id"))); + arn = (String.of_json (Util.of_option_exn (Json.lookup j "arn"))) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("Arn", String.to_query v.arn)) - ; Some (Query.Pair ("AssumedRoleId", String.to_query v.assumed_role_id)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("arn", String.to_json v.arn) - ; Some ("assumed_role_id", String.to_json v.assumed_role_id) - ]) - - let of_json j = - { assumed_role_id = - String.of_json (Util.of_option_exn (Json.lookup j "assumed_role_id")) - ; arn = String.of_json (Util.of_option_exn (Json.lookup j "arn")) - } -end - -module PackedPolicyTooLargeException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetFederationTokenResponse = struct - type t = - { credentials : Credentials.t option - ; federated_user : FederatedUser.t option - ; packed_policy_size : Integer.t option - } - - let make ?credentials ?federated_user ?packed_policy_size () = - { credentials; federated_user; packed_policy_size } - - let parse xml = - Some - { credentials = Util.option_bind (Xml.member "Credentials" xml) Credentials.parse - ; federated_user = - Util.option_bind (Xml.member "FederatedUser" xml) FederatedUser.parse - ; packed_policy_size = - Util.option_bind (Xml.member "PackedPolicySize" xml) Integer.parse + end +module PackedPolicyTooLargeException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.packed_policy_size (fun f -> - Query.Pair ("PackedPolicySize", Integer.to_query f)) - ; Util.option_map v.federated_user (fun f -> - Query.Pair ("FederatedUser", FederatedUser.to_query f)) - ; Util.option_map v.credentials (fun f -> - Query.Pair ("Credentials", Credentials.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.packed_policy_size (fun f -> - "packed_policy_size", Integer.to_json f) - ; Util.option_map v.federated_user (fun f -> - "federated_user", FederatedUser.to_json f) - ; Util.option_map v.credentials (fun f -> "credentials", Credentials.to_json f) - ]) - - let of_json j = - { credentials = Util.option_map (Json.lookup j "credentials") Credentials.of_json - ; federated_user = - Util.option_map (Json.lookup j "federated_user") FederatedUser.of_json - ; packed_policy_size = - Util.option_map (Json.lookup j "packed_policy_size") Integer.of_json - } -end - -module InvalidIdentityTokenException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetFederationTokenRequest = struct - type t = - { name : String.t - ; policy : String.t option - ; duration_seconds : Integer.t option - } - - let make ~name ?policy ?duration_seconds () = { name; policy; duration_seconds } - - let parse xml = - Some - { name = Xml.required "Name" (Util.option_bind (Xml.member "Name" xml) String.parse) - ; policy = Util.option_bind (Xml.member "Policy" xml) String.parse - ; duration_seconds = - Util.option_bind (Xml.member "DurationSeconds" xml) Integer.parse + end +module GetFederationTokenResponse = + struct + type t = + { + credentials: Credentials.t option ; + federated_user: FederatedUser.t option ; + packed_policy_size: Integer.t option } + let make ?credentials ?federated_user ?packed_policy_size () = + { credentials; federated_user; packed_policy_size } + let parse xml = + Some + { + credentials = + (Util.option_bind (Xml.member "Credentials" xml) + Credentials.parse); + federated_user = + (Util.option_bind (Xml.member "FederatedUser" xml) + FederatedUser.parse); + packed_policy_size = + (Util.option_bind (Xml.member "PackedPolicySize" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.packed_policy_size + (fun f -> Query.Pair ("PackedPolicySize", (Integer.to_query f))); + Util.option_map v.federated_user + (fun f -> + Query.Pair ("FederatedUser", (FederatedUser.to_query f))); + Util.option_map v.credentials + (fun f -> Query.Pair ("Credentials", (Credentials.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.packed_policy_size + (fun f -> ("packed_policy_size", (Integer.to_json f))); + Util.option_map v.federated_user + (fun f -> ("federated_user", (FederatedUser.to_json f))); + Util.option_map v.credentials + (fun f -> ("credentials", (Credentials.to_json f)))]) + let of_json j = + { + credentials = + (Util.option_map (Json.lookup j "credentials") Credentials.of_json); + federated_user = + (Util.option_map (Json.lookup j "federated_user") + FederatedUser.of_json); + packed_policy_size = + (Util.option_map (Json.lookup j "packed_policy_size") + Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - Query.Pair ("DurationSeconds", Integer.to_query f)) - ; Util.option_map v.policy (fun f -> Query.Pair ("Policy", String.to_query f)) - ; Some (Query.Pair ("Name", String.to_query v.name)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - "duration_seconds", Integer.to_json f) - ; Util.option_map v.policy (fun f -> "policy", String.to_json f) - ; Some ("name", String.to_json v.name) - ]) - - let of_json j = - { name = String.of_json (Util.of_option_exn (Json.lookup j "name")) - ; policy = Util.option_map (Json.lookup j "policy") String.of_json - ; duration_seconds = - Util.option_map (Json.lookup j "duration_seconds") Integer.of_json - } -end - -module IDPRejectedClaimException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module AssumeRoleWithSAMLResponse = struct - type t = - { credentials : Credentials.t option - ; assumed_role_user : AssumedRoleUser.t option - ; packed_policy_size : Integer.t option - ; subject : String.t option - ; subject_type : String.t option - ; issuer : String.t option - ; audience : String.t option - ; name_qualifier : String.t option - } - - let make - ?credentials - ?assumed_role_user - ?packed_policy_size - ?subject - ?subject_type - ?issuer - ?audience - ?name_qualifier - () = - { credentials - ; assumed_role_user - ; packed_policy_size - ; subject - ; subject_type - ; issuer - ; audience - ; name_qualifier - } - - let parse xml = - Some - { credentials = Util.option_bind (Xml.member "Credentials" xml) Credentials.parse - ; assumed_role_user = - Util.option_bind (Xml.member "AssumedRoleUser" xml) AssumedRoleUser.parse - ; packed_policy_size = - Util.option_bind (Xml.member "PackedPolicySize" xml) Integer.parse - ; subject = Util.option_bind (Xml.member "Subject" xml) String.parse - ; subject_type = Util.option_bind (Xml.member "SubjectType" xml) String.parse - ; issuer = Util.option_bind (Xml.member "Issuer" xml) String.parse - ; audience = Util.option_bind (Xml.member "Audience" xml) String.parse - ; name_qualifier = Util.option_bind (Xml.member "NameQualifier" xml) String.parse + end +module InvalidIdentityTokenException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.name_qualifier (fun f -> - Query.Pair ("NameQualifier", String.to_query f)) - ; Util.option_map v.audience (fun f -> - Query.Pair ("Audience", String.to_query f)) - ; Util.option_map v.issuer (fun f -> Query.Pair ("Issuer", String.to_query f)) - ; Util.option_map v.subject_type (fun f -> - Query.Pair ("SubjectType", String.to_query f)) - ; Util.option_map v.subject (fun f -> Query.Pair ("Subject", String.to_query f)) - ; Util.option_map v.packed_policy_size (fun f -> - Query.Pair ("PackedPolicySize", Integer.to_query f)) - ; Util.option_map v.assumed_role_user (fun f -> - Query.Pair ("AssumedRoleUser", AssumedRoleUser.to_query f)) - ; Util.option_map v.credentials (fun f -> - Query.Pair ("Credentials", Credentials.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.name_qualifier (fun f -> "name_qualifier", String.to_json f) - ; Util.option_map v.audience (fun f -> "audience", String.to_json f) - ; Util.option_map v.issuer (fun f -> "issuer", String.to_json f) - ; Util.option_map v.subject_type (fun f -> "subject_type", String.to_json f) - ; Util.option_map v.subject (fun f -> "subject", String.to_json f) - ; Util.option_map v.packed_policy_size (fun f -> - "packed_policy_size", Integer.to_json f) - ; Util.option_map v.assumed_role_user (fun f -> - "assumed_role_user", AssumedRoleUser.to_json f) - ; Util.option_map v.credentials (fun f -> "credentials", Credentials.to_json f) - ]) - - let of_json j = - { credentials = Util.option_map (Json.lookup j "credentials") Credentials.of_json - ; assumed_role_user = - Util.option_map (Json.lookup j "assumed_role_user") AssumedRoleUser.of_json - ; packed_policy_size = - Util.option_map (Json.lookup j "packed_policy_size") Integer.of_json - ; subject = Util.option_map (Json.lookup j "subject") String.of_json - ; subject_type = Util.option_map (Json.lookup j "subject_type") String.of_json - ; issuer = Util.option_map (Json.lookup j "issuer") String.of_json - ; audience = Util.option_map (Json.lookup j "audience") String.of_json - ; name_qualifier = Util.option_map (Json.lookup j "name_qualifier") String.of_json - } -end - -module MalformedPolicyDocumentException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module IDPCommunicationErrorException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module ExpiredTokenException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module DecodeAuthorizationMessageResponse = struct - type t = { decoded_message : String.t option } - - let make ?decoded_message () = { decoded_message } - - let parse xml = - Some - { decoded_message = Util.option_bind (Xml.member "DecodedMessage" xml) String.parse + end +module GetFederationTokenRequest = + struct + type t = + { + name: String.t ; + policy: String.t option ; + duration_seconds: Integer.t option } + let make ~name ?policy ?duration_seconds () = + { name; policy; duration_seconds } + let parse xml = + Some + { + name = + (Xml.required "Name" + (Util.option_bind (Xml.member "Name" xml) String.parse)); + policy = (Util.option_bind (Xml.member "Policy" xml) String.parse); + duration_seconds = + (Util.option_bind (Xml.member "DurationSeconds" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> Query.Pair ("DurationSeconds", (Integer.to_query f))); + Util.option_map v.policy + (fun f -> Query.Pair ("Policy", (String.to_query f))); + Some (Query.Pair ("Name", (String.to_query v.name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> ("duration_seconds", (Integer.to_json f))); + Util.option_map v.policy (fun f -> ("policy", (String.to_json f))); + Some ("name", (String.to_json v.name))]) + let of_json j = + { + name = (String.of_json (Util.of_option_exn (Json.lookup j "name"))); + policy = (Util.option_map (Json.lookup j "policy") String.of_json); + duration_seconds = + (Util.option_map (Json.lookup j "duration_seconds") Integer.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.decoded_message (fun f -> - Query.Pair ("DecodedMessage", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.decoded_message (fun f -> - "decoded_message", String.to_json f) - ]) - - let of_json j = - { decoded_message = Util.option_map (Json.lookup j "decoded_message") String.of_json } -end - -module AssumeRoleResponse = struct - type t = - { credentials : Credentials.t option - ; assumed_role_user : AssumedRoleUser.t option - ; packed_policy_size : Integer.t option - } - - let make ?credentials ?assumed_role_user ?packed_policy_size () = - { credentials; assumed_role_user; packed_policy_size } - - let parse xml = - Some - { credentials = Util.option_bind (Xml.member "Credentials" xml) Credentials.parse - ; assumed_role_user = - Util.option_bind (Xml.member "AssumedRoleUser" xml) AssumedRoleUser.parse - ; packed_policy_size = - Util.option_bind (Xml.member "PackedPolicySize" xml) Integer.parse + end +module IDPRejectedClaimException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.packed_policy_size (fun f -> - Query.Pair ("PackedPolicySize", Integer.to_query f)) - ; Util.option_map v.assumed_role_user (fun f -> - Query.Pair ("AssumedRoleUser", AssumedRoleUser.to_query f)) - ; Util.option_map v.credentials (fun f -> - Query.Pair ("Credentials", Credentials.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.packed_policy_size (fun f -> - "packed_policy_size", Integer.to_json f) - ; Util.option_map v.assumed_role_user (fun f -> - "assumed_role_user", AssumedRoleUser.to_json f) - ; Util.option_map v.credentials (fun f -> "credentials", Credentials.to_json f) - ]) - - let of_json j = - { credentials = Util.option_map (Json.lookup j "credentials") Credentials.of_json - ; assumed_role_user = - Util.option_map (Json.lookup j "assumed_role_user") AssumedRoleUser.of_json - ; packed_policy_size = - Util.option_map (Json.lookup j "packed_policy_size") Integer.of_json - } -end - -module DecodeAuthorizationMessageRequest = struct - type t = { encoded_message : String.t } - - let make ~encoded_message () = { encoded_message } - - let parse xml = - Some - { encoded_message = - Xml.required - "EncodedMessage" - (Util.option_bind (Xml.member "EncodedMessage" xml) String.parse) + end +module AssumeRoleWithSAMLResponse = + struct + type t = + { + credentials: Credentials.t option ; + assumed_role_user: AssumedRoleUser.t option ; + packed_policy_size: Integer.t option ; + subject: String.t option ; + subject_type: String.t option ; + issuer: String.t option ; + audience: String.t option ; + name_qualifier: String.t option } + let make ?credentials ?assumed_role_user ?packed_policy_size ?subject + ?subject_type ?issuer ?audience ?name_qualifier () = + { + credentials; + assumed_role_user; + packed_policy_size; + subject; + subject_type; + issuer; + audience; + name_qualifier } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Some (Query.Pair ("EncodedMessage", String.to_query v.encoded_message)) ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Some ("encoded_message", String.to_json v.encoded_message) ]) - - let of_json j = - { encoded_message = - String.of_json (Util.of_option_exn (Json.lookup j "encoded_message")) - } -end - -module GetSessionTokenResponse = struct - type t = { credentials : Credentials.t option } - - let make ?credentials () = { credentials } - - let parse xml = - Some - { credentials = Util.option_bind (Xml.member "Credentials" xml) Credentials.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.credentials (fun f -> - Query.Pair ("Credentials", Credentials.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.credentials (fun f -> "credentials", Credentials.to_json f) ]) - - let of_json j = - { credentials = Util.option_map (Json.lookup j "credentials") Credentials.of_json } -end - -module InvalidAuthorizationMessageException = struct - type t = { message : String.t option } - - let make ?message () = { message } - - let parse xml = - Some { message = Util.option_bind (Xml.member "message" xml) String.parse } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> Query.Pair ("message", String.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.message (fun f -> "message", String.to_json f) ]) - - let of_json j = { message = Util.option_map (Json.lookup j "message") String.of_json } -end - -module GetSessionTokenRequest = struct - type t = - { duration_seconds : Integer.t option - ; serial_number : String.t option - ; token_code : String.t option - } - - let make ?duration_seconds ?serial_number ?token_code () = - { duration_seconds; serial_number; token_code } - - let parse xml = - Some - { duration_seconds = - Util.option_bind (Xml.member "DurationSeconds" xml) Integer.parse - ; serial_number = Util.option_bind (Xml.member "SerialNumber" xml) String.parse - ; token_code = Util.option_bind (Xml.member "TokenCode" xml) String.parse + let parse xml = + Some + { + credentials = + (Util.option_bind (Xml.member "Credentials" xml) + Credentials.parse); + assumed_role_user = + (Util.option_bind (Xml.member "AssumedRoleUser" xml) + AssumedRoleUser.parse); + packed_policy_size = + (Util.option_bind (Xml.member "PackedPolicySize" xml) + Integer.parse); + subject = + (Util.option_bind (Xml.member "Subject" xml) String.parse); + subject_type = + (Util.option_bind (Xml.member "SubjectType" xml) String.parse); + issuer = (Util.option_bind (Xml.member "Issuer" xml) String.parse); + audience = + (Util.option_bind (Xml.member "Audience" xml) String.parse); + name_qualifier = + (Util.option_bind (Xml.member "NameQualifier" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.name_qualifier + (fun f -> Query.Pair ("NameQualifier", (String.to_query f))); + Util.option_map v.audience + (fun f -> Query.Pair ("Audience", (String.to_query f))); + Util.option_map v.issuer + (fun f -> Query.Pair ("Issuer", (String.to_query f))); + Util.option_map v.subject_type + (fun f -> Query.Pair ("SubjectType", (String.to_query f))); + Util.option_map v.subject + (fun f -> Query.Pair ("Subject", (String.to_query f))); + Util.option_map v.packed_policy_size + (fun f -> Query.Pair ("PackedPolicySize", (Integer.to_query f))); + Util.option_map v.assumed_role_user + (fun f -> + Query.Pair ("AssumedRoleUser", (AssumedRoleUser.to_query f))); + Util.option_map v.credentials + (fun f -> Query.Pair ("Credentials", (Credentials.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.name_qualifier + (fun f -> ("name_qualifier", (String.to_json f))); + Util.option_map v.audience + (fun f -> ("audience", (String.to_json f))); + Util.option_map v.issuer (fun f -> ("issuer", (String.to_json f))); + Util.option_map v.subject_type + (fun f -> ("subject_type", (String.to_json f))); + Util.option_map v.subject + (fun f -> ("subject", (String.to_json f))); + Util.option_map v.packed_policy_size + (fun f -> ("packed_policy_size", (Integer.to_json f))); + Util.option_map v.assumed_role_user + (fun f -> ("assumed_role_user", (AssumedRoleUser.to_json f))); + Util.option_map v.credentials + (fun f -> ("credentials", (Credentials.to_json f)))]) + let of_json j = + { + credentials = + (Util.option_map (Json.lookup j "credentials") Credentials.of_json); + assumed_role_user = + (Util.option_map (Json.lookup j "assumed_role_user") + AssumedRoleUser.of_json); + packed_policy_size = + (Util.option_map (Json.lookup j "packed_policy_size") + Integer.of_json); + subject = (Util.option_map (Json.lookup j "subject") String.of_json); + subject_type = + (Util.option_map (Json.lookup j "subject_type") String.of_json); + issuer = (Util.option_map (Json.lookup j "issuer") String.of_json); + audience = + (Util.option_map (Json.lookup j "audience") String.of_json); + name_qualifier = + (Util.option_map (Json.lookup j "name_qualifier") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.token_code (fun f -> - Query.Pair ("TokenCode", String.to_query f)) - ; Util.option_map v.serial_number (fun f -> - Query.Pair ("SerialNumber", String.to_query f)) - ; Util.option_map v.duration_seconds (fun f -> - Query.Pair ("DurationSeconds", Integer.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.token_code (fun f -> "token_code", String.to_json f) - ; Util.option_map v.serial_number (fun f -> "serial_number", String.to_json f) - ; Util.option_map v.duration_seconds (fun f -> - "duration_seconds", Integer.to_json f) - ]) - - let of_json j = - { duration_seconds = - Util.option_map (Json.lookup j "duration_seconds") Integer.of_json - ; serial_number = Util.option_map (Json.lookup j "serial_number") String.of_json - ; token_code = Util.option_map (Json.lookup j "token_code") String.of_json - } -end - -module AssumeRoleWithSAMLRequest = struct - type t = - { role_arn : String.t - ; principal_arn : String.t - ; s_a_m_l_assertion : String.t - ; policy : String.t option - ; duration_seconds : Integer.t option - } - - let make ~role_arn ~principal_arn ~s_a_m_l_assertion ?policy ?duration_seconds () = - { role_arn; principal_arn; s_a_m_l_assertion; policy; duration_seconds } - - let parse xml = - Some - { role_arn = - Xml.required - "RoleArn" - (Util.option_bind (Xml.member "RoleArn" xml) String.parse) - ; principal_arn = - Xml.required - "PrincipalArn" - (Util.option_bind (Xml.member "PrincipalArn" xml) String.parse) - ; s_a_m_l_assertion = - Xml.required - "SAMLAssertion" - (Util.option_bind (Xml.member "SAMLAssertion" xml) String.parse) - ; policy = Util.option_bind (Xml.member "Policy" xml) String.parse - ; duration_seconds = - Util.option_bind (Xml.member "DurationSeconds" xml) Integer.parse + end +module MalformedPolicyDocumentException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - Query.Pair ("DurationSeconds", Integer.to_query f)) - ; Util.option_map v.policy (fun f -> Query.Pair ("Policy", String.to_query f)) - ; Some (Query.Pair ("SAMLAssertion", String.to_query v.s_a_m_l_assertion)) - ; Some (Query.Pair ("PrincipalArn", String.to_query v.principal_arn)) - ; Some (Query.Pair ("RoleArn", String.to_query v.role_arn)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - "duration_seconds", Integer.to_json f) - ; Util.option_map v.policy (fun f -> "policy", String.to_json f) - ; Some ("s_a_m_l_assertion", String.to_json v.s_a_m_l_assertion) - ; Some ("principal_arn", String.to_json v.principal_arn) - ; Some ("role_arn", String.to_json v.role_arn) - ]) - - let of_json j = - { role_arn = String.of_json (Util.of_option_exn (Json.lookup j "role_arn")) - ; principal_arn = String.of_json (Util.of_option_exn (Json.lookup j "principal_arn")) - ; s_a_m_l_assertion = - String.of_json (Util.of_option_exn (Json.lookup j "s_a_m_l_assertion")) - ; policy = Util.option_map (Json.lookup j "policy") String.of_json - ; duration_seconds = - Util.option_map (Json.lookup j "duration_seconds") Integer.of_json - } -end - -module AssumeRoleWithWebIdentityResponse = struct - type t = - { credentials : Credentials.t option - ; subject_from_web_identity_token : String.t option - ; assumed_role_user : AssumedRoleUser.t option - ; packed_policy_size : Integer.t option - ; provider : String.t option - ; audience : String.t option - } - - let make - ?credentials - ?subject_from_web_identity_token - ?assumed_role_user - ?packed_policy_size - ?provider - ?audience - () = - { credentials - ; subject_from_web_identity_token - ; assumed_role_user - ; packed_policy_size - ; provider - ; audience - } - - let parse xml = - Some - { credentials = Util.option_bind (Xml.member "Credentials" xml) Credentials.parse - ; subject_from_web_identity_token = - Util.option_bind (Xml.member "SubjectFromWebIdentityToken" xml) String.parse - ; assumed_role_user = - Util.option_bind (Xml.member "AssumedRoleUser" xml) AssumedRoleUser.parse - ; packed_policy_size = - Util.option_bind (Xml.member "PackedPolicySize" xml) Integer.parse - ; provider = Util.option_bind (Xml.member "Provider" xml) String.parse - ; audience = Util.option_bind (Xml.member "Audience" xml) String.parse + end +module IDPCommunicationErrorException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.audience (fun f -> - Query.Pair ("Audience", String.to_query f)) - ; Util.option_map v.provider (fun f -> - Query.Pair ("Provider", String.to_query f)) - ; Util.option_map v.packed_policy_size (fun f -> - Query.Pair ("PackedPolicySize", Integer.to_query f)) - ; Util.option_map v.assumed_role_user (fun f -> - Query.Pair ("AssumedRoleUser", AssumedRoleUser.to_query f)) - ; Util.option_map v.subject_from_web_identity_token (fun f -> - Query.Pair ("SubjectFromWebIdentityToken", String.to_query f)) - ; Util.option_map v.credentials (fun f -> - Query.Pair ("Credentials", Credentials.to_query f)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.audience (fun f -> "audience", String.to_json f) - ; Util.option_map v.provider (fun f -> "provider", String.to_json f) - ; Util.option_map v.packed_policy_size (fun f -> - "packed_policy_size", Integer.to_json f) - ; Util.option_map v.assumed_role_user (fun f -> - "assumed_role_user", AssumedRoleUser.to_json f) - ; Util.option_map v.subject_from_web_identity_token (fun f -> - "subject_from_web_identity_token", String.to_json f) - ; Util.option_map v.credentials (fun f -> "credentials", Credentials.to_json f) - ]) - - let of_json j = - { credentials = Util.option_map (Json.lookup j "credentials") Credentials.of_json - ; subject_from_web_identity_token = - Util.option_map (Json.lookup j "subject_from_web_identity_token") String.of_json - ; assumed_role_user = - Util.option_map (Json.lookup j "assumed_role_user") AssumedRoleUser.of_json - ; packed_policy_size = - Util.option_map (Json.lookup j "packed_policy_size") Integer.of_json - ; provider = Util.option_map (Json.lookup j "provider") String.of_json - ; audience = Util.option_map (Json.lookup j "audience") String.of_json - } -end - -module AssumeRoleWithWebIdentityRequest = struct - type t = - { role_arn : String.t - ; role_session_name : String.t - ; web_identity_token : String.t - ; provider_id : String.t option - ; policy : String.t option - ; duration_seconds : Integer.t option - } - - let make - ~role_arn - ~role_session_name - ~web_identity_token - ?provider_id - ?policy - ?duration_seconds - () = - { role_arn - ; role_session_name - ; web_identity_token - ; provider_id - ; policy - ; duration_seconds - } - - let parse xml = - Some - { role_arn = - Xml.required - "RoleArn" - (Util.option_bind (Xml.member "RoleArn" xml) String.parse) - ; role_session_name = - Xml.required - "RoleSessionName" - (Util.option_bind (Xml.member "RoleSessionName" xml) String.parse) - ; web_identity_token = - Xml.required - "WebIdentityToken" - (Util.option_bind (Xml.member "WebIdentityToken" xml) String.parse) - ; provider_id = Util.option_bind (Xml.member "ProviderId" xml) String.parse - ; policy = Util.option_bind (Xml.member "Policy" xml) String.parse - ; duration_seconds = - Util.option_bind (Xml.member "DurationSeconds" xml) Integer.parse + end +module ExpiredTokenException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - Query.Pair ("DurationSeconds", Integer.to_query f)) - ; Util.option_map v.policy (fun f -> Query.Pair ("Policy", String.to_query f)) - ; Util.option_map v.provider_id (fun f -> - Query.Pair ("ProviderId", String.to_query f)) - ; Some (Query.Pair ("WebIdentityToken", String.to_query v.web_identity_token)) - ; Some (Query.Pair ("RoleSessionName", String.to_query v.role_session_name)) - ; Some (Query.Pair ("RoleArn", String.to_query v.role_arn)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.duration_seconds (fun f -> - "duration_seconds", Integer.to_json f) - ; Util.option_map v.policy (fun f -> "policy", String.to_json f) - ; Util.option_map v.provider_id (fun f -> "provider_id", String.to_json f) - ; Some ("web_identity_token", String.to_json v.web_identity_token) - ; Some ("role_session_name", String.to_json v.role_session_name) - ; Some ("role_arn", String.to_json v.role_arn) - ]) - - let of_json j = - { role_arn = String.of_json (Util.of_option_exn (Json.lookup j "role_arn")) - ; role_session_name = - String.of_json (Util.of_option_exn (Json.lookup j "role_session_name")) - ; web_identity_token = - String.of_json (Util.of_option_exn (Json.lookup j "web_identity_token")) - ; provider_id = Util.option_map (Json.lookup j "provider_id") String.of_json - ; policy = Util.option_map (Json.lookup j "policy") String.of_json - ; duration_seconds = - Util.option_map (Json.lookup j "duration_seconds") Integer.of_json - } -end - -module AssumeRoleRequest = struct - type t = - { role_arn : String.t - ; role_session_name : String.t - ; policy : String.t option - ; duration_seconds : Integer.t option - ; external_id : String.t option - ; serial_number : String.t option - ; token_code : String.t option - } - - let make - ~role_arn - ~role_session_name - ?policy - ?duration_seconds - ?external_id - ?serial_number - ?token_code - () = - { role_arn - ; role_session_name - ; policy - ; duration_seconds - ; external_id - ; serial_number - ; token_code - } - - let parse xml = - Some - { role_arn = - Xml.required - "RoleArn" - (Util.option_bind (Xml.member "RoleArn" xml) String.parse) - ; role_session_name = - Xml.required - "RoleSessionName" - (Util.option_bind (Xml.member "RoleSessionName" xml) String.parse) - ; policy = Util.option_bind (Xml.member "Policy" xml) String.parse - ; duration_seconds = - Util.option_bind (Xml.member "DurationSeconds" xml) Integer.parse - ; external_id = Util.option_bind (Xml.member "ExternalId" xml) String.parse - ; serial_number = Util.option_bind (Xml.member "SerialNumber" xml) String.parse - ; token_code = Util.option_bind (Xml.member "TokenCode" xml) String.parse + end +module DecodeAuthorizationMessageResponse = + struct + type t = { + decoded_message: String.t option } + let make ?decoded_message () = { decoded_message } + let parse xml = + Some + { + decoded_message = + (Util.option_bind (Xml.member "DecodedMessage" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.decoded_message + (fun f -> Query.Pair ("DecodedMessage", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.decoded_message + (fun f -> ("decoded_message", (String.to_json f)))]) + let of_json j = + { + decoded_message = + (Util.option_map (Json.lookup j "decoded_message") String.of_json) } - - let to_query v = - Query.List - (Util.list_filter_opt - [ Util.option_map v.token_code (fun f -> - Query.Pair ("TokenCode", String.to_query f)) - ; Util.option_map v.serial_number (fun f -> - Query.Pair ("SerialNumber", String.to_query f)) - ; Util.option_map v.external_id (fun f -> - Query.Pair ("ExternalId", String.to_query f)) - ; Util.option_map v.duration_seconds (fun f -> - Query.Pair ("DurationSeconds", Integer.to_query f)) - ; Util.option_map v.policy (fun f -> Query.Pair ("Policy", String.to_query f)) - ; Some (Query.Pair ("RoleSessionName", String.to_query v.role_session_name)) - ; Some (Query.Pair ("RoleArn", String.to_query v.role_arn)) - ]) - - let to_json v = - `Assoc - (Util.list_filter_opt - [ Util.option_map v.token_code (fun f -> "token_code", String.to_json f) - ; Util.option_map v.serial_number (fun f -> "serial_number", String.to_json f) - ; Util.option_map v.external_id (fun f -> "external_id", String.to_json f) - ; Util.option_map v.duration_seconds (fun f -> - "duration_seconds", Integer.to_json f) - ; Util.option_map v.policy (fun f -> "policy", String.to_json f) - ; Some ("role_session_name", String.to_json v.role_session_name) - ; Some ("role_arn", String.to_json v.role_arn) - ]) - - let of_json j = - { role_arn = String.of_json (Util.of_option_exn (Json.lookup j "role_arn")) - ; role_session_name = - String.of_json (Util.of_option_exn (Json.lookup j "role_session_name")) - ; policy = Util.option_map (Json.lookup j "policy") String.of_json - ; duration_seconds = - Util.option_map (Json.lookup j "duration_seconds") Integer.of_json - ; external_id = Util.option_map (Json.lookup j "external_id") String.of_json - ; serial_number = Util.option_map (Json.lookup j "serial_number") String.of_json - ; token_code = Util.option_map (Json.lookup j "token_code") String.of_json - } -end + end +module AssumeRoleResponse = + struct + type t = + { + credentials: Credentials.t option ; + assumed_role_user: AssumedRoleUser.t option ; + packed_policy_size: Integer.t option } + let make ?credentials ?assumed_role_user ?packed_policy_size () = + { credentials; assumed_role_user; packed_policy_size } + let parse xml = + Some + { + credentials = + (Util.option_bind (Xml.member "Credentials" xml) + Credentials.parse); + assumed_role_user = + (Util.option_bind (Xml.member "AssumedRoleUser" xml) + AssumedRoleUser.parse); + packed_policy_size = + (Util.option_bind (Xml.member "PackedPolicySize" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.packed_policy_size + (fun f -> Query.Pair ("PackedPolicySize", (Integer.to_query f))); + Util.option_map v.assumed_role_user + (fun f -> + Query.Pair ("AssumedRoleUser", (AssumedRoleUser.to_query f))); + Util.option_map v.credentials + (fun f -> Query.Pair ("Credentials", (Credentials.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.packed_policy_size + (fun f -> ("packed_policy_size", (Integer.to_json f))); + Util.option_map v.assumed_role_user + (fun f -> ("assumed_role_user", (AssumedRoleUser.to_json f))); + Util.option_map v.credentials + (fun f -> ("credentials", (Credentials.to_json f)))]) + let of_json j = + { + credentials = + (Util.option_map (Json.lookup j "credentials") Credentials.of_json); + assumed_role_user = + (Util.option_map (Json.lookup j "assumed_role_user") + AssumedRoleUser.of_json); + packed_policy_size = + (Util.option_map (Json.lookup j "packed_policy_size") + Integer.of_json) + } + end +module DecodeAuthorizationMessageRequest = + struct + type t = { + encoded_message: String.t } + let make ~encoded_message () = { encoded_message } + let parse xml = + Some + { + encoded_message = + (Xml.required "EncodedMessage" + (Util.option_bind (Xml.member "EncodedMessage" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("EncodedMessage", (String.to_query v.encoded_message)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("encoded_message", (String.to_json v.encoded_message))]) + let of_json j = + { + encoded_message = + (String.of_json + (Util.of_option_exn (Json.lookup j "encoded_message"))) + } + end +module GetSessionTokenResponse = + struct + type t = { + credentials: Credentials.t option } + let make ?credentials () = { credentials } + let parse xml = + Some + { + credentials = + (Util.option_bind (Xml.member "Credentials" xml) + Credentials.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.credentials + (fun f -> Query.Pair ("Credentials", (Credentials.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.credentials + (fun f -> ("credentials", (Credentials.to_json f)))]) + let of_json j = + { + credentials = + (Util.option_map (Json.lookup j "credentials") Credentials.of_json) + } + end +module InvalidAuthorizationMessageException = + struct + type t = { + message: String.t option } + let make ?message () = { message } + let parse xml = + Some + { + message = + (Util.option_bind (Xml.member "message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("message", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f)))]) + let of_json j = + { message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module GetSessionTokenRequest = + struct + type t = + { + duration_seconds: Integer.t option ; + serial_number: String.t option ; + token_code: String.t option } + let make ?duration_seconds ?serial_number ?token_code () = + { duration_seconds; serial_number; token_code } + let parse xml = + Some + { + duration_seconds = + (Util.option_bind (Xml.member "DurationSeconds" xml) + Integer.parse); + serial_number = + (Util.option_bind (Xml.member "SerialNumber" xml) String.parse); + token_code = + (Util.option_bind (Xml.member "TokenCode" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.token_code + (fun f -> Query.Pair ("TokenCode", (String.to_query f))); + Util.option_map v.serial_number + (fun f -> Query.Pair ("SerialNumber", (String.to_query f))); + Util.option_map v.duration_seconds + (fun f -> Query.Pair ("DurationSeconds", (Integer.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.token_code + (fun f -> ("token_code", (String.to_json f))); + Util.option_map v.serial_number + (fun f -> ("serial_number", (String.to_json f))); + Util.option_map v.duration_seconds + (fun f -> ("duration_seconds", (Integer.to_json f)))]) + let of_json j = + { + duration_seconds = + (Util.option_map (Json.lookup j "duration_seconds") Integer.of_json); + serial_number = + (Util.option_map (Json.lookup j "serial_number") String.of_json); + token_code = + (Util.option_map (Json.lookup j "token_code") String.of_json) + } + end +module AssumeRoleWithSAMLRequest = + struct + type t = + { + role_arn: String.t ; + principal_arn: String.t ; + s_a_m_l_assertion: String.t ; + policy: String.t option ; + duration_seconds: Integer.t option } + let make ~role_arn ~principal_arn ~s_a_m_l_assertion ?policy + ?duration_seconds () = + { role_arn; principal_arn; s_a_m_l_assertion; policy; duration_seconds + } + let parse xml = + Some + { + role_arn = + (Xml.required "RoleArn" + (Util.option_bind (Xml.member "RoleArn" xml) String.parse)); + principal_arn = + (Xml.required "PrincipalArn" + (Util.option_bind (Xml.member "PrincipalArn" xml) String.parse)); + s_a_m_l_assertion = + (Xml.required "SAMLAssertion" + (Util.option_bind (Xml.member "SAMLAssertion" xml) + String.parse)); + policy = (Util.option_bind (Xml.member "Policy" xml) String.parse); + duration_seconds = + (Util.option_bind (Xml.member "DurationSeconds" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> Query.Pair ("DurationSeconds", (Integer.to_query f))); + Util.option_map v.policy + (fun f -> Query.Pair ("Policy", (String.to_query f))); + Some + (Query.Pair + ("SAMLAssertion", (String.to_query v.s_a_m_l_assertion))); + Some + (Query.Pair ("PrincipalArn", (String.to_query v.principal_arn))); + Some (Query.Pair ("RoleArn", (String.to_query v.role_arn)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> ("duration_seconds", (Integer.to_json f))); + Util.option_map v.policy (fun f -> ("policy", (String.to_json f))); + Some ("s_a_m_l_assertion", (String.to_json v.s_a_m_l_assertion)); + Some ("principal_arn", (String.to_json v.principal_arn)); + Some ("role_arn", (String.to_json v.role_arn))]) + let of_json j = + { + role_arn = + (String.of_json (Util.of_option_exn (Json.lookup j "role_arn"))); + principal_arn = + (String.of_json + (Util.of_option_exn (Json.lookup j "principal_arn"))); + s_a_m_l_assertion = + (String.of_json + (Util.of_option_exn (Json.lookup j "s_a_m_l_assertion"))); + policy = (Util.option_map (Json.lookup j "policy") String.of_json); + duration_seconds = + (Util.option_map (Json.lookup j "duration_seconds") Integer.of_json) + } + end +module AssumeRoleWithWebIdentityResponse = + struct + type t = + { + credentials: Credentials.t option ; + subject_from_web_identity_token: String.t option ; + assumed_role_user: AssumedRoleUser.t option ; + packed_policy_size: Integer.t option ; + provider: String.t option ; + audience: String.t option } + let make ?credentials ?subject_from_web_identity_token + ?assumed_role_user ?packed_policy_size ?provider ?audience () = + { + credentials; + subject_from_web_identity_token; + assumed_role_user; + packed_policy_size; + provider; + audience + } + let parse xml = + Some + { + credentials = + (Util.option_bind (Xml.member "Credentials" xml) + Credentials.parse); + subject_from_web_identity_token = + (Util.option_bind (Xml.member "SubjectFromWebIdentityToken" xml) + String.parse); + assumed_role_user = + (Util.option_bind (Xml.member "AssumedRoleUser" xml) + AssumedRoleUser.parse); + packed_policy_size = + (Util.option_bind (Xml.member "PackedPolicySize" xml) + Integer.parse); + provider = + (Util.option_bind (Xml.member "Provider" xml) String.parse); + audience = + (Util.option_bind (Xml.member "Audience" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.audience + (fun f -> Query.Pair ("Audience", (String.to_query f))); + Util.option_map v.provider + (fun f -> Query.Pair ("Provider", (String.to_query f))); + Util.option_map v.packed_policy_size + (fun f -> Query.Pair ("PackedPolicySize", (Integer.to_query f))); + Util.option_map v.assumed_role_user + (fun f -> + Query.Pair ("AssumedRoleUser", (AssumedRoleUser.to_query f))); + Util.option_map v.subject_from_web_identity_token + (fun f -> + Query.Pair + ("SubjectFromWebIdentityToken", (String.to_query f))); + Util.option_map v.credentials + (fun f -> Query.Pair ("Credentials", (Credentials.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.audience + (fun f -> ("audience", (String.to_json f))); + Util.option_map v.provider + (fun f -> ("provider", (String.to_json f))); + Util.option_map v.packed_policy_size + (fun f -> ("packed_policy_size", (Integer.to_json f))); + Util.option_map v.assumed_role_user + (fun f -> ("assumed_role_user", (AssumedRoleUser.to_json f))); + Util.option_map v.subject_from_web_identity_token + (fun f -> + ("subject_from_web_identity_token", (String.to_json f))); + Util.option_map v.credentials + (fun f -> ("credentials", (Credentials.to_json f)))]) + let of_json j = + { + credentials = + (Util.option_map (Json.lookup j "credentials") Credentials.of_json); + subject_from_web_identity_token = + (Util.option_map (Json.lookup j "subject_from_web_identity_token") + String.of_json); + assumed_role_user = + (Util.option_map (Json.lookup j "assumed_role_user") + AssumedRoleUser.of_json); + packed_policy_size = + (Util.option_map (Json.lookup j "packed_policy_size") + Integer.of_json); + provider = + (Util.option_map (Json.lookup j "provider") String.of_json); + audience = + (Util.option_map (Json.lookup j "audience") String.of_json) + } + end +module AssumeRoleWithWebIdentityRequest = + struct + type t = + { + role_arn: String.t ; + role_session_name: String.t ; + web_identity_token: String.t ; + provider_id: String.t option ; + policy: String.t option ; + duration_seconds: Integer.t option } + let make ~role_arn ~role_session_name ~web_identity_token ?provider_id + ?policy ?duration_seconds () = + { + role_arn; + role_session_name; + web_identity_token; + provider_id; + policy; + duration_seconds + } + let parse xml = + Some + { + role_arn = + (Xml.required "RoleArn" + (Util.option_bind (Xml.member "RoleArn" xml) String.parse)); + role_session_name = + (Xml.required "RoleSessionName" + (Util.option_bind (Xml.member "RoleSessionName" xml) + String.parse)); + web_identity_token = + (Xml.required "WebIdentityToken" + (Util.option_bind (Xml.member "WebIdentityToken" xml) + String.parse)); + provider_id = + (Util.option_bind (Xml.member "ProviderId" xml) String.parse); + policy = (Util.option_bind (Xml.member "Policy" xml) String.parse); + duration_seconds = + (Util.option_bind (Xml.member "DurationSeconds" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> Query.Pair ("DurationSeconds", (Integer.to_query f))); + Util.option_map v.policy + (fun f -> Query.Pair ("Policy", (String.to_query f))); + Util.option_map v.provider_id + (fun f -> Query.Pair ("ProviderId", (String.to_query f))); + Some + (Query.Pair + ("WebIdentityToken", (String.to_query v.web_identity_token))); + Some + (Query.Pair + ("RoleSessionName", (String.to_query v.role_session_name))); + Some (Query.Pair ("RoleArn", (String.to_query v.role_arn)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.duration_seconds + (fun f -> ("duration_seconds", (Integer.to_json f))); + Util.option_map v.policy (fun f -> ("policy", (String.to_json f))); + Util.option_map v.provider_id + (fun f -> ("provider_id", (String.to_json f))); + Some ("web_identity_token", (String.to_json v.web_identity_token)); + Some ("role_session_name", (String.to_json v.role_session_name)); + Some ("role_arn", (String.to_json v.role_arn))]) + let of_json j = + { + role_arn = + (String.of_json (Util.of_option_exn (Json.lookup j "role_arn"))); + role_session_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "role_session_name"))); + web_identity_token = + (String.of_json + (Util.of_option_exn (Json.lookup j "web_identity_token"))); + provider_id = + (Util.option_map (Json.lookup j "provider_id") String.of_json); + policy = (Util.option_map (Json.lookup j "policy") String.of_json); + duration_seconds = + (Util.option_map (Json.lookup j "duration_seconds") Integer.of_json) + } + end +module AssumeRoleRequest = + struct + type t = + { + role_arn: String.t ; + role_session_name: String.t ; + policy: String.t option ; + duration_seconds: Integer.t option ; + external_id: String.t option ; + serial_number: String.t option ; + token_code: String.t option } + let make ~role_arn ~role_session_name ?policy ?duration_seconds + ?external_id ?serial_number ?token_code () = + { + role_arn; + role_session_name; + policy; + duration_seconds; + external_id; + serial_number; + token_code + } + let parse xml = + Some + { + role_arn = + (Xml.required "RoleArn" + (Util.option_bind (Xml.member "RoleArn" xml) String.parse)); + role_session_name = + (Xml.required "RoleSessionName" + (Util.option_bind (Xml.member "RoleSessionName" xml) + String.parse)); + policy = (Util.option_bind (Xml.member "Policy" xml) String.parse); + duration_seconds = + (Util.option_bind (Xml.member "DurationSeconds" xml) + Integer.parse); + external_id = + (Util.option_bind (Xml.member "ExternalId" xml) String.parse); + serial_number = + (Util.option_bind (Xml.member "SerialNumber" xml) String.parse); + token_code = + (Util.option_bind (Xml.member "TokenCode" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.token_code + (fun f -> Query.Pair ("TokenCode", (String.to_query f))); + Util.option_map v.serial_number + (fun f -> Query.Pair ("SerialNumber", (String.to_query f))); + Util.option_map v.external_id + (fun f -> Query.Pair ("ExternalId", (String.to_query f))); + Util.option_map v.duration_seconds + (fun f -> Query.Pair ("DurationSeconds", (Integer.to_query f))); + Util.option_map v.policy + (fun f -> Query.Pair ("Policy", (String.to_query f))); + Some + (Query.Pair + ("RoleSessionName", (String.to_query v.role_session_name))); + Some (Query.Pair ("RoleArn", (String.to_query v.role_arn)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.token_code + (fun f -> ("token_code", (String.to_json f))); + Util.option_map v.serial_number + (fun f -> ("serial_number", (String.to_json f))); + Util.option_map v.external_id + (fun f -> ("external_id", (String.to_json f))); + Util.option_map v.duration_seconds + (fun f -> ("duration_seconds", (Integer.to_json f))); + Util.option_map v.policy (fun f -> ("policy", (String.to_json f))); + Some ("role_session_name", (String.to_json v.role_session_name)); + Some ("role_arn", (String.to_json v.role_arn))]) + let of_json j = + { + role_arn = + (String.of_json (Util.of_option_exn (Json.lookup j "role_arn"))); + role_session_name = + (String.of_json + (Util.of_option_exn (Json.lookup j "role_session_name"))); + policy = (Util.option_map (Json.lookup j "policy") String.of_json); + duration_seconds = + (Util.option_map (Json.lookup j "duration_seconds") Integer.of_json); + external_id = + (Util.option_map (Json.lookup j "external_id") String.of_json); + serial_number = + (Util.option_map (Json.lookup j "serial_number") String.of_json); + token_code = + (Util.option_map (Json.lookup j "token_code") String.of_json) + } + end \ No newline at end of file diff --git a/libraries/sts/lib_test/dune b/libraries/sts/lib_test/dune index dbc89c461..a1ef27822 100644 --- a/libraries/sts/lib_test/dune +++ b/libraries/sts/lib_test/dune @@ -1,19 +1,18 @@ (executables (names test_async test_lwt) - (flags - (:standard -w -27 -w -33)) + (flags (:standard -w -27 -w -33)) (modules test_async test_lwt aws_sts_test) - (libraries aws aws_sts aws-async aws-lwt oUnit yojson async cohttp-async lwt - cohttp-lwt cohttp-lwt-unix)) + (libraries aws aws_sts aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) (rule (alias runtest) (deps test_async.exe) - (action - (run %{deps}))) + (action (run %{deps}))) (rule (alias runtest) (deps test_lwt.exe) - (action - (run %{deps}))) + (action (run %{deps}))) diff --git a/libraries/sts/lib_test/test_async.ml b/libraries/sts/lib_test/test_async.ml index a9d3c38ea..580fe261f 100644 --- a/libraries/sts/lib_test/test_async.ml +++ b/libraries/sts/lib_test/test_async.ml @@ -1,13 +1,11 @@ open Aws_sts_test -module T = TestSuite (struct - type 'a m = 'a Async.Deferred.t +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key - - let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) -end) + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/sts/lib_test/test_lwt.ml b/libraries/sts/lib_test/test_lwt.ml index f091700d8..8b8957e8f 100644 --- a/libraries/sts/lib_test/test_lwt.ml +++ b/libraries/sts/lib_test/test_lwt.ml @@ -1,13 +1,11 @@ open Aws_sts_test -module T = TestSuite (struct - type 'a m = 'a Lwt.t +module T = TestSuite(struct + type 'a m = 'a Lwt.t - let access_key = Unix.getenv "AWS_ACCESS_KEY" + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" - let secret_key = Unix.getenv "AWS_SECRET_KEY" - - let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key - - let un_m = Lwt_main.run -end) + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) From c400a5f7398414646d53620c910bfa8f2dd4bd3b Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Wed, 18 Nov 2020 21:14:14 +1100 Subject: [PATCH 8/8] WIP Tests for EMR. --- .../lib_test/aws_elasticmapreduce_test.ml | 81 ++++++++++++++++--- 1 file changed, 69 insertions(+), 12 deletions(-) diff --git a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml index 555c2638b..06347140f 100644 --- a/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml +++ b/libraries/elasticmapreduce/lib_test/aws_elasticmapreduce_test.ml @@ -19,28 +19,81 @@ struct (* Tag for test EMR instances *) let test_tag = Types.Tag.make ~key:"client" ~value:"ocaml-aws" () + let region = "ap-southeast-2" + + let steps = + Types.StepConfig.make + ~name:"Example Streaming Step" + ~action_on_failure:Types.ActionOnFailure.CANCEL_AND_WAIT + ~hadoop_jar_step: + (Types.HadoopJarStepConfig.make + ~jar:"/home/hadoop/contrib/streaming/hadoop-streaming.jar" + ~args: + (Types.XmlStringList.make + [ "-input" + ; "s3://elasticmapreduce/samples/wordcount/input" + ; "-output" + ; "s3://examples-bucket/example-output" + ; "-mapper" + ; "s3://elasticmapreduce/samples/wordcount/wordSplitter.py" + ; "-reducer" + ; "aggregate" + ] + ()) + ()) + () + + (* TODO The response from Create + * { + * "ClusterId": "j-3RQ0GU8ICBSW2", + * "ClusterArn": "arn:aws:elasticmapreduce:ap-southeast-2:779241156015:cluster/j-3RQ0GU8ICBSW2" + * } *) + + let list_emr_test () = + let res = + Runtime.( + un_m + (run_request + ~region + (module ListClusters) + (Types.( + ListClustersInput.make + ~cluster_states:(ClusterStateList.make ClusterState.[ TERMINATED ] ())) + ()))) + in + "List terminated EMR Clusters" + @? + match res with + | `Ok resp -> + Printf.printf + "%s\n" + (Yojson.Basic.to_string + Types.ListClustersOutput.(to_json (of_json (to_json resp)))); + true + | `Error err -> + Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); + false + let create_describe_shutdown_test () = let res = Runtime.( un_m (run_request - ~region:"us-east-1" + ~region (module RunJobFlow) (Types.RunJobFlowInput.make ~name:"ocaml-aws test EMR" - ~release_label:"emr-5.20.0" - ~applications:[ Types.Application.make () ] - ~tags:(Types.TagList.make [ test_tag ] ()) - ~service_role:"EMR_DefaultRole" - ~job_flow_role: - "EMR_EC2_DefaultRole" - (* TODO Invalid instance profile? What should this be? *) ~instances: (Types.JobFlowInstancesConfig.make ~instance_count:1 - ~master_instance_type:"t1.micro" - ~slave_instance_type:"t1.micro" + ~master_instance_type:"m1.medium" + ~slave_instance_type:"m1.medium" ()) + ~release_label:"emr-5.31.0" + ~service_role:"EMR_DefaultRole" + ~steps:(Types.StepConfigList.make [ steps ] ()) + ~job_flow_role:"EMR_EC2_DefaultRole" + ~scale_down_behavior:Types.ScaleDownBehavior.TERMINATE_AT_TASK_COMPLETION ()))) in ("Create EMR" @@ -69,7 +122,7 @@ struct Runtime.( un_m (run_request - ~region:"us-east-1" + ~region (module TerminateJobFlows) (Types.TerminateJobFlowsInput.make ~job_flow_ids:[ instance_id ] ()))) in @@ -84,7 +137,11 @@ struct Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false - let test_cases = [ "Create EMR" >:: create_describe_shutdown_test ] + let test_cases = + [ (* "Create EMR" >:: create_describe_shutdown_test *) + (* , *) + "List EMR" >:: list_emr_test + ] let rec was_successful = function | [] -> true